Planned functions
The names below come from the SDK plan. Parameters and return types aren’t final, so they aren’t listed.getPoolV3
Will return the pool address for two tokens and a fee tier, using the V3 factory’sgetPool(tokenA, tokenB, fee). The factory returns the zero address when no pool exists. BDEX V3 pools on testnet use the 500, 3000 and 10000 fee tiers (0.05%, 0.30% and 1%).
quoteExactInputSingleV3
Will quote a swap through one pool with QuoterV2’squoteExactInputSingle. QuoterV2 isn’t a view function: it runs the swap and reverts to return the result, so it has to be simulated, not read. A pool with no liquidity at the current price makes it revert.
Do it today
The SDK shipsbdexV3FactoryAbi, bdexV3QuoterV2Abi and bdexV3SwapRouterAbi, with addresses for both networks.
v3-quote.ts
exactInputSingle with the best tier. The full, tested script is in Swap on BDEX V3.
getAddresses(968) has a universalRouter, but mainnet doesn’t, because the mainnet Universal Router isn’t confirmed. Use SwapRouter for V3 swaps on both networks.Related
BDEX V2
Simpler pools with one fee.
Provide V3 liquidity
Add liquidity to a V3 pool.