@pancakeswap/v4-sdk
v0.1.6
Published
⚒️ An SDK for building applications on top of Pancakeswap V4
Downloads
419
Readme
PancakeSwap V4 SDK
PancakeSwap V4 Official SDK, used for PancakeSwap Interface and interacting with PancakeSwap V4 smart contracts.
Usage
CLAMM Pool
TBD
Bin Pool
in Bin Pool, we use symbol Y
and X
to represent the two tokens in the pool. Like the 1
and 0
in CLAMM Pool.
- getBinPool: Get the bin pool with state
- getIdFromPrice: Get the bin id from given price
- getPriceFromId: Get the price from given bin id
- getNextNonEmptyBin: Get the next non-empty bin
- swap: Dry run Swap tokens in bin pool, return the state after swap
Utils for both CLAMM and Bin Pool
- getPoolId: Get the pool id from given PoolKey
- getSortedCurrencies: Returns the sorted currencies from given
- encodeHooksRegistration: hooks registration option encoder
- encodePoolParameters: pool parameters encoder
Contributing
pnpm install
pnpm run test