What you can do
| swap exact input | Swap 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 position | Add 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 position | Withdraw 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 pairs | Swap on the legacy V2 AMM | Use getAmountsOut for the quote, approve the V2 router, then call swapExactTokensForTokens or swapExactETHForTokens. |
Out of range positions earn no fees and hold only one token until the price returns.
Low liquidity pools can move sharply on a single swap. Always set amountOutMinimum or amountInMaximum from a fresh quote.
Swaps with a deadline can revert if the transaction waits too long.
Tokens with transfer fees or rebasing behavior can break exact amount math.
Contracts
Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).PancakeV3Factoryfactory on bsc0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865
read getPool(address,address,uint24)
Pool address for a token pair and fee tier. Args: tokenA, tokenB, fee (hundredths of a bip, for example 2500 for 0.25%). Returns the zero address if no pool exists.
write createPool(address,address,uint24)
Create the pool for a token pair and fee tier if it does not exist. Reverts if the fee tier is not enabled or the pool already exists. Returns the pool address.
read feeAmountTickSpacing(uint24)
Tick spacing for a fee tier. Returns zero if the fee tier is not enabled.
read owner()
Factory owner, who can enable fee tiers and change the owner.
write setOwner(address)
Owner only. Transfers factory ownership to a new address.
write enableFeeAmount(uint24,int24)
Owner only. Enables a new fee tier with a tick spacing.
read poolDeployer()
Address of the pool deployer contract used by createPool.
PancakeSwap V3 SwapRouterrouter on bsc0x1b81D678ffb9C0263b24A97847620C99d213eB14
write exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160))
Swap an exact amount of tokenIn for as much tokenOut as possible in one pool. Struct fields in order: tokenIn, tokenOut, fee, recipient, deadline, amountIn, amountOutMinimum, sqrtPriceLimitX96 (0 for no limit). Approve the router for tokenIn first. Send value only for native BNB input.
write exactInput((bytes,address,uint256,uint256,uint256))
Multi hop exact input swap. Struct fields: path (packed token, fee, token, ... bytes), recipient, deadline, amountIn, amountOutMinimum.
write exactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160))
Swap as little tokenIn as possible for an exact amount of tokenOut in one pool. Struct fields: tokenIn, tokenOut, fee, recipient, deadline, amountOut, amountInMaximum, sqrtPriceLimitX96.
write exactOutput((bytes,address,uint256,uint256,uint256))
Multi hop exact output swap. Path is encoded in reverse order (tokenOut first). Struct fields: path, recipient, deadline, amountOut, amountInMaximum.
write multicall(bytes[])
Run several router calls in one transaction. Each element is calldata for another router function.
write refundETH()
Send any native BNB held by the router to msg.sender. Used after native swaps.
write unwrapWETH9(uint256,address)
Unwrap WBNB held by the router and send native BNB to a recipient. Args: minimum amount, recipient.
write sweepToken(address,uint256,address)
Send any leftover token balance held by the router to a recipient. Args: token, minimum amount, recipient.
write selfPermit(address,uint256,uint256,uint8,bytes32,bytes32)
Approve the router with an EIP 2612 permit signature in the same transaction.
read factory()
PancakeV3Factory used by the router.
read WETH9()
Wrapped BNB token used for native swaps.
PancakeSwap V3 NonfungiblePositionManagerpool on bsc0x46A15B0b27311cedF172AB29E4f4766fbE7F4364
write mint((address,address,uint24,int24,int24,uint256,uint256,uint256,uint256,address,uint256))
Open a new liquidity position and mint its ERC721 NFT to recipient. Struct fields in order: token0, token1, fee, tickLower, tickUpper, amount0Desired, amount1Desired, amount0Min, amount1Min, recipient, deadline. Tokens must be sorted by address. Approve both tokens first.
write increaseLiquidity((uint256,uint256,uint256,uint256,uint256,uint256))
Add liquidity to an existing position. Struct fields: tokenId, amount0Desired, amount1Desired, amount0Min, amount1Min, deadline.
write decreaseLiquidity((uint256,uint128,uint256,uint256,uint256))
Remove liquidity from a position. Struct fields: tokenId, liquidity, amount0Min, amount1Min, deadline. The tokens stay owed to the position until collect is called.
write collect((uint256,address,uint128,uint128))
Collect owed tokens and fees. Struct fields: tokenId, recipient, amount0Max, amount1Max. Use the uint128 maximum to collect everything.
write burn(uint256)
Burn a position NFT. The position must have zero liquidity and no owed tokens. Collect first.
read positions(uint256)
Position data for a tokenId: token pair, fee, tick range, liquidity, fee growth and owed amounts.
read ownerOf(uint256)
Owner of a position NFT.
write multicall(bytes[])
Run several position manager calls in one transaction, for example collect and burn together.
write refundETH()
Send any leftover native BNB held by the position manager to msg.sender.
write safeTransferFrom(address,address,uint256)
Transfer a position NFT to another address. Transfers the position and its claim on the liquidity.
read factory()
PancakeV3Factory used by the position manager.
read WETH9()
Wrapped BNB token used for native deposits.
PancakeSwap V3 QuoterV2other on bsc0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997
read quoteExactInputSingle((address,address,uint256,uint24,uint160))
Quote the output of an exact input swap in one pool. Struct fields: tokenIn, tokenOut, amountIn, fee, sqrtPriceLimitX96. The function is not a view. Call it with eth_call. Returns amountOut and related pool values.
read quoteExactOutputSingle((address,address,uint256,uint24,uint160))
Quote the input needed for an exact output swap in one pool. Struct fields: tokenIn, tokenOut, amount (exact output), fee, sqrtPriceLimitX96. Call with eth_call.
read quoteExactInput(bytes,uint256)
Quote a multi hop exact input swap. Args: path (packed tokens and fees), amountIn. Call with eth_call.
read quoteExactOutput(bytes,uint256)
Quote a multi hop exact output swap. Args: path (encoded in reverse order), amountOut. Call with eth_call.
read factory()
PancakeV3Factory used to find pools.
PancakeSwap V2 Routerrouter on bsc0x10ED43C718714eb63d5aA57B78B54704E256024E
write swapExactTokensForTokens(uint256,uint256,address[],address,uint256)
Swap an exact input amount along a V2 path. Args: amountIn, amountOutMin, path, to, deadline. Approve the router first.
write swapTokensForExactTokens(uint256,uint256,address[],address,uint256)
Swap for an exact output amount along a V2 path. Args: amountOut, amountInMax, path, to, deadline.
write swapExactETHForTokens(uint256,address[],address,uint256)
Swap exact native BNB for tokens along a V2 path. Args: amountOutMin, path (first token is WBNB), to, deadline. Send BNB as value.
write swapExactTokensForETH(uint256,uint256,address[],address,uint256)
Swap an exact token amount for native BNB along a V2 path. Args: amountIn, amountOutMin, path (last token is WBNB), to, deadline.
read getAmountsOut(uint256,address[])
Expected output amounts along a V2 path for an input amount.
read getAmountsIn(uint256,address[])
Required input amounts along a V2 path for an output amount.