> For the complete documentation index, see [llms.txt](https://cetus-1.gitbook.io/cetus-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cetus-1.gitbook.io/cetus-developer-docs/developer/via-sdk/features-available/liquidity-and-coin-amounts-calculation.md).

# Liquidity and coin amounts calculation

## 1. Liquidity to CoinAmount

use `ClmmPoolUtil.getCoinAmountFromLiquidity` method.

#### Example

this is an example shows how to calculate coin amounts about one position.

```ts
import BN from 'bn.js'
import { TickMath, ClmmPoolUtil } from '@cetusprotocol/cetus-sui-clmm-sdk'

const pool = await sdk.Pool.getPool(poolAddress)
const position = await sdk.Position.getSimplePosition(positionAddress)\
const lowerSqrtPrice = TickMath.tickIndexToSqrtPriceX64(position.tick_lower_index)
const upperSqrtPrice = TickMath.tickIndexToSqrtPriceX64(position.tick_upper_index)

const liquidity = new BN(position.liquidity)
const curSqrtPrice = new BN(pool.current_sqrt_price)

const lowerSqrtPrice = TickMath.tickIndexToSqrtPriceX64(position.tick_lower_index)
const upperSqrtPrice = TickMath.tickIndexToSqrtPriceX64(position.tick_upper_index)
const amounts = ClmmPoolUtil.getCoinAmountFromLiquidity(
  liquidity,
  curSqrtPrice,
  lowerSqrtPrice,
  upperSqrtPrice,
  false
)

const {coinA, coinB} = amounts
```
