Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@dicksonp/dlmm-sdk
Advanced tools
For now, see `src/example.ts` for examples. Will add examples once stable.
For now, see src/example.ts
for examples. Will add examples once stable.
Function | Description | Notes |
---|---|---|
getLbPairs | Get all available LB Pairs | |
getLbPair | Get a specific LB Pair | |
findLbPairs | Given a X and Y token mint, find corresponding LB Pair(s). Will also find inverse LB Pairs ie desiredTokenX as tokenY and desiredTokenY as tokenX | |
getBinsAroundActiveBin | Get current distribution based on a radius around the active bin. Returns price, bin id, x amount and y amount for each bin | |
getBinsBetweenMinAndMaxPrice | Get bins and corresponding distribution based on a min and max price. Returns price, bin id, x amount and y amount for each bin | |
getBinsBetweenLowerAndUpperBound | Get bins and corresponding distribution based on a min and max bin ID. Returns price, bin id, x amount and y amount for each bin | |
getCurrentPrice | Get current price for a LB pair | |
getPriceOfBinByLbPair | Get price of a bin by its bin id for a LB pair | Prefer getPriceOfBinByBinStep if already have information on bin step to reduce RPC calls |
getPriceOfBinByBinStep | Get price of a bin by its bin id given a bin step | Use this when necessary but in general getBinsAroundActiveBin , getBinsBetweenMinAndMaxPrice and getBinsBetweenLowerAndUpperBound would already return the prices for each bin |
getBinIdFromPrice | Returns the bin id given a price | |
getPositionsByUser | Get positions by user pubkey | |
getPositionsByUserAndLbPair | Get positions by user pubkey for a specific LB Pair | |
getPosition | Get detailed information for a specific position. information includes binId , price , positionXAmount , positionYAmount etc+ | |
getEqualWeightageAmount | Returns an equal weightage amount of the opposing token based on ratio | This is useful when adding liquidity |
initializePositionAndAddLiquidity | Returns a yet-to-be sent Transaction as well as position and positionMint. Use this to construct a transaction to add liquidity to a LB Pair | Note that X and Y distribution values are a percentage (in BPS) of totalX and totalY amount to be deposited. PositionMint will be remove in next iteration. |
removeLiquidity | withdraw liquidity from a position | |
createLbPair | Create a new LB Pair or pool | |
swap | Works for swaps from X to Y or Y to X. Todo: Handle situation if bin array not yet initialized | If out token account does not exist, will create out token ATA. If out token is SOL, will receive WSOL. Does not handle for WSOL -> SOL |
FAQs
For now, see `src/example.ts` for examples. Will add examples once stable.
The npm package @dicksonp/dlmm-sdk receives a total of 3 weekly downloads. As such, @dicksonp/dlmm-sdk popularity was classified as not popular.
We found that @dicksonp/dlmm-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.