Skip to main content
Mainnet currently supports Spot DEX only. Perpetuals, Oracle, Margin Trading, Lending, and Vaults are Testnet-Only. Use Testnet endpoints and assets for those products.
Keep a durable journal of the network, product, trading account, client order ID, exact signed transaction hash, returned order IDs, and final result. A network response, acceptance by a node, a committed transaction, order state, and a fill are five separate things to check.

Before quoting

  1. Load the native constraints, account balances or risk, and usable prices. Resolve market IDs separately from display symbols and oracle feed IDs.
  2. Check the agent’s permissions and replay namespace. Coordinate processes sharing a message account or wallet sequence.
  3. Reconcile ordinary, conditional (Testnet-Only), and TWAP parent orders for every account the strategy controls. A fresh process or replacement key does not start with an empty account.
  4. Allocate headroom for cancellation, risk changes, and reconnect work before sending new quotes.

Unknown submission result

A timeout is not proof of rejection. Search indexed history and the native order/client-ID query for the exact account, allowing for indexer delay. Absence from open orders does not prove an order never executed: it may have filled, expired, or been replaced. A client ID is not permanent deduplication storage. Keep the signed bytes and hash and resolve their result before signing a fresh attempt with a new sequence or agent timestamp. For a timed-out cancel or modify, query the old ID, replacement ID, client ID, and intervening fills. Interpret batch results separately from transaction success. Stop the affected quoting loop while its exposure is uncertain.

Disconnect and restart

Pause quoting when required market or account data is stale. Reconnect, resubscribe, and refresh paginated orders, fills, balances, and product risk before resuming. Deduplicate fill records by their identifiers rather than summing repeated deliveries. Each Spot l2Book frame is a complete snapshot of its published depth: replace both sides. There is no common REST/WS sequence bridge or guaranteed replay of missed intermediate books. Follow the reconnect rules. Use product REST reads for risk reconciliation. Spot frames do not represent every product account.

Stop quoting and remove orders

  1. Stop every writer that can recreate quotes. A socket disconnect or agent expiry leaves existing on-chain orders and schedules in place.
  2. Enumerate every page of ordinary and pending conditional orders across the owner and derived accounts. Include TWAP parents; a Spot open-order list is not this full inventory.
  3. Cancel explicit IDs through MsgCancelOrders. Inspect the committed code and succeeded/failed items. Orders created in the current block cannot be canceled or modified through this action until a later block.
  4. Confirm terminal states and requery. Canceling the TWAP parent stops later slices after commit; already-created slices and fills need separate reconciliation. Cancellation does not reverse executions, close positions, or repay debt.
  5. Revoke a compromised or retired agent separately. Keep another authorized signer available; revocation is not a cancel-all instruction.
This workflow uses explicit on-chain cancellations. Do not treat the read-only WebSocket heartbeat as a quote-cancellation timer or infer server-side protection from connection health.

Limits and backoff

Read rate-limit configuration and current account benefits instead of copying a fixed requests-per-second value. A chain rejection is distinct from REST 429. Retries must respect the unknown-result procedure above.