# Welcome to Agilely

Agilely Documentation v1.0.  Last updated: 26 July 2023

## Introduction

As the first LRT(Liquid Restaking Token) derivative, Agilely introduces an advanced decentralized borrowing protocol on the Arbitrum ecosystem, offering users an unparalleled stablecoin solution - USDA (Agilely USD). USDA is pegged to the US Dollar and stands as a beacon of stability within the Agilely ecosystem. What sets USDA apart are its **extensive collateral support**, encompassing assets like ETH, wstETH, rETH, cbETH, sfrxETH, wBTC, ARB, GLP, GMX and LRTs, and its groundbreaking **omni-chain capabilities**, leveraging Layerzero's cutting-edge technology.

### Multi-collateral

Agilely provides support for the major assets that comprise the portfolio of an active DeFi yield farmer - ETH, liquid staking tokens (LSTs), GLP, and GMX (in Arbitrum). For LSTs, the protocol will support wstETH and rETH first and then expand to others. wBTC is also included to allow BTC savers to unlock the liquidity of their assets without selling any wBTC they hold.

### USDA: Omni-chain stablecoin

Native Omni-chain OFT-20 stablecoin powered by LayerZero, allowing you to participate in exploding ecosystems on Ethereum L2s. USDA will initially launch on Arbitrum, Ethereum expanding accessibility and utility.

### Reliable Liquidation

Liquidation mechanism of Agilely is forked from liquity, containing time-tested features such as stability pool and recovery mode.

### Long-term Vision

We are looking forward to ecosystem expansion. Developing a diverse range of financial products leveraging USDA is a crucial element of this vision, accompanied by supporting more collaterals and making liquidation more efficient. The key point is to enhance USDA's liquidity, reliability, and utility.

## Disclaimer

What you are about to read is not the final version of the Agilely whitepaper. As time passes, the project develops and new features are added, the documentation will be expanded and is subject to change.


# USDA Overview

## What is USDA?

USDA is an interest-bearing  stablecoin based on the CDP(Collateral Debt Position) model. USDA can be minted by depositing collateral on Agilely Protocol.In the following content, we will introduce the price stability and interest-bearing properties of USDA separately.

## Price Stability

The first principle of a stablecoin is to maintain a price pegged with $1. In order to achieve this goal, we have adopted Liquity's price stabilization mechanisms, including hard peg and soft peg, to ensure that the price of 1 USDA always remains at $1.

### Hard Peg

#### Hard price ceiling

USDA's Vaults' maximum LTV of 90% with WETH as a collateral creates a natural price ceiling at $1.10. When the exchange rate of USDA exceeds this level, borrowers can capitalize on an arbitrage opportunity. They can borrow the maximum amount against their collateral and sell USDA on the market for a price higher than its ceiling value. This dynamic creates an incentive for borrowers and helps maintain price stability.

#### Hard price floor

USDA has a hard price floor, ensuring that the token's value does not fall below a certain level. Users can redeem 1 USDA for $0.995 worth of collateral (a redemption fee of 0.5% is charged), creating a direct "hard peg mechanism." This mechanism enables users to benefit from arbitrage opportunities when the price of USDA falls below its floor value, helping to prevent consistent over-pegging and promoting a more sustainable implementation of USDA.

### Soft Peg

By implementing a defined formula, the parity between USDA and USD is firmly established as the inherent equilibrium state within the system. Through its redemption mechanism, the presence of a hard price floor, and its clear identification as a stablecoin tied to the value of the US dollar, we anticipate that users will regard the 1:1 dollar peg as a significant reference point, towards which the system naturally gravitates following temporary deviations.

This collective belief, as long as it is widely held, will generate a self-reinforcing effect: when the price of USDA surpasses $1, borrowing becomes more appealing (as borrowers can anticipate repayment at a rate of $1 or less). Conversely, when the price falls below $1, it creates an incentive to repay existing debts (as this state is expected to be temporary). Over time, if more USDA is borrowed than repaid, the total supply of USDA will increase, causing the tokens to become relatively cheaper compared to the USD and other currencies. Conversely, if the amount repaid exceeds new borrowed amounts, the money supply will contract, resulting in an appreciation of USDA's value.

## Interest-Bearing

After the Merge, LSTs (Liquid Restaking Token) carrying the proof-of-stake (POS) interest rate has introduced a benchmark rate to the Ethereum ecosystem. By collateralizing LST, such as wstETH, to mint USDA, the interest rates from LST are passed on to USDA, allowing users to earn higher yields and enjoy improved liquidity compared to directly holdingLST. The upcoming EigenLayer, through Re-Staking, will further enhance this benchmark interest rate. Agilely is also actively embracing changes and becoming the first to offer LRT derivative.


