# Deposit and Exit Fee

## Vault Fee Rationale

To protect current vault shareholders from economic attacks stemming from transient depegging events, we may implement a [Pessimistic Price Oracle](https://www.inverse.finance/blog/posts/en-US/Why-We-Are-Using-Pessimistic-Price-Oracles) to generate ***dynamic*** Deposit and Exit fees. These fees are sensitive to current market price volatility for the vault reserve token.&#x20;

For Origami vaults, the Deposit Fee discourages arbitrageurs who seek to enter the vault when the underlying token was depegged to enter at a favorable price. The Exit fee covers the cost of unwinding the leveraged position, which may include slippage (up to 0.5% maximum) and gas fees.&#x20;

{% hint style="info" %}
Exiting a 11x position at 0.1% slippage means you'd be will to pay 1% fee to unwind the position. This is true regardless of whether you enter the position through Origami Finance or manually.
{% endhint %}

A Dynamic Deposit/Exit fee will be imposed *if at the time of deposit or exit,* the vault reserve token spot price deviation from the reference price is greater than the threshold deviation. The price deviation from reference price is also multiplied by the `LevFactor` to account for the impact of leverage for that vault. These vault fees are imposed as a discount on the number of vault shares issued to the user at the time of deposit, or withheld at the time of redemption. \
\
For the Fees Schedule for a specific vault, check the [Vault Fee Schedule](/the-second-fold-v2/vault-fee-schedule.md).

{% hint style="info" %}
An economic attack is exemplified when a user attempts to deposit into the vault when the share price was temporarily depressed due to the reserve asset e.g. sUSDe being in a depegged state vs DAI, and subsequently exit once the sUSDe price was restored.
{% endhint %}

## When market price volatility is low for the underlying vault token:

* A vault fee of *not less than* `minDepositFeePercent` will be assessed for User Deposits&#x20;
* A vault fee of *not less than* `minExitFeePercent` will be assessed for User Exits

### When market price volatility is high for the underlying vault token:

* The Vault deposit and exit fee may be significantly higher than the minimum (See Formula Below)

{% hint style="info" %}
The Deposit and Exit modal will always show the vault fee that is applicable. If the current Dynamic vault deposit or exit fee is higher than the `minimumFee` outlined in the [Vault Fee Schedule](/the-second-fold-v2/vault-fee-schedule.md), the higher of the two fees will be applied.
{% endhint %}

## Deposit Fee Formula

$$
\boxed{max(levFactor*min(reference-spot, 0) / reference*100, minDepositFeePercent)}
$$

<figure><img src="/files/KNGkG6Ke13v0YaJVgwGT" alt=""><figcaption></figcaption></figure>

## Exit Fee Formula

$$
\boxed{max(levFactor*min(spot-reference, 0)/reference*100, minExitFeePercent) }
$$

<figure><img src="/files/u1XCqBSEyaZc3p6qQAeK" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If the Exit fee shown on the Exit modal is is higher than the `minExitFee` for the vault, you may wait until the underlying token price is less volatile to exit at the `minExitFee`.
{% endhint %}

Formula Terms Defined for the *lov-sUSDe-a* Vault:

$$
spot = \text{Oracle Price}\_{\text{(sUSDe/DAI)}}
$$

$$
reference = \text{ShareToAsset}*\text{(sUSDe/USDe)} \* \text{Oracle}*\text{(USDe/DAI)}
$$

$$
levFactor\text{ = Vault Leverage}
$$

{% hint style="info" %}
*LevFactor* is set to the actual leverage for the *delta-neutral* lovToken vaults.
{% endhint %}


---

# 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.origami.finance/the-second-fold-v2/what-fees-we-collect/deposit-and-exit-fee.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.
