Migrate the client in a controlled cutover
- Inventory the assumptions your current CEX client makes about accounts, positions, order lifecycle, and retries.
- Map those assumptions onto DerivaDEX strategy, sequencing, and settlement concepts.
- Rebuild the client around REST bootstrap plus realtime continuation.
- Run one bounded testnet cutover before moving any larger workflow.
- Keep the first release narrow until lifecycle reconciliation is stable.
Start with the model differences
Before changing code, classify these differences:- DerivaDEX trades through strategy-scoped collateral rather than exchange-custodied balances
- sequencing acknowledgement, execution outcomes, and later settlement-related effects are distinct stages
- mark price, margin, and liquidation controls are first-class safety inputs
- realtime feeds continue state, but REST still owns initial truth bootstrap
Rebuild account and position ownership
For the first migration pass:- identify which wallet and strategy own the DerivaDEX workflow,
- map your current account-level risk checks to strategy-level collateral and exposure checks,
- move all hard-coded balance assumptions behind one DerivaDEX strategy-state adapter.
Separate submission from lifecycle tracking
Rebuild the order path into two stages:- request creation, signing, encryption, and submission
- lifecycle tracking through REST snapshots plus realtime updates
Map your market-data path to DerivaDEX rules
When moving the market-data path:- choose the minimum realtime feeds you need,
- treat mark price as the risk and liquidation anchor,
- keep local order-book usage separate from account-state reconciliation,
- design the reconnect path around REST bootstrap rather than WebSocket-only continuity.
Rebuild retries around DerivaDEX failure classes
Do not port generic retry logic unchanged. On DerivaDEX:- replay-window and nonce defects usually require request rebuild
SafetyFailuremeans repair first, not retry unchanged- rate pressure and readiness faults need bounded retry
- lifecycle gaps should trigger reconciliation, not speculative local state updates
Cut over in one bounded workflow first
For the first live migration path:- one symbol,
- one strategy,
- one submission path,
- one lifecycle monitor,
- one reconciliation loop.