# Vaults and Collateral

## What are Vaults?

A Vault in Agilely is where you can deposit collateral to borrow USDA and maintain your loan. Each Vault is associated with an Ethereum address, and you can have one Vault per collateral type.&#x20;

A Vault has two balances: one for the collateral and another for the debt denominated in USDA. You can adjust these balances by adding collateral or repaying debt, which affects your Vault's  Collateral Ratio (CR) and Loan-to-Value (LTV) ratio. You can close your Vaults at any time (excluding the times when system is in Recovery Mode) by fully paying off your debt.&#x20;

## Collateral ratio

The Collateral Ratio (CR)  is used to describe the relationships between the collateral, the borrowed amount, and the value of the collateral.&#x20;

The Collateral Ratio is the proportion of the total value of the Collateral to the total Value of the Borrowed amount. It is expressed as a percentage and indicates the degree to which the collateral backs the borrowed amount.

$$
\displaystyle{C}{R}={\left(\frac{{{C}{V}}}{{{B}{V}}}\right)}⋅{100}
$$

A higher Collateral Ratio means that the borrower has more collateral relative to the borrowed amount, which reduces the risk for the protocol.&#x20;

## Collateral Minimum CR

You can find here the maximum amount of USDA that you can borrow based on your collateral of choice. (We define the MCR by the risk level of collateral)

| Token                           | Minimum CR |
| ------------------------------- | ---------- |
| ETH                             | 110%       |
| wstETH                          | 120%       |
| rETH                            | 120%       |
| sfrxETH                         | 120%       |
| cbETH                           | 120%       |
| wBTC                            | 120%       |
| GLP                             | 130%       |
| GMX                             | 150%       |
| ARB                             | 150%       |
| Liquid Restaking Tokens(Coming) | NaN        |

In addition mint caps are in place to ensure protocol stability.&#x20;


# Repayment and Redemption

## Repayment

When users open a Position[ ](/how-agilely-works/vaults-and-collateral)and borrow USDA tokens, they have the option to make partial or full repayments of their debt. However, it is essential to ensure that the resulting debt balance after partial repayment does not fall below **300 USDA**.

Successful repayment will trigger an immediate burn of the repaid USDA tokens through a fully decentralized smart contract. This process not only enhances the Position's collateral ratio but also increases the available collateral for withdrawal.

## Redemption

USDA holders within Agilely have the flexibility to redeem 1 USDA for the equivalent of 1 USD in underlying collateral at any time. This decentralized process empowers users to conveniently tap into the true value of their assets. A redemption fee of (0.5% + [baseRate](/how-agilely-works/protocol-fee/base-rate)) is applied.

Redemptions constitute an entirely distinct mechanism accessible to all USD holders, regardless of whether they have engaged in borrowing on the platform. The redemption process involves reducing the collateral vault associated with the lowest Collateral Ratio (CR), and it doesn't impact your debt position. In essence, your Collateral Ratio (CR) remains unchanged, featuring the same amount of collateral and borrowing—except in scenarios where your vault has the lowest CR among all vaults, specific to the collateral type.


# Liquidation and Stablity Pools

Ensuring Collateral Backing


# Liquidation

## What are liquidations?

Liquidations in Agilely ensure that the entire Position supply remains fully backed by collateral. If a Position exceeds the maximum Loan-to-Value (LTV) defined on the platform, it will be subject to liquidation.

During the liquidation process, the debt of the Position is canceled and absorbed by the Stability Pool, while the collateral is distributed among Stability Providers. Importantly, the owner of the Position retains the full amount of USDA borrowed and is not required to repay their debt.

System Status significantly influences how Liquidations operate. It is crucial to have a clear understanding of Recovery Mode to avoid unexpected liquidation events.

## Who can liquidate Positions?

Any user can initiate the liquidation of a Position once it surpasses the maximum LTV threshold. As an incentive for this service, the initiator receives 30 USDA as gas compensation, along with 0.5% of the Position's collateral.


# Stability Pool

The first line of defense in maintaining system solvency

## Stability Pool Overview

The Stability Pool is a crucial element of the Agilely ecosystem, serving as the first line of defense in maintaining system solvency. During the liquidation process, the debt of the liquidated Vaults is repaid by the Stability Pool to ensure that the total USDA supply always remains backed, while the collateral is distributed among Stability Providers. The Stability Pool is funded by users transferring USDA into it (called Stability Providers).

