# Add Liquidity

Once you have set a suitable tick range, you can proceed to add liquidity to this position. The quantity composition of tokens you need to add is affected by the current price of the pool and the tick interval you have chosen.

## 1. Create the payload of Add Liquidity&#x20;

use `sdk.Position.addLiquidityTransactionPayload` method

### Function Input params

* `positionId` : The position id.
* `currencyA`:  coin/fa type of currency token
* `currencyB`:  coin/fa type of currency token
* `currencyAAmount`: the amount about currency A, which used to add liquidity
* `currencyBAmount`: the amount about currency B, which used to add liquidity
* `feeRateTier`: Fee Rate Tier will affect price precision. Now mainnet exist some different type FeeRateTier, the correspond to different fee rates.

<table data-full-width="true"><thead><tr><th>Tick spacing</th><th>Fee Rate</th><th data-type="number">FeeTierIndex</th></tr></thead><tbody><tr><td>1</td><td>0.01%</td><td>0</td></tr><tr><td>10</td><td>0.05%</td><td>1</td></tr><tr><td>60</td><td>0.3%</td><td>2</td></tr><tr><td>200</td><td>1%</td><td>3</td></tr><tr><td>20</td><td>0.1%</td><td>4</td></tr><tr><td>50</td><td>0.25%</td><td>5</td></tr></tbody></table>

* `slippage` : slippage value. 0.1 means 0.1%.

### Example

```typescript


const currencyAAmount = Math.pow(10, 8);
// currencyA's decimals is 8
// currencyB's decimals is 6
const decimalsRatio = Math.pow(10, 8 - 6);
const feeTierIndex = FeeTierIndex["PER_0.05_SPACING_5"]

const currentPriceTick = priceToTick({
  price: 995,
  feeTierIndex,
  decimalsRatio,
})

const tickLower = priceToTick({
  price: 992,
  feeTierIndex,
  decimalsRatio,
})

const tickUpper = priceToTick({
  price: 1336,
  feeTierIndex,
  decimalsRatio,
})

const [_, currencyBAmount] = await sdk.Pool.estCurrencyBAmountFromA({
  // address here mus be fa type
  currencyA: "0xa",
  currencyB:
    "0xc5bcdea4d8a9f5809c5c945a3ff5698a347afb982c7389a335100e1b0043d115",
  currencyAAmount,
  feeTierIndex,
  tickLower,
  tickUpper,
  currentPriceTick,
});

const params = {
    positionId: '',
    currencyA: "0x1::aptos_coin::AptosCoin",
    currencyB:
      "0x6926bff1eab5554fa72ae167ed736acf623ab17fe81ebf2ea0d2138f8c533f77::type::T",
    currencyAAmount,
    currencyBAmount,
    slippage: 0.1,
    feeTierIndex,
}

const payload = await sdk.Position.addLiquidityTransactionPayload(params)


```

<sub>The White Paper is for informational purposes only. Nothing in the White Paper constitutes legal, financial or tax advice. Its content may be updated from time to time without express notice. You should seek your own professional advice before engaging in any activity in connection with Hyperion. See</sub> [<sub>Legal Disclaimer</sub>](https://docs.hyperion.xyz/legal-and-compliance/legal-disclaimer)<sub>.</sub>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperion.xyz/developer/via-sdk/features-available/add-liquidity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
