# Backtest

Backtesting validates the USDC Vault's strategy using historical market data before deploying real capital.

## Methodology

* **Data**: Binance SOL-PERP 8-hour funding rates + OHLCV
* **Period**: January 2024 — April 2026 (821 days)
* **Initial Capital**: $10,000
* **Assumptions**: Multiply and Lending APYs are held constant (see [Limitations](#limitations)). DN entry/exit uses the same parameters as the live bot.

### Parameters

| Parameter           | Value                       |
| ------------------- | --------------------------- |
| Multiply APY        | 13% (fixed)                 |
| Lending APY         | 5% (fixed)                  |
| dawnSOL Staking APY | 6.8%                        |
| DN Allocation Cap   | 70% of NAV                  |
| FR Entry Threshold  | > 10% annualized for 3 days |
| FR Exit Threshold   | < 0% annualized for 3 days  |
| FR Emergency Exit   | < -10% annualized           |

## Results: Current Strategy

Multiply-first + Lending overflow + conditional DN — the live production configuration.

| Metric                | Value      |
| --------------------- | ---------- |
| **Final NAV**         | $13,439.01 |
| **Total Return**      | 34.39%     |
| **Annualized Return** | 14.04%     |
| **Sharpe Ratio**      | 27.01      |
| **Max Drawdown**      | 0.23%      |
| Days in BASE\_ONLY    | 584        |
| Days in BASE\_DN      | 237        |
| DN Entries / Exits    | 3 / 3      |

### Yield Breakdown

| Source              |        Amount |    Share |
| ------------------- | ------------: | -------: |
| Multiply Yield      |     $2,784.87 |    79.1% |
| Funding Rate Income |       $535.38 |    15.2% |
| dawnSOL Staking     |       $200.22 |     5.7% |
| **Total Gross**     | **$3,520.47** | **100%** |
| Fees (deducted)     |       -$69.86 |          |
| **Net Profit**      | **$3,439.01** |          |

Multiply generates the vast majority of returns. The DN layer contributes a smaller but consistent positive amount across 3 entry/exit cycles ($736 gross from funding + staking).

### DN Active Periods

| #         | Period                  |            Days | Avg FR (annualized) |
| --------- | ----------------------- | --------------: | ------------------: |
| 1         | 2024-01-03 — 2024-07-05 |             185 |               18.4% |
| 2         | 2024-11-11 — 2024-12-20 |              40 |               20.0% |
| 3         | 2025-07-22 — 2025-08-02 |              12 |                6.4% |
| **Total** |                         | **237 (28.9%)** |           **18.0%** |

### Benchmarks

| Strategy                              | Total Return |
| ------------------------------------- | -----------: |
| **Current (Multiply + Lending + DN)** |   **34.39%** |
| Multiply Only                         |       31.64% |
| Lending Only                          |       11.60% |
| SOL Buy & Hold                        |      -18.31% |

## Known Limitations

### 1. Fixed Multiply / Lending APY

The largest constraint. Multiply (13%) and Lending (5%) are held constant for the entire period. In practice, rates fluctuate significantly (Multiply: 8-20%, Lending: 2-8%). This means:

* **Sharpe Ratio is overstated** — volatility comes only from fee events, not from APY fluctuations
* **Max Drawdown is understated** — Multiply APY drops and depeg-driven drawdowns are not modeled
* **DN's relative value is hidden** — DN becomes more valuable when Multiply APY drops, but this flexibility cannot be evaluated under fixed assumptions

Improvement: ingest historical APY time-series from Kamino/Jupiter APIs and apply variable rates per tick.

### 2. Multiply Risk Not Modeled

* **Depeg risk**: No NAV loss if ONyc depegs from USDC
* **Liquidity risk**: Exit slippage during forced withdrawals not reflected
* **Liquidation risk**: Deleverage costs from Health Rate drops not included
* **Pool capacity**: Assumed unlimited, but real capacity depends on TVL

With these factors, Max Drawdown would likely be materially higher than 0.23%.

### 3. Short Data Period (2 years)

Only data from January 2024 onward is used. Different market cycles (bear markets, low-volatility regimes) are not tested. Binance FR data is available from 2021, but Kamino Multiply only launched in 2024 — longer backtests would require stronger APY assumptions.

### 4. Instant DN Transitions

In production, DN entry/exit involves multiple steps (lending withdrawal → CEX transfer → position construction) taking minutes to tens of minutes. The backtest assumes instant transitions, ignoring price movement risk during execution.

### 5. Static Fee Model

* Swap slippage is fixed at 0.1%, but actual slippage depends on pool liquidity and trade size
* Binance fees vary by tier (down to 0.02% at VIP levels)
* Solana priority fees spike during congestion

### 6. Only FR Uses Real Data

Funding rates are the only real market data driving both DN entry/exit decisions and DN revenue. Base Layer yield (Multiply/Lending) uses fixed assumptions. This creates uneven simulation fidelity across the portfolio — the backtest is most reliable for evaluating DN signal quality, less so for absolute return projections.

{% hint style="warning" %}
Backtest results do not guarantee future performance. Past market conditions may not repeat. See [Risk & Security](/dawn-vault/risk-and-security.md) and [Disclaimer](/legal/disclaimer.md).
{% endhint %}

## Run It Yourself

The backtest engine is open source. You can reproduce these results or test your own parameters.

### Setup

```bash
git clone https://github.com/DawnLabsTech/vault.git
cd vault/backtest
npm install
```

### Basic Usage

```bash
# Run with default parameters (matches live bot config)
npm run backtest

# Show all available options
npm run backtest -- --help
```

### CLI Options

| Flag             | Description                             | Default    |
| ---------------- | --------------------------------------- | ---------- |
| `--start`        | Start date                              | 2021-01-01 |
| `--end`          | End date                                | 2026-03-01 |
| `--capital`      | Initial capital (USDC)                  | 10000      |
| `--multiply-apy` | Fixed Multiply APY (%)                  | 13         |
| `--multiply-cap` | Max USDC in Multiply                    | unlimited  |
| `--lending-apy`  | Fixed Lending APY (%)                   | 5          |
| `--dawnsol-apy`  | Fixed dawnSOL APY (%)                   | 6.8        |
| `--entry-fr`     | FR entry threshold (%)                  | 10         |
| `--exit-fr`      | FR exit threshold (%)                   | 0          |
| `--emergency-fr` | Emergency exit threshold (%)            | -10        |
| `--confirm-days` | Confirmation days                       | 3          |
| `--dn-alloc`     | DN allocation ratio                     | 0.7        |
| `--output`       | Output format: `table` / `csv` / `json` | table      |
| `--fetch-only`   | Fetch data only, skip simulation        | —          |

### Examples

```bash
# Reproduce the published results
npm run backtest -- --start 2024-01-01 --end 2026-04-01

# Export as JSON for further analysis
npm run backtest -- --output json

# Fetch funding rate data without running simulation
npm run backtest -- --fetch-only --start 2020-01-01 --end 2026-04-01
```

Funding rate data is fetched from Binance on the first run and cached locally in SQLite. Subsequent runs reuse the cache.


---

# 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.dawnlabs.tech/dawn-vault/backtest.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.
