Withdraw
⏱️ 2 min read — This section covers the withdraw functions on a Vault. You can do this in 3 ways: through Smart Contract, Through API or through SDK.
Method 1: Smart Contract call
Withdraw
{ "method": "withdraw", "params": { "withdraw_shares": 500, "min_amounts_out": [450], "from": "GCINP..." } }
let withdraw_args = vec![
e,
&withdraw_shares,
&min_amounts_out,
&from
]
let result = e.try_invoke_contract::(
&vault_address,
&Symbol::new(&e, "withdraw"),
withdraw_args.into_val(e),
).unwrap_or_else(|_| {
panic_with_error!(e, SomeError::SomeError);
}).unwrap();Method 2: Withdraw using API
Method 3: Using SDK
Withdraw from Vault
Withdraw by Shares
Last updated