### Benefits for Stability Providers

Stability Providers have the opportunity to earn profits from liquidations. When a Vault is liquidated, Stability Providers receive a portion of the liquidated collateral as a reward. For each collateral's stability pool, a bonus parameter is set, indicating the maximum profits depositors can earn from liquidations. There are two scenarios as outlined below when liquidation occurs (CR < MCR):

1. 100% + Bonus <= CR\*(1-0.5%). In this situation, remaining collateral after equivalent debt, bonus and gas compensation are taken would be returned to the borrowers.
2. CR\*(1-0.5%) < 100% + Bonus. No remaining collateral would be returned.

### No Lockup Duration

In general, you can withdraw your deposited funds from the Stability Pool at any time without a minimum lockup duration. However, withdrawals may be temporarily suspended if there are unliquidated Positions with a CR below the set MCR.

### Possible Risks

1. Extreme Market Condition: While liquidations are typically designed to occur at a CR well below 100%, it's important to consider potential risks in extreme market conditions or sudden price fluctuations that could lead to liquidations beyond 100%. In such cases, Stability Providers may face a reduction in their deposited value.
2. USDA Depeg: In specific scenarios where USDA is trading above $1, liquidations might become unprofitable for Stability Providers, even when CRs are larger than 100%. Consequently, the gains from liquidations may not fully offset potential losses.

## What if the Stability Pool is empty?

If the Stability Pool is empty, the system uses a secondary liquidation mechanism called **redistribution**. In such a case, the system redistributes the debt and collateral from liquidated Positions to all other existing Positions. The redistribution of debt and collateral is done in proportion to the recipient Position's collateral amount.


# ABI

Agilely Basic Interest

Agilely Basic Interest, abbreviated as ABI, is a fundamental component of the Agilely protocol designed to provide users with essential earnings. ABI is accessible to users holding USDA tokens on both the ETH and ARB chains, and its distribution is facilitated regularly.

### Distribution **Eligibility**

To be eligible for ABI distribution, users must meet specific criteria related to their holdings and participation:

1. **USDA Wallet Holders:** Users holding a minimum quantity of USDA tokens in their wallets on both the ETH and ARB chains are eligible for ABI distribution.
2. **SSP USDA Stakers:** Individuals who have staked USDA tokens in the Smart Stability Pool (SSP) on both the ETH and ARB chains can participate in ABI earnings.
3. **Liquidity Providers on designated DEX:** Users providing liquidity to the USDA-TBD on particular Dex can qualify for ABI distribution.

### Calculation and Allocation

The distribution ratio is calculated as follows:

Distribution Ratio = Individual User's ABI Available USDA Quantity / Global ABI Available USDA Quantity

This calculation determines the proportion of available ABI earnings that each eligible user can claim. Users have the flexibility to choose on which chain they wish to claim their ABI earnings.


# Protocol Fee

### [Mint Fee](https://app.gitbook.com/o/tqLVehXrZsNOIYpzpYqq/s/TbLe21G6tAxFeOmhXYni/~/changes/39/how-agilely-works/fee/mint-fee)

### [Redemption Fee](https://app.gitbook.com/o/tqLVehXrZsNOIYpzpYqq/s/TbLe21G6tAxFeOmhXYni/~/changes/39/how-agilely-works/fee/redemption-fee)

### [baseRate](https://app.gitbook.com/o/tqLVehXrZsNOIYpzpYqq/s/TbLe21G6tAxFeOmhXYni/~/changes/39/how-agilely-works/fee/baserate)

### [Dynamic Interest](https://app.gitbook.com/o/tqLVehXrZsNOIYpzpYqq/s/TbLe21G6tAxFeOmhXYni/~/changes/39/how-agilely-works/fee/dynamic-interest)


# Mint Fee

The Agilely Protocol's Mint Fee is a critical charge applied when users borrow our native stablecoin, USDA. This fee is essential for maintaining USDA's value stability and managing borrowing costs.

The Mint Fee calculation centers on a dynamic variable called the [baseRate](/how-agilely-works/protocol-fee/base-rate), which adjusts based on the protocol's conditions. The fee rate is bounded between 0.5% and 5%, ensuring fairness in borrower charges and adhering to the protocol's principles. This mechanism accurately reflects borrowing activity, promoting a sustainable borrowing environment.

Agilely's approach involves aligning the Mint Fee with the baseRate. This strategy encourages users to retain their USDA holdings instead of immediate redemption, fostering a stabilized price and discouraging abrupt fluctuations.


# Base Rate

