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