> For the complete documentation index, see [llms.txt](https://docs.pancakeswap.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pancakeswap.finance/kr/pancakeswap/how-to-guides/v3-v2-migration/how-v3-apr-is-calculated.md).

# v3 APR 계산 방식

{% hint style="info" %}
V3 유동성 및 파밍에서는 새로운 대체 불가능(non-fungible) 유동성과 사용자 지정 가격 범위 기능이 도입되어, 각 LP 포지션마다 고유한 LP 수수료 및 CAKE 파밍 APR을 갖습니다.
{% endhint %}

총 APR은 LP 수수료 APR과 CAKE 보상 APR을 합산한 값입니다.

### LP 수수료

이론적으로, 사용자가 추가하려는 가격 범위와 유동성이 주어지면 향후 7일간 예상 수수료를 다음과 같이 추정할 수 있습니다.

$$
fee\_{next7d} = fee\_{in} \frac{\Delta{L}}{L\_{in} + \Delta{L}}
$$

* $$fee\_{in}$$ : 최근 7일간 사용자가 지정한 가격 범위에서 발생한 수수료 금액
* $$L\_{in}$$: 사용자가 지정한 가격 범위의 현재 유동성
* $$\Delta{L}$$: 사용자가 해당 가격 범위에 추가하려는 유동성

#### 범위 내 수수료

$$fee\_{in}$$은 과거 거래량 데이터, 수수료 등급, 과거 가격 데이터를 사용하여 범위 내 가격을 추정합니다.

$$fee\_{in} = f\_tV\_{7d}\frac{T\_{in}}{T\_{7d}}$$

* $$f\_t$$: 수수료 등급
* $$V\_{7d}$$: 최근 7일간의 총 거래량
* $$T\_{in}$$: 지난 7일 동안 가격이 해당 가격 범위 내에 머문 시간(초 단위)
* $$T\_{7d}$$: 7일을 초 단위로 환산한 값

### CAKE APR

#### 풀 할당

MC v3에서 업킵(upkeep)을 사용하는 초당 총 CAKE 보상은 `latestPeriodCakePerSecond`로 구할 수 있습니다.

`cakePerSecond = lastestPeriodCakePerSecond / 1e12 / 1e18`

각 풀에서는 `poolInfo`를 사용하여 `poolInfo.allocPoint / totalAllocPoint`로 나누어 `poolWeight`를 구할 수 있습니다.

#### 글로벌 CAKE APR

글로벌 APR은 활성 상태로 스테이킹된 유동성의 총량과 풀의 CAKE 보상 배출량을 사용하여 계산합니다.

`APR (global) = (cakePerSecond * 31536000) / (totalAllocPoint / pool.allocPoint) * 100 * cakeUSD / totalStakedLiquidityUSD`

`totalStakedLiquidityUSD`는 MasterChef v3에 스테이킹된 범위 내 모든 포지션 틱으로 구성된, 현재 풀의 활성 스테이킹 유동성을 USD로 나타낸 값입니다.

#### 포지션별 CAKE APR

개별 포지션의 APR은 가격 범위 설정에 따라 달라질 수 있습니다.

$$
APR\_p = {\frac{USD\_{r}}{USD\_{p}}} {\frac{L\_{p}}{L\_{lm}}}
$$

* $$USD\_r$$: 풀에서 연간 받는 CAKE 보상의 USD 가치
* $$USD\_p$$: 포지션의 총 USD 가치
* $$L\_{p}$$: 포지션 유동성
* $$L\_{lm}$$: LMPool이 추적하는 총 스테이킹 유동성


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pancakeswap.finance/kr/pancakeswap/how-to-guides/v3-v2-migration/how-v3-apr-is-calculated.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