Each redemption event contributes to an increment in the baseRate, which then gradually recedes over time, considering the span since the last fee occurrence. The formula for calculating the redemption fee involves the expression (baseRate + 0.5%) \* borrowed USDA, with baseRate representing the adjusted fee rate and borrowed USDA indicating the loaned amount.

In each redemption, the base rate is augmented based on the proportion of redeemed USDA, aligned with the prevailing supply of USDA. This is mathematically outlined as follows:

$$
b(t):=b(t-1) + α × \frac{m}n
$$

where b(t) stands for the base rate at time t, m represents the redeemed USDA amount, n symbolizes the current supply of USDA, and α is a constant parameter set at 0.5.

The base rate experiences a gradual decay over time due to a decay factor that is applied with each instance of USDA redemption or issuance before computing the resulting fee. This decay process takes the following form:

$$
b(t):=b(t-1) ×  δ^{Δt}
$$

where δ stands for the decay factor (e.g., 0.94), and △t corresponds to the time elapsed since the most recent redemption or loan issuance. The selection of the decay factor δ is such that it aligns with a half-life of 12 hours for the base rate.


# Agilely Dynamic Interest

The Agilely Dynamic Interest (ADI) is an innovative system designed to stabilize the price of USDA.

* In situations where there is an oversupply of USDA and its price falls below the desired level, borrowers will be subject to higher interest rates, and users will be encouraged to deposit USDA in the safety vault to earn attractive interest rewards. This incentivizes users to acquire USDA from the market, which raises its price.
* Conversely, when there is a high demand for USDA and its price exceeds the desired level, borrowers will be charged lower interest rates, and users will be prompted to deposit fewer USDA in the safety vault. This motivates users to sell USDA in the market, which lowers its price.

In essence, the Agilely Dynamic Interest (ADI) mechanism dynamically adjusts interest rates to stimulate actions that align the price of USDA with the desired level, either by increasing or decreasing its supply in the market.


# Redemption Fee

The formula for calculating the redemption fee:

$$Redemption\ Fee\ =\  (baseRate + 0.5%) × borrowed\ USDA$$

