pancakeswap-lp-route

v1.0.0
com.brainonbnb/pancakeswap-lp-route Checked 4 days ago Published 28 days ago

PancakeSwap fee tier, V3 range, position and best swap route on BNB Chain, measured, free

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pancakeswap_fee_tiers

Measure which PancakeSwap fee tier of a pair actually pays liquidity providers, to decide WHERE to put liquidity. A first read of a pair reads an hour of swaps in every tier and takes about 8-12 s; a repeat within minutes is faster. Use it before adding liquidity to a pair; once the pool is chosen use pancakeswap_range_plan for the price range, for a position you already hold use pancakeswap_position_look, and for a swap (not liquidity) use pancakeswap_best_route. Pass a token to compare all its pools against its main quote, or a pool address to pin the exact pair. A pair lives in up to five p…

ParameterTypeDescription
address *stringA BSC token address (all of its PancakeSwap pools against its main quote are compared), or one PancakeSwap pool address to pin that exact pair; 0x + 40 hex

pancakeswap_position_look

Look at any PancakeSwap V3 liquidity position on BNB Chain, read from the chain: in range or not and how much room is left to each edge, what it holds and is worth in BNB, the fees it is owed and whether collecting them pays for the gas, and what PancakeSwap’s The Flip proposal (LPs keeping 88% of swap fees) would change for it if adopted - the share the pool pays its LPs today is read from the pool itself. Give a position id, or a wallet that holds one (a wallet with several gets their ids back). Free. What to do about it - whether a re-set is due and in which width - is the paid plan of th…

ParameterTypeDescription
addressstringOr a wallet address that holds the position
positionstringA PancakeSwap V3 position id (the NFT token id), digits only

pancakeswap_range_plan

Replay real swaps to compare PRICE RANGE widths for a PancakeSwap V3 position: fees each width would have earned and how long it stayed in range. Use it after the pool is chosen (pancakeswap_fee_tiers picks the tier); for a position you already hold use pancakeswap_position_look. Read-only, free, no key. For a liquidity provider who has picked a PancakeSwap V3 pool and now has to pick a PRICE RANGE - the decision concentrated liquidity actually forces, and the one every interface answers with a preset. This does not model and does not forecast. It replays: the V3 Swap event carries the liquidi…

ParameterTypeDescription
address *stringA BSC token address, or a PancakeSwap V3 pool address to pin the pool
capitalUsdnumberSize of the position in dollars, optional - defaults to 1000. It sets your share of the active liquidity at each swap, so the fees depend on it
quotestringThe other side of the pair, optional: BNB, USDT, USDC, USD1 or BUSD, or its address. Without it the quote with the deepest V3 pool is used, so pass it whenever a pair was named (CAKE/BNB)

pancakeswap_best_route

For an agent about to swap on PancakeSwap, and for the two questions it has to answer before signing. FIRST: which of the up-to-five pools the pair lives in actually returns the most AT THIS SIZE, quoted by the venue itself rather than ranked by depth - the deepest pool is regularly not the cheapest one for the trade being made. SECOND: what comes back if the proceeds are sold straight back on the same route, with the transfer tax (measured from executed trades, or simulated on chain when there was no trade to measure: transfer_tax.source says which) applied to the amounts carried between the…

ParameterTypeDescription
address *stringA BSC token address, or a PancakeSwap pool address to pin the pair
usdnumberTrade size in dollars, optional - defaults to 250