Skip to content

The Vault

The Vault is an on-chain smart contract that holds deposited tokens with per-user ledger balances. It is the foundation of trading on Sera.

Non-Custodial Design

Assets are held in the on-chain Vault ledger. Orders are authorized through the Sera signing flow, while order collateral is reserved in off-chain accounting. Direct user transactions and privileged contract calls have different authorization rules; see the contract roles and security model.

Why the Vault Exists

Pre-funded collateral reduces counterparty funding failures for limit orders and VL batches. It does not guarantee that every match settles: signatures, balances, token behavior and settlement conditions can still cause failure or revert. Track per-fill settlement evidence before treating proceeds as confirmed.

Swaps do not require a prior deposit. Their signed route may combine wallet funding and Vault balance; the settlement path can move tokens into or out of the Vault.

Balance Types

Balance Meaning
Wallet Tokens held by the external wallet
vault_available Available amount in off-chain accounting; not guaranteed spendable
vault_frozen Amount reserved by off-chain accounting for open orders
vault_total Accounting available + frozen
vault_spendable Spendable amount after current coverage and recovery restrictions

Use spendability_status, recovery fields and sync hints from GET /balances. These raw strings use each token's decimals. Zero rows can still contain important recovery state.

Deposit & Withdraw

Depositing moves tokens from your wallet into the Vault contract. The API builds unsigned transactions for you — your frontend signs and broadcasts them. See Deposit for the full flow.

Withdrawing moves tokens from the Vault back to your wallet using a dual-signature instant withdrawal. See Withdraw for details.

Emergency Withdrawal

Users can call emergencyWithdraw() directly on Sera without the API. The request requires sufficient balance, a minimum wait of 7,200 blocks and execution before the request expires; a later call starts a new request. Blacklisted users can withdraw, subject to current balance and successful token transfer. See the full rules.