Skip to content

Conversation

@codewithgun
Copy link
Contributor

@codewithgun codewithgun commented Apr 3, 2025

Example on how to retrive the value to display the liquidity distribution graph of DLMM pool. The example generate the below data structure

const liquidityBarChart: {
    price: Decimal;
    tokenXAmount: Decimal;
    tokenYAmount: Decimal;
    liquidity: Decimal;
  }[] = [];

where:

  • price = Bin price
  • tokenXAmount = Amount of token X in the bin
  • tokenYAmount = Amount of token Y in the bin
  • liquidity = px * y, this field will be used to fill the bar chart

@codewithgun codewithgun force-pushed the example/liquidity-graph branch from c0288c0 to 902a2d2 Compare April 3, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants