Exchange API
Trading operations — place, replace, bracket, and cancel orders; set leverage; manage vaults.
Last updated
Trading operations — place, replace, bracket, and cancel orders; set leverage; manage vaults.
All trading operations go through a single endpoint:
POST /api/v1/exchangeThe action.type field determines which operation to execute. Every request requires an EIP-712 signature. See Authentication for signing details.
JavaScript snippets in this section are illustrative pseudocode for action shape and flow. The official high-level SDK examples are currently provided by the Python SDK.
Vault operations can affect vault balances, ownership, withdrawal flow, or lifecycle depending on the action. Do not treat a vault-authorized Agent as trading-only. Review Agent Safety before automating vault workflows.
The official SDK repository includes runnable examples for common Exchange actions:
Authorization: faucet_claim.py, approve_agent.py, revoke_agent.py
Account settings: set_leverage.py, set_margin_mode.py, assign_pos_margin.py
Funds and vaults: withdraw.py, vault_deposit.py, vault_withdraw.py, bind_referral.py
Use revoke_agent.py or client.exchange.revoke_agent(...) to revoke the currently approved Agent wallet. The SDK submits an approveAgent action with the zero address and validitySeconds=0.
Revocation is a Master wallet operation. Keep it available in operational runbooks so automated trading access can be disabled quickly.
Last updated

