Skip to main content
The planned V2 helpers will quote a swap through BDEX V2 pools and build the swap transaction for you to sign. You can do both today with viem and the Router02 ABI.
In development. This describes the planned API. It is not published yet and details may change. Follow progress on GitHub.

Planned functions

The names below come from the SDK plan. Parameters and return types aren’t final, so they aren’t listed.

getAmountsOutV2

Will quote how much of the last token in a path you get for an input amount. It wraps Router02’s getAmountsOut(amountIn, path), which returns one amount per token in the path with the 0.30% pool fee already taken out.

buildSwapExactTokensForTokensV2

Will return an unsigned transaction for Router02’s swapExactTokensForTokens. It’s planned to apply a minimum output from your slippage and a deadline, and to throw SlippageTooHighError if the slippage is above the cap. You sign and send the result yourself.

Do it today

The SDK already ships bdexV2Router02Abi and the Router02 address for both networks.
1

Quote

v2-quote.ts
2

Approve and swap

Approve Router02 to spend your input token, then call swapExactTokensForTokens(amountIn, amountOutMin, path, to, deadline). The full, tested script is in Swap on BDEX V2. To swap native tBOT without wrapping, use swapExactETHForTokens with the amount as value, as shown in the same guide.

Things the helpers will handle for you

Until then, handle these yourself:
  • Decimals. USDT has 6 decimals on BOT Chain. Use TOKENS to format amounts.
  • Paths. For tokens without a direct pair, route through WBOT, for example [tokenA, wbot, usdt].
  • Deadlines. Build the deadline right before you send, in Unix seconds.
  • Stale quotes. Quote again right before you swap. See Slippage and deadlines.

BDEX V3

Concentrated liquidity pools.

Approvals

Approve before you swap.
Last modified on October 3, 2026