# Overview

Introducing `Duo Exchange`, an yield swapping protocol that allows LPs to boost airdrop points or yield. A single `Vault` contract houses liquidity provision from all LPs and routes points / yield according to an LP's preference.

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

This simple setup creates powerful applications. Currently, there are duo exchanges that enables [Point-Yield Swap](/point-yield-swap) or [Variable-Fixed Yield Swap](/variable-fixed-yield-swap).&#x20;


# Duo Asset Token

For each LP's deposit (native ETH, WETH or USDB), Duo Exchange mints an equivalent amount of DETH or DUSD. These are "Duo Restaking Tokens" (DRTs) that can be further used in other protocols, e.g. as collateral in lending, as currency is swapping or leverage trading, etc.

At withdraw, an equivalent amount of DRTs must be present in the wallet, in order to redeem the original principal at 1:1 ratio.

<table><thead><tr><th width="152">Token</th><th>Blast Mainnet Address</th></tr></thead><tbody><tr><td>DETH</td><td><a href="https://blastscan.io/token/0x1Da40C742F32bBEe81694051c0eE07485fC630f6">0x1Da40C742F32bBEe81694051c0eE07485fC630f6</a></td></tr><tr><td>DUSD</td><td><a href="https://blastscan.io/token/0x1A3D9B2fa5c6522c8c071dC07125cE55dF90b253">0x1A3D9B2fa5c6522c8c071dC07125cE55dF90b253</a></td></tr></tbody></table>

Below are the logos to download for DETH and DUSD.

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td></td><td><img src="/files/NgSNko5E6isYRe5c3dJc" alt="" data-size="original"></td><td></td></tr><tr><td></td><td><img src="/files/6ryYHnyy96YGeG5s5yed" alt="" data-size="original"></td><td></td></tr></tbody></table>


# Point-Yield Swap

<figure><img src="/files/2kj9W567Y2gVKyVYbgWU" alt=""><figcaption></figcaption></figure>

Point-Yield Swap allows LPs to access (1) boosted points or (2) boosted yield. A single `Vault` contract houses both liquidity flows.

The vault allows two ways of liquidity provision, denoting LP1 and LP2. LP1 provides liquidity to get boosted points, but forgo the yield. LP2 provides liquidity to get boosted yield, but forgo the points.

LP1 gets a higher point rate, because both LP1 and LP2's principals are at the work, generating points for LP1. Similarly, LP2 gets a higher yield rate, because both LP1 and LP2's principals are generating yield for LP2.


# Variable-Fixed Yield Swap

<figure><img src="/files/eXQxsnWAs01EaO3x3ltF" alt=""><figcaption><p>Protocol Architecture</p></figcaption></figure>

Variable-Fixed Yield Swap allows LPs to access (1) fixed rate yield until maturity and (2) variable but potentially higher yield compared to the yield source. A single `Vault` contract houses both liquidity flows.

## Liquidity Flow

The vault allows two ways of liquidity provision, denoting LP1 and LP2. LP1 provides liquidity to lock a fixed rate of yield until maturity. LP2 provides liquidity to get variable but likely higher rate than the source over time.

As one can imagine, LP2 can get higher rate (over time) because LP1 gets a lower (but fixed) rate than the source. The overflow yield of LP1 flows into LP2. Additionally, opening an LP1 position pays LP2 a position fee.

## Fixed Rate Yield

In an environment where the yield fluctuates over time, locking a specific yield upfront is desirable. The exact available rate to lock is determined by the market. More details in [Yield Curve](/yield-curve).

Equivalently, this enables a product to buy an asset with discount and get full access to the asset at maturity.

LP1 can exit any time before maturity, but can't get the full yield. The unmatured portion will be burned by the vault (equivalently, the actual unmatured yield will shared by all LP2s).

## Variable Rate Yield

LP2 has variable but over time it's likely to have higher yield than the yield source. This is because both LP1 and LP2 are generating yield. And for the one pie of yield, LP1 is taking a smaller part (locking a lower yield than the instantaneous yield estimate). Besides, LP2 earns the position fee from LP1.

LP2 can exit any time and get the proportional yield and position fee. The proportion is this LP2's principal sum over time, divided by all LP2's principal sum over time.


# 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.


# Yield Curve

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

The protocol currently uses a piecewise linear curve to let the market determine the current fixed rate yield. The market demand/supply is indicated by the ratio between `Total Yield` and `Idle Yield` (see [Yield Manager](/yield-manager)).&#x20;

At any point in time, `Total Yield` is tracked by

```
Total Yield = Idle Yield + Locked Yield
```

The best of the fixed term yield the protocol can offer, is the current yield. The worst the protocol can offer is 0 yield.&#x20;

Now let's consider the boundary case. When `Idle Yield / Total Yield = 1`, this means all yield is idle, i.e. there are a lot of LP2 (supply) but no LP1 (demand). In this case, new LP1 should get a good deal, so the right end of the curve is at the current yield.&#x20;

On the other end, when hen `Idle Yield / Total Yield = 0`, this means no yield is idle, i.e there are a lot of LP1 already (insufficient supply for the demand). In this case, new LP1 should shouldn't get a good deal, so the left end of the curve is at 0.

