# Yield Manager

The interface to obtain yield for each user is by minting `YieldStrippedToken`. This happens when locking upfront yield when minting `FixedRate` contracts, or transferring proportional yield when burning `VariableRate`  contracts.&#x20;

The protocol isolates the the minting and burning access of `YieldStrippedToken` to a separated, switchable `YieldManager` contract.

## Yield Formula

At its current form (this specific `YieldManager` to deploy and grant minter/burner access), each contract interaction triggers an update to  `Idle Yield`

```
Idle Yield += Principal * TimeSpan (since last checkpoint) * Rate
```

The `Principal` is tracked when liquidity transfers in and out of the `Vault` contract. The `Rate` is controlled by `YieldManager` Governors. Therefore, `Idle Yield` is the maximum amount of yield that `FixedRate` contracts can upfront lock, or `Variable Rate` contracts can proportionally withdraw.

## Position Fee

Every LP1 needs to pay (deduct from principal) a position fee. The fee charging portion is applied to the principal amount of LP1. For Point-Yield swap, the position fee is 0. For Variable-Fixed Yield swap, the position fee is 0.05%.&#x20;

The position fee sits in the Vault contract. Every time LP2 burns the principal, same proportion as the yield for the fee will be sent.&#x20;

## Security

The protocol segregates each LP1 and each LP2 into different contracts. The principal of the yield stripped tokens are in each separated contract. The underlying token is stored in the yield stripped token contract. The vault only holds position fee.&#x20;

The owner of LP1 and LP2 burns the principal to access actual token with the yield. The minting, burning of principal and the minting, burning of yield all have clear requirements for the allowed spending.

LP1 and LP2 contracts are immutable with no approval of spending needed. This segregation is to provide an extra layer of security, such that in the absolute worst or even adversarial scenario (i.e. no matter what happens to the vault), no user principal can be touched.

Also, the protocol governors control a last resort emergency switcher. At emergency, LP1 and LP2 can withdraw their principals directly from the contract, without interacting with the vault contract.


---

# 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.duo.exchange/yield-manager.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.
