> 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/japanese/pancakeswapheyoukoso/how-to-guides/v3-v2-migration/how-v3-apr-is-calculated.md).

# v3 APRの計算方法

{% hint style="info" %}
v3の流動性とFarmでは、非代替性流動性とカスタマイズ可能な価格範囲設定により、各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における1秒あたりの合計報酬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は価格範囲の設定によって異なる場合があります。

$$
ARP\_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/japanese/pancakeswapheyoukoso/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.
