> For the complete documentation index, see [llms.txt](https://docs.nodo.xyz/public/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nodo.xyz/public/economic-mechanisms/apr-calculation-detailed.md).

# APR Calculation (Detailed)

## Realized APR Formula

When profits are realized (converted to USDC):

```
Profit % = Realized Profit / Last Snapshot Total Credited USDC
```

```
Daily Rate = Profit % / Days Since Last Realization
```

```
Realized APR = Daily Rate × 365
```

## Unrealized APR Formula

When profits are credited (still in position):

```
Unrealized Profit = (Position Value + Unclaimed Fees) - Last Snapshot Credited USDC - New Capital
```

```
Profit % = Unrealized Profit / (Snapshot Credited + New Capital)
```

```
Daily Rate = Profit % / Days Since Last Realization
```

```
Unrealized APR = Daily Rate × 365
```

## Snapshot Logic

A snapshot of Total Credited USDC is recorded every time profits are realized or credited. This snapshot is used as the denominator in future APR calculations.

## Daily Profit Rate Calculation

Based on the time difference from the last profit event. This allows APR to adapt dynamically depending on the frequency and scale of profit events.

## Profit Accounting Methods

* realizeProfit: Agent converts profit to USDC, adds to vault. APR is Realized.
* creditProfit: Agent leaves profit in position but updates the vault’s accounting. APR is still treated as Realized.

If neither function is called recently, APR falls back to Unrealized based on the active DEX position value.

<br>


---

# 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://docs.nodo.xyz/public/economic-mechanisms/apr-calculation-detailed.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.
