Skip to main content
The three user-facing methods on a vault. For the API equivalents, see Vault Operations.

Deposit

  • amounts_desired: the quantity of each asset to deposit.
  • amounts_min: the minimum quantity of each asset to transfer, your slippage protection.
  • from: the Soroban address making the deposit.
  • invest: true to invest into the vault’s strategies immediately, false to leave the funds idle.
Returns the amounts actually deposited, the shares minted, and, when invest is true, how the funds were allocated across strategies.

Withdraw

  • withdraw_shares: the amount of vault shares to burn.
  • min_amounts_out: the minimum amounts to receive before the transaction fails, in underlying assets.
  • from: the address performing the withdrawal, which receives the funds.
To withdraw a given amount of the underlying asset rather than a number of shares, convert first: call total_supply for the vault’s total shares and fetch_total_managed_funds for the total_amount of the asset, then shares_to_withdraw = total_supply * amount_to_withdraw / total_amount A vault can hold several assets, so on a single-asset vault take the first element to get its total_amount.

Balance

  • from: the Soroban address whose balance you are querying.