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¶
The Vault is fully non-custodial. Your tokens remain in the smart contract under your address — Sera's off-chain services (order matching, API) never hold or control your funds. All deposits, freezes, settlements, and withdrawals are enforced entirely on-chain. Every action requires your EIP-712 signature, which means you can review exactly what you're authorizing (tokens, amounts, recipient) in your wallet before approving.
Why the Vault Exists¶
The Vault exists to guarantee settlement for every participant. When you trade on Sera, you want certainty that when your order is matched, the other side can actually pay. The Vault provides this guarantee — because both parties have pre-deposited funds, settlement always succeeds.
Without the Vault, tokens would need to be pulled from wallets at settlement time. If the counterparty's wallet no longer had sufficient funds, the trade would fail — leaving you with a matched order that can't settle. By requiring pre-deposited collateral, the Vault ensures that every matched order settles immediately and atomically on-chain. This is what makes Sera's order book reliable for all participants.
Note
Swaps do not require a Vault deposit — tokens are handled at execution time. The Vault is only required for limit orders and Virtual Liquidity batches.
Balance Types¶
| Balance | Description |
|---|---|
| Wallet balance | Tokens in your Ethereum wallet (not yet deposited) |
| Vault available | Tokens in the Vault, ready to be used for new orders |
| Vault frozen | Tokens locked in open orders — still in the Vault contract under your address, not held by Sera |
| Vault total | Available + frozen |
You can check all balances via GET /balances.
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¶
If Sera's API ever becomes unavailable, you can always recover your funds — including frozen balances — by calling emergencyWithdraw() directly on the Sera smart contract. This is a two-step process with a ~24 hour delay to prevent abuse, but it guarantees you can always access your tokens without relying on any off-chain service.
See Emergency Withdrawal for details.