Skip to main content
The planned BDEX module will let you quote and build swaps on BDEX V2 and V3 with typed helpers. Until it ships, you can do all of this today with viem and the SDK’s addresses and ABIs.
In development. This describes the planned API. It is not published yet and details may change. Follow progress on GitHub.

What it will do

@uzolabs/sdk/bdex is planned for SDK 0.3.0. It will cover four areas: The function names come from the SDK plan. Their parameters and return types aren’t published yet, so these pages describe what each function is for, not its final signature.

How it will work

Like the rest of the SDK, the module won’t hold keys or send transactions. Quote functions read from the chain. Build functions return a transaction request that you sign and send with your own wallet client. Two safety checks are planned, and their error classes already exist in 0.2.0:
  • Slippage cap. A swap that asks for more slippage than the maximum throws SlippageTooHighError.
  • Router allowlist. Calldata from the Routing API that targets an unknown router throws RouterNotAllowedError.

Do it today

Everything the module will do is possible now with viem plus @uzolabs/sdk/contracts, which already ships the BDEX addresses and typed ABIs. This quote runs as is:
quote.ts
Output
Your number depends on the pool at the time. For full swaps, follow these guides:

Swap on BDEX V2

Quote, approve and swap through Router02.

Swap on BDEX V3

Compare fee tiers and swap through SwapRouter.

Slippage and deadlines

Set safe minimums before you build a swap.

BDEX API

List pairs and pools without reading the chain.

BDEX V2

Reference for the planned getAmountsOutV2 and buildSwapExactTokensForTokensV2 functions.

BDEX V3

Reference for the planned getPoolV3 and quoteExactInputSingleV3 functions.

Routing API

Reference for the planned createRoutingClient. You supply the Routing API base URL, which is not public.

Approvals

Build ERC-20 and Permit2 approval transactions for BDEX routers with the planned SDK.
Last modified on October 2, 2026