Skip to main content
SODAX swaps are intents, not bridges. Your user signs one transaction on BNB Chain that locks the input and declares what they want on the destination network. Solvers fill it; the SODAX relayer carries proof between BNB Chain, the hub (Sonic), and the destination. If nothing fills, the intent can be cancelled and funds recovered. From your side it is one SDK call. From your user’s side it is one wallet prompt, plus an approval the first time they swap a BEP-20 token.

What this looks like on BNB Chain

  • Source: the intent transaction is an ordinary EVM transaction on BNB Smart Chain. ChainKeys.BSC_MAINNET ('0x38.bsc') identifies the network everywhere in the SDK.
  • Reach: any solver-compatible asset on any SODAX network is a valid destination, 166 assets today. The on-BNB Chain asset list only bounds what users hold on BNB Chain itself, not what they can swap into.
  • Tokens: BEP-20 tokens, which are ERC-20 contracts at their BNB Smart Chain addresses; native BNB uses the zero address. Read addresses and decimals from the SDK config rather than typing them.
  • Settlement: output lands on the destination network at dstAddress. Swaps into BNB Chain settle as ordinary BNB or BEP-20 balances; the recipient needs no setup.

Approvals

swap() does not approve the input token for you. BNB is the native token and needs no approval. Every BEP-20 token does: SODAX’s asset manager on BNB Chain pulls it through the token’s ERC-20 interface, so check the allowance first and approve when it falls short.
params is the same intent params object you pass to swap().

Quoting

The solver API quotes both directions:
getQuote deducts any configured partner fee before quoting, so quoted_amount is the net output the user actually receives.

Decimals across networks

On BNB Chain, USDC and USDT use 18 decimals. On most other SODAX networks they use 6. A swap between them crosses that boundary, so keep each amount in its own token’s units:
  • amount and inputAmount use the input token’s decimals: 100 USDT on BNB Chain is 100n * 10n ** 18n.
  • quoted_amount is in the destination token’s smallest unit: for USDC on Arbitrum, 6 decimals. Derive minOutputAmount from quoted_amount, never from the input amount.
  • For display, format each side with its own token’s decimals.
The same applies in the other direction: 100 USDC swapped from Base into USDT on BNB Chain quotes an output with 18 decimals.

Fees

Using SODAX is free to integrate. Two fees can apply to a trade:
  • Base fee: a fixed 0.1% of the input, taken by the protocol. Not configurable; compute it ahead of time with getSolverFee(inputAmount).
  • Your fee: optional platform fee on top, set by you and paid to you. It is the only fee you control. Configure it at SDK setup and check it with getPartnerFee(inputAmount). See Monetize SDK.
The user also pays BNB Chain’s network fee for the intent transaction, in BNB, like any other BNB Smart Chain transaction.

Executing

Prefer swap(). It creates the intent on BNB Chain, verifies it landed, submits it to the relay, waits for the packet on the hub, and notifies the solver. The Quickstart has the complete call. Track progress with getStatus(request), and cancel unfilled intents with cancelIntent. Limit orders (intents without deadlines) work from BNB Chain too, via createLimitOrder. Orchestrating manually with createIntent and submitIntent works the same as on any EVM network: BNB Chain intents need no relay extra data.

Error handling

Operations return Result<T> instead of throwing. The core methods (swap, createIntent, postExecution) return a typed SodaxError union you can switch on by error.code.
Full reference, including raw mode, limit orders, cancellation, and the complete error-code table: Swaps.