Skip to content
Docs

DeFi

Mainnet-only behavior

DeFi positions and actions are available on mainnet chains only.

Overview

All DeFi routes reject testnet chain ids. Gate features in UI using chain capabilities ( Cap(defi) on OKX-mapped mainnets).

Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.

CodeHTTPWhen
unsupported_capability400Testnet chain id or feature disabled on testnets (prices, NFTs, DeFi, swap)
json
{
  "error": {
    "code": "unsupported_capability",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}