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

# APR calculation

## Pool APR

The pool's Annual Percentage Rate (APR) is influenced by both the trading volume and the pool's rewards. The calculation is based on the average trading volume over the past 24 hours.

```typescript
apr = ((feeUsd * 365) / tvlUsd) * 100 + rewardAPR
```

## Position APR

We use the getPositionAPR method in the SDK to calculate the position apr

**Examples**

```typescript
const poolId = '0xb32fb8ec0b447a833066496bd7251d3a2ee57a0a97c54bf4cc945a986235582a';
const pool = await turbosSdk.pool.getPool(poolId);
const positionId =
  '0xb7efa54832e000dcb8879e586f74cec55623105920c96f5f1ebe78a60f9cbd3b';
const position = await turbosSdk.nft.getPositionFields(positionId);
turbosSdk.nft.getPositionAPR({
  poolId,
  tickLower: turbosSdk.math.bitsToNumber(position.tick_lower_index.fields.bits),
  tickUpper: turbosSdk.math.bitsToNumber(position.tick_upper_index.fields.bits),
  fees24h: '100000000',
  getPrice: async (coinType) => {
    return await getPriceFromApi(coinType);
  },
})
```

{% hint style="info" %}
24h fee and pool apr can get from our api: [https://api.turbos.finance/pools/v2?page=1\&pageSize=40\&orderBy=\&category=\&coinTypes=\&includeRisk=false\&symbol=<br>](<https://api.turbos.finance/pools/v2?page=1\&pageSize=40\&orderBy=\&category=\&coinTypes=\&includeRisk=false\&symbol=&#xA;>)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://turbos.gitbook.io/turbos/developer-docs/via-sdk/clmm/apr-calculation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
