Skip to content
Termbook
Use cases

Vaults

Deposit into a strategy and recover its underlying assets through a verified redemption path.

On this page

Return shape

Every account snapshot includes block, holdings and liabilities. Use actual venue data, with owners bound to the Credit Account. Optional public actions must be declared in the definition; a schema-supported capability does not mean every integration offers it.

PluginStates["vault"]
{
  block: context.block, holdings: [], liabilities: [],
  positions: [{
    position_id: "3", market_id: "USDC-VAULT", owner: context.account,
    assets: [{ asset: usdc, amount: 10_000_000n }],
    liability: 0n, recoverable_value: 9_900_000n, shares: 10_000_000n,
  }],
  requests: [],
}

Share ownership and the actual redemption value must be readable at the snapshot block. A share’s accounting price is not sufficient when exit fees, losses or a queue change recoverability.

Capabilities

CapabilityParametersPurpose
deposit_vaultmarket_id, amount_in, min_sharesDeposit underlying and enforce minimum minted shares.
redeem_vaultposition_id, shares_in, min_amount_outRedeem shares with a minimum underlying receipt.
claim_rewardsposition_idCollect admitted rewards into the account.
withdraw_to_credit_accountrequest_idComplete an existing redemption request.

Deposit

deposit_vault
termbook.open({
  action: {
    "use_case": "vault",
    "capability": "deposit_vault",
    "params": {
      "market_id": "USDC-VAULT",
      "amount_in": 10000000n,
      "min_shares": 9900000n
    }
  },
});

Exit requirements

Redeem shares, track delayed requests, claim when available and convert the underlying into settlement assets if needed. requests include claimable_at and may reference replaces_position_id to prevent counting shares and the withdrawal claim twice.

Documentation
8 results

Let’s talk

Tell us what you have in mind.

Supply liquidity