# Introduction to Hedge

{% hint style="info" %}
**TLDR:** Hedge is a protocol that enables the minting of USH, a stablecoin soft-pegged to the US dollar. USH is minted on flexible terms and gives users instant access to the USH ecosystem.

Hedge allows users to take out 0% interest loans for a one-time fee by depositing collateral for USH. Users are incentivized to keep their collateral-to-debt ratio above 110% to avoid liquidation. When an undercollateralized vault is liquidated, users who have deposited USH in a stability pool are returned discounted collateral as a reward. USH is always redeemable for its underlying value, but a fee ensures the protocol is impacted infrequently.

For more detail, see our [whitepaper](https://drive.google.com/file/d/1-W_LlAhpgXgl8rlMJMt8e-ztkHe53c3g/view).
{% endhint %}


# Overview

Hedge is a protocol that aims to offer:&#x20;

* The best lending rates possible: our initial offering is a 0% interest vault&#x20;
* Maximum loan-to-value as high as 90.9%&#x20;
* Low minimum loan amounts close to $200&#x20;
* Loans with a one-time small setup fee and 0% interest so users can repay the loan on their own schedule

## What's the advantage of using Hedge?

Users are able to deposit collateral (currently, SOL is the first supported form) in a Hedge vault, which allows them in return to take a loan from Hedge. The loan is issued in the platform’s native stablecoin, USH.

With a 0% interest loan, once you've deposited SOL to borrow USH, you are in no way obligated to repay your USH. As long as you maintain a healthy collateral ratio (collateral divided by debt) for your vault, you can access your collateral any time and pay back the loan on your schedule.

The borrowed USH can be used for multiple purposes, including exchanging it for other stablecoins or leveraging your SOL exposure by buying more SOL with USH and adding this to your collateral. You can also deposit the USH in the stability pool to earn HDG token rewards. Another way to participate in Hedge is to liquidate under-collateralized vaults. This keeps the system healthy, and gives you rewards. For more detail, see [Stability Pool and Liquidating a Vault](/how-to-use-hedge/stability-pool-and-liquidating-a-vault).

## W**hy would I deposit SOL to take out a USH loan?**

Imagine that you own a lot of SOL (maybe you're a successful NFT artist!), more than enough to buy the Tesla you really want. However, you believe in the future upside of SOL and don't want to sell yet.

Instead, you create a Hedge vault with 1,000 SOL (worth $150,000 if the SOL price is $150). You take out a loan of 50,000 USH, which is pegged to USD so you can make your purchase. A year later, SOL has doubled to $300! Your collateral is now worth $300,000 and your debt is still $50,000, so your vault is worth $250,000. You've made a profit of $150,000, meaning you can buy yourself a second Tesla or keep the SOL in the vault until you decide to close it.

Since Hedge only charges a one-time fee with 0% interest, your debt isn't increasing over time so you aren’t in a rush to decide next steps. Just make sure that you keep an eye on the SOL price so that your collateral is worth at least 110% as much as your debt. Ideally, the ratio of collateral to debt should be as high as possible; having a low ratio can risk your vault being [redeemed](/protocol-overview/redeeming-against-a-vault) or [liquidated](/protocol-overview/liquidation-and-liquidation-pool).

## Tokens

Hedge issues two tokens:

* [**USH**](/protocol-overview/ush) is a USD-pegged stablecoin. Each $1 equivalent of USH is backed by at least $1.10 equivalent of collateral.&#x20;
* [**HDG**](/protocol-overview/hedge-token) is a revenue share and governance token. It’s used to reward market makers for providing liquidity to the system by capturing a proportional share of the protocol revenues when staked.

## Key Features

The key parts of the protocol are:&#x20;

* A 0% interest loan offering&#x20;
* A stability pool, where users can deposit USH and be rewarded in SOL and HDG tokens&#x20;
* A staking pool, where users can stake HDG and earn a proportional share of the protocol's revenue&#x20;
* Incentives to participate in token liquidity pools (such as USH/SOL & HDG/SOL)

## Fees

Hedge only charges fees when:&#x20;

* Initiating a USH loan. There is a one-time fee of 0.5% of the loan amount.&#x20;
* Liquidating a vault. If your vault falls below the minimum required collateral ratio, it may be *liquidated*. In this process, an equivalent amount of debt in USH is first burned from the stability pool. The user who initiates the liquidation is rewarded a fee (5% of the vault value), and a portion of the liquidated vault’s collateral is taken as a protocol fee (20% of the vault value). The rest of the collateral from the liquidated vault is then distributed to users in the stability pool.

## Risks

The following scenarios may result in loss of funds:

* Bugs: All SOL tokens are managed by the smart contracts written by the Hedge team. A bug or error in the contracts could result in a loss of SOL. Hedge is audited by multiple auditors, see <https://docs.hedge.so/protocol-overview/security>.
* SOL liquidation: If your vault is below the minimum required collateral ratio, your SOL may be liquidated and offered as a reward to liquidators.&#x20;
* SOL exposure: If you deposit USH in the stability pool, your USH will gradually be burnt to liquidate risky vaults in return for SOL. However, this causes exposure to the SOL price, which could result in less funds than initially deposited.


# Connecting a wallet

To use Hedge, users must have a Solana wallet installed. There are many available; some of the popular options are [Phantom](https://phantom.app/) and [Slope](https://slope.finance/).

Once your wallet has been installed, you should either restore a previous key or set up a new wallet. For extra security, we recommend using a hardware wallet such as [Ledger](https://www.ledger.com/) (though Solana support is limited right now).

When your wallet is set up, you can send yourself SOL from a centralized exchange such as [Coinbase](https://www.coinbase.com/) or [FTX](https://ftx.com/). A guide like [this one](https://help.phantom.app/hc/en-us/articles/4406393831187-How-to-deposit-SOL) can help you transfer funds. You can also buy SOL from within Phantom using [Moonpay](https://www.moonpay.com/buy/sol).


# Creating a vault

You can create a vault in a few clicks. Start by heading to the [Borrow](https://www.hedge.so/borrow) section of the Hedge website, then click **Deposit Collateral**. From there, you’ll see the option to select your vault type. Currently, the following vault type is supported:

SOL-110: A vault with a 110% minimum collateral ratio and a 0.5% loan initiation fee. Note that the vault may be liquidated under 150% collateral ratio in exceptional circumstances.  For more detail, see [Recovery Mode](/protocol-overview/liquidation-and-liquidation-pool#recovery-mode).

After selecting your vault type, input the amount of SOL that you want to deposit, and then click **Create Vault**.

![](/files/v818WBJ6ObsL6EKXpXiQ)


# Taking out a loan

Now, you’re ready to take out a loan. Keep in mind that there is a minimum of 100 USH debt and a 0.5% fee is assessed when the loan is taken out. You can repay the loan at any time. Partial repayments are possible as long as your final loan balance is above 100 USH; otherwise, the full amount of the debt must be repaid.

Inside the vault, you can deposit more SOL or withdraw it. You can only withdraw SOL as long as you maintain the minimum collateral to debt ratio for the vault.

![](/files/KFNFyfstdHjszWOKOf6o)


# Stability pool and liquidating a vault

You can deposit USH in the stability pool and receive profits from liquidated vaults, where the profit is denominated in the collateral. In the liquidation process, an equivalent amount of USH is burned from the stability pool, and then, after fees, the vault’s collateral is distributed to users in the stability pool. In essence, USH is used to buy the collateral under the market rate. Users who deposit USH will also earn HDG rewards. The stability pool helps avoid a spike in the price of USH in a market downturn and also allows for lower overall collateral requirements for vaults.

You can initiate a [liquidation](/protocol-overview/liquidation-and-liquidation-pool) and pass in a vault ID, so long as that vault is under-collateralized.

![](/files/oWRn2AzkkZOp2oYLbzRU)


# Earning Hedge rewards

HDG tokens can also be staked in a pool to earn additional HDG and USH as a portion of the platform fees. For more detail, please see the [whitepaper](https://drive.google.com/file/d/1-W_LlAhpgXgl8rlMJMt8e-ztkHe53c3g/view).

![](/files/cuNVn7kHv9FiMeDkXO27)


# How to get a console log

If you're having issues and want to help report this issue with the team feel free to share us the console log of the transaction.

## Chrome

To do this in Chrome, got to **View** > **Developer** > **JavaScript Console**

![](/files/TIkRkjE0JpC1GKGhxbES)

The console log will appear in a window similar to this. This is what developers will be interested in seeing to help debug any issue you find.

![](/files/bCdAPgGs3d3F9UgyV15y)

Your feedback is very much appreciated!


# USH stablecoin

The ceiling price of USH is $1.10, as users can always deposit the equivalent of $110 of collateral to mint $100 worth of USH. If USH is trading above $1.10, a profit could be made by selling USH on the market.

To establish a floor price for USH, there are two different mechanisms. If a user has a loan and finds USH to be below $1, they can repay their loan at a lower price by buying more USH, in turn stabilizing the price of USH. Alternatively, they can [redeem](/protocol-overview/redeeming-against-a-vault) their USH.

The USH token mint is [9iLH8T7zoWhY7sBmj1WK9ENbWdS1nL8n9wAxaeRitTa6](https://solscan.io/token/9iLH8T7zoWhY7sBmj1WK9ENbWdS1nL8n9wAxaeRitTa6).

## Price ceiling

There is a hard price ceiling for USH at $1.1 which can be explained as follows:

* Let's assume USH trades at 1.12 USDC and that you have 1000 USDC. We'll assume SOL price is at 50/USDC
* With 1000 USDC you buy 20 SOL
* With that you deposit into a Hedge vault and mint 909.09 USH (the max possible at 100% collateral ratio).
* You sell the 909.09 USH on the market for 1018.18 USDC. (909.09 \* 1.12)
* You started with 1000 USDC and now have 1018.18 without ever needing to repay your vault. In the process you made 18.18 USDC profit


# HDG protocol token

HDG tokens are primarily used for revenue sharing. Anyone who stakes the HDG token is able to claim a proportion of all protocol fees. As the Hedge protocol evolves (with new functionality such as accepting different types of collateral), HDG tokens will be used to vote on governance and use of treasury funds.

The protocol, and in turn HDG token holders, earns fees when:&#x20;

* A vault is opened&#x20;
* A vault is liquidated

The HDG token mint is [5PmpMzWjraf3kSsGEKtqdUsCoLhptg4yriZ17LKKdBBy](https://solscan.io/token/5PmpMzWjraf3kSsGEKtqdUsCoLhptg4yriZ17LKKdBBy).

## How to earn HDG

There are two primary ways to earn HDG tokens:

* Depositing USH in the stability pool. The formula for the total amount of HDG rewards released is the following:

`f(x) = 2,000,000 * 0.5^(x/365) / (365/log(2))`, where `x` is the time in days.  This can be visualized [here](https://www.wolframalpha.com/input?i=2000000+*+0.5%5E%28x%2F365%29+%2F+%28365%2Flog%282%29%29+with+x+from+0+to+1000). &#x20;

Effectively, HDG token incentives are large at the initiation of the protocol but will gradually decrease over time. The more USH you deposit in the stability pool and the longer the USH is deposited, the more HDG you are rewarded with.&#x20;

For more detail, please see section A.3.1 [in the whitepaper](https://drive.google.com/file/d/1-W_LlAhpgXgl8rlMJMt8e-ztkHe53c3g/view).

* Staking the HDG tokens on our platform to collect a percentage of the platform fees.


# Vault Types

What vault types does Hedge offer?

Before onboarding new vault types, the Hedge community will carefully assess the risks of each collateral (e.g. liquidity & volatility) and set the parameters for the vault.

For each vault there exists various parameters including:

* **Collateral Token**: this is the collateral that the Hedge protocol will accept in the vault to mint USH.
* **Minimum Collateral Ratio (MCR)**: This is the minimum collateral ratio a vault must maintain before be liquidated.
* **Recovery Mode Collateral Ratio (RMCR)**: This is the minimum amount that the Vault Type must be collateralised by before entering Recovery Mode and enabling the liquidation of vaults under this collateral ratio.
* **Minimum Debt**: This is the minimum debt that must be extended against an individual vault type to be opened.
* **Maximum Debt against Vault Type**: This is the total debt against a Vault Type that can be extended. This is used to avoid having too much debt set against a certain type of collateral.
* **Interest Rate**: If set to a value other than 0, the vault will accumulate interest over time.
* **Initialization Fee**: This is the fee taken during loan initiation.
* **Redeemability**: Whether the vault can have collateral redeemed to keep USH peg. Only the lowest collateral ratio vault for each Vault Type may be redeemed against. See more details at [Redeeming against a vault](/protocol-overview/redeeming-against-a-vault).
* **Oracle**: The oracle price feeds used for this Vault Type.

The Hedge Protocol currently supports:

<table><thead><tr><th> </th><th>SOL-110</th><th width="118">mSOL-110</th><th width="95">cUSDC-105</th><th width="114">wBTC-110</th><th width="126">soETH-110</th><th width="124">cUSDT-106</th></tr></thead><tbody><tr><td>Vault Collateral</td><td>SOL</td><td>mSOL</td><td>Solend cUSDC</td><td>wBTC</td><td>soETH</td><td>Solend cUSDT</td></tr><tr><td>Interest Rate</td><td>0%</td><td>0%</td><td>2%</td><td>0%</td><td>0%</td><td>1.50%</td></tr><tr><td>Initialization Fee</td><td>0.5%</td><td>0.5%</td><td>0.25%</td><td>0.5%</td><td>0.5%</td><td>0.1%</td></tr><tr><td>MCR</td><td>110%</td><td>110%</td><td>105%</td><td>110%</td><td>110%</td><td>106%</td></tr><tr><td>Recovery Mode Trigger</td><td>150%</td><td>150%</td><td>N/A</td><td>150%</td><td>150%</td><td>N/A</td></tr><tr><td>Redeemable</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td><td>Yes</td><td>No</td></tr><tr><td>Min Debt</td><td>200 USH</td><td>200 USH</td><td>50 USH</td><td>200 USH</td><td>200 USH</td><td>50 USH</td></tr><tr><td>Max Total Debt</td><td>1B USH</td><td>100M USH</td><td>10M USH</td><td>1M USH</td><td>1M USH</td><td>2.5M USH</td></tr><tr><td>Oracle</td><td>Pyth, Chainlink, Switchboard</td><td>Pyth</td><td>Solend via Switchboard</td><td>Pyth, Chainlink, Switchboard</td><td>Pyth</td><td>Solend via Switchboard</td></tr></tbody></table>


# Redeeming against a vault

To keep USH pegged at $1, Hedge offers a [redemption mechanism](https://www.hedge.so/redeem), where any user may redeem their USH for the equivalent value in SOL. This SOL will be taken from the user’s vault with the lowest collateral ratio; after a fee is assessed, the vault owner's debt is repaid at a premium. While this may not be an optimal experience for vault owners, they end up with a better collateral ratio which leaves their vault in a healthier state.

Redemptions are only made available to ensure USH has a price floor and only will be profitable when USH is trading below $1. There is also a fee for redemptions so that they don’t happen too frequently, which would degrade the user experience.

## Redemption Fee

The redemption fee is a protocol mechanism to ensure that redemption doesn’t happen too frequently, which would degrade the user experience.

The fee charged is the sum of four components:&#x20;

1\. A base fee of 0.5%&#x20;

2\. The amount of USH redeemed compared to the vault type's circulation.

This fee is equal to `0.5 * m/n` where `m` is the amount of USH redeemed and `n` is the total amount of USH in the respective vault type. The goal is to incentivize the correct percentage of redemption in the system. For example, if USH is trading at $0.98, at most ($1 − $0.98), or 2%, of the total supply needs to be redeemed to get back to peg. Redeeming any extra amount will not be profitable.

That is, if 100 USH is redeemed and there is a total of 1000 USH in circulation, the fee is equal to `0.5 * 100/1000 = 0.05`.

3\. The fee charged during the last redemption in the system, which decays over time

This is calculated as `0.9^days * lastFee`. Here, `days` is the amount of time since the last redemption. `lastFee` only includes the USH supply-based fee component and time-based fee component for the last fee charged in the system, and does not include the vault collateral ratio fee component. The initial value of `lastFee` is zero. This fee component has the following effect: If USH has recently been redeemed, there is an incentive not to do another redemption in the near future.

4\. The collateral ratio of the redeemed vault&#x20;

Only the vault with the lowest collateral ratio can be redeemed against for any given vault type. However, there may be multiple collateral types (e.g. SOL and BTC) each with separate types of vaults; if both exist, the vault with the lowest ratio per collateral type can be redeemed against. Redeeming against a vault with a higher collateral ratio (i.e. a vault in better standing) leads to a higher fee. Therefore, this fee incentivizes users to redeem against the most under-collateralized vault across all vault types and, in turn, for vault users to maintain healthy collateral ratios.

For more detail on the fee calculations, please see the [whitepaper](https://drive.google.com/file/d/1-W_LlAhpgXgl8rlMJMt8e-ztkHe53c3g/view).


# Peg Stability Module

### What is the Peg Stability Module?

The Peg Stability Module (PSM) is one of the few mechanisms offered by Hedge to help further ensure that USH stays pegged to a dollar. The PSM allows users to swap USH for USDC and vice versa at a fixed rate.

Unlike the traditional Hedge vaults, the PSM has no borrowing mechanism. The contract simply swaps the coins directly and collects a fee at the point of transaction.

### When can the module be used?

It is helpful where USH is trading above a dollar. Users can simply take advantage of the arbitrage opportunity by minting USH from USDC. This in turn will help bring the price of USH down closer to a dollar.

Likewise, in the event that USH is trading below a dollar, users can redeem their USH for USDC to take advantage of the arbitrage opportunity which eventually helps to revert USH back up to a dollar.

Do note that there is a capped amount that the peg stability module can hold.

### What are the fee involved?

* To mint USH from USDC - 0.75%
* To redeem USH to USDC - 0.1%


# Liquidations & stability pool

In a typical crypto-collateralised stablecoin system, users must use the stablecoin to buy up collateral to liquidate another position. While this is generally acceptable, the stablecoin can lose peg if the collateral price decreases sharply.

Hedge aims to preemptively secure the USH required for liquidation by offering a USH stability pool. Users can deposit USH in the pool and receive profits from liquidated vaults, where the profit is denominated in the collateral and is a result of buying the collateral at a market discount.

Since there are users already ready to buy collateral with USH, the stability pool helps avoid a spike in the price of USH in a market downturn. As a result, users with loans will be able to pay back their debts without paying a premium to obtain USH. The stability pool also allows for lower overall collateral requirements for vaults by helping ensure that there is USH available to buy vaults at low collateral ratios.

## How does a liquidation happen?

Whenever a vault is below its maintenance collateral ratio (110%) it is considered at risk.

A user initiates the liquidation, then USH from the stability pool is taken to pay back the USH debt (plus a protocol fee) and burnt. The remaining SOL is distributed to the users participating in the stability pool, who make a profit since the value of the SOL is more than the amount of USH burnt.

![Example of how collateral is distributed during a liquidation.](/files/dh6M4fqtuzMJ2sV1eQPj)

### Example

For example, let's imagine there is a vault with 100 SOL collateral with 12,500 USH in debt. The maintenance collateral ratio is 110%. The current price of SOL is $160 so the collateral ratio is 128%. If the SOL price then falls to $136.25, the collateral ratio is now 109%. The vault is now under-collateralized, making it a candidate for liquidation.

The liquidation mechanism must be initiated by an individual user, who is rewarded 5% of the outstanding vault value. The outstanding vault value, equal to the collateral minus the debt, is $13,625 equivalent of SOL - $12,500 equivalent of USH = $1,125 or 8.26 SOL. 5% of this number is $56.25 or 0.41 SOL. In addition, there is a liquidation fee given to the Hedge protocol equal to 20% of the outstanding vault value, which is $225 or 1.65 SOL. The remaining 75% of the outstanding vault value is transferred to users in the stability pool, in proportion to how much USH they have deposited.

The end result is that 12,500 USH will be burnt from the pool and 97.94 SOL (the original 100 SOL minus the 0.41 and 1.65 SOL fees) given out as rewards. Since 97.94 SOL \* $136.25 = $13,344, this represents a 6.8% return for users in the stability pool.

However, if the vault has a collateral ratio of less than 100%, the abovementioned fees do not apply. Since the outstanding vault value is negative, the liquidation initiator will instead be rewarded 1% of the total collateral. The protocol and stability pool will receive no reward in this case.

## Black swan event liquidations

Hedge is designed to survive a sudden (< 1 hour) 50% SOL price crash with the measures described below. While this is not expected to happen, the nature of crypto markets means that Hedge must be able to quickly restore a system collateral ratio of >110%.

### Stability pool

The first measure consists of using the funds in the stability pool to burn all the outstanding USH.

For example, at a SOL price of $100, a vault may have 10000 USH debt and have a balance of 90 SOL or $9000. In this case 10000 USH will be burnt from the stability pool (plus fees) and 90 SOL given pro-rata to all stability pool participants.

In this scenario, the stability pool participants will need to wait for SOL to appreciate above $111.11 to start making a profit since they essentially bought SOL for a premium.

### Debt redistribution&#x20;

*Note*: Debt redistributions are currently disabled.

If the stability pool is empty, Hedge uses an alternative measure which involves moving the debt from under-collateralized vaults to other vaults in better standing.

If the current state of Hedge is as follows (assuming a price of $10/SOL):

| Vault   | Debt (USH) | Collateral (SOL) | Value | Collateral ratio |
| ------- | ---------- | ---------------- | ----- | ---------------- |
| Vault 1 | 30         | 6                | $60   | 200.00%          |
| Vault 2 | 55         | 6                | $60   | *109.09*%        |
| Vault 3 | 20         | 7                | $70   | 350.00%          |
| Total   | 105        | 19               | $190  | 180.95%          |

Then we would distribute the debt of vault 2 to all other vaults.  For more detail on this calculation, please see [the whitepaper](https://drive.google.com/file/d/1-W_LlAhpgXgl8rlMJMt8e-ztkHe53c3g/view).

| Vault   | Debt (USH) | Collateral (SOL) | Value | Collateral ratio |
| ------- | ---------- | ---------------- | ----- | ---------------- |
| Vault 1 | 63         | 9.6              | $96   | 152.38%          |
| Vault 2 | 0          | 0                | 0     | *Liquidated*     |
| Vault 3 | 42         | 9.4              | $94   | 223.09%          |
| Total   | 105        | 19               | $190  | 180.95%          |

## Recovery Mode

While individual vaults may have very risky positions, the entire system should remain collateralized by at least 150%. If the system falls below this ratio, it will enter recovery mode. This is done on a per-collateral basis by vault type: e.g. if SOL and BTC are both supported types of collateral for vaults, a calculation will be done separately for the collateral and debt per currency. That is, a crash in the price of BTC will not affect users with SOL vaults and vice versa.

In this mode, all vaults below the 150% collateral threshold can be liquidated, and actions that would make the system less healthy are prevented. Redemptions, taking a loan, or withdrawing collateral will not be allowed until the system exits recovery mode.&#x20;

See a more detailed explanation in the [Recovery Mode](/protocol-overview/recovery-mode) section.


# Recovery Mode

What is Recovery Mode, why does it exist and what happens when a vault enters recovery mode?

## Definitions

**Vault Type** refers to a certain category of vaults - e.g. all 0% interest SOL vault belong to that vault type.

**VTCR** refers Vault Type Collateral Ratio which is the total value of the collateral locked up in that vault type divided by the total USH debt extended against it.

**ICR** refers to Individual Collateral Ratio. This refers to the current collateral ratio of an individual vault.

**MCR** refers to Minimum Collateral Ratio.

**RMCR** refers to Recovery Mode Collateral Ratio. This can be different for each Vault Type. For most Vault Types this is 150%.

## Why

Recovery Mode exists to ensure the Hedge protocol can sustain a large volatility in backing assets and still be solvent. It ensures that each vault type (e.g. SOL vault) is backing USH by at least 150% collateral ratio - this parameter may vary for different vaults and some vaults offered by the Hedge protocol may not even need to have a Recovery Mode enabled due to the nature of the assets or other parameters of the vault.

Because Recovery mode will cause vaults close to the threshold to be liquidated, there is a natural incentive by users not to open vaults that would cause the system to enter recovery mode. It acts as a deterrent for users to take risky positions.&#x20;

## Logic

A Vault Type (e.g. BTC vaults) enter Recovery Mode when their total collateral ratio falls under 150% (e.g. BTC value divided by USH generated against BTC).

A vault type enters Recovery Mode when the vault type's collateral ratio is under the recovery mode threshold - which is usually at least 150%. Because recovery mode is isolated for each vault type, the sudden decrease of one asset you do not hold in the Hedge protocol will not cause your position to be liquidated.

E.g. if Hedge offers BTC and SOL type vaults, but you only have a USH loan extended against SOL then a price crash of BTC will not impact your SOL vault's liquidation.

### What happens?

When a vault type is in Recovery Mode, any vault under the vault type's collateral ratio is eligible for liquidation. Additionally, collateral cannot be taken out from the vault's type and new loans that worsen the vault type's state will not be allowed.

To avoid liquidation, it is advised that users only open positions above the recovery mode threshold.

| Condition  | Details                                                                                                                        |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------ |
| ICR < MCR  | Vault will get liquidated using funds from the stability pool and the collateral will be given to stability pool participants. |
| ICR < RMCR | Vault is eligible for liquidation.                                                                                             |
| ICR > RMCR | Vault is safe and will not be liquidated.                                                                                      |

When the stability pool is empty, the vault's debt and collateral will instead be redistribute according to the rules defined in [Liquidations & stability pool](/protocol-overview/liquidation-and-liquidation-pool#debt-redistribution).


# Security

## Audits

Hedge is audited by [Kudelski](https://kudelskisecurity.com/), [Sec3 (formerly Soteria)](https://www.sec3.dev/) and [OtterSec](https://osec.io/).

The Kudelski report can be found [here](https://drive.google.com/file/d/1eZaHWyT2zlMq6RohEYtB7SUtYMQoSDb9/view?usp=sharing).&#x20;

The OtterSec report can be found [here](https://drive.google.com/file/d/1Ky5bRxVT9ouHboF9HYC_H7ZL6ndHX0hL/view?usp=sharing).&#x20;

The Sec3 (formely Soteria) report can be found [here](https://drive.google.com/file/d/15nP55IyWuVN5DAlQZlpYVC2hNWJ42nAX/view?usp=sharing).

## Contract address

The mainnet contract has been deployed with the following address:\
[HedgeEohwU6RqokrvPU4Hb6XKPub8NuKbnPmY7FoMMtN](https://explorer.solana.com/address/HedgeEohwU6RqokrvPU4Hb6XKPub8NuKbnPmY7FoMMtN?cluster=mainnet-beta)

Please ensure you are only interacting with the following address.

## Oracles&#x20;

Vault systems that rely on a single exchange's price feed may be subject to [flash loan attacks](https://twitter.com/emilianobonassi/status/1339719073333194754?s=20). To avoid this, Hedge uses​ [Pyth’s SOL](https://pyth.network/markets/#Crypto.SOL/USD) feed as its primary source and falls back on [Switchboard’s feed](https://switchboard.xyz/explorer/0/AdtRGGhmqvom3Jemp5YNrxd9q9unX36BZk1pujkkXijL). [Chainlink](https://chain.link/) will also be used once it is deployed to Solana mainnet.

We've released upgrades to our Oracle Module which strengthen the reliability of collateral price quotes.&#x20;

Our Oracle Module checks for 3 major attributes: **Confidence Intervals**, **Price Staleness** and **Median Price Value**.&#x20;

**Confidence intervals** allow us to check when an Oracle Provider's publishers are reporting a precise price. If an Oracle Providers publishers are compromised, intending to provide an incorrect value -- A confidence interval based on the standard deviation of Oracle Publishers will be refused by our Oracle Module.&#x20;

**Price Staleness** allows us to make sure a price quote is still "fresh". If the price quoted was reported more than a minute ago, the Oracle Module will refuse the Oracle Providers Quote.&#x20;

**Median Price Value** allows us to select an appropriate price quote when all three Oracle Providers quote a value. This ensures we utilize the most accurate price value and are resistant to faulty oracle price quotes.


# Oracle Address

### SOL

<table><thead><tr><th width="184">Oracle Provider </th><th>Oracle Address</th></tr></thead><tbody><tr><td>Pyth</td><td>H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG</td></tr><tr><td>Chainlink</td><td>CcPVS9bqyXbD9cLnTbhhHazLsrua8QMFUHTutPtjyDzq</td></tr><tr><td>Switchboard</td><td>GvDMxPzN1sCj7L26YDK2HnMRXEQmQ2aemov8YBtPS7vR</td></tr></tbody></table>

### mSOL

<table><thead><tr><th width="187">Oracle Provider </th><th>Oracle Address</th></tr></thead><tbody><tr><td>Pyth</td><td>E4v1BBgoso9s64TQvmyownAVJbhbEPGyzA3qn4n46qj9</td></tr></tbody></table>

### cUSDC

<table><thead><tr><th width="187">Oracle Provider</th><th>Oracle Address</th></tr></thead><tbody><tr><td>Switchboard</td><td>7Y3nWv5B2rLiDBsNpkfXqa4cbJqszJos2sZVutF8R3FE</td></tr></tbody></table>

### wBTC

<table><thead><tr><th width="190">Oracle Provider</th><th>Oracle Address</th></tr></thead><tbody><tr><td>Pyth</td><td>GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU</td></tr><tr><td>Chainlink</td><td>CGmWwBNsTRDENT5gmVZzRu38GnNnMm1K5C3sFiUUyYQX</td></tr><tr><td>Switchboard</td><td>8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee</td></tr></tbody></table>

### soETH

<table><thead><tr><th width="188">Oracle Provider</th><th>Oracle Address</th></tr></thead><tbody><tr><td>Pyth</td><td>JBu1AL4obBcCMqKBBxhpWCNUt136ijcuMZLFvTP7iWdB</td></tr></tbody></table>

### cUSDT

<table><thead><tr><th width="188">Oracle Provider</th><th>Oracle Address</th></tr></thead><tbody><tr><td>Switchboard</td><td>7xC7k76f2CQYRuzjyCdqmYM6kKHNpxBx89e7hw2xMf5Q</td></tr></tbody></table>


# FAQ

## What was the motivation behind this project?

The idea of offering a 0% interest loan product felt very novel to us — we had never seen anything like this offered in the traditional finance world and it got us really excited to build the first version of Hedge, which we submitted to the Ignition Hackathon. Our submission attracted tons of interest: we won the Chainlink Prize(link) and had close to 10,000 vaults created on our devnet smart contract.

Hedge is growing quickly now and moving toward a mainnet launch in the near future.

## Any future plans for Hedge?

Our initial focus is to give users the very best way to unlock their SOL at rates not previously available. We plan to scale by being the go-to place for token liquidity: with the input of the community, we’ll carefully onboard additional forms of collateral. Alongside this, a vibrant ecosystem built on top of USH will be made available — including yield and leverage products — to help users get the most out of their favorite token.


# Tokenomics

Hedge tokenomics

## Token utility

The Hedge protocol issues 2 protocol tokens - [USH](/protocol-overview/ush) and [HDG](/protocol-overview/hedge-token). USH is an overcollateralised stablecoin issued by locking up collateral and as such has a varying supply over time. HDG is the protocol token. At launch, users may stake HDG to earn portion of protocol fees, which are taken during loan initiation - this model may change as the protocol matures and HDG is used for governance.

## HDG distribution

![HDG token distribution.](https://lh6.googleusercontent.com/5qDDX2LgdPTt6Yf2wvOBD4qg3GlaUzhGpR1nEgohnbbRuVIY5n-Cu6gzLKTSn1P2JwJ07W5YnZ8ZxW2nYjHN_qsuvMmOIkJFfm5oi9et6Y2LwsMqhEI5ybZhySfKg-p8J2GZYkiUZ_DYH-poGA)

There are a total of 10M HDG tokens.

60% of all tokens are allocated to the community, with 45% of the total tokens given out as liquidity & stability mining incentives. 5% of the total is given out as community rewards which include incentives for integration and potential airdrops. 10% of the total is kept aside for the Hedge Treasury. A portion of the Hedge Treasury will be staked to generate revenues for the team and community, though Hedge will ensure that the staked tokens do not represent more than 50% of the staking pool at any point in time.

15% of all tokens are set aside for investors - with 10% of the total going to seed investors and 5% set aside for future fundraise if needed. The seed investors have a 18 month vesting schedule after token launch with a 1 year cliff.

25% of all tokens are allocated to the core team and are subject to a 3 year vest with a 1 year cliff.

## HDG Emissions

Hedge will start liquidity mining at the same time as mainnet launch. This is the expected emission schedule for HDG token emission over the next 6 years. The stability pool incentives are fixed and halve every year.

![Target HDG emissions for the 1st year after launch](https://lh4.googleusercontent.com/X5Un5xMPmZarQtm8jIfGKcASQSd_jgcdYtwHzms2rQxYO68PnoeSr_EZfh1I7U_FWSOXpnTTjInfuXnlerslWt7Yi0o-qE_nQVWEQetOO4YBNteWTuvynn339xOVZXC7SoKMwYsTaj96EAXVEw)

![Target HDG emissions 6 years after launch](https://lh5.googleusercontent.com/zSPI5o9Q6AVzgP3jURDoChfYBpkWlMQ_deSFR5w9DXxZHw_jVCQuCYxBPHgFUA4BM0I0y-4xlbD5HPi7hJnmk1ruUM0Omg3UlabHDMPIdEyZdB0XxTQY36RoL5LQc_Uo_BHXTwJ8h5beg61x7A)

```markdown
| Emissions schedule     | Liquidity Incentives     | Stability Pool Emissions     | Cumulative Total     |
|------------------------|--------------------------|------------------------------|----------------------|
| Month 1                |                   70’000 |                      112’250 |              182’250 |
| Month 2                |                   60’000 |                      105’951 |              348’201 |
| Month 3                |                   60’000 |                      100’005 |              508’206 |
| Month 4                |                   50’000 |                       94’393 |              652’599 |
| Month 5                |                   50’000 |                       89’094 |              791’693 |
| Month 6                |                   45’000 |                       84’094 |              920’787 |
| Month 7                |                   45’000 |                       79’373 |            1’045’160 |
| Month 8                |                   45’000 |                       74’918 |            1’165’078 |
| Month 9                |                   45’000 |                       70’714 |            1’280’792 |
| Month 10               |                   45’000 |                       66’745 |            1’392’537 |
| Month 11               |                   45’000 |                       62’999 |            1’500’536 |
| Month 12               |                   40’000 |                       59’464 |            1’600’000 |
| Year 2                 |                  500’000 |                      500’000 |            2’600’000 |
| Year 3                 |                  400’000 |                      250’000 |            3’250’000 |
| Year 4                 |                  300’000 |                      125’000 |            3’675’000 |
| Year 5                 |                  200’000 |                       31’250 |            3’906’250 |
| Year 6                 |                  200’000 |                       15’625 |            4’121’875 |
```

#### Stability Pool Emissions

A total of 2M HDG tokens will be emitted over the total lifetime of the Hedge contract. Emissions are dictated according to the following half-life formula, where f(n) represents the total amount of tokens emitted on day n after launch.&#x20;

$$
f(n) = \int\_{0}^{n} \frac{2000000}{\frac{365}{log(2))}}\* \frac{1}{2}^{\frac{x}{365}} dx
$$


# Glossary

| Term             | Description                                                                                                                                                                                                                                                                                                    |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| USH              | A stablecoin soft-pegged to the US dollar. Its value should always be close to US $1.00. Each $1 equivalent of USH is backed by at least $1.10 equivalent of collateral.                                                                                                                                       |
| HDG              | A revenue share and governance token. It rewards market makers for providing liquidity to the system by capturing a proportional share of the protocol revenues when staked.                                                                                                                                   |
| Collateral       | Tokens that you deposit as a guarantee for the loan that Hedge gives you. Currently, SOL is the first supported form of collateral.                                                                                                                                                                            |
| Collateral Ratio | The market value of your collateral divided by your debt (loan amount in USH).                                                                                                                                                                                                                                 |
| Liquidation      | When an undercollateralized vault is liquidated, the debt and collateral are zeroed out and users who have deposited USH in a stability pool are returned discounted collateral as a reward.                                                                                                                   |
| Liquidity Pool   | Users can put tokens in to allow other users to swap their tokens more easily; for example from USH to SOL and from HDG to SOL. This is not native to Hedge but may be done on other platforms.                                                                                                                |
| Redemption       | Any user may redeem their USH for the equivalent value in SOL. This SOL will be taken from the user’s vault with the lowest collateral ratio; after a fee is assessed, the vault owner's debt is repaid at a premium. This reduces the vault’s debt and collateral and increases the vault’s collateral ratio. |
| Stability Pool   | Used in liquidations; users can deposit USH and be rewarded in SOL and HDG tokens.                                                                                                                                                                                                                             |
| Staking pool     | Users can stake their HDG tokens and earn a proportional share of the protocol's revenue.                                                                                                                                                                                                                      |


# Whitepaper

A copy of the official whitepaper can be found [here](https://drive.google.com/file/d/1-W_LlAhpgXgl8rlMJMt8e-ztkHe53c3g/view?usp=sharing).


# Disclaimer

Hedge protocol

Hedge is a decentralised lending platform deployed to the Solana blockchain. Risks include liquidation due to price fluctuations, smart contract risk, and associated risks of using the Solana blockchain which include irreversible transactions.

Anyone is free to access the Hedge protocol, which may be offered from the main website but also offered by 3rd party clients.

The developers of Hedge do not own the protocol and are not responsible for any direct or indirect losses or damages incurred by using it. The developers may choose to upgrade the contract at any time.