The Redemption Fee in the Agilely Protocol is a one-time charge that comes into play when users redeem their USDA. This fee's calculation is based on a dynamic variable called the baseRate. Each time there's a redemption, the baseRate goes up a bit, and it gradually goes down over time since the last fee event (see [baseRate](broken://pages/uYKTiHqApqC1AcrbA9QN)).

The fluctuations in the baseRate directly impact the redemption fee, which, in turn, shapes the overall cost of borrowing. This deliberate interplay ensures that borrowers thoughtfully assess their borrowing decisions, cultivating an environment of balanced borrowing practices.


# Parameters

<table><thead><tr><th width="48">Asset</th><th width="32">MCR</th><th width="90">Performance Fee</th><th width="99">Liquidation Bonus</th><th width="69">Debt Ceiling</th></tr></thead><tbody><tr><td>ETH</td><td>110%</td><td>N/A</td><td>10%</td><td>TBD</td></tr><tr><td>wstETH</td><td>120%</td><td>N/A</td><td>10%</td><td>TBD</td></tr><tr><td>wBTC</td><td>120%</td><td>N/A</td><td>10%</td><td>TBD</td></tr><tr><td>GLP</td><td>120%</td><td>20%</td><td>10%</td><td>TBD</td></tr><tr><td>GMX</td><td>150%</td><td>0%</td><td>15%</td><td>TBD</td></tr><tr><td>ARB</td><td>150%</td><td>N/A</td><td>15%</td><td>TBD</td></tr></tbody></table>


# Roadmap

Keep our feet on the ground, shoot for the moon.

## 2023 Q2

* [x] Define project positioning, target audience, and core value proposition.
* [x] Build the team. Establish project website and social media channels.
* [x] Kickoff prototype development and overall project planning.

## 2023 Q3

* [x] Launch the Minimum Viable Product (MVP) with core features on Arbitrum Goerli.
* [x] Integrate LayerZero's OFT technology to unlock new omni-chain possibilities.
* [x] Compile project documentation and initiate community-building efforts.
* [x] Conduct contract auditing in partnership with the top-level auditing company

## 2023 Q4

* [ ] Officially launch Version 1.0 of the project on Arbitrum.
* [ ] Release tokenomics details outlining the distribution and utility of the native token.
* [ ] Launch Agilely Points Program rewarding early participants with points.

## 2024&#x20;

* [ ] Token Initial DEX Offering (IDO).
* [ ] Expand to additional chains including Ethereum, Polygon, and Optimism and more.
* [ ] Accept more diverse LSTs (rETH, sfrxETH, swETH) and LDT as collateral options.
* [ ] More features: one-step leverage, flash mint and more.
* [ ] Cross-chain deposit and mint USDA with seamless experience.
* [ ] V2 launch with the distribution of the project's native tokens to participants and supporters.
* [ ] Integration of sDAI and gFRAX.


# Get ETH on Arbitrum Goerli

To explore Agilely Version 0.1, you'll need ETH on Arbitrum Goerli (which we refer to as gETH in this article to differentiate from ETH on Ethereum mainnet). With a minimum debt requirement of 300 USDA, ensure you have at least 0.3 gETH to test our core functions. Here are steps to acquire gETH on Goerli and bridge it to Arbitrum Goerli:

## 1. **Add Networks:**

* Visit <https://chainlist.org/>
* Search for "Goerli" and "Arbitrum Goerli" (select "Include Testnets" first)
* Click "Add to Metamask" to add the networks

![](https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2Fsa00QnMGGpEwJyPjZKnI%2Fimage.png?alt=media\&token=4327caa0-d6f4-42e8-b717-efa195a7b13d)![](https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FruITt8XZY0ZePqsafXcJ%2Fimage.png?alt=media\&token=e1b5f77c-0360-4ad0-b389-daa53bc1e5a0)

## 2. Get gETH on Goerli

We suggest choosing Option 1 for adequate gETH supply.

### Option1: Buy on testnetbridge (recommended)

You can buy gETH from testnetbridge which is powered by Layerzero.

1. Visit [http://testnetbridge.com](https://t.co/pNYCCFvvux)
2. Connect your wallet, prepare enough ETH for exchange and gas&#x20;
3. Exchange ETH for gETH on Goerli

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FaICXEQN4CsLLz79lfUNe%2Fimage.png?alt=media&amp;token=13ad324f-5d12-45b6-9f42-10a1adc8cb6a" alt=""><figcaption><p>Buy gETH on testnetbridge powered by Layerzero</p></figcaption></figure>

Ez right? With just 0.01 ETH on Ethereum, you can acquire approximately 150 gETH on Goerli!

### Option2: Alchemy faucet

Active Alchemy users can get 0.02 gETH daily.

1. Visit <https://goerlifaucet.com/>
2. Log in with your Alchemy account (need to register if you don't have)
3. Have at least 0.001 ETH on Ethereum Mainnet
4. Claim gETH on Goerli

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FF9oHylKBOQQnNvFJzprd%2Fimage.png?alt=media&amp;token=323e095c-84e3-4952-ad34-0565ba3bac85" alt=""><figcaption><p>Claim gETH on goerlifaucet using your Alchemy acounnt</p></figcaption></figure>

## 3. Bridge gETH to Arbitrum Goerli

1. Go to <https://bridge.arbitrum.io/?l2ChainId=421613>
2. Connect your wallet and enter the gETH amount to bridge (minimum 0.3 gETH for Agilely experience)
3. Initiate the bridge process, wait briefly, and verify your balance on Arbitrum Goerli

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FqvGNdak4S3S4UEERciDw%2Fimage.png?alt=media&amp;token=0ad10424-741e-4501-a805-88ccc63e5ec3" alt=""><figcaption><p>Bridge gETH to Arbitrum Goerli</p></figcaption></figure>

You're all set! Now, you're ready to dive into our product.


# V0.3 User Guide

### Conditions for Participating in the Test

In order to participate in the testing of version 3.0, you need to have the **OG Role** or **Early Adopter** in our [Discord](https://discord.com/invite/Y6E8ekzrCG) and request test coins or an account from the admins to carry out the testing.

### What's New

1. **Redemption Feature**: Our Redemption Feature is now live on the front-end page <https://agilely.io/redemption/>. With this feature, users can convert their USDA into collateral from currently active vaults. Vaults are redeemed in order of their Collateral Ratios (CR), starting with the ones having the lowest CR.
2. **Protocol Stability Module (PSM)**: We have also launched the Protocol Stability Module, accessible at <https://agilely.io/psm/>. Users can now mint USDA using DAI, and the PSM module will automatically convert DAI into CHAI to earn DSR (Dai Savings Rate) returns. Currently, both the Mint Fee for creating USDA in the PSM and the Redemption Fee for redeeming DAI are set at 0.5% for testing purposes. Once the product officially launches, the Mint Fee will become 0, while the Redemption Fee will depend on factors such as the amount of DAI available for withdrawal from the PSM module.

These updates not only enhance our product's functionality but also bring significant improvements in user interaction, UI, and the overall user experience. We encourage you to actively participate in the testing process to fully appreciate these enhancements in the product experience.


# Mint


# Open a vault

This tutorial shows you how to open a vault on Agilely.

1. Go to <https://agilely.io/mint/> and connect your wallet.&#x20;

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FuqllGY0CdK0KZXO6lKhP%2Fimage.png?alt=media&amp;token=9d64e734-478a-453f-b91f-d24c9a52a824" alt="" width="563"><figcaption><p>Agilely Mint Page</p></figcaption></figure>

2. Once you've chosen a vault, you'll be taken to the Vault page. To open your vault, simply click on "Mint". On this page, you'll encounter two sections where you can enter numbers. The first section is labeled "Deposit" and the second one is "Borrow" In these sections, you have the flexibility to determine how much collateral you'd like to provide and how much you wish to borrow. You can adjust these values by editing the corresponding fields.&#x20;

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FSPHbgdc9I1zbNqfBBzTV%2Fimage.png?alt=media&amp;token=a8c20593-2f48-4144-a89b-ed30e3c5754e" alt="" width="362"><figcaption><p>Open a vault</p></figcaption></figure>

3. Once you're satisfied with your selections and have reviewed all the relevant stats related to your vault, you can scroll down and hit the "Mint" button to confirm your transaction. it is recommended to maintain a collateral ratio above MCR + 10%.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FOSKe5T8hekkA9WiKBoEL%2Fimage.png?alt=media&amp;token=41724a05-85e8-4003-a6a0-e5271093a5ff" alt="" width="334"><figcaption><p>Confirm the transaction</p></figcaption></figure>

4. After successfully creating the vault, you'll be presented with a summary of your newly established vault. It shows the collateral Ratio, liquidation price and ADI of your vault.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FPWucIRnWypdfQMXTiiYK%2Fimage.png?alt=media&amp;token=ef659bea-fdf1-4d8f-b4cd-b661b9095ad8" alt="" width="375"><figcaption><p>Vault Summary</p></figcaption></figure>

Congratulations! You've successfully created your first vault and minted some USDA.


# Deposit & Withdraw

## Deposit

When your vault's collateral ratio gets close to the Minimum Collateral Ratio (MCR), it's important to take action to prevent liquidation. You can either [deposit](/guide/v0.3-user-guide/mint/deposit-and-withdraw) more collateral or [repay ](broken://pages/Q063Cyo7wRekEyom9hmD)some of your debt. To deposit more collateral, go to the "Manage" page and select the "Deposit" option. Enter the amount of ETH you want to deposit.

The "Current" value displays the collateral currently in your vault, while the "Balance" value represents the collateral in your wallet. The information below the entry box provides guidance on how much collateral to deposit. This helps you maintain a healthy vault or meet your borrowing needs for USDA.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2F0vKW3yOaUz9AEYFAieQt%2Fimage.png?alt=media&amp;token=524b3bf7-a0d5-4eea-9fd3-14c170e144a9" alt="" width="375"><figcaption><p>Manage Vault: Deposit</p></figcaption></figure>

## Withdraw

Even if you haven't fully repaid your debt, you're still able to withdraw a part of your ETH. The amount you can withdraw depends on your collateral ratio. The "Current" value shows the existing collateral in your vault, while the "Available To Withdraw" value specifies the maximum amount of USDA you can withdraw while maintaining a collateral ratio greater than the Minimum Collateral Ratio (MCR).

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FmfoDadll4ZMN5PLi9fVA%2Fimage.png?alt=media&amp;token=122a7fec-f7f8-4af4-88db-469071b88499" alt="" width="375"><figcaption><p>Manage Vault: Withdraw</p></figcaption></figure>


# Borrow & Repay

## Borrow

On the manage page, enter the amount of USDA you wish to mint/borrow. The minimum collateral ratio is 110%. This means that if you deposit $110 worth of ETH (mockETH), you can mint up to 100 USDA. If your collateral ratio drops below 110% due to market fluctuations, you will be liquidated. To avoid this, it is recommended to maintain a collateral ratio above 120%.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FWq48qJgpHG4eKe8YAjrB%2Fimage.png?alt=media&amp;token=cef59f1d-8269-4845-ae81-2f0503af5bcb" alt="" width="375"><figcaption><p>Manage Vault: Borrow</p></figcaption></figure>

## Repay

When your vault's collateral ratio approaches the Minimum Collateral Ratio (MCR), it's crucial to act to avoid liquidation. You have two options: add more collateral or repay some of your debt. To repay your borrowed USDA, head to the "Manage" page and choose the "Repay" option. Specify the amount of USDA you wish to repay.

The "Current" value displays the total debt you've borrowed using the collateral in this vault. The "Available To Repay" value indicates the maximum amount of USDA you can repay while keeping a minimum debt of 1800 USDA. The information below the input box offers guidance on how much USDA to repay. The "Payable Debt" value signifies the maximum amount of USDA you can repay to close the vault. Meanwhile, "Remaining Debt" indicates the remaining total debt after repaying the specified amount of USDA.

Note: If the amount of USDA you've borrowed falls below 1800 USD after repayment, which is equivalent to the total debt ("Current") minus the liquidation reserve (200 USDA) and dynamic fee, you won't be able to repay and will need to choose to close your vault.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2F5l5FW8YqfF32XxiXuyGR%2Fimage.png?alt=media&amp;token=94ae74bf-855e-43f3-b534-094b049af79c" alt="" width="375"><figcaption><p>Manage Vault: Repay</p></figcaption></figure>


# Close your vault

This tutorial shows how to close a vault.

1. Connect your wallet and navigate to your Vault page (in our case: mockETH Vault).

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FyrMb4vrLa0QdEICbL1UA%2Fimage.png?alt=media&amp;token=ed0b5ff2-1483-4ffb-b358-dd26abe5f629" alt="" width="375"><figcaption><p>Vault Page</p></figcaption></figure>

2. Click on "Close," and you'll be directed to a page displaying all the details of your vault. Since you're closing the vault, make sure you have enough USDA in your wallet. For instance, if you borrowed 2000 USDA, you'll need to have 2210 USDA in your wallet to complete the vault closure. Wondering why 2210? It's calculated by adding 2000 (borrowed amount) + 10 (0.5% borrowing fee + Dynamic fee) + 200 (gas compensation, which will be refunded in our case as no liquidation occurred).

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2Fq7SZeaLITFM56BYTvJXo%2Fimage.png?alt=media&amp;token=5133b47e-2922-424e-b452-158a50f5cb66" alt="" width="375"><figcaption><p>Close your vault</p></figcaption></figure>

2. If your wallet contains enough USDA, you're ready to close the vault by clicking on "Close Vault." If you're short on USDA, you can select "pay debt with collateral" and then hit "Swap & Close Vault."

That's it – you're all done!


# Bridge

USDA, the omnichain stablecoin utilizing the Layerzero OFT standard, can now be seamlessly and securely bridged across various EVM chains, including Goerli, Arbitrum Goerli, and Polygon Mumbai. On the bridge page, you can select the source and destination chains for your USDA tokens, specify the amount you wish to bridge, and even update the recipient's address. Additionally, you have the option to review your bridge history.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FhZHlV7tiPsBMLHBLb0Gg%2Fimage.png?alt=media&amp;token=520de793-87c7-4491-98fc-4d7dfebae07e" alt="" width="563"><figcaption><p>Bridge Page</p></figcaption></figure>


# Earn


# Staking

On the staking page, users have the option to stake their USDA tokens in the recommended stability pool. The Smart Stability Pool (SSP) module facilitates the allocation of USDA to the stability pool that requires it the most. SSP utilizes an algorithm capable of predicting the deficiency of liquidation assets for each stability pool.&#x20;

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FokgtfozQRQpU4eHEkdhO%2Fimage.png?alt=media&amp;token=ee6c590d-0059-4fff-97e7-6799f2b2afbd" alt=""><figcaption><p>Staking USDA</p></figcaption></figure>

If users wish to stake USDA in other stability pools, a 3% fee will be applied to the staking amount (temperarilly 0% in testnet v0.2). To switch to a different stability pool, start by clicking 'edit,' then select 'I still want to switch assets for staking,' and choose your preferred stability pool. It is highly recommended to stake USDA in the default vault, as it not only maximizes users' profitability but also enhances the protocol's stability.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FVqnzd8RBnydExHR3kmUJ%2Fimage.png?alt=media&amp;token=224bcf9d-ac33-494d-92b1-975fe5a32103" alt="" width="563"><figcaption><p>Switch the stability pool to stake</p></figcaption></figure>

Once users have successfully staked USDA, information about the stability pools in which they have staked USDA will be displayed in the lower section of the staking page. If there are any liquidation gains available for users to acquire, they can simply click 'claim' or 'claim all.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FyhdjBmZhpc3ik8L4f8Wp%2Fimage.png?alt=media&amp;token=8f03e4bf-eae1-4f17-8b79-e7932d6a3d7d" alt=""><figcaption><p>Claim liquidation gains</p></figcaption></figure>


# Liquidation

On the liquidation page, users have the ability to initiate the liquidation process for vaults with an Individual Collateral Ratio (ICR) below the Minimum Collateral Ratio (MCR) for each collateral type. The page provides information on the liquidator rewards users can receive and offers general details about specific collateral vaults and individual vaults.

If a vault's ICR is less than 1.15 times the MCR, the 'Action' column displays 'Risky'; otherwise, it displays 'Healthy'.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FNwMseoAOYMF0AXhnjhgo%2Fimage.png?alt=media&amp;token=43111dfd-7733-48c4-9eb6-0522050a30d4" alt=""><figcaption><p>Liquidation List shows general info of vaults for each collateral type</p></figcaption></figure>

The lower section of the page displays the Liquidation Gains that users can claim if they have deposited USDA into the corresponding stability pool. For example, if a user has deposited USDA into the rETH vault, they can claim liquidation gains in rETH when a liquidation event occurs for rETH vaults. It's important to note that liquidation gains are distinct from liquidator rewards, as the latter is granted to users who trigger the liquidation rather than to the USDA depositors in the Stability Pool.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FRsvIdk4rXI4dl8CborkQ%2Fimage.png?alt=media&amp;token=9dbc1807-ff6b-4997-97f8-cba55ce74871" alt=""><figcaption><p>Stabliity Pool depositors and claim Liquidation Gains</p></figcaption></figure>


# Redemption

On the redemption page, users have the option to exchange their USDA for collaterals in active vaults, beginning with vaults that have the lowest Collateral Ratio (CR) when a specific asset is selected. In the example below, the user intends to redeem 100 USDA for mockETH, and the information below provides an estimate of the amount of the asset the user will receive. The Redemption Fee indicates the fee the user will be required to pay when the redemption is executed.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2Fm6o5RcqS1xXHbDjGnW4J%2Fimage.png?alt=media&amp;token=0cd3dd72-8536-4495-962e-5fcf3b9e0777" alt="" width="563"><figcaption><p>Redeem USDA for assets in vaults</p></figcaption></figure>

Users have the flexibility to select the particular asset they wish to exchange their USDA for.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2F1MpRMOaKdZF1DhszCxUk%2Fimage.png?alt=media&amp;token=dd38fd3a-f5ba-4337-a137-0471173f3080" alt="" width="563"><figcaption><p>Choose asset</p></figcaption></figure>


# PSM

Peg Stablity Module

At PSM page, users can now mint USDA using DAI, and the PSM module will automatically convert DAI into CHAI to earn DSR (Dai Savings Rate) returns. Currently, both the Mint Fee for creating USDA in the PSM and the Redemption Fee for redeeming DAI are set at 0.5% for testing purposes.&#x20;

Once the product officially launches, the Mint Fee will be reduced to 0%, while the Redemption Fee will depend on factors such as the amount of DAI available for withdrawal from the PSM module.

### Mint USDA

In the example below, the user exchanges 100 DAI for 99.5 USDA since the mint fee is 0.5%.&#x20;

* Mint Cap: the total amount of USDA can be minted from PSM.
* Available To Mint: the amount of USDA currently available for minting from the PSM.
* Total Mint: the total amount of USDA that has been minted through the PSM.

Users can also switch to the "Redeem DAI" option by clicking "Redeem DAI" or using the bi-directional arrows in the center of the page to exchange their USDA back for DAI.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FnnJ9dviro7Rp8dhNiT3X%2Fimage.png?alt=media&amp;token=d5cca581-e625-446a-9acd-a8ecfca58c7c" alt="" width="563"><figcaption><p>PSM Page: Mint USDA</p></figcaption></figure>

### Redeem DAI

In the example below, the user exchanges 100 USDA for 99.5 DAI since the redemption fee is 0.5%.&#x20;

* Available To Redeem: the current amount of DAI that can be redeemed from the PSM.

<figure><img src="https://3552531420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbLe21G6tAxFeOmhXYni%2Fuploads%2FhQgvQrBBKoP4lJfuCcgb%2Fimage.png?alt=media&amp;token=ba9ae39c-a90d-46b5-b2a1-29d6110ab74f" alt="" width="563"><figcaption><p>PSM Page: Redeem DAI</p></figcaption></figure>


# Tokenomics

## Coming soon


# Public Sale (Upcoming)

## Coming soon


# Agilely Points Program

## Coming soon


# Contracts

## Coming soon


# Security

## Coming soon


# Oracles

## Coming soon