The curve in between is trying to let the market (demand vs supply) converges to a fixed yield rate.&#x20;


# Deployment

## Point-Yield Swap

<table><thead><tr><th width="169">Contracts</th><th width="280">DETH</th><th>DUSD</th></tr></thead><tbody><tr><td>Vault</td><td><a href="https://blastscan.io/address/0x687F0Ca7a640b9E5d70b36e6247fD6bC0215fD7A">0x687F0Ca7a640b9E5d70b36e6247fD6bC0215fD7A</a></td><td><a href="https://blastscan.io/address/0x34Dc47d9325631768116E67a095c6aDdf8Ab1778">0x34Dc47d9325631768116E67a095c6aDdf8Ab1778</a></td></tr><tr><td>Yield Manager</td><td><a href="https://blastscan.io/address/0x22597493C61c6d766f78F50A98fBd83f7DE9F6B1">0x22597493C61c6d766f78F50A98fBd83f7DE9F6B1</a></td><td><a href="https://blastscan.io/address/0x1a540c1A1a67bB7dEe573a1BafD30007862bA02b">0x1a540c1A1a67bB7dEe573a1BafD30007862bA02b</a></td></tr><tr><td>Wrap Minter (v2)</td><td><a href="https://blastscan.io/address/0x11ebbf8588cabd749aa64f1a213084527e02506a">0x11EbBF8588cabD749aa64f1A213084527E02506A</a></td><td><a href="https://blastscan.io/address/0x49e86734d015890bd004491f3f1a42b44be39cb8">0x49e86734D015890BD004491f3F1A42B44be39CB8</a></td></tr><tr><td>Wrap Minter (v1)</td><td><a href="https://blastscan.io/address/0xD89dcC88AcFC6EF78Ef9602c2Bf006f0026695eF">0xD89dcC88AcFC6EF78Ef9602c2Bf006f0026695eF</a></td><td><a href="https://blastscan.io/address/0xf2050acF080EE59300E3C0782B87f54FDf312525">0xf2050acF080EE59300E3C0782B87f54FDf312525</a></td></tr></tbody></table>

## Variable-Fixed Swap

<table><thead><tr><th width="167">Contracts</th><th width="283">DETH</th><th>DUSD</th></tr></thead><tbody><tr><td>Vault</td><td><a href="https://blastscan.io/address/0xb3BA2cfd109cd0fACDf7c376C290c11F803dc8F2">0xb3BA2cfd109cd0fACDf7c376C290c11F803dc8F2</a></td><td><a href="https://blastscan.io/address/0x428a64A664f5a62C4E8c336E1792F52D0880512E">0x428a64A664f5a62C4E8c336E1792F52D0880512E</a></td></tr><tr><td>Yield Manager</td><td><a href="https://blastscan.io/address/0x08B939da28C97aFa6664eC49aD5bE51805ebbb36">0x08B939da28C97aFa6664eC49aD5bE51805ebbb36</a></td><td><a href="https://blastscan.io/address/0xa625B1e6686E8ceADd88aFAC8E44365005C3dbc4">0xa625B1e6686E8ceADd88aFAC8E44365005C3dbc4</a></td></tr><tr><td>Wrap Minter</td><td><a href="https://blastscan.io/address/0x7B4b51b482e874B3109ba618B0CA9cc1A75210dF">0x7B4b51b482e874B3109ba618B0CA9cc1A75210dF</a></td><td><a href="https://blastscan.io/address/0xd32A76755BeB19A514FBFE1aa534d1808C925B09">0xd32A76755BeB19A514FBFE1aa534d1808C925B09</a></td></tr></tbody></table>

## Operators

<table><thead><tr><th width="288">Operators</th><th>Blast Mainnet Address</th></tr></thead><tbody><tr><td>Contract Admin</td><td>0x7c8b9E2De6FfA465c6f717f349B3Ab13AB46481d</td></tr><tr><td>Blast Points Contract</td><td>0xa75da2a5f29c84c0F0Dc336B01dB702A5d61c792</td></tr><tr><td>Blast Points Contract Operator</td><td>0x375A47864D9422d81D227e28c5b75E354F6D092E</td></tr></tbody></table>


# Audits

<table><thead><tr><th width="222">Auditor</th><th>Report</th></tr></thead><tbody><tr><td>SlowMist</td><td><a href="https://github.com/Particle-Platforms/audits/blob/main/SlowMist%20Audit%20Report%20-%20Particle%20Vault%20Contract.pdf">Link1</a>, <a href="https://github.com/Particle-Platforms/audits/blob/main/SlowMist%20Audit%20Report%20-%20Particle%20Vault%20WrapMintV2.pdf">Link2</a></td></tr><tr><td>BlockSec</td><td><a href="https://github.com/Particle-Platforms/audits/blob/main/blocksec_particlevault_v1.0-signed.pdf">Link1</a>, <a href="https://github.com/Particle-Platforms/audits/blob/main/blocksec_particlevault_v1.1-signed.pdf">Link2</a></td></tr></tbody></table>


