Order lifecycle
The path of an order from signature to settled balance.
Order path
Accounts and agents
An account is a wallet address, with no signup and no fee. An owner can open sub-accounts, each with its own balance, positions, and request allowance, funded by transfers only the owner can sign. The owner approves agents, which are keys that act for the account within the permissions below. Each account has one unnamed agent, which the browser terminal uses as its session agent for up to 24 hours, plus up to three named API wallets with an optional expiry of up to 180 days. Each terminal login replaces the session agent, so a bot should run on a named API wallet (Trading API).
| Action | Owner | Agent |
|---|---|---|
| Trade, set leverage and margin, read the account | Yes | Yes |
| Withdraw, transfer, open sub-accounts | Yes | No |
| Stake, vault deposits, commit open interest | Yes | No |
| Approve or replace agents | Yes | No |
Execution priority
Requests arriving within each matching cycle apply in the five classes below, in arrival order within each class.
- Non-order actions such as deposits, withdrawals, transfers, leverage, and margin changes
- Cancels, scheduled cancels, and cancel-all included
- Post-only orders
- One step of the liquidation sweep, when one is due
- All other orders
A request that arrives after a cycle is full waits for the next cycle and is never refused for that reason. The AMM vault’s orders enter the same queue under the same rules (AMM vault).
Fill and acknowledgement rules
- A resting order is re-checked against margin when it fills; an unfunded quote is canceled instead of filled.
- A reply is sent only after the request is committed to disk; acknowledged state survives any restart.
- The public feed publishes committed events only.
Settlement and withdrawal
Trading runs continuously and never waits on the chain. A withdrawal is checked against the owner’s own balance and margin and settles onchain to the owner’s wallet (Onchain settlement).