BTB Finance for agents

Protocols / Dexs

PancakeSwap AMM V3

PancakeSwap V3 concentrated liquidity DEX on BNB Chain. An agent can swap tokens through the SwapRouter, open and manage liquidity position NFTs, and quote prices with QuoterV2. The V2 router is included for legacy pairs.

On-chainEVM5 contractsWebsite · Docs

get_protocol({ "protocol": "pancakeswap-amm-v3" })

Risks an agent should know

What an agent can do

swap exact inputSwap one token for another in a V3 pool
Read the quote with QuoterV2.quoteExactInputSingle, approve SwapRouter for tokenIn, then call SwapRouter.exactInputSingle with amountOutMinimum set from the quote and a deadline.
open liquidity positionAdd liquidity in a tick range
Approve both tokens for NonfungiblePositionManager, then call mint with tokens sorted by address, the fee tier, the tick range and a deadline.
collect and close positionWithdraw liquidity and fees, then burn the NFT
Call decreaseLiquidity for all liquidity, then collect with max amounts, then burn. Batch them with multicall.
swap on V2 pairsSwap on the legacy V2 AMM
Use getAmountsOut for the quote, approve the V2 router, then call swapExactTokensForTokens or swapExactETHForTokens.

Contracts

bsc · chain id 56

ContractAddressKey functionsTry
PancakeV3Factory
factory
0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865
source
readgetPool(address,address,uint24)
writecreatePool(address,address,uint24)
readfeeAmountTickSpacing(uint24)
readowner()
writesetOwner(address)
writeenableFeeAmount(uint24,int24)
readpoolDeployer()
Full ABI
PancakeSwap V3 SwapRouter
router
0x1b81D678ffb9C0263b24A97847620C99d213eB14
source
writeexactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160))
writeexactInput((bytes,address,uint256,uint256,uint256))
writeexactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160))
writeexactOutput((bytes,address,uint256,uint256,uint256))
writemulticall(bytes[])
writerefundETH()
writeunwrapWETH9(uint256,address)
writesweepToken(address,uint256,address)
+3 more via get_protocol
Full ABI
PancakeSwap V3 NonfungiblePositionManager
pool
0x46A15B0b27311cedF172AB29E4f4766fbE7F4364
source
writemint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256))
writeincreaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256))
writedecreaseLiquidity((uint256,uint128,uint256,uint256,uint256))
writecollect((uint256,address,uint128,uint128))
writeburn(uint256)
readpositions(uint256)
readownerOf(uint256)
writemulticall(bytes[])
+4 more via get_protocol
Full ABI
PancakeSwap V3 QuoterV2
other
0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997
source
readquoteExactInputSingle((address,address,uint256,uint24,uint160))
readquoteExactOutputSingle((address,address,uint256,uint24,uint160))
readquoteExactInput(bytes,uint256)
readquoteExactOutput(bytes,uint256)
readfactory()
Full ABI
PancakeSwap V2 Router
router
0x10ED43C718714eb63d5aA57B78B54704E256024E
source
writeswapExactTokensForTokens(uint256,uint256,address[],address,uint256)
writeswapTokensForExactTokens(uint256,uint256,address[],address,uint256)
writeswapExactETHForTokens(uint256,address[],address,uint256)
writeswapExactTokensForETH(uint256,uint256,address[],address,uint256)
readgetAmountsOut(uint256,address[])
readgetAmountsIn(uint256,address[])
Full ABI

Notes

Only BNB Chain contracts are included, and they were confirmed on BNB Chain. The developer docs list the same V3 factory address on Ethereum, Arbitrum, Base, Linea, opBNB, Monad and Robinhood, and a different one on zkSync. Those deployments are not included here. The V2 router is included for legacy V2 pairs. Smart Router, MasterChefV3 and TickLens are not included because their function sets were not checked against bytecode.

Sources

Researched 2026-11-28. Addresses are copied from the official sources above; check them before moving large amounts.