Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dicksonp/dlmm-sdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dicksonp/dlmm-sdk

For now, see `src/example.ts` for examples. Will add examples once stable.

  • 0.6.5-test2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Example Usage

For now, see src/example.ts for examples. Will add examples once stable.

Available functions

FunctionDescriptionNotes
getLbPairsGet all available LB Pairs
getLbPairGet a specific LB Pair
findLbPairsGiven 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
getBinsAroundActiveBinGet current distribution based on a radius around the active bin. Returns price, bin id, x amount and y amount for each bin
getBinsBetweenMinAndMaxPriceGet bins and corresponding distribution based on a min and max price. Returns price, bin id, x amount and y amount for each bin
getBinsBetweenLowerAndUpperBoundGet bins and corresponding distribution based on a min and max bin ID. Returns price, bin id, x amount and y amount for each bin
getCurrentPriceGet current price for a LB pair
getPriceOfBinByLbPairGet price of a bin by its bin id for a LB pairPrefer getPriceOfBinByBinStep if already have information on bin step to reduce RPC calls
getPriceOfBinByBinStepGet price of a bin by its bin id given a bin stepUse this when necessary but in general getBinsAroundActiveBin, getBinsBetweenMinAndMaxPrice and getBinsBetweenLowerAndUpperBound would already return the prices for each bin
getBinIdFromPriceReturns the bin id given a price
getPositionsByUserGet positions by user pubkey
getPositionsByUserAndLbPairGet positions by user pubkey for a specific LB Pair
getPositionGet detailed information for a specific position. information includes binId, price, positionXAmount, positionYAmount etc+
getEqualWeightageAmountReturns an equal weightage amount of the opposing token based on ratioThis is useful when adding liquidity
initializePositionAndAddLiquidityReturns a yet-to-be sent Transaction as well as position and positionMint. Use this to construct a transaction to add liquidity to a LB PairNote 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.
removeLiquiditywithdraw liquidity from a position
createLbPairCreate a new LB Pair or pool
swapWorks for swaps from X to Y or Y to X. Todo: Handle situation if bin array not yet initializedIf 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

Package last updated on 01 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc