# Introduction

Welcome to RHEA Finance, the chain-abstracted liquidity solution

The next evolution of decentralized finance leads to borderless liquidity, where capital moves freely across ecosystems and trading, lending, staking, and bridging all flow through one connected experience. That is the vision behind **RHEA Finance**.

Built on NEAR’s fast and low-cost infrastructure, RHEA enables seamless swaps, cross-chain lending, liquid staking, and other DeFi utilities through one coherent system. RHEA represents a framework for the next era of decentralized finance, where liquidity flows without friction and finance becomes truly borderless.

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

## Quick Links&#x20;

<table data-view="cards"><thead><tr><th align="center"></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center"><strong>Explore RHEA</strong></td><td>Dive into the user guides for each RHEA product and feature. </td><td><a href="/files/NpT0hWNLZ5ndTsUUlHc0">/files/NpT0hWNLZ5ndTsUUlHc0</a></td><td><a href="/pages/ExVQvjqrlbBdMA8WX3zS">/pages/ExVQvjqrlbBdMA8WX3zS</a></td></tr><tr><td align="center"><strong>Build with RHEA</strong></td><td>Check out developer resources to start integrating RHEA or building on the platform.</td><td><a href="/files/HY6qEJxSsJQDHBb9NDad">/files/HY6qEJxSsJQDHBb9NDad</a></td><td><a href="/pages/P25JfkJv8ybgeJowiaFS">/pages/P25JfkJv8ybgeJowiaFS</a></td></tr><tr><td align="center"><strong>Join the Community</strong></td><td>Connect with other users and the RHEA team on Discord</td><td><a href="/files/6T6nkOaRQhEuVBJPYhbM">/files/6T6nkOaRQhEuVBJPYhbM</a></td><td><a href="/pages/7FGdExb7eeulQzmuDNAa">/pages/7FGdExb7eeulQzmuDNAa</a></td></tr></tbody></table>

## Overview of RHEA Finance&#x20;

{% content-ref url="/pages/3nHI1BTOcGaPOgoWRaIo" %}
[How RHEA Finance Works](/near-chain-guides/how-rhea-finance-works)
{% endcontent-ref %}

{% content-ref url="/pages/r0v8jJCJcQAFd2clp0gK" %}
[Auto Router](/near-chain-guides/how-rhea-finance-works/auto-router)
{% endcontent-ref %}

{% content-ref url="/pages/81LdO15VS7haqng9hH2m" %}
[Multi-chain Router](/near-chain-guides/how-rhea-finance-works/multi-chain-router)
{% endcontent-ref %}


# Copy of History

From 0 to 1

RHEA Finance, (formally Ref Finance) was initially created by Illia Polosukhin, co-founder of NEAR Protocol. The first commit on Github was made on March 9, 2021.&#x20;

Following the deployment of the application in April 2021, Proximity Labs, a research and development company focused on NEAR, received a grant from the NEAR Foundation to bootstrap and scale Ref Finance.

Early June 2021, Proximity set up the Ref Finance DAO. DAO members were selected based on their value, contribution, and activity across the board (mainly Telegram and Discord).&#x20;

Early well-known contributors are:

* Developers
  * Illia: <https://github.com/ilblackdragon>
  * Evgeny: <https://github.com/evgenykuzyakov>
  * Marco: <https://github.com/marco-sundsk>
  * Joe: <https://github.com/aidai524>
  * Referencedev: <https://github.com/referencedev>
  * Mikedotexe: <https://github.com/mikedotexe>
* Business, Strategy and Product
  * ve$RUST at Proximity Labs (ex NEAR core team)
  * Kendall at Proximity Labs (ex NEAR core team)


# Copy of Introduction

Welcome to RHEA Finance, the chain-abstracted liquidity solution on NEAR Protocol

<picture><source srcset="/files/M6B0vVlZNtfIfkRiTqsq" media="(prefers-color-scheme: dark)"><img src="/files/gBxI0XgX74CchC4PCMNp" alt="" width="369"></picture>

RHEA Finance is a community-led, multi-purpose DeFi platform built on the NEAR Protocol.

RHEA takes full advantage of NEAR’s low fees, one-to-two second finality, and WebAssembly-based runtime (hello, Rust smart contracts!).

In addition to the advantages of being built on top of NEAR, RHEA Finance provides:&#x20;

* Multiple pools in one contract
* Atomic transactions
* Customisable pool fee

## Features

↔️ **Trade**

Trade tokens with our automated market maker (AMM) exchange

**💰** **Pool**

Provide liquidity and earn revenue from swap fee

**🌾** **Farm**

Stake LP tokens into farms and earn rewards in return

**🌈** **Stake**

Stake REF tokens to earn more REF tokens, by earning fees generated by the protocol

🗳​ **Lending & Borrowing**

Lend your NEP-141 Token and Unlock asset liquidity all in one place


# Tokenomics

Information about our Governance token, REF

## **General Information**

REF is a Governance token that also rewards its holders with a protocol revenue sharing model.

* Token name: Ref Finance
* Ticker: REF
* Fungible Token Contract: token.v2.ref-finance.near
* Fungible Token Standard: NEP-141
* Fixed Supply: 100,000,000
* IDO: 2,500,000 auctioned via Skyward Finance (July 26–31, 2021)

## **Token Allocation**

<table><thead><tr><th width="261.2851934609063">Categories</th><th width="150">Allocation</th><th>Release Schedule</th></tr></thead><tbody><tr><td>Liquidity Incentives</td><td>60%</td><td><p>Year 1: 25%</p><p>Year 2: 18.3%</p><p>Year 3: 11.7%</p><p>Year 4: 5%</p></td></tr><tr><td>Treasury</td><td>20%</td><td>N/A</td></tr><tr><td>Development Fund</td><td>10%</td><td>4-year linear release</td></tr><tr><td>Early Users Airdrop</td><td>1%</td><td>3-month vesting with 3-month cliff</td></tr><tr><td>Future Airdrop(s)</td><td>2%</td><td>TBD</td></tr><tr><td>IDO (Skyward Auction)</td><td>2.5%</td><td>1-week auction</td></tr><tr><td>REF Token Liquidity Provisions</td><td>2.5%</td><td>N/A</td></tr><tr><td>Strategic Airdrop</td><td>2%</td><td>N/A</td></tr></tbody></table>

![](/files/oHdK9YoOYoLXBlMW8mrK)

## **Private Fundraising**

In March 2022, Ref Finance has closed a strategic Over-the-Counter (OTC) deal with professional investors as well as business angels.

Professional investors are:

* [Jump Crypto](https://jumpcrypto.com/) (Lead)
* [Alameda Research](https://www.alameda-research.com/)
* [Dragonfly Capital](https://www.dcp.capital/)
* [D1 Ventures](https://www.d1.ventures/)
* [OKX BlockDream Ventures](https://www.okx.com/blockdream-ventures)
* [Kucoin Ventures](https://www.kucoin.com/land/kucoinlabs)
* [SevenX Ventures](http://www.7xvc.com/)
* [Woo Network](https://woo.org/)
* [Move Capital](https://move-capital.com/en/)
* [Puzzle Ventures](https://puzzle.ventures/)

The objective of the fundraising is to support and cover the development cost of the solution for at least 24 months, starting from March 2022.

The total amount raised was $4.5m in stablecoins in exchange for 3,664,943 REF tokens, leading to an average price of 1.227 REF per stable.

The stablecoins breakdown is as follows:

* $3.6m USDC
* $0.9m USDT

### Terms

* Price: 7-day market Time-weighted Average Price (TWAP) at a 20% discount
* Lockup: 1-year linear release every quarter

More details can be found in the [Ref governance forum](https://gov.ref.finance/t/a-strategic-ref-otc-wip/448).

## **Token Utility**

1. **Earning protocol revenue**: Users who stake REF tokens to earn fees generated by the protocol
2. **Pooling**: Users who provide liquidity with any REF token pairs earn swap fee from the associated pool(s)
3. **Farming**: Users who stake their LP tokens into different farms, thus earning additional revenue
4. **Boosted farming**: Users who lock their LP tokens into the REF<>NEAR pool can get LOVE tokens, which can be staked to unlock extra rewards for multiple farms
5. **Governance**: Users who lock their LP tokens into the REF<>NEAR pool can get veTokens, which can be used to vote on governance proposals and on the allocation of liquidity incentives


# Governance

In the long term, we envision RHEA to be fully governed by its community

## DAO <a href="#id-9a14" id="id-9a14"></a>

The current DAO (ref-finance.sputnik-dao.near) uses SputnikDAO contract to manage its affairs.&#x20;

The DAO has two different roles:

1. **Council**: Council members can create proposals and vote. Only Council members can create proposals. If the majority of the Council confirms or rejects a proposal, that decision will stand
2. **Community**: Community members can vote on proposals. If the majority of the Community confirms or rejects a proposal, that decision will stand. For most proposals, the Council will defer to the Community's decision, and refrain from voting

## Core Values <a href="#id-9a26" id="id-9a26"></a>

Beyond voting power, anyone in our community is welcomed and encouraged to participate in the activities of the project, including, but not limited to:

* **Project Management**: planning, project methodology, and documentation
* **Product Testing**: unit test and end-to-end test
* **Product Strategy**: benchmark, market analysis, and go-to-market plan
* **User Support and Moderation**
* **PR and Communication**

In addition to proactiveness, Community members shall:

* Challenge project proposals
* Share their opinion about different matters raised by the Community
* Be proactive and act in the protocol’s best interests
* Exercise independent judgement (Community members should not be delegates who simply implement the commands of other parties)
* Exercise their voting right
* Participate in the Community calls and meetups


# Team

The team is composed of fifteen fulltime members, covered/paid by the Dev DAO (dao.ref-dev-team.near).

<table><thead><tr><th width="181">Member</th><th width="302.42297650130547">Position</th><th>Link</th></tr></thead><tbody><tr><td>Marco</td><td>Lead Backend Developer</td><td></td></tr><tr><td>Joe</td><td>Lead Frontend Developer</td><td></td></tr><tr><td>Gordon</td><td>Senior Backend Developer</td><td></td></tr><tr><td>Dom</td><td>DevOps</td><td></td></tr><tr><td>Nature</td><td>Frontend Developer</td><td></td></tr><tr><td>Luke</td><td>Frontend Developer</td><td></td></tr><tr><td>Willa</td><td>Lead QA Engineer</td><td></td></tr><tr><td>Amy</td><td>QA Engineer</td><td></td></tr><tr><td>Mency</td><td>Designer &#x26; UX</td><td></td></tr><tr><td>Zero</td><td>Product &#x26; Project Manager</td><td></td></tr><tr><td>Aescobar</td><td>BD</td><td></td></tr><tr><td>Anne</td><td>Lead Marketing</td><td><a href="https://www.linkedin.com/in/anne-nguyen-5ba5a720a/">https://www.linkedin.com/in/anne-nguyen-5ba5a720a/</a></td></tr></tbody></table>

Although not considered as a fulltime member of the team, ve$RUST (from Proximity Labs) is one of the leaders of the project and is very involved in Product Design, Business, Marketing, Strategy and Growth.

The team is a mix of both pseudonymous and non-pseudonymous people. Within the crypto space, being pseudonymous can mitigate the risks of conducting an activity that is not considered as regulated in a specific country, for example. For more details on the topic, the team recommends the following read: [Sputnik DAO: Empowering Communities](https://medium.com/sputnikdao/sputnik-dao-empowering-communities-e55ac65f4433).

The team does not stop to the above list. As a community-driven project, many community members are contributing, on a regular basis, to different aspects of the project, such as Marketing, end-to-end community testing, etc.&#x20;

Moderators are also a key piece of the project. They participate in the success and growth of RHEA Finance in different areas, such as (not limited to):

* User onboarding/acquisition
* User support/guidance
* Discussion facilitation
* Removal of unrelated or inappropriate content

RHEA Finance's Legendary Mods:

| Username | Telegram Handle |
| -------- | --------------- |
| Cudam    | @cudam321       |
| Larry    | @Larry\_Lang    |
| Rim      | @rimberjack     |
| Sanket   | @SanketN81      |

Fore more details on how to contribute, please see our [Community section](/community/official-links).


# Get Started

A quick guide to DeFi on NEAR

Just like on other chains, NEAR also needs some native NEAR tokens to pay for gas. Always ensure you save some NEAR in your wallet.


# Buy RHEA Token

## DEX Routes

CA on Binance Smart Chain&#x20;

* 0x4c067DE26475E1CeFee8b8d1f6E2266b33a2372E

CA on NEAR Protocol&#x20;

* token.rhealab.near

### RHEA Finance

Link: <https://app.rhea.finance/swap>

### Pancake Swap

Link: <https://bit.ly/3YIKlJr>&#x20;

### GemPump

Link: <https://www.gempump.io/token/rheafinance>

Trading pair:

* RHEA <> wBNB

## CEX Routes

### **Binance Alpha**&#x20;

Link: <https://www.binance.com/en/alpha/bsc/0x4c067de26475e1cefee8b8d1f6e2266b33a2372e>&#x20;

### GATE US&#x20;

Link: <https://www.gate.com/en-us/trade/RHEA_USDT>&#x20;

### Bitget

Link: <https://www.bitget.com/spot/RHEAUSDT?utmSource=Twitter>

Trading pair:

* RHEA <> USDT

### Kraken

Link: [app.kraken.com/JDNW/RHEA](https://t.co/o3pTff1xQQ)

Trading pair:

* RHEA <> USD
* RHEA <> EUR&#x20;

### Gate io

Link: <https://www.gate.com/trade/RHEA_USDT>

Trading pair:

* RHEA <> USDT

### MEXC

Link: <https://www.mexc.com/exchange/RHEA_USDT>

Trading pair:

* RHEA <> USDT

### LBank

Link: <https://www.lbank.com/trade/rhea_usdt>

Trading pair:

* RHEA <> USDT

### Ourbit

Link: <https://www.ourbit.com/exchange/RHEA_USDT>

Trading pair:

* RHEA <> USDT

### BitMart

Link: <https://www.bitmart.com/trade/en-US?symbol=RHEA_USDT>

Trading pair:

* RHEA <> USDT

### Bingx

Link: <https://bingx.com/en/spot/RHEAUSDT>

Trading pair:

* RHEA <> USDT

### HIBT

Link: <https://hibt.com/trade/RHEA-USDT>

Trading Pair:&#x20;

* RHEA <> USDT


# Setup Wallet

The wallet allows you to interact with the NEAR blockchain

## **Using Hot Wallet**

HOT Wallet — a multichain wallet seamlessly integrating both EVM and non-EVM blockchains.

Download the browser extension: <https://hot-labs.org/wallet/>

## **Using Meteor** Wallet

A powerful, self-custody wallet built to connect you to the decentralized web — safely and securely

Get Started: <https://meteorwallet.app/>&#x20;

## **Using My**Near Wallet

The MyNear Wallet is a non-custodial, web-based wallet for the NEAR blockchain.&#x20;

Please follow the official guide: <https://app.mynearwallet.com/>

## **Using Sender Wallet**

Sender is a browser extension wallet built for NEAR Protocol, aiming at providing a secure and easy-to-use wallet for DeFi and NFT users.&#x20;

Download the browser extension: <https://senderwallet.io/>


# Using the Platform

One platform, many things you can do

RHEA Finance is a fully permissionless exchange, meaning that any token on NEAR can be swapped or pooled on the platform.

When visiting the platform, you will be required to confirm the connection between RHEA Finance and your wallet. <mark style="color:green;">This is completely normal and safe</mark>. Once confirmed, you can start using RHEA Finance to **Trade**, **Pool**, **Farm,** **Stake** and **Vote**.

RHEA Finance has designed a simple tool to swap any token on NEAR, often being the first and unique place to get an exposure to new NEAR-native projects. Simply ensure RHEA Finance has permission to 'spend' your tokens and enjoy instantaneous, low-cost transactions.

## Increase your Yields

There is a number of ways to earn rewards on RHEA Finance.

**Pooling** tokens facilitates trading, ensuring that there is enough liquidity for traders. This works by providing two tokens (such as RHEA and NEAR) or three tokens (such as USDC, DAI and USDT for the Tri-Pool) to a pool in return for LP tokens, which can then be farmed. Not all pools can be farmed, but you will still earn a percentage of the trading fees in proportion to your share of the pool.&#x20;

Once in the pool, in most cases you can use LP tokens to farm. Simply visit the Farms tab and search for the pair you wish to farm to earn additional rewards.&#x20;


# Staying Safe

Stay alert ⚠️ 👀, always

## NEVER trust someone pretending to work for the 'Customer Support Team' <a href="#trader-joe-has-no-formal-customer-support-team" id="trader-joe-has-no-formal-customer-support-team"></a>

<mark style="color:red;">RHEA Finance has NO formal 'Customer Support Team'.</mark>

We will **NEVER**:

❌ Send you a direct message claiming to represent customer support or someone working directly for the team

❌ Ask you for your private key or recovery phrase&#x20;

​If you're having trouble, please contact us directly via our [official social channels](/community/official-links).

## ALWAYS use RHEA Finance verified domains <a href="#always-use-trader-joe-verified-domains" id="always-use-trader-joe-verified-domains"></a>

Bookmark: <https://www.rhea.finance/>

If you ever have any doubt of the URL, please use our linked URL on the official Ref Finance Twitter profile or alternatively, reach out to a Moderator in our [official social channels](/community/official-links).

If you believe that you have been scammed, please report it to one of our moderators.


# Using the Rainbow Bridge

Transfer tokens between Ethereum, NEAR and Aurora networks

The Rainbow Bridge allows you to transfer tokens between **Ethereum**, **NEAR** and the **Aurora** networks. The bridge was created and is maintained by Aurora, the Ethereum-compatible scaling solution built on NEAR.

## Guide

The following guide will show you how to use it:

1. Prepare ERC-20 assets in your non-custodial Wallet (Metamask, Coin98, etc.)
2. Use the Rainbow Bridge to transfer tokens to NEAR Protocol
3. Access <https://rainbowbridge.app/transfer>, connect your NEAR Wallet and MetaMask Wallet

### Step 1: Choose Ethereum <> NEAR route and connect both wallets

![](/files/G0dOrAvqBhpMpjMwCq4e)

### Step 2: Choose Begin new transfer and select tokens

![](/files/kWTEp4wxJOQm7glPR2mp)

### Step 3: Approve the transaction and click Transfer, it will cost you some ETH to cover the gas fee (amount depends on network congestion)

![](/files/s4H9VuRpFRs97BFhgUOc)

### Step 4: Confirm the transaction, like the previous step, it will cost you some ETH&#x20;

![](/files/P3K1onVWXD9YuE03kWIj)

### Step 5: Click Go to my transfer, to see your pending and/or finalised transfers

![](/files/54LEsae9T8WwVzimNp12)

![](/files/ReIKMY18TkQ5D1IvlEI1)

For more details, please check the following video: <https://www.youtube.com/watch?v=zbmnITYLE-M>


# X Chain Guides&#x20;


# Lending & Borrowing

The lending & borrowing platform is a decentralized, non-custodial, pool-based interest rates platform that enables users to supply assets to earn interest, and to borrow against them to unlock liquidity, similar in nature to Aave, Compound, and other pool-based protocols.

The platform runs natively on the NEAR blockchain, a layer 1, proof-of-stake, sharded blockchain with a WebAssembly runtime. The protocol's smart contracts are written in Rust.

The protocol aims to unlock liquidity for interest-bearing assets, particularly layer 1 staking derivatives such as stNEAR and stETH. For instance, users will be able to deposit stNEAR as collateral, then borrow more NEAR to create a leveraged staking position, or borrow a stablecoin to create a self-repaying position.

Access the app at: <https://lending.rhea.finance/>

[<br>](https://docs.burrow.finance/product-docs/introduction/audits-and-risks)


# Audits & Risks

## Audits <a href="#audits" id="audits"></a>

The Lending & Borrowing Platform has undergone two smart contract audits by the independent auditing firm [BlockSec](https://www.blocksecteam.com/) between February and March of 2022.

For the full reports, see below:

* [Security Audit Report by BlockSec, February 2022 ](https://github.com/NearDeFi/burrowland/blob/main/blocksec-audit-signed-1.pdf)
* [Security Audit Report by BlockSec, March 2022](https://github.com/NearDeFi/burrowland/blob/main/blocksec-audit-signed-2.pdf)

Audits, though a good practice to maintain security standards and minimize potential risks, are not an end-all-be-all when it comes to protocol security. The completed audit of specific contracts does not equate to the security of the entire protocol and does not relate to other layers of risk such as runtime pricing or the human influence on protocols. Moreover, security does not mean the elimination of risk inherent in financial products: always do your own research and manage risk appropriately.

## Risks <a href="#risks" id="risks"></a>

Although we take a multitude of safety precautions and the contracts have been audited, participating in DeFi comes with certain risks. Below is a list of potential risks associated with using the protocol.

## **Smart Contracts Risks**

While our smart contracts have been audited by third-party firms, they could theoretically have vulnerabilities.

## **Liquidation**

Assets that are deposited or borrowed on the protocol could fluctuate in value due to the systemic risks of the issuing platforms or market volatility, including the loss of peg of certain pegged assets. This could result in the [liquidation](https://docs.burrow.finance/product-docs/introduction/audits-and-risks#liquidation-risks) or closing of a user's position.

## **Bad Debt**

The risk of debt accrued by underwater positions in case liquidators do not liquidate in time during a period of high market volatility.

While we do our best to eliminate all the possible risks, DeFi is an industry where events that no one predicted can occur(the dreaded black swans). So please don’t invest your life savings, or risk assets you can’t afford to lose. Try to be as careful with your funds as we are with our code. [😊](https://emojipedia.org/smiling-face-with-smiling-eyes/)


# Supplying

## Introduction

Users can supply assets to the protocol and immediately begin earning passive interest. The [interest rates](https://app.gitbook.com/o/-MhIAeiN1ghyR-ugLhMu/s/-MhIB0bSr6nOBfTiANqT-2910905616/~/changes/141/products/guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model) are variable and will fluctuate based on the utilization rate for the given asset.

Users can withdraw their supplied assets at any time, as long as the utilization rate for the asset will be less than 100% after the withdrawal. If the withdrawal will raise the utilization rate to 100%, the withdrawal will be temporarily unavailable (note: if this does occur, it will be a very expensive situation for borrowers, and lucrative for suppliers)

Users can also designate a percentage of their supplied assets as collateral. Assets not designated as collateral will not be subject to liquidation and will continue to accrue interest. Users can manage which assets are designated as collateral (and what percentage of each asset) at any time.

#### Supported Assets <a href="#supported-assets" id="supported-assets"></a>

* NEAR
* STNEAR
* LINEAR
* NearX
* AURORA
* WOO
* ETH
* wBTC
* USDC
* USDT
* DAI
* USN
* BRRR


# Borrowing

## Introduction

Users can borrow against their supplied assets. All positions must be over-collateralized. If the value of a user's collateral drops below the minimum collateral ratio, their collateral will be liquidated to pay off their debt.

On the borrowing platform, each asset has a unique minimum collateral ratio, as each asset carries unique risk. The collateral ratios of each asset can be found here

The aggregate risk of an account can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

To learn more about how the health factor is calculated, click here


# APY

## Introduction <a href="#introduction" id="introduction"></a>

\
Annual Percentage Yield (APY) is the compounding interest on a deposit or a loan after a year, calculated based on the initial principal. Each asset has its own market of supply and demand with its own APY that evolves with time. You may find more details about Burrow's interest rate model [here](/near-chain-guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model)

## Supply APY <a href="#supply-apy" id="supply-apy"></a>

Supply APY is the current interest APY of the asset when you supply. Each asset has a different set of parameters that determines its actual yield at different points. You may find more details about the  interest rate model [here](/near-chain-guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model).

When you supply, you may get liquidity mining rewards like BRRR, USN, or other tokens. As a result, the actual supply APY may be higher.

## Borrow APY

Borrow APY is the current interest APY of the asset when you borrow. Each asset has a different set of parameters that determines its actual yield at different points. You may find more details about the interest rate model [here](/near-chain-guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model).

When you borrow, you may get liquidity mining rewards. As a result, the actual borrow APY may be lower.


# Health Factor

## Introduction <a href="#introduction" id="introduction"></a>

Users can borrow against their supplied assets. All positions must be over-collateralized. The risk of a position can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

## Computation <a href="#computation" id="computation"></a>

The Health Factor is computed per account instead of per asset.

Each asset has a configuration value `collateral_factor` which indicates the expected price stability factor.

The higher the factor, the higher expectation of the stability of the price of the corresponding asset.

To compute the current health factor for the account, we need to know the current prices of all collateral and borrowed assets.

Firstly, we compute the adjusted sums of all collateral assets and borrowed assets.

`adjusted_collateral_sum = sum(collateral_i * price_i * collateral_factor_i) adjusted_borrowed_sum = sum(borrowed_i * price_i / collateral_factor_i)`

Now we can compute the health factor:

`health_factor = adjusted_collateral_sum / adjusted_borrowed_sum`

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

In the Lending & Borrowing smart contracts, `collateral_factor` is also named `volatility_ratio`

## Example <a href="#example" id="example"></a>

Account `alice.near` supplied to collateral `1000 wNEAR` and borrowed `4000 nDAI`.

Let's say (note: the numbers are hypothetical for illustration purposes only):

* the price of `wNEAR` is `10`
* the price of the `nDAI` is `1`
* the `collateral_factor` of `wNEAR` is `0.5`
* the `collateral_factor` of `nDAI` is `1`

The health factor of `alice.near` is the following:

* `adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 5000 / 4000 = 125%`


# LP as Collateral

Increase the capital efficiency of LP assets!

LP tokens are no longer limited to farming, they can also be supplied to Burrow as collateral to borrow other assets at the same time.

## **Use Case** <a href="#use-case" id="use-case"></a>

When capital is tight and you want to both retain LP income and borrow other assets, you can use LP as collateral.

## LP Price <a href="#lp-price" id="lp-price"></a>

The price of LP is ensured by Ref's contract. The Burrow contract will automatically fetch the price from the Ref contract during on-chain operations to ensure real-time accuracy.

## Separate position <a href="#separate-position" id="separate-position"></a>

From a security perspective, LP Collateral positions are independent. Each LP token type has its own separate position. When borrowing other assets, users need to select the collateral position they wish to use.

\ <br>


# How Lending & Borrowing works


# Health Factor

## Introduction <a href="#introduction" id="introduction"></a>

Users can borrow against their supplied assets. All positions must be over-collateralized. The risk of a position can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

## Computation <a href="#computation" id="computation"></a>

The Health Factor is computed per account instead of per asset.

Each asset on Burrow has a configuration value `collateral_factor` which indicates the expected price stability factor.

The higher the factor, the higher expectation of the stability of the price of the corresponding asset.

To compute the current health factor for the account, we need to know the current prices of all collateral and borrowed assets.

Firstly, we compute the adjusted sums of all collateral assets and borrowed assets.

`adjusted_collateral_sum = sum(collateral_i * price_i * collateral_factor_i) adjusted_borrowed_sum = sum(borrowed_i * price_i / collateral_factor_i)`

Now we can compute the health factor:

`health_factor = adjusted_collateral_sum / adjusted_borrowed_sum`

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

> In lending & borrowing smart contracts, `collateral_factor` is also named `volatility_ratio`

Example\ <a href="#computation" id="computation"></a>
-----------------------------------------------------

Account `alice.near` supplied to collateral `1000 wNEAR` and borrowed `4000 nDAI`.

Let's say (note: the numbers are hypothetical for illustration purposes only):

* the price of `wNEAR` is `10`
* the price of the `nDAI` is `1`
* the `collateral_factor` of `wNEAR` is `0.5`
* the `collateral_factor` of `nDAI` is `1`

The health factor of `alice.near` is the following:

* `adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 5000 / 4000 = 125%`


# Interest Rate Model

The platform uses a compounding interest model similar to [Aave](https://docs.aave.com/risk/liquidity-risk/borrow-interest-rate).

Each asset defines interest rate configuration with the following values:

* `target_utilization` - the utilization rate targeted by the model, e.g. 80% borrowed comparing to the total supplied.
* `target_utilization_r` - the constant to use as a base for computing compounding APR at the target utilization.
* `max_utilization_r` - the constant to use as a base for computing compounding APR at the 100% utilization.
* `reserve_ratio` - the percentage of the acquired interest reserved for the platform.

Based on these values we define 3 points of utilization: `0%`, target utilization and `100%`. For each of these points we have the `r` constant: `1.0`, `target_utilization_r` and `max_utilization_r` respectively.

To compute the APR, we can use the following formula:

`1 + APR = r ** MS_PER_YEAR`, where MS\_PER\_YEAR is the number of milliseconds in a year equal to `31536000000`.

Based on the current supplied, reserved and borrowed balances, the current utilization is defined using the following formula:

`utilization = borrowed / (supplied + reserved)`

To compute the current APR, we need to find the current `r` constant based on the linear interpolation between utilization points:

* if `utilization <= target_utilization`, `r = target_utilization_r * (utilization / target_utilization)`
* if `utilization > target_utilization`, `r = target_utilization_r + (max_utilization_r - target_utilization_r) * (utilization - target_utilization) / (1 - target_utilization)`

To calculate the amount of interest acquired for the duration of `t` milliseconds, we can use the following formula:

`interest = (r ** t) * borrowed`

The interest are distributed to `reserved` and `supplied`, based on `reserve_ratio`, so the new values are: `reserved_interest = interest * reserve_ratio new_reserved = reserved + reserved_interest new_supplied = supplied + (interest - reserved_interest) new_borrowed = borrowed + interest`


# Liquidations

## Introduction

A liquidation is triggered when an account's Health Factor goes below 100%, due to its collateral value not being sufficient to cover the debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value.

Burrow's liquidation mechanism is designed to make liquidators compete for the profit that they make during liquidations to minimize the loss taken by unhealthy accounts. This is achieved by introducing a variable discount with variable liquidation size, Instead of offering a fixed profit that is used in other protocols.

## Liquidation rules <a href="#liquidation-rules" id="liquidation-rules"></a>

Liquidations on Burrow follow 3 basic rules:

1. The initial health factor of the liquidated accounts has to be below 100%
2. The discounted sum of the taken collateral should be less than the sum of repaid assets
3. The final health factor of the liquidated accounts has to stay below 100%

The first rule only allows liquidating accounts in an unhealthy state. The second rule prevents from taking more collateral than the repaid sum (after discount). The third rule prevents the liquidator from repaying too much of the borrowed assets, only enough to bring closer to the 100%.

A liquidation action consists of the following:

* `account_id` - the account ID that is being liquidated
* `in_assets` - the assets and corresponding amounts to repay form borrowed assets
* `out_assets` - the assets and corresponding amounts to take from collateral assets

The discount is computed based on the initial health factor of the liquidated account:

`discount = (1 - health_factor) / 2`

Now we can compute the taken discounted collateral sum and the repaid borrowed sum:

* `taken_sum = sum(out_asset_i * price_i)`
* `discounted_collateral_sum = taken_sum * (1 - discount)`
* `repaid_sum = sum(in_asset_i * price_i)`

Once the action is completed, we can compute the final values and verify the liquidation rules:

1. `health_factor < 100%`
2. `discounted_collateral_sum <= repaid_sum`
3. `new_health_factor < 100%`

## Liquidation example

Account `alice.near` supplied to collateral `1000 wNEAR` and borrowed `4000 nDAI`.

Let's say (note: the numbers are hypothetical for illustration purposes only):

* the price of `wNEAR` is `10`
* the price of the `nDAI` is `1`
* the `collateral_factor` of `wNEAR` is `0.5`
* the `collateral_factor` of `nDAI` is `1`

The health factor of `alice.near` is the following:

* `adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 5000 / 4000 = 125%`

Let's say the price of `wNEAR` drops to `8`

* `adjusted_collateral_sum = sum(1000 * 8 * 0.5) = 4000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 4000 / 4000 = 100%`

The health factor is 100%, so the account still can't be liquidated.

Let's say the price of `wNEAR` drops to `7`

* `adjusted_collateral_sum = sum(1000 * 7 * 0.5) = 3500`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 3500 / 4000 = 0.875 = 87.5%`

The health factor is below 100%, so the account can be liquidated. The discount is the following:

`discount = (1 - 0.875) / 2 = 0.0625 = 6.25%`

It means anyone can repay some `nDAI` and take some `wNEAR` from `alice.near` with `6.25%` discount.

Account `bob.near` decides to liquidate `alice.near`

`bob.near` wants to repay `1000 nDAI`, we can compute the maximum sum of the collateral to take:

* `repaid_sum = sum(1000 * 1) = 1000`
* `max_taken_sum = repaid_sum / (1 - discount) = 1000 / (1 - 0.0625) = 1066.666`

And based on the `wNEAR` price, we can compute the maximum amount:

`max_wnear_amount = max_taken_sum / wnear_price = 1066.666 / 7 = 152.38`

But to avoid risk, `bob.near` takes `152` `wNEAR` - a bit less to avoid price fluctuation for the duration of the transaction.

Let's compute the liquidation action:

* `taken_sum = sum(out_asset_i * price_i) = sum(152 * 7) = 1064`
* `discounted_collateral_sum = taken_sum * (1 - discount) = 1064 * (1 - 0.0625) = 997.5`
* `repaid_sum = sum(in_asset_i * price_i) = sum(1000 * 1) = 1000`
* `new_adjusted_collateral_sum = sum((1000 - 152) * 7 * 0.5) = 2968`
* `new_adjusted_borrowed_sum = sum((4000 - 1000) * 1 / 1) = 3000`
* `new_health_factor = 2968 / 3000 = 0.9893 = 98.93%`

Now checking the liquidation rules:

`1. 87.5% < 100% 2. 997.5 <= 1000 3. 98.93% < 100%`

All rules were satisfied, so the liquidation was successful.

Now, let's compute the profit of `bob.near` (or the loss for `alice.near`) for this liquidation:

`profit = taken_sum - repaid_sum = 1064 - 1000 = 64`

Notes:

* During the time when the price of `wNEAR` was falling from `8` to `7`, if someone liquidated `alice.near`, they would have made less profit, by liquidating a smaller amount with a smaller collateral discount.
* To fully realize the profit, `bob.near` has to make another transaction to swap received `152` `wNEAR` for `nDAI`, which may involve extra fees and transactional risks. That's why liquidators may wait for higher discount.

## Liquidation Bot <a href="#liquidation-bot" id="liquidation-bot"></a>

You can find an example liquidation bot [here](https://github.com/NearDeFi/burrowland-liquidation-bot).<br>


# Oracle

## Price Oracle <a href="#price-oracle" id="price-oracle"></a>

The platform uses a MakerDAO-inspired whitelisted oracle. The oracle currently has five independent operators and may be easily extended into a decentralized, self-sustainable network. For a price to be reported on-chain, the majority of oracles must propose the current price within a tight range.

Relevance of the price is less than 1 minute.

In the future, the DAO will consider adding other robust oracle solutions supported on NEAR, such as Flux.

The oracle code can be found here:

* [Smart Contract](https://github.com/NearDeFi/price-oracle)
* [Price Updater Bot](https://github.com/NearDeFi/near-price-oracle-bot) (system service)

### Pyth Oracle <a href="#pyth-oracle" id="pyth-oracle"></a>

The [Pyth Network](https://pyth.network/) is a first-party financial data oracle network that delivers low-latency price data for various assets to blockchains securely.

The Pyth protocol aggregates the data providers' inputs to produce a single aggregate price and confidence interval every 400ms for each price feed. This aggregation mechanism lives on an application-specific blockchain called Pythnet.

Pyth Network introduces a unique architecture called the Pull Oracle. With the Pull Oracle design, data users can “pull” or request a price update from the Pyth protocol when needed.

Learn more, refer to the [Pyth documentation](https://docs.pyth.network/home).<br>


# Lending & Borrow Market Limits

## Supply Cap & Borrow Cap

The following table outlines the current supply and borrow caps for all assets listed on the RHEA Finance lending market.

<table data-header-hidden><thead><tr><th width="171">Symbol</th><th>Name</th><th width="187">Supply Cap (Current)</th><th>Borrow Cap (Current)</th></tr></thead><tbody><tr><td>Symbol</td><td>Name</td><td>Supply Cap (Current)</td><td>Borrow Cap (Current)</td></tr><tr><td>USDC</td><td>USDC</td><td>60,000,000</td><td>54,000,000</td></tr><tr><td>WBTC</td><td>Wrapped BTC</td><td>15</td><td>6</td></tr><tr><td>DAI</td><td>Dai Stablecoin</td><td>500,000</td><td>300,000</td></tr><tr><td>FRAX</td><td>Frax</td><td>1,000,000</td><td>900,000</td></tr><tr><td>USDC.e</td><td>Bridged USDC</td><td>1,000,000</td><td>900,000</td></tr><tr><td>AURORA</td><td>Aurora</td><td>200,000</td><td>180,000</td></tr><tr><td>USDT.e</td><td>Tether USD</td><td>1,500,000</td><td>1,350,000</td></tr><tr><td>ETH</td><td>Ether</td><td>200</td><td>30</td></tr><tr><td>LINEAR</td><td>LiNEAR</td><td>20,000,000</td><td>18,000,000</td></tr><tr><td>rNEAR</td><td>Rhea Liquid Near Staking Token</td><td>12,000,000</td><td>8,000,000</td></tr><tr><td>STNEAR</td><td>Staked NEAR</td><td>12,000,000</td><td>10,800,000</td></tr><tr><td>NBTC</td><td>Near WBTC</td><td>20</td><td>3</td></tr><tr><td>LP-4179</td><td>LP-4179</td><td>10,000</td><td>9,000</td></tr><tr><td>USDt</td><td>Tether USD</td><td>60,000,000</td><td>54,000,000</td></tr><tr><td>wNEAR</td><td>Wrapped NEAR fungible token</td><td>10,000,000</td><td>1,000,000</td></tr><tr><td>XRHEA</td><td>xRhea</td><td>100,000,000</td><td>30,000,000</td></tr><tr><td>ZEC</td><td>Zcash</td><td>20,000</td><td>5,000</td></tr></tbody></table>

<br>


# Step by Step Guide

## Supply

Step 1: Access <https://lending.rhea.finance/> and connect your wallet

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

Step 2: Select one asset from the list and click “Supply”

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

Step 3: Enter your desired number and turn on “Use as Collateral” (Optional)

<div data-full-width="false"><figure><img src="/files/dtzvHeKqkEOp9oUXeSYr" alt="" width="375"><figcaption></figcaption></figure></div>

Step 4: Supply and sign the transaction

<figure><img src="/files/siizd38gCVsOLb1ZweAL" alt="" width="352"><figcaption></figcaption></figure>

## Borrow

Make sure you have already supplied your asset (and turned on Use as collateral button) first before borrowing.

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

Step 1: Select a token you want to borrow

I will borrow $DAI using $USDT as collateral in this situation

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

Step 2: Choose an appropriate amount

<figure><img src="/files/yBhTpe48NqgvONW82Io8" alt="" width="375"><figcaption></figcaption></figure>

Step 3: Verify all the details and confirm the transaction

### Repay

Step 1: Click on Repay Button

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

Step 2: Enter an appropriate amount&#x20;

<figure><img src="/files/eDXvByDunmTysrCji1Ll" alt="" width="375"><figcaption></figcaption></figure>

Notice that Health Factor changes every time you increase/decrease the repayment amount

Step 3: Confirm the transaction

### Withdraw

Step 1: Click the [Dashboard](https://lending.rhea.finance/dashboard) button & choose the token you wish to withdraw

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

Step 2:  Choose an appropriate amount

<figure><img src="/files/nGRhAybclsk9GFtwtfac" alt="" width="375"><figcaption></figcaption></figure>

Step 3: Verify the details and confirm your transaction

### Adjusting collateral

Step 1: Select the token and click "Adjust" button

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

Step 2: Enter an appropriate amount&#x20;

Keep an eye on your Health Factor since it will adjust following your collateral position

<figure><img src="/files/33doXa58VMkO47GN0rHB" alt="" width="375"><figcaption></figcaption></figure>

Step 3: Confirm the transaction


# Liquidity Pools


# Adaptive Liquidity Market Maker (ALMM)

Adaptive Liquidity Market Maker (ALMM) aim to enhance the trading experience by providing minimal swap price impact on volatile pools.

These pools are seeded with one volatile and one stable asset or two volatile assets but they employ the [Stableswap AMM](https://guide.ref.finance/products/overview/pooling#stablepool) instead of the Constant Product one. This choice enables traders to achieve an unparalleled efficiency as they can swap one asset for another at a 1:1 dollar ratio with little to no price impact.

In standard market conditions, ALMM are expected to gather a much higher trading volume than their standard counterparts.

#### ALMM Example <a href="#gitbookdegenpool-example" id="gitbookdegenpool-example"></a>

Assume there are two XYZ/USDC pools. One uses the Constand Product AMM and the other, the ALMM, uses the Stableswap AMM. Assume the pool TVL is $ 2 mln and that XYZ trades at 10 USDC.

A trader that wants to swap 50,000 USDC for XYZ would receive 4,762 XYZ by swapping in the standard pools and approximately 5,000 XYZ by swapping in the ALMMM. The higher swap efficiency of the ALMM amounts to 5% (5,000 / 4,762 -1 ) in this specific case, without considering swap fees.

#### ALMM Risk factors <a href="#gitbookdegenpool-riskfactors" id="gitbookdegenpool-riskfactors"></a>

Liquidity providers (LPs) that deposit capital in ALMM must be aware of the following risk factors:

* **Impermanent loss:** ALMM can expose LPs to a much higher impermanent loss compared to standard pools. This is because allowing traders to swap at a 1:1 dollar ratio could quickly deplete liquidity of either asset in case of large trading volume.
* **Oracle risk**: ALMMs use external oracle price feeds for the prices of the tokens traded in the pool. An oracle malfunctioning could result in incorrect price feeds which could result in losses to liquidity providers.


# Concentrated Liquidity Market Maker (CLMM)

Concentrated Liquidity Market Maker (CLMM) was built based on the Discretized Concentrated Liquidity (DCL) pool, initially founded by Izumi Team.

Here, we discuss some concepts and behaviors that are important for users and researchers to have a better understanding of ref-v2.

## From Price to Point

In a pool with two types of tokens, like token X and token Y, the price tells you how many of token Y you need to give to get one of token X. If we take an example of a pool with wnear and usdt, and say the price is 4.05 USDT for one wnear, that's what we call the **decimal price**.

Now, there's also something called the **undecimal price**. Since wnear and usdt don't have the same number of decimal places (wnear has 24 and usdt has 6), we have to adjust the price by taking into account these decimals. The price now  comes to **4.05 \* 106 / 1024**

Next, comes the important part. We need to map this continuous price into a discrete one (what we call ***price point*** or just ***point***), in a way that lets 1.0001 \*\* ***point*** be the price splitter. Practically, we limit point in a \[-800,000, 800,000) range, which can represent an undecimal price range of 1.81e-35 to 6.52e+34, that is 1.81e-17 to 6.52e+52 decimal price range in that wnear<>usdt pool.

Now, each point represents a very small price range, and we use the exact price computed from that point to be the fixed price when swapping in this range, which we call a ***constant sum formula*** model. For example, in the previous pool, point -400520 represents a price range of \[4.041169… , 4.041573…). And when swapping in this small range, we take 4.041169… as a fixed swap price.

In a word, we map continuous prices into small ranges of points. For the curve comprised of those points, we take the classic constant production formula for swap. But in those small ranges, we take a constant sum formula for swap.

## From Point to Slot, From Slot to Bin

For those tokens with strong correlation, even a very small price movement will reflect a major change in market. So we allow users to mint liquidity, and place orders on each point.

But for those pool that hold weak correlation even non-correlation tokens, the market price vary frequently and drastically. To get a better performance, we group ***points*** into ***slots***, and only allow users to mint liquidity or place orders on those slot borders.

For example, let’s say take 40 points per slot in the previous wnear-usdt pool, we have three conjunctive slot borders -400560, -400520, -400480, they represent three conjunctive human-readable prices: 4.025040, 4.041574, 4.057366. And the current point is -400498, which means a price of 4.050069. Then If Alice wants to place an order that is just one step over the current price, she can only choose 4.057366. Or to place an order one step below the current one, that would be 4.041574. Seems complex? Don’t worry, our frontend will take care of all this stuff for users. They can just simply click up or down to have a small adjustment of price.

Furthermore, we associate pool fee policy (we call it fee-tier) with the slot. There are 4 fee tiers on REF-V2:

* 0.01% fee rate and 1 point per slot (suitable for stable coins swap pool);
* 0.04% fee rate and 8 points per slot;
* 0.2% fee rate and 40 points per slot;
* 1% fee rate and 200 points per slot;

However, the number of slots for a liquidity pool is still too many, we further group the ***slots*** into ***bins***, and users on Ref UI can only mint liquidity or place orders on bin borders.

## Three Roles And What They Are Capable Of

1. **Liquidity provider**, classic maker, passive party in trade, with swap fee income;
2. **Order owner**, one-way maker, passive party in trade, no swap fee income;
3. **Swapper**, taker, and active party in trade need to pay a swap fee according to the fee tier of the pool;

### Swapper

On ref-v2, the user can directly initiate a swap from token contracts through their ***ft\_transfer\_call*** interface. We support chained swaps, which means the user can swap A to C in a chained way (A→B and B→C) in one TX. The swapped-out token would be auto-transferred back to the user’s wallet and furthermore, all wnear would be unwrapped to near when transferred back to the user.

There are 3 swap modes for the user to choose.

* Normal Swap, support chained swap, swap all token-in into token-out;
* Swap by Output Amount, support chained swap, swap to get given amount of token-out;
* Swap with a Stop Point, only on the single pool, swap all token-in or part of it if the point goes to the stop limit.

For the swap of any point, we always consume orders first and then the liquidity. Liquidity Provider won’t complain about it, cause all swap fee (excluding those that go to protocol), including those generated on swapping of those orders, goes to LP.

### Order Owner

Here, order means limit order. It is a kind of one-way liquidity. A selling order is an order that is placed on a point equal to or above the current point, to sell token X for Y with the price on that point. On the contrary, a buying order is an order that sells token Y for X on a point equal to or below the current point. Just a kind reminder, we have talked it through that orders can only placed at slot borders.

We say the order is one-way liquidity, which means, let’s look at a selling order, if the current price passes the order point from left to right, we ensure this order will be fulfilled and the earned token Y won’t go back to token X even if current price drop back to the left of order point again.

There is a possibility that a race condition would come up. As a contract aggregates all user orders at the same point into one point order, it can NOT tell whose user order is filled and whose not when the point order is partially filled. In this case, order owners come to a race condition that obeys to a first-claim-first-get policy.

If user places a selling order on a point below the current point or a buying order on a point above the current point, we would first try to do a swap-with-stop-point action and if there is any amount left, then an order with the remaining amount would be established. But need to notice, that a swap fee would be charged on swap action.

As a passive party of trader, the earned token won’t auto transfer to the order owner’s wallet, they need to call a claim interface to explicitly harvest their earnings. Currently, this claim interface is combined with the cancel interface, where you put a 0 as cancel amount, which means a pure claim action.

Order owner can cancel / partially cancel his order, and as we just said, it will be claimed internally before trying to cancel. So, it is possible the order has been fulfilled or the remaining amount is less than the requested cancellation amount. But don’t worry, it won’t cause any trouble, we will try to cancel as many as you requested.

User may get some token X or Y back after canceling, an order earning a refund from cancel, or both. Those tokens would directly transfer to user’s wallet.

To save contract storage, we have some limits on the contract level. Each user can only have a maximum of 64 active orders in total. An active order means it still has remaining tokens waiting to sell. Users can either wait for it to be fulfilled or cancel all remaining to save room for new orders. Those non-active orders will go to the user’s history order list. Likewise, the contract only stores the latest 16 history orders per user. But user can fetch all history through our centralized data service.

### Liquidity Provider

User mints liquidity with a range, which is one or several slots. Here we use the word mint, it implies that liquidity is a kind of NFT in REF-V2, but user are free to modify their liquidity NFT by adding or removing its amount.

Only liquidity providers would get benefits from swap fee. Those swap fees in the form of tokens X or Y, won’t go back to pool liquidity. They just stand there waiting for LP to claim, like order earnings but without any race condition in liquidity fee.

The add and remove actions, just like order, would imply an internal claim fee action. And to remove zero amount of liquidity means a pure claim too.

No matter whether to add or remove liquidity, the user may get some token X or Y back, a swap fee income, a refund from removal, or both. Those tokens would directly transfer to user’s wallet.

## About Fee

Although we may have touched on this topic in previous chapters, it is better to have a dedicated chapter to discuss fees.

Basically, we only charge swap fees from those swappers (active party of swap). In other words, we only have a fee for the taker. The fee would be charged in the form of a token-in. For example, on a 0.2% fee pool, when the swapper starts a swap of 100 token-in, he actually uses 99.8 to do the swap, and the 0.2 left is the fee we charged.

For those fees charged, we split them between liquidity in that swap range and protocol. Currently, the share ratio is 50%. This means a 0.2% fee pool, liquidity got 0.1% and the protocol got another 0.1%.

For those fees belonging to liquidity, LP should explicitly call the claim interface to get them back to wallets. If this liquidity has been transferred to a new owner, then the original owner lost all unclaimed fees.


# Classic Pools

"Classic" Liquidity Pools

Classic pools are based on the Uniswap v2 algorithm. They are fully permissionless, meaning that anyone can create a classic pool, and set the fee for that pool.

## Adding liquidity to a Classic Pool

### 1. Go to the Classic Pools tab on the Liquidity Pools page

The Liquidity Pools page can be found in the top menu under "Earn"

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

Make sure you are on the "Classic Pools" tab.&#x20;

<figure><img src="/files/8cOKIGKqSf4cDCLMqsGv" alt=""><figcaption></figcaption></figure>

### 2. Locate a specific pool

There's a search box to filter pools by token, and check boxes to filter by characteristics, such as pools with Farms

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

Incentivized pools have a "Farms" tag next to their token pairs, and those with multiple reward tokens will include a special icon within the tag.&#x20;

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

### 3. Open the "Details" page for a pool&#x20;

Clicking on a pool on the Pools page opens that pool's "Details" page. The pool's Details page shows, well, details about the pool, like the current and historical TVL and 24-hour volume. The pool's Details page also includes an "Add Liquidity" button to open the form for depositing tokens into the pool.

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

The pool's Details page has an "Add Liquidity" button that, when clicked, will open the form for depositing tokens into the pool. If you currently have liquidity in the pool, the button will be named simply "Add", and there will be a "Remove" button next to it.&#x20;

<figure><img src="/files/GIuevMGeQnpT8Xt8Idva" alt="" width="494"><figcaption></figcaption></figure>

<figure><img src="/files/T4yhNhhTvskUzdXiuTO6" alt="" width="497"><figcaption></figcaption></figure>

### 4. Use the Add Liquidity form to add tokens to the pool

After clicking the the "Add Liquidity" button on the pool's Detail page, the Add Liquidity Form will open. Use this form to enter the amount of tokens you want to deposit. The amounts must be in the same proportion as the balance of the pool at that point in time. When you enter an amount for one token, the form will automatically set the proper amount for the second token. You must have **both** tokens in your wallet to add liquidity to a classic pool.

If you click on the numbers to the text "Balance", the form will automatically enter the balanced amount of that token that is maxed in your wallet.&#x20;

<figure><img src="/files/6sPCqnsJRASJtaJhSu4r" alt="" width="375"><figcaption></figcaption></figure>

Click "Pool Stats" at the bottom of the Add Liquidity form to see details about the pool, including the balance of tokens, and the fee for swaps that take place on that pool.

<figure><img src="/files/xU0HlYMiWePGmqyLIbDp" alt="" width="375"><figcaption></figcaption></figure>

## Removing liquidity from a pool

### 1. Go to the Your Liquidity page

You can see all pools you have liquidity in by going to the Your Liquidity page. You can get to the Your Liquidity page by clicking Earn > Your Liquidity in the main menu of the site.&#x20;

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

### 2. Unstake shares from a farm, if necessary

If your shares are staked on a farm you must unstake them before you can remove your liquidity from the pool. If only some shares are staked, you will be able to remove the liquidity for the unstaked portion. See [Farming](/near-chain-guides/liquidity-pool-farming) for more details about staking and unstaking shares.

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

### 3. Use the Remove Liquidity form to withdraw tokens from the pool

After clicking the Remove button, the Remove Liquidity form will appear. You can enter an amount of shares to remove, or click the "MAX" button to remove the liquidity for all your shares.

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

Increase the slippage tolerance If you receive slippage related errors when attempting to remove liquidity from a pool. This may be necessary if there are a lot of swaps occurring on the pool at that time, especially if the pool does not have a lot of liquidity in it.

## Creating a new Classic pool

There are several reasons why you may want to create a new Classic pool on Ref Finance:

1. A pool with the token pairs does not currently exist.
2. A pool with the token pairs exists, but you believe their fees are too high or too low.
3. A pool with the token pairs exists, but you believe the ratio of the token pairs (Amount of Token A / Amount of Token B) is not accurate.

### 1. Click the "Create Pool" button on the Pools page.

The Liquidity Pools page can be found in the top menu under "Earn". Make sure you are on the "[Classic Pools](https://dex.rhea.finance/pools?activeTab=classic)" tab.&#x20;

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

### 2. Use the "Create New Pool" form to configure the new pool

After clicking the "Create Pool" button on the Pools page, the "Create New Pool" form will open. Select the token pairs, enter the total fee for the pool, and then click the "Create" button. You will be able to add liquidity to the pool after it is created. Once a pool is created, the fee cannot be changed.&#x20;

To set the total fee, click on one of the three predefined fees (0.20%, 0.30%, 0.60%), or use the text box to enter any value from 0.01% to 19.99%.

<figure><img src="/files/D1wH8taDP9PjhTVLUnkR" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="/files/0RCgdNVpcsGKlCuFAEzl" alt="" width="375"><figcaption></figcaption></figure>

When trades occur on a Classic pool, 80% of the total fee will be shared among liquidity providers, while the remaining 20% will go toward the Protocol fee and/or Referral fee.&#x20;

### 3. Deposit tokens into the newly created Pool

After the new pool is created, you will be taken to the pool's Details page. Since this pool has just been created, all values are set to zero.

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

### 4. Use the Add Liquidity form to add tokens to the new pool

Just like when [adding liquidity to an existing pool](#4.-use-the-add-liquidity-form-to-add-tokens-to-the-pool), you click the Add Liquidity button on the new pool's Details page to open the Add Liquidity form. The only difference between adding liquidity to a newly created pool vs an existing one, is that for newly created pools, you can set any amount to deposit for both tokens. The amounts you choose will determine the starting ratio of the tokens. This ratio will change whenever a trade takes place on the pool.&#x20;

It is recommended that you do your own research before deciding on the initial balance of a pool. Choosing an incorrect amount can result in a significant loss of funds within seconds of your initial deposit, as arbitrage bots take advantage of the difference between your pool's token balance and those on existing pools, exchanges, or prices on other types of trading services.&#x20;


# Stable & Rated Pools

Stable pools, which can contain two or three tokens, use Curve's StableSwap algorithm. Rated pools are for yield-bearing tokens, and are based on a variation of Curve's StableSwap algorithm.

## How to add liquidity to a Stable or Rated Pool

### 1. Go to the Stable Pools tab on the Liquidity Pools page

The Liquidity Pools page can be found in the top menu under "Earn"

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

Make sure you are on the "Stable Pools" tab.&#x20;

### 2. Locate a specific pool

There's a search box to filter pools by token, and sub-tabs to filter by type of pool.&#x20;

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

"USD" pools are stable pools where all tokens are pegged to the US dollar. BTC are pools where both tokens are pegged to Bitcoin. "NEAR" are Rated pools where one of the tokens is wNEAR, and the second is a a yield-bearing, or "liquid staking", token like STNEAR, NEARX, and LINEAR.

Incentivized pools have a "Farms" tag next to their token pairs, and those with multiple reward tokens will include a special icon within the tag.&#x20;

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

### 3. Open the page for the Stable or Rated pool&#x20;

Clicking on a Stable or Rated pool on the Pools page will open a page with tabs to Add or Remove liquidity

<figure><img src="/files/YcSDYQ3xzPi6jfgFViKe" alt="" width="375"><figcaption></figcaption></figure>

### 4. Enter the amounts to deposit

You have three choices when adding liquidity to a Stable or Rated pool. You can deposit any amount of one or more of the pool tokens, deposit amounts that are in the same proportion as the current balance of the pool, or deposit all the tokens in your wallet for that pool.&#x20;

<div align="center"><figure><img src="/files/UFlIGqhLISu8RLYDUUwR" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/gHWluiFrjk4sGIWaesbo" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/TgUeOmCIf69JBf62Y6Zt" alt="" width="375"><figcaption></figcaption></figure></div>

Once you have entered the amounts you wish to add, click "Add Liquidity" to deposit the tokens. You will need to approve the transaction(s) on your wallet for the deposit to be made.&#x20;

## How to remove liquidity from a Stable or Rated pool

### 1. Go to the Your Liquidity page

You can see all pools you have liquidity in by going to the Your Liquidity page. You can get to the Your Liquidity page by clicking Earn > Your Liquidity in the main menu of the site.&#x20;

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

### 2. Unstake shares from a farm, if necessary

If your shares are staked on a farm you must unstake them before you can remove your liquidity from the pool. If only some shares are staked, you will be able to remove the liquidity for the unstaked portion. See [Farming](/near-chain-guides/liquidity-pool-farming) for more details about staking and unstaking shares.

<figure><img src="/files/Yun4HFDhAeuKCiZDVnjb" alt=""><figcaption><p>Pool shares are currently staked on a Farm and must be unstaked in order to remove tokens from the pool.</p></figcaption></figure>

### 3. Use the Remove Liquidity tab on the Stable or Rated pool

Clicking the Remove button on a Stable or Rated pool will take you to the Remove Liquidity tab on the pool's page.&#x20;

You have the option to remove your liquidity by Share, or by Token. If you remove by Share, you will get back amounts of all the tokens in the pool, proportional to the current balance of those tokens within the pool. If you remove by Token, you decide which tokens you will receive and at what amounts. The current balance of the tokens in the pool will determine how many shares the amounts you entered are worth.

<div><figure><img src="/files/vO07CJ4RtJsxM5V6Sphh" alt="" width="375"><figcaption><p>Removing tokens from a Stable pool by shares.</p></figcaption></figure> <figure><img src="/files/Xt4QRgjtS4Ug07orQBA5" alt="" width="375"><figcaption><p>Removing liquidity from a Stable pool by Token.</p></figcaption></figure></div>

Increase the Slippage Tolerance If you receive slippage related errors when attempting to remove liquidity from a pool. This may be necessary if there are a lot of swaps occurring on the pool at that time, especially if the pool does not have a lot of liquidity in it.


# RHEA v2 Pools

Pooling with RHEA v2's Discretized Concentrated Liquidity AMM

### Introduction

RHEA v2's Discretized Concentrated Liquidity (DCL) pools are based on [iZUMi Finance’s Discretized Liquidity AMM](#user-content-fn-1)[^1]. Each DCL Pool is divided into many separate bins, each of which represents a slightly different swap rate between the two tokens in the pool.&#x20;

When a Liquidity Provider (LP) deposits their assets in a DCL Pool, they select a range of swap rates for which their assets can be used for swapping. In other words, their liquidity is “concentrated” within a specific range of swap rates, which is then distributed among separate, or “discrete”, bins along that range. This differs from the pools in RHEA v1, where liquidity is evenly distributed throughout the curve of the constant product formula (x \* y = k).

<figure><img src="/files/i79EZvPqbT3HwzBWSsed" alt=""><figcaption><p>Liquidity Distribution in a DCL Pool</p></figcaption></figure>

To determine the swap rate, the exchange uses a virtual constant product curve, derived from the total liquidity in the pool and how it is distributed. When a swap takes place, the exchange identifies which bins to use for the transaction. It treats each bin as if it were a pool, and manages each one separately using a method based on the constant sum formula (x + y = z).

<figure><img src="/files/0XizfRBi6fytsNtOYNnS" alt=""><figcaption><p>Virtual vs Real Reserves in DL Pools</p></figcaption></figure>

When a swap takes place against a DCL pool, only the LPs with assets placed within bins utilised for the swap will receive a share of the swap fees, in proportion to their share of the liquidity within those bins. This differs from the pools in RHEA v1, where fees are shared among all LPs in proportion to their share of the liquidity within the entire pool. Another way RHEA v2 differs is that a LP’s share of the fees is immediately allocated to them, and are not part of the pool’s liquidity.

### Types of DCL Strategy

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

* **Uniform (Flat) Liquidity**: In this model, liquidity is distributed evenly across all price ranges. No matter what the current price is, the liquidity is the same for each price point. This is the simplest form of liquidity distribution and is used by some of the earliest AMMs. It's like spreading a fixed amount of resources across a battlefield evenly, without concentrating forces at any strategic point.
* **Normal (Bell Curve) Liquidity**: Here, liquidity is distributed according to a normal distribution, with most of it concentrated around a certain price, which is usually the current or the expected future price of the asset. The further away from this price, the less liquidity is available.
* **Skewed (Asymmetric) Liquidity**: In a skewed distribution, liquidity is not evenly distributed and is instead biased towards a certain price direction. A skewed distribution could look like a normal distribution that has been pushed to one side. This is akin to placing more soldiers on one flank of an army in anticipation of the main attack coming from that direction.<br>

### Risks with DCL Pools

The more concentrated a LP’s liquidity is (i.e. the smaller the range of swap rates they choose when they deposit), the higher their share of the fees will be when their liquidity is used for a swap, compared to how much they would have received had they spread their liquidity over a wider range. However, there is also increased risk. If the overall swap rate goes outside the bounds they have chosen, their entire position will be converted to the token that is decreasing in value relative to the other.&#x20;

For example, if a LP deposits USDC.e and NEAR within the range of 2.23572 - 2.730688 USDC.e/NEAR, and the value of NEAR drops below 2.23572 USDC.e, then their entire position will be converted to NEAR. If the value of NEAR goes above 2.730688 USDC.e, then their entire position will be converted to USDC.e.

<figure><img src="/files/HT42K2wLF3S2ZAXXS4vC" alt=""><figcaption><p>Price points at which a position is converted into one token. The more concentrated a LP’s liquidity is, the higher the risk that their entire position will be converted to the token whose value is decreasing relative to the other.  </p></figcaption></figure>

### Depositing Liquidity

To deposit liquidity in a DCL pool, first go to the "V2 Pools" tab on the Pools Page, click on a pool, and then click "Add liquidity".

<figure><img src="/files/mNJUETNhZUkEbuiPI8r5" alt=""><figcaption><p>DCL Pools are found in the "V2 Pools" tab of the Pools Page.</p></figcaption></figure>

<figure><img src="/files/cin6DuXXXIOd5F6I3qK4" alt=""><figcaption><p>The "Add Liquidity" button is on each pool's detail page. </p></figcaption></figure>

Choose a minimum and maximum rate that your assets can be used for swaps, and the amounts to deposit. There may be pools with multiple "Fee Tiers" to choose from. The higher the fee, the more you make from swaps that utilize your pool, but your pool is less likely to be selected for swaps than pools with lower fees.&#x20;

<figure><img src="/files/8kQF9hjofotsHc4yebI7" alt=""><figcaption><p>The Add Liquidity form for a DCL pool.</p></figcaption></figure>

### Claiming Swap Fees

With RHEA v2's DCL Pools, your share of the swap fees are immediately allocated to your account, and are not part of the pool’s liquidity. You can “claim” your share of the fees at any time, without removing any liquidity from the pool. However, adding or removing liquidity will automatically transfer any unclaimed tokens to your wallet. &#x20;

<figure><img src="/files/mL9ZhvX0lhIG97zqhi86" alt=""><figcaption><p>Clicking the "Claim" button will transfer your share of the swap fees to your wallet.</p></figcaption></figure>

### Adding More Liquidity

If you want to add more liquidity to a pool, you will be given two choices. You can add more liquidity to your existing position, or you can create a new position and select a different range to deposit your liquidity in.&#x20;

<figure><img src="/files/c8Hv6BNb06RRjbSPY8fc" alt=""><figcaption><p>You are presented with this form when adding liquidity to a pool that you already have a position in.</p></figcaption></figure>

### Removing Liquidity

After clicking the "Remove" button on the pool page, you will have the option of removing all your liquidity, or only a portion of it. Removing any liquidity will automatically transfer any unclaimed tokens from swap fees to your wallet.&#x20;

<figure><img src="/files/DcGGHqaRqRXgraHCfgqv" alt=""><figcaption><p>You can remove some or all of your liquidity.</p></figcaption></figure>

[^1]: <https://izumi.finance/paper/dswap.pdf>


# Margin Trading

Margin Trading is built on top of Rhea’s Lending product, allowing users to provide sufficient collateral to access 1–3x leverage.

## <sub>**Technical Implementation**</sub>

Reference Document:[ https://hackmd.io/@MarcoSun/SkW-\_2Z\_yl](https://hackmd.io/@MarcoSun/SkW-_2Z_yl)

### Loop-Based Leverage (Before Margin Trading)

Before Margin Trading was introduced, users could manually implement leveraged trading through a series of looping actions:

* **Shorting:**\
  Supply USDC → Borrow NEAR → Swap NEAR to USDC → Supply USDC → Borrow NEAR → ...<br>
* **Longing**:\
  Supply USDC → Borrow USDC → Swap USDC to NEAR → Supply NEAR → Borrow USDC → ...

## Margin Trading

Margin Trading simplifies the user's repeated loop operations into a single action, with steps managed by smart contracts. This makes leveraged trading more accessible and user-friendly.

***

Margin trading is available for:

* **Meme tokens (Selected assets)**
* **NEAR**
* **nBTC**

Users can deposit Stablecoins (USDC, DAI, or USDt) as collateral to open long or short positions with up to 2x leverage on Meme Tokens and 3x leverage on NEAR and nBTC.

<figure><img src="/files/7sQMgdWUlnl9dy1RQkD3" alt=""><figcaption><p>Margin Trading markets as of current assets</p></figcaption></figure>

## Isolated Positions for Meme Tokens

Due to the low liquidity and high volatility of Meme Tokens, and to avoid impacting the $200M liquidity pool of the main Lending product, we’ve created separate smart contracts (forked Lending contracts) for Meme Tokens. This isolates risk at the contract level.

All USDC used for long and short positions on Meme Tokens comes exclusively from these dedicated Meme Token lending contracts.

## Meme Token Listing Criteria

Not all Meme Tokens can be listed on Margin Trading. To ensure the safety of users and the platform, a Meme Token must have over $100K liquidity on Rhea’s DEX to be eligible for listing.

***

## Liquidation

Liquidation in Margin Trading differs from Lending:

* **Lending:**\
  Uses partial liquidation — only enough assets are liquidated to bring the user's health factor back to a safe level, avoiding full liquidation.<br>
* **Margin Trading:**\
  Involves full liquidation (similar to a total position wipeout). Once a position is liquidated, all assets in that position are sold to repay the Lending debt and compensate the liquidator.<br>

***

## Open-Source Liquidation Bot

The Margin Trading liquidation bot is open-source and available here:\
<https://github.com/burrowHQ/burrowland-liquidation-bot/tree/margin_trading><br>


# Guide

Disclaimer: Margin trading carries risks. Volatility & leverage can lead to rapid fluctuations and losses. Always DYOR & apply risk management.

#### Step 1: Access <https://lending.rhea.finance/marginTrading> and connect your wallet

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

#### Step 2: Select the market you would like to margin trade:

Example shown using nBTC as the asset choice

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

#### Step 3: Navigate the Margin trading Interface.&#x20;

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

**Chart on the left indicates price movement, and the interface on the right displays 3 interactive buttons:**&#x20;

1. Long/Short nBTC
2. Stablecoin choice, token balance, input amount for trading
3. &#x20;Leverage Bar

Lets break it down:

1. Users can choose to Long or Short an Asset using the Navigation Bar&#x20;

<figure><img src="/files/olfedRkFAxdGrrv8hEA5" alt="" width="375"><figcaption><p>Long nBTC</p></figcaption></figure>

<figure><img src="/files/2yqBULxRz4TuMFkBVPfT" alt="" width="375"><figcaption><p>Short nBTC</p></figcaption></figure>

2. Pick your asset choice and fill in the desired number&#x20;

<figure><img src="/files/KUKYUPS5lKGyzxLCjBlO" alt="" width="375"><figcaption></figcaption></figure>

3. Adjust the leverage that you are comfortable with. Notice that the liquidation price varies varies depending on the leverage.&#x20;

   Note: Its important to keep track of the liquidation price to ensure your position is not liquidated.

   1. If you go long on an asset, your position will be liquidated if its below the liquidation price
   2. If you shorted an asset, your position will be liquidated if its above the liquidation price&#x20;

<figure><img src="/files/0rHpVctNo0CkDYsBogMH" alt="" width="375"><figcaption></figcaption></figure>

Step 4: Click on the button and confirm the transaction

<figure><img src="/files/NZqAlYSGV4T7IcPvps3R" alt="" width="563"><figcaption></figcaption></figure>

Step 5: Done! Your can track your positions at the bottom of the interface or your one stop dashboard at <https://lending.rhea.finance/dashboard>&#x20;

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


# Yield Boost


# xRHEA Farming Boost

### Overview

xRHEA Farming Boost allows users to lock xRHEA tokens in exchange for boosted incentive rewards on their [farm APYs](https://app.rhea.finance/pools?activeTab=farm). The longer the lock-up period, the greater the boost — up to a maximum of 6 months.

<div data-full-width="true"><figure><img src="/files/RkE43mRGiZCpbRF0UPcA" alt="" width="563"><figcaption><p><a href="https://app.rhea.finance/stake"> xRHEA Farming Boost</a> interface with boost ratio range and lock-up period up to 6 months</p></figcaption></figure></div>

### List of 7 Boosted farm Pools on RHEA

| Farm Pools     | Link                                  |
| -------------- | ------------------------------------- |
| rNEAR-NEAR     | <https://app.rhea.finance/sauce/6494> |
| RHEA-NEAR      | <https://app.rhea.finance/pool/6458>  |
| NEAR-ZEC       | <https://app.rhea.finance/pool/6065>  |
| NEAR-PUBLIC    | <https://app.rhea.finance/pool/6503>  |
| mpDAO - STNEAR | <https://app.rhea.finance/pool/5438>  |
| nBTC - NEAR    | <https://app.rhea.finance/sauce/5949> |
| DOG - NBTC     | <https://app.rhea.finance/pool/6424>  |

### How it works

Lock xRHEA → Earn Weight → Get Boosted APYs on Farming

The program operates in two sections:

1. Weight Algorithm – Calculates your Weight based on the amount and duration of xRHEA locked.
2. Farming Multiplier Algorithm – Converts your Weight into a reward boost factor.

### 1. Weight Algorithm

Your Weight is determined by:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK-zvUam_7OLgZSrZecUvTX29tv-8DFbtOY6-QNkVTB5c8GnGMUsgEs3-E2AuqxlkqffiIBH3xSXW0bhyElyJp3ysTbblAI57GFpYB0r4wmIs3eBngR-4OPKkf1v16e2PwZXFgjw?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = Weight
* X = The amount of xRHEA locked
* D = Lock duration (from 30 to 180 days)
* D\_min = 30
* D\_max = 180
* M\_min = 10,000

M\_max = 30,000

### Example Weight Table&#x20;

| xRHEA Locked | Lock Duration | Weight Received |
| ------------ | ------------- | --------------- |
| 100 xRHEA    | 1 Month       | 100             |
| 100 xRHEA    | 3.5 Months    | 200             |
| 100 xRHEA    | 6 Months      | 300             |

> The longer you lock, the higher the Weight (up to 3x boost at 180 days)

### 2. Farming Multiplier Algorithm

Once Weight is calculated, it’s converted into a Farming Multiplier, which boosts the user’s share of the incentive rewards pool.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK09JUsm53m6a0pSoXwiZeeeyL0UgYuCJCVztKYFq2N_a3BdOQBfLlAgfhbmibp3a-ejRVcZVWRswzD5ZrXZs_KLw33B3edUfFSAFkTtzuD52v6nnvfk5J0z6MMw4ScIVMGhqMTg?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = user's Weight
* boost\_suppress\_factor = 100
* base = 38634105686174997042188779520

#### Farming Multiplier Table

| Weight Amount | Farming Multiplier |
| ------------- | ------------------ |
| 1,500         | 1.111x             |
| 15,000        | 1.205x             |
| 150,000       | 1.300x             |
| 1,500,000     | 1.394x             |
| 15,000,000    | 1.488x             |

### Example: How Rewards Are Distributed

Imagine the rNEAR-NEAR farm emits 9.89% APY in incentive rewards.

#### Case 1:  New User Without xRHEA Lock when farming

<table><thead><tr><th width="82.4423828125">User</th><th width="207.7041015625">USD value staked in farm</th><th width="107.9534912109375">Weight </th><th width="111.199951171875">Multiplier</th><th width="79.728515625">APY</th><th>Boosted APY</th></tr></thead><tbody><tr><td>Charlie</td><td>1,000</td><td>0</td><td>1.000x</td><td>9.89%</td><td>-</td></tr></tbody></table>

#### Case 2: xRHEA Lock Boosted Users when farming&#x20;

<table><thead><tr><th width="87.64453125">User</th><th width="207.65869140625">USD value staked in farm</th><th width="96.72119140625">Weight </th><th width="110.9932861328125">Multiplier</th><th width="86.28125">APY</th><th>Boosted APY </th></tr></thead><tbody><tr><td>Alice </td><td>500</td><td>150,000</td><td>1.300x</td><td>9.89%</td><td>12.85%</td></tr><tr><td>Bob</td><td>50</td><td>150</td><td>1.056x</td><td>9.89%</td><td>10.44%</td></tr></tbody></table>

### Updated incentive rewards allocation for rNEAR-NEAR farm

**Alice: 12.85% APY**

**Bob: 10.44% APY**

**Charlie: 9.89% APY (Not Boosted)**

## How to stake xRHEA for farming boost: Step by Step walkthrough

### Step 1: Go to <https://app.rhea.finance/stake> and connect your wallet&#x20;

### Step 2: Click Farming Boost:  &#x20;

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

<p align="center"></p>

### Step 3: Choose RHEA or xRHEA:  &#x20;

<figure><img src="/files/PZvtEvSlcwPG9a2l7viv" alt=""><figcaption><p>Stake requires minimum of 1.7 RHEA/xRHEA</p></figcaption></figure>

### Step 4: Pick Boost Ratio Range based on your Lock time.&#x20;

<figure><img src="/files/SNxQqSPNOf44SreuqX6g" alt=""><figcaption><p>Lock-up period from 1~6 month</p></figcaption></figure>

### Step 4.1: If you hover to the Boosted ratio text, there will be a quick preview pop-up of your Boosted Farm APYs based on Stake Amount and Lock time of xRHEA

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

<p align="center"></p>

### Step 5: Click Stake and you're done!&#x20;

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

### Step 6:  you head over to the [farms section](#step-1-go-to-https-app.rhea.finance-stake-and-connect-your-wallet) on Liquidity tab, you can now see your boosted APY figures under the APYs.&#x20;

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


# xRHEA Lending Boost

### Overview

xRHEA Lending Boost allows users to lock xRHEA tokens in exchange for boosted incentive rewards on Rhea Lending. The longer the lock-up period, the greater the boost — up to a maximum of 6 months.

Note: Boost only affects incentive rewards. It does not impact base lending interest rates.

<figure><img src="/files/oprMzZ8ShXvperFlMYsF" alt=""><figcaption><p> <a href="https://t.co/Bk0wJfmeZ8">xRHEA Lending Boost</a> interface with boost ratio range and lock-up period up to 6 months</p></figcaption></figure>

### How it works

Lock xRHEA → Earn Weight → Get Boosted Rewards

The program operates in two sections:

1. Weight Algorithm – Calculates your Weight based on the amount and duration of xRHEA locked.
2. Farming Multiplier Algorithm – Converts your Weight into a reward boost factor.

### 1. Weight Algorithm

Your Weight is determined by:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK-zvUam_7OLgZSrZecUvTX29tv-8DFbtOY6-QNkVTB5c8GnGMUsgEs3-E2AuqxlkqffiIBH3xSXW0bhyElyJp3ysTbblAI57GFpYB0r4wmIs3eBngR-4OPKkf1v16e2PwZXFgjw?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = Weight
* X = The amount of xRHEA locked
* D = Lock duration (from 30 to 180 days)
* D\_min = 30
* D\_max = 180
* M\_min = 10,000

M\_max = 30,000

### Example Weight Table&#x20;

| xRHEA Locked | Lock Duration | Weight Received |
| ------------ | ------------- | --------------- |
| 100 xRHEA    | 1 Month       | 100             |
| 100 xRHEA    | 3.5 Months    | 200             |
| 100 xRHEA    | 6 Months      | 300             |

> The longer you lock, the higher the Weight (up to 3x boost at 180 days)

### 2. Farming Multiplier Algorithm

Once Weight is calculated, it’s converted into a Farming Multiplier, which boosts the user’s share of the incentive rewards pool.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK09JUsm53m6a0pSoXwiZeeeyL0UgYuCJCVztKYFq2N_a3BdOQBfLlAgfhbmibp3a-ejRVcZVWRswzD5ZrXZs_KLw33B3edUfFSAFkTtzuD52v6nnvfk5J0z6MMw4ScIVMGhqMTg?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = user's Weight
* boost\_suppress\_factor = 100
* base = 2137469933345.874131511402299392

#### Farming Multiplier Table

| Weight Amount | Farming Multiplier |
| ------------- | ------------------ |
| 500           | 1.056x             |
| 5,000         | 1.137x             |
| 50,000        | 1.218x             |
| 500,000       | 1.300x             |
| 5,000,000     | 1.381x             |
| 50,000,000    | 1.462x             |

### Example: How Rewards Are Distributed

Imagine the USDC lending pool emits 200 wNEAR/day in incentive rewards.

#### Case 1: Boosted Users Only&#x20;

| User  | Supplied USDC | Weight  | Multiplier | Boosted Shares |
| ----- | ------------- | ------- | ---------- | -------------- |
| Alice | 500           | 500,000 | 1.300x     | 650            |
| Bob   | 50            | 500     | 1.056x     | 52.8           |

* Total Boosted Shares: 702.8<br>
* Reward Allocation:
  * Alice: 184.96 wNEAR/day
  * Bob: 15.2 wNEAR/day

#### Case 2:  New User Without xRHEA Lock

| User    | Supplied USDC | Weight | Multiplier | Boosted Shares |
| ------- | ------------- | ------ | ---------- | -------------- |
| Charlie | 1,000         | 0      | 1.000x     | 1,000          |

* New Total Boosted Shares: 1,702.8<br>
* Updated Reward Allocation:
  * Alice: 76.34 wNEAR/day
  * Bob: 6.2 wNEAR/day
  * Charlie: 117.44 wNEAR/day


# Liquid Staking Tokens (LST)

RHEA’s NEAR LST — Liquid Staking for $NEAR, Multichain

RHEA LST is the first multichain liquid staking protocol purpose-built for $NEAR. It allows users to stake $NEAR and receive $rNEAR, a yield-bearing token that can be used across chains — all from their original wallets, on their original chains.

### What is $rNEAR?

$rNEAR is the receipt token users receive upon staking $NEAR with the rNEAR Protocol. As PoS rewards continuously accrue, the value of $rNEAR increases relative to $NEAR.

Users can unstake $rNEAR at any time to get their staked $NEAR back.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0JU8mxOPjEmHQrBGgR8qWXXYFyxHdWfbmXKATAdCeauvR2jAV__tjha0G2keys9oR-saa_Wi7KOTaUNrnBcF0ldswcJTunrUUFOnBJdZ6rELuruyqslqnVy_Q6pyDK3TpKHpP-Q?key=jj6huYDscW93vCrr-SeUvA" alt=""><figcaption></figcaption></figure>

* $rNEAR is minted when users stake $NEAR and is burned when they unstake.
* It accrues staking rewards over time — its value increases as the NEAR it represents grows.
* $rNEAR follows the **NEP-141 standard** and can be bridged easily to other ecosystems (ERC-20, SPL, etc.).<br>

> $NEAR holders on other chains like Solana, BSC, etc, can also access NEAR liquid staking natively on their chain

### Native Staking & Unstaking&#x20;

* Stake: Deposit $NEAR into the RHEA contract → instantly receive $rNEAR at the current exchange rate.
* Unstake:
  * Instant Unstake – withdraw immediately via RHEA DEX with a small fee
  * Standard Unstake – wait 4 epochs(\~30hours)<br>

Each $rNEAR is backed by more $NEAR over time as staking rewards are accrued — increasing its value in NEAR terms.

### Validator Strategy

RHEA maintains a decentralized, weighted pool of NEAR validators selected based on:

* Reward performance (with time-weighting)
* Online uptime stability
* Staking ratio
* Community reputation<br>

Scores are calculated automatically and periodically reviewed by the RHEA DAO for optimal decentralization and performance.

### Common Questions:

> #### Why Can’t I Get 1 rNEAR by Staking 1 NEAR?

As PoS rewards accumulate over time, $rNEAR appreciates in value, meaning the price of $rNEAR will always be higher than the price of $NEAR.&#x20;

You don’t need to worry about staking a certain amount of NEAR and receiving less when you unstake.&#x20;

The amount of $NEAR you receive when you unstake will always be greater than or equal to the amount you initially staked.

> #### When Does Staked NEAR Start Earning PoS Rewards?

PoS rewards are based on Epochs, not Blocks. An Epoch lasts approximately 7 hours, depending on the block production speed.

Staked $NEAR does not immediately start generating PoS rewards because PoS rewards require the staked $NEAR to be present from the start of the Epoch. NEAR added after the Epoch begins will not earn rewards for that Epoch.

To reduce frequent staking actions, we will automatically stake the NEAR in the current LST contract at the end of the current Epoch.

> #### If I Stake NEAR, Does the Current Epoch Not Generate Any Rewards?

No, users still earn rewards during the current Epoch. However, these rewards do not come from PoS rewards. Instead, they come from the Incentive Mechanism.

To encourage more users to migrate to rNEAR, we have activated the incentive mechanism to compensate for the loss of rewards in the first Epoch.

> #### How Does the Incentive Mechanism Work?

Every 10 minutes, the incentive mechanism checks the current $rNEAR price against the price from 30 days ago and calculates the PoS Reward APY.

Based on this APY, the incentive mechanism adds an additional 1% through a compensation system.

### The Technology Behind: Cross Chain NEAR Liquid Staking

While most LST protocols operate within a single chain, RHEA aligns with NEAR’s multichain vision, enabling liquid staking of $NEAR to be initiated and utilized across multiple source and destination chains, with a native user experience.

### How it Works&#x20;

**If Cross-Chain Messaging Is Available**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOR_oCMV1p-yQu4tbkKuqw-zcveiTWhM42dUguaQEt3lpnPrnxwbIqLe1WJEEETHnL26kih93nYASdtPs_m5w92E_uYpvA41a2HgG9VpObBZGNW8S7ym-w9-3lsPybnyga_TpqVw?key=SLv95-TUbNFtc6871tvhRw" alt=""><figcaption></figcaption></figure>

\
RHEA deploys a lightweight **Account Abstraction (AA) contract:**<br>

* Receives user-signed staking instructions via message bridge or direct wallet intent
* Delivers $NEAR or $rNEAR back to the user on their original chain

✅ Advantage: To the user, staking feels native—like using any local DeFi protocol.

#### If Only Token Bridge Is Available

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeh-w5rfMrmI70xo2i4B7G-EjCEmY2mZdC17D92ZMkAZZ_mJBedeYQDTDcdD0-Anp0L9iv-GB1ln21GVdk0t1iPK9gkwCTkFkjND1YsPICx5PLdTukZqcD_H6gGSEHQvQew6N8SSw?key=SLv95-TUbNFtc6871tvhRw" alt=""><figcaption></figcaption></figure>

RHEA uses External Account Management (EAM) via NEAR Chain Abstraction:

1. Sub-account Creation – A NEAR sub-account is created and linked to the user’s wallet using derived keys.
2. Authorization – User signs a one-time request to link an embedded NEAR wallet to their sub-account.
3. Interaction – Users control the sub-account via RHEA frontend to stake, unstake, or access NEAR DeFi.

✅ Advantage: Users gain full access to NEAR staking and DeFi, using their existing wallet and chain.

### Summary:

* $rNEAR appreciates over time due to PoS rewards.
* The price of $rNEAR will always be higher than the price of $NEAR.
* Staked NEAR starts earning PoS rewards only at the beginning of an Epoch.
* Incentive mechanism compensates users in the first Epoch to encourage migration to rNEAR.
* Incentive mechanism adds an additional 1% on top of the PoS Reward APY to further boost earnings.

**RHEA LST makes $NEAR staking borderless, non-custodial, and yield-optimized.**


# Farming

Farming or Yield Farming is defined as the process of staking your LP tokens into a farm, to earn additional rewards, on top of your existing liquidity position(s) swap fee revenue.

Like pools, all farms are contained in one single contract (v2.ref-farming.near). Plus, a farm can support up to 16 different reward tokens.

Liquidity incentives are usually used by projects' owners to attract liquidity and to facilitate trading.

{% hint style="info" %}
When you stake LP tokens into a farm, you also continue to earn trading fees from the corresponding liquidity pool
{% endhint %}

## How to farm?

First, make sure that you are connected to Ref Finance with your wallet.

### Step 1: Click on Farms and choose a relevent pool

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

In the Farms section, you can view all old, live, and future farms and filter them by different criteria.

To farm, you need LP tokens, which means you need to provide liquidity initially for the corresponding pool. To provide liquidity, please refer to the [Pooling section](/near-chain-guides/how-rhea-finance-works/pooling).&#x20;

{% hint style="info" %}
Farms are limited to a certain number of pools, not all pools have a yield farming option &#x20;
{% endhint %}

You can check the associated pool of a farm by either clicking on the pool, choosing Add liquidity or Get LP Tokens

<figure><img src="/files/5ZaHfUTvOSIy8qgF7yTE" alt=""><figcaption></figcaption></figure>

### Step 2: Click on Stake after adding liquidity

Note that you can do some yield simulations by clicking on ROI calculator. Please be careful as the simulations are 'other things being equal' (i.e. not taking into account potential Divergence Loss).

Enter the amount of LP tokens you want to stake.

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

### Step 3: Stake & approve the transaction (i.e. using NEAR wallet)

![](/files/xp5QltE02qUPUMQGVRf8)

## Track, claim and withdraw farming rewards

First, make sure that you are connected to RHEA Finance with your wallet.

### Step 1: Click on Farms and select Yours, Click your farm

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

### Step 2: Claim your rewards

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


# Aggregator Bridge

How to bridge?

#### Step1: Click on the "Bridge" tab and choose Aggregate Bridge&#x20;

<figure><img src="/files/7pLPyqBs2GWuL5vPJhAM" alt=""><figcaption></figcaption></figure>

#### Step2: Select the chain you want to bridge "from" and "to" for the asset you want to bridge.&#x20;

<figure><img src="/files/UMufRTcBcCYGTQiFPi9c" alt="" width="563"><figcaption></figcaption></figure>

#### Step3: Connect the wallet of the chain you selected.

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

#### Step4: Enter the amount of the assets you want to bridge.&#x20;

The aggregator will automatically calculate and choose the best amount out.

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

#### Step 5: Click "**Preview"** to view the bridge preview.

<figure><img src="/files/4Ns97nsCl4aoSx7QgMfo" alt="" width="563"><figcaption></figcaption></figure>

#### Step 6: Click "**Transfer"** to sign transaction. You can check the progress anytime through the "Bridge Transaction History" page

<figure><img src="/files/hDuTPqlCl69XJeEwCLy0" alt="" width="563"><figcaption></figcaption></figure>

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


# RHEA Point System Season 2

## **Introduction**

The RHEA Points System is designed to incentivise platform activity by rewarding users for trading, liquidity provision, and community engagement. Points are accumulated based on specific actions and can be used to enhance user participation in the ecosystem.

In Season 2, **every action you take on RHEA can earn you points** — and those points can be redeemed for oRHEA during designated redemption windows (dates to be announced).

The more active you are, the more oRHEA you can secure.

## **Point Categories & Earning Mechanisms for oRHEA**

### **1. Trading Points**

Users earn points through token swaps, using the [aggregator bridge](https://dex.rhea.finance/bridge), and margin trading.

| Action                                                                                                       | Point Calculation                   | Rule                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap $100                                                                                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Swap more than $1000 in a single transaction                                                                 | 100 Points + 20% Boost = 120 Points | <p>Applies to Selected Pool Tokens:<br></p><ul><li><a href="https://app.rhea.finance/pool/6458">RHEA–NEAR</a></li><li><a href="https://app.rhea.finance/pool/4512">USDC–NEAR</a></li><li><a href="https://app.rhea.finance/sauce/5949">nBTC-NEAR</a></li><li><a href="https://app.rhea.finance/pool/4276">BlackDragon-NEAR</a></li><li><a href="https://app.rhea.finance/pools?activeTab=stable">Stable Pools </a></li><li><a href="https://app.rhea.finance/pool/6503">PUBLIC-NEAR</a></li><li><a href="https://app.rhea.finance/poolV2/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1%3C%3Etoken.rhealab.near@100">RHEA-USDC </a></li><li><a href="https://app.rhea.finance/pool/5154">NEAR-WBNB </a></li><li><a href="https://app.rhea.finance/sauce/6494">rNEAR-NEAR</a></li><li>wBTC Pools </li></ul> |
| Bridge $100 via the [Aggregator Bridge ](https://dex.rhea.finance/bridge)                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Bridge more than $1000 in a single transaction via the [Aggregator Bridge ](https://dex.rhea.finance/bridge) | 100 Points + 20% Boost = 120 Points | EVM to NEAR USDC bridge only                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Margin Trade $50                                                                                             | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Margin Trade more than $1000 in single transaction                                                           | 200 Points + 20% Boost = 240 Points | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### **Example Calculation:**

* A $1,000 total swap in Selected Pool Tokens:

  * Base points: **= 100 points**
  * **20% boost** for $1,000 swap = **20 points**
  * **Total: 120 points**

### 2. Lending

Users earn points by supplying or borrowing selected assets.

<table><thead><tr><th>Supply (Points per $100)</th><th width="205.69921875">Borrow (Points per $100)</th><th>Assets</th></tr></thead><tbody><tr><td>50 pts</td><td>50 pts</td><td><a href="https://app.rhea.finance/tokenDetail/xtoken.rhealab.near?pageType=main">xRHEA</a>, <a href="https://app.rhea.finance/tokenDetail/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1?pageType=main">USDC</a>, <a href="https://app.rhea.finance/tokenDetail/usdt.tether-token.near?pageType=main">USDt</a>, <a href="https://app.rhea.finance/tokenDetail/lst.rhealab.near?pageType=main">rNEAR</a>, <a href="https://app.rhea.finance/tokenDetail/6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near?pageType=main">DAI</a></td></tr><tr><td>25 pts</td><td>50 pts</td><td><a href="https://app.rhea.finance/tokenDetail/nbtc.bridge.near?pageType=main">nBTC</a>, <a href="https://app.rhea.finance/tokenDetail/zec.omft.near?pageType=main">ZEC</a>, <a href="https://app.rhea.finance/tokenDetail/wrap.near?pageType=main">NEAR</a>, <a href="https://app.rhea.finance/tokenDetail/853d955acef822db058eb8505911ed77f175b99e.factory.bridge.near?pageType=main">FRAX</a>, <a href="https://app.rhea.finance/tokenDetail/eth.bridge.near?pageType=main">ETH</a></td></tr></tbody></table>

### 3. Community Points

Earn points through social media engagement, referrals, and platform advocacy.

We reward active **community builders and contributors**.

* RHEA Insider vault campaign - in Discord
  * The engage point will be converted to RHEA points by the end of the campaign
* Onboarding referrals
  * Counted by how many users have been onboarded through the RHEA referral link and will be added by the end of the campaign
* Kaito yapping (approved discussions & shilling)

  * read our [article](https://x.com/rhea_finance/status/1955283722187706621) on X&#x20;

  NOTE: Every tweet must tag @rhea\_finance

## Multipliers & Bonus Mechanisms

Users can earn bonus points by maintaining long-term engagement on Margin Trading and Supply/ Borrow

### Margin Trading

<table><thead><tr><th width="345.86328125">Activity Streak</th><th>Point Multiplier Applied</th><th data-hidden></th></tr></thead><tbody><tr><td>15 consecutive days of trades</td><td>1.2x every future trades</td><td></td></tr><tr><td>30 consecutive days of trades</td><td>1.5x every future trades</td><td></td></tr><tr><td>60 consecutive days of trades</td><td>2x every future trades</td><td></td></tr></tbody></table>

### Supply and Borrow&#x20;

<table><thead><tr><th width="439.80645751953125">Activity Streak</th><th width="388.8056640625" align="center">Point Multiplier Applied </th></tr></thead><tbody><tr><td>30 consecutive days of  $100+ TVL in Supply or Borrow</td><td align="center">1.2x (After 30 Days)</td></tr><tr><td>60 consecutive days of  $100+ TVL in Supply or Borrow</td><td align="center">1.5x (After 60 Days)</td></tr></tbody></table>

### Liquidity Provider

<table><thead><tr><th width="440.23272705078125">Activity Streak</th><th align="center">Point Multiplier Applied</th></tr></thead><tbody><tr><td>30 consecutive days of $100+ in LP Supply</td><td align="center">1.2x (After 30 Days)</td></tr></tbody></table>


# RHEA Credits

### Overview

The Credit Model is introduced in welcoming Season 3 while recalculate **Season 2 distribution** to improve the fairness of oRHEA redemption.

Previously, oRHEA redemption relied entirely on Points, which led to heavy concentration—where a small number of high-volume users accumulated the majority of redeemable supply. This limited redemption access for most users.

To address this, **Credit** is introduced as a new, daily-based redemption unit while keeping the existing Points system intact for activity tracking.

***

### Key Changes at a Glance

* **Credit replaces Points as the unit for oRHEA redemption**
* Credit is **calculated daily** based on points earned that day
* Credit **accumulates over time**
* Daily Credit gains are **capped by tiers**
* Historical data for **Season 2 will be recalculated**

***

### Definitions

| Term   | Description                                          |
| ------ | ---------------------------------------------------- |
| Points | Original points generated from daily user activity   |
| Credit | New daily, cumulative unit used for oRHEA redemption |
| Season | A defined activity period (current: Season 2)        |
| oRHEA  | Reward asset redeemable using Credit                 |

***

### What Is Credit?

* Credit is a **daily reward unit derived from Points**
* It is calculated **once per day**
* Credits **accumulate over time**
* Credits are used to redeem **oRHEA**
* Points remain unchanged and are still used for tracking and history

***

### Credit Calculation Rules

#### Daily Calculation Principle

* Credit is calculated **independently each day**
* Only the **highest eligible tier** per day is counted
* Credits do **not stack within the same day**
* Points below the minimum threshold earn **no Credit**

***

#### Daily Points → Credit Mapping

| Daily Points Earned | Credit Earned |
| ------------------- | ------------- |
| ≥ 20                | 1 Credit      |
| ≥ 40                | 2 Credits     |
| ≥ 80                | 3 Credits     |
| ≥ 160               | 4 Credits     |

**Notes:**

* Thresholds increase exponentially
* Extra points beyond a tier do not increase daily Credit
* Credit gain is capped per day

**Examples:**

* 45 Points → 2 Credits
* 160 Points → 4 Credits
* 10 Points → 0 Credits

***

### Credit Accumulation

* Credits are **added daily**
* Each day is calculated independently
* Once earned, Credits **cannot be adjusted or removed**
* Total Season 2 Credit is the **sum of all daily Credits**

#### Example

| Day   | Daily Points | Credit Earned | Total Credit |
| ----- | ------------ | ------------- | ------------ |
| Day 1 | 25           | 1             | 1            |
| Day 2 | 90           | 3             | 4            |
| Day 3 | 10           | 0             | 4            |
| Day 4 | 160          | 4             | 8            |

***

### Season 2 Historical Recalculation

#### Scope

* Credit will be recalculated for **all historical days in Season 2**
* Based on each user’s **daily points record**

#### Logic

1. Retrieve daily Points data for Season 2
2. Calculate daily Credit using the tier rules
3. Sum all daily Credits
4. Store Credit as a **new Season 2 field**

**Important:**

* Points data remains unchanged
* Season 1 data is not included

***

### Credit → oRHEA Redemption

* oRHEA redemption now uses **Credit instead of Points**
* Redemption pricing and logic remain unchanged
* Users can only redeem up to their available Credit balance
* Credit cannot go negative
* Over-redemption is not supported

### Difference from RHEA ticket Trade Competitions

| Aspect            | Trade Competition | Credit Model             |
| ----------------- | ----------------- | ------------------------ |
| Calculation Cycle | Campaign-based    | Daily                    |
| Accumulation      | Rule-dependent    | Always cumulative        |
| Volume Advantage  | High              | Capped daily             |
| Focus             | Short-term volume | Consistent participation |
| Redemption Unit   | Points            | Credit                   |

***


# How RHEA Finance Works

### RHEA Finance is an open-source software.&#x20;

Inspired by Uniswap v2, Curve Finance, and iZiSwap, RHEA Finance is an automated liquidity protocol powered by two constant product functions, and a discretized concentrated liquidity function:

* Swap function: x \* y = k
* StableSwap function: χDn−1 \* ∑ xi + ∏ xi = χDn + ( D / n )n&#x20;
* StableSwap function for yield-bearing tokens (Rated pools)
* iZiSwap function for Discretized Concentrated Liquidity Pools (Ref v2)

For more information, please refer to:

* Swap function
  * Uniswap v2 Whitepaper: <https://uniswap.org/whitepaper.pdf>
* StableSwap function
  * Curve StableSwap Whitepaper: <https://curve.fi/files/stableswap-paper.pdf>
* StableSwap function for yield-bearing tokens (Rated pools)

{% file src="/files/xFfW749Z6kspOO4kQqvO" %}
Rated pools document
{% endfile %}

* Discretized Concentrated Liquidity
  * iZiSwap Discretized Concentrated Liquidity Whitepaper: <https://izumi.finance/paper/dswap.pdf>

RHEA Finance is implemented on the NEAR blockchain. The platform is fully permissionless and removes the need for trusted intermediaries, prioritising decentralisation and censorship resistance. Anyone can trade and/or become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token in return for pool tokens (LP tokens). These tokens track pro-rata LP shares of the total reserves, and can be redeemed for the underlying assets at any time.

Unlike Uniswap, RHEA Finance smart contract (v2.ref-finance.near), which manages the automated market maker functions; swap and provide liquidity, contains all pairs or liquidity pools, made of reserves of two or three [NEP-141](https://nomicon.io/Standards/FungibleToken/Core) tokens ([ERC-20](https://eips.ethereum.org/EIPS/eip-20) equivalent on NEAR).

When a LP creates a new pool, the pool fee is customisable. Every pool has the same fee structure, as shown below.

![](/files/bbwkctMuCWT52rCl9czF)

## Ecosystem Participants

![](/files/aRD4VGzBKM9FltTljIMQ)

The RHEA Finance ecosystem is primarily comprised of five types of users: traders, liquidity providers, stakers, lenders & borrowers, voters and developers.&#x20;

* Traders can swap [NEP-141](https://nomicon.io/Standards/FungibleToken/Core) tokens
* Liquidity providers are incentivised to provide these tokens to liquidity pools
* Stakers are receiving pro-rata shares of the shared protocol revenue
* Lenders & Borrowers can unlock the liquidity of Near Ecosystem
* Voters can participate in the governance of the project and the allocation of liquidity incentives
* Developers can integrate directly with RHEA Finance smart contracts to empower users in their interactions with tokens, trading interfaces, trading strategies, and more

### Traders

There are different types of traders interacting with the protocol:

* Speculators can use a wide range of strategies from fundamental to technical analysis, to 'ape' approach (process of buying a token shortly after the token project launch without conducting thorough research)
* Hig-frequency bots can cover different strategies, such as market-neutral arbitrage or long/short strategies
* Dapp users buy tokens for use in other applications on NEAR, for example, buying PixelDapp tokens to play games
* Smart contracts that execute trades by implementing swap functionality, from products like DEX aggregators to custom scripts
* Legal entities (can be for-profit or not-for-profit organisations) and/or DAOs (can be a smart contract) that execute trades to manage their affairs, such as the settlement of an invoice in a differrent currency/token&#x20;

{% hint style="info" %}
Traders are all subject to the same fee for trading on the platform
{% endhint %}

### Liquidity Providers

Liquidity providers, or LPs, are a fragmented group, mainly made of:

* Passive LPs are token holders who passively invest to accumulate trading fees, they generally do not actively monitore their positions and divergence loss
* Sophisticated LPs are focused on market making as their primary strategy, they usually develop custom tools and monitore actively their positions and divergence loss
* Token projects sometimes choose to become LPs to 'initiate' liquidity, by creating a liquid pool for their token
* Protocol-oriented or 'politicised' LPs are focused primarily on the REF<>NEAR pool and the vetoken [model](broken://pages/JL4foBrFvtyJef4LYTyC),  allowing them to participate in the governance of the protocol (also see Voters)

### Stakers

Stakers can have different objectives and belong to specific subgroups:

* Long-term stakers are usually interested in a more predictable source of revenue, deriving from the protocol revenue, while holding the protocol token and participating in the governance (Under Development)
* Short-term or intra-strategy stakers are staking for a limited period of time, with the objective to optimise their returns, generally until the underlying token (REF) needs to be sold or used for a different purpose (i.e., liquidity provision)
* Voting-only stakers can be identified as users that stake only to vote the associated proposal(s), they are generally interested in participating/influencing the future of the protocol by voting on specific proposals

### Lender & Borrowers

Lenders & Borrowers are the key components in every DeFi Ecosystem, which can exist in all the following groups:

* Retail Investors: They have access to the current layer of liquidity and play a crucial role in accelerating DeFi activities within the ecosystem.
* Venture Capitalists: This group includes entities such as Maker Maker or any institution that can access the NEAR Ecosystem liquidity. They employ various DeFi strategies such as hedging, asset optimization, and flash loans to maximize their returns.

Please note that the information provided is based on general knowledge about DeFi ecosystems and may not reflect the latest developments or specific details about individual projects.

### Voters

$REF holders can participate in the governance of the projects by voting on key governance proposals and by voting on the allocation of REF tokens to specific farms for additional farming rewards.

Voters can be:

* Community members, organisations, or investors that are interested in participating in the development and strategic orientation of the project
* Project owners who want to support/grow their community by voting on the allocation of additional rewards for their corresponding farm
* Short-term farmers who want to maximise their farming APR by voting on the allocation of additional rewards for their corresponding farm

Once the veTokenomics function is released, this feature will become accessible.

### Developers

There are many ways RHEA Finance can be used by developers, some examples include:

* UX/UI experiments and front-ends built to give users access to the backend functionalities
* Data and analytics (e.g. <https://stats.ref.finance/>)
* Liquidity aggregation
* Yield aggregation
* DeFi dashboard projects (e.g. <https://app.odyssey.fi/>, <https://app.depocket.com/dashboard>)
* Trading bots

### RHEA Finance Team and Community

Finally, the RHEA Finance team along with the DAO (ref-finance.sputnik-dao.near) and the broader community drives development of the protocol and its ecosystem.


# Auto Router

Better prices, better liquidity utilisation

Auto Router, also known as Smart Routing, can be defined as the ability to find better prices for traders on RHEA Finance. This includes splitting the trade across multiple pools at once.

The Auto Router delivers a unique value proposition. Value that will be accumulated over time by Ref's users, in the form of better prices and liquidity utilisation.

{% hint style="info" %}
The Auto Router algorithm is open source, and available at the frontend/interface level of RHEA Finance
{% endhint %}

## High-Level Design&#x20;

RHEA Finance's Auto Router aims to find the best price for a trade. The algorithm takes advantage of all liquidity, using, when available:

1. Parallel pools
2. Intermediary pools

In a nutshell, the solution determines the best **allocation** across pools of the same pairs, and the best **path** using one hop or intermediary pool.

{% hint style="info" %}
The Auto Router also leverages the [StableSwap function](/near-chain-guides/how-rhea-finance-works), therefore combining both, normal and stable pools as potential intermediary pools
{% endhint %}

Find below a high-level description of the Auto Router.

![](/files/YK0wNqVEOvVFTs3w94Ms)

The Auto Router ultimately creates a win-win situation for market participants:

* Traders: better prices
* Liquidity Providers: fairer model (vs winner-takes-all approach)

For more details, please refer to:

* Parallel Swap solution: <https://github.com/giddyphysicist/ParallelSwapForRefFinance>
* Parallel Swap Liquidity Threshold Research Paper

{% file src="/files/8lbZPPdo6rY6ERFqEMVM" %}

* Smart Routing Multi Swap Optimization Research Paper

{% file src="/files/5NezaU1ly7Moznug1uN2" %}

* Smart Routing Test Plan

{% file src="/files/Cp6CkZ5NjEuDfO7PABFg" %}

## **Credit** <a href="#id-853e" id="id-853e"></a>

The Auto Router is the result of a successful collaboration between the team and Giddy & Dave.

Giddy is an avid learner of Web3 and DeFi. His background in mathematical modeling is aided by his experience with a doctorate in physics, and he likes to explore complex systems with the tools of modeling & simulation, algorithm development, and data analysis. He posts most of his work to <https://github.com/giddyphysicist>.

Dave is a DeFi enthusiast. He is also very interested in math, problem solving, and coding. His entrance into the DeFi world was solving some difficult optimization problems. He has three Master’s degrees, including physics and analytics.

Giddy & Dave won Ref's first Hackathon ([OpenDeFi Hackathon 3](https://github.com/near/bounties/issues/64)). The implementation of the Parallel Swap and Smart Routing followed their original winning [submission](https://github.com/giddyphysicist/ParallelSwapForRefFinance).&#x20;

Giddy & Dave are the creators and authors of the associated research papers (see above).


# Multi-chain Router

Swap Pro

Also called the multi-chain aggregator, the multi-chain router is a built-in function on RHEA Finance that aggregates data across Decentralised Exchanges on Aurora and NEAR protocols.&#x20;

Designed for traders, the solution leverages liquidity accross both environments to deliver not only better prices, but also:

* Deeper liquidity and improved price impact
* Lower trading slippage
* Improved token accessibility/visibility

## High-Level Design

The solution goes through the following logic:

1. Query trading data (price, slippage, fee, etc.) on Aurora using the Aurora’s Software Development Kits (SDKs)
2. Find optimal route (best price) for a specified amount of Token A to Token B accross all liquidity pools on Near and Aurora
3. Swap — Action that combines:

* Transfer of tokens to a mapping address on Aurora via a cross-network contract call
* Swap on Aurora using the user’s NEAR account keys
* Transfer of tokens from the mapping address on Aurora to the user’s NEAR wallet

***Note**: a mapping address is a “proxy address” which maps one’s Near account onto Aurora with a corresponding ETH address. It is generated by the user’s Near account ID, and triggers/generates all the actions on the Aurora network on behalf of the user. In other words, the user signs all transactions on Aurora from the mapping address using their Near wallet, removing the need to set up a separate ETH wallet to use Aurora.*

![Liquidity Aggregation: High-level Abstract](/files/8aznabjM3jPQ25Ur6Zvf)

## Credit <a href="#e0ae" id="e0ae"></a>

The Multi-chain Router is the result of a successful collaboration between the team and Evgeny & Vadim.

For more details, please check the following link: <https://defihub.pages.dev/>


# Pooling

Liquidity Pools

RHEA Finance offers [several types of Liquidity Pools](/near-chain-guides/how-rhea-finance-works), Classic, Stable, Rated, and DCL. Classic pools are based on the Uniswap v2 algorithm; Stable pools, which can contain two or more tokens, use Curve's StableSwap algorithm; Rated pools are for yield-bearing tokens, and are based on a variation of Curve's StableSwap algorithm; and [Ref v2's "DCL" Pools](/near-chain-guides/liquidity-pools/rhea-v2-pools), which are based on [iZUMi Finance’s Discretized Liquidity AMM](#user-content-fn-1)[^1].

Classic pools are fully permissionless, meaning that anyone can create a Classic pool, and set the fee for that pool. Currently only [Guardians](/developers/guardians) can create Stable, Rated, and DCL pools.

## Stable Pool

Stable Pools are designed for assets that are expected to regularly trade either very close to parity or at a predetermined exchange rate. The Algorithm design is based on [Stableswap](https://classic.curve.fi/files/stableswap-paper.pdf) (introduce by Curve Finance), which enable significant size swap to occur without triggering considerable price impact, greatly enhancing capital efficiency for swaps involving similar or correlated assets.

RHEA Finance offers a variety of pool types, including:&#x20;

* 4 pools: support USDT Native, USDC Native, USDT.e and USDC.e
* 3 pools: USDT.e, USDC.e and DAI
* Correlated Assets: tokens that swap near 1:R with some slowly changing exchange rate R (stNEAR, LINEAR, NearX)

To understand more about logic design behind the contracts, refer to this [paper](https://classic.curve.fi/files/stableswap-paper.pdf) from the Curve Finance Team.

###

## Trading Fees

Trades that take place using liquidity from a pool are charged a fee. The fee is defined at the creation of the pool, and cannot be modified once the pool is created. The pool fee usually varies from 0.05% to 0.3%.&#x20;

Users can earn a share of the trading fees by depositing tokens into the pool (also known as "adding liquidity"). When a trade is made, the share of the trading fees a liquidity provider receives is directly proportional to their share of the liquidity in the pool used for that trade. A user who has 1% of the total liquidity will receive 1% of the trading fees designated for liquidity providers.&#x20;

## Pool Tokens&#x20;

When a user adds liquidity to a pool, they will receive one or more tokens representing their share of the pool. Shares of Classic, Stable, and Rated pools are represented by LP Tokens (LPT). LPTs are fungible tokens where the quantity held is equal to the amount of shares of the pool (e.g. 1 LPT token = 1 pool share, and 0.25 LPTs = 0.25 pool shares). On the other hand, shares of DCL pools are represented by non-fungible tokens (NFT). When a user adds liquidity to a DCL pool, they will receive **one** NFT containing the details of their position, including the number of shares it is worth. In other words, a DCL NFT can be worth 1 pool share, or 0.25 pool shares. Users can hold multiple NFTs for the same DCL pool, each of which will represent a position in that pool.

## Pool APR

Pool APR is the yield you accrue by adding liquidity to a pool. You earn 80% of the pool fee for all trades on the associated pair (or triple for stablecoin pool) proportional to your share of the pool.&#x20;

![](/files/eCvsJN7dt9tXOFRCh7LF)

{% hint style="info" %}
For Classic pools, if there is no account to receive the Referral Fee, it goes to all LPs of that pool as a form of increased LP tokens. For the other types of pools, it goes to the Protocol Fee as a form of increased LP tokens
{% endhint %}

Fees are added to the pool, accrue in real-time, and can be claimed when you withdraw your Liquidity.

{% hint style="info" %}
Your share will be accrued in real-time and will be paid in addition to your existing position when you remove liquidity from the pool
{% endhint %}

## Viewing liquidity position(s)

There are two locations where users can see their liquidity positions, the Your Liquidity page, and the Portfolio page.&#x20;

### The "Your Liquidity" page

You can see all pools you have liquidity in by going to the Your Liquidity page. You can get to the Your Liquidity page by clicking Earn > Your Liquidity in the main menu of the site.&#x20;

You can see details like how many shares you have, the USD value of your shares, and the amount of each token your shares are worth. There are also buttons to add more liquidity and remove liquidity from the pool.

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

### The Portfolio page

The "Your Liquidity" tab of the Portfolio page shows you your current liquidity positions. You can get to the Portfolio page by clicking "Portfolio" on the main menu. Each item has a drop-down icon that, when clicked, will reveal details about the position.

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

## Risks

Providing liquidity is not without risk, as you may be exposed to *Divergence Loss* or *Impermanent Loss (IL).*

> Simply put, impermanent loss is the difference between holding tokens in an AMM and holding them in your wallet. - [Beginner’s Guide to (Getting Rekt by) Impermanent Loss](https://blog.bancor.network/beginners-guide-to-getting-rekt-by-impermanent-loss-7c9510cb2f22), Nate Hindman, 2020

[^1]: <https://izumi.finance/paper/dswap.pdf>


# Staking

## Concept

xREF is the main staking contract (xtoken.ref-finance.near) on the platform. When you stake your REF, you effectively exchange your REF for xREF. Over time, you will always earn more REF by holding xREF tokens.&#x20;

{% hint style="info" %}
There is no Divergence Loss when you stake REF for xREF tokens
{% endhint %}

Every swap executed on RHEA Finance generates revenue for the protocol.&#x20;

* 100% of the protocol fee will be used to buy back REF tokens, of which:
  * 75% will be transferred to the xREF contract (xtoken.ref-finance.near) and released linearly over time&#x20;
  * 25% will be allocated to a Community/Provision treasury. This treasury will be used to fund grants and other community initiatives/programs

![](/files/YdMRN0EHG7j78Sz5v91g)

## Execution <a href="#id-6306" id="id-6306"></a>

Like any liquidity provider, RHEA Finance collects its shares (16% of the total pool fee) in real-time and will be paid when it removes liquidity from the pool.&#x20;

Converting protocol LP tokens, resulting from the trading fees, involves the following actions:

1. Remove liquidity from pools
2. Withdraw corresponding tokens from RHEA Finance (v2.ref-finance.near) to the DAO (ref-finance.sputnik-dao.near)
3. Send tokens from the DAO to a specific execution account&#x20;
4. Buy (back) REF tokens (with the execution account)
5. Send REF tokens to the staking contract (xtoken.ref-finance.near)

The process happens on a quarterly basis.

{% hint style="info" %}
The first buy back involved as many as 35 DAO proposals&#x20;
{% endhint %}

Because the conversion from LP to REF tokens happens on a quarterly basis, and because the tokens collected might be very volatile on the same period, there might be a significant difference between the daily 'observable' revenue and the 'realised' revenue, after conversion.

Finally, rewards are being released linearly on a quarterly basis, and will have boosted markups for the first three years (subject to change):

* Year 1: 2x
* Year 2: 1.5x
* Year 3: 1.2x
* Year 4: 1x


# Aggregator Bridge

**Aggregator Bridge** is an important infrastructure to connect Near ecosystem and external ecosystems. It will aggregate all existing bridges within the Near ecosystem, including **Stargate**, **Rainbow**, **TokenBridge**, and **AllBridge**.

## Stargate Bridge

Bridging with Stargate is actually a collaboration between **Stargate** and **Rainbow** Bridge. Stargate handles the cross-chain transfer between EVM and Aurora, while Rainbow Bridge manages the transfer between Aurora and Near.

#### Why can users complete the bridge from EVM to Near with just one click?&#x20;

Ref has deployed a smart contract on the Aurora chain to receive and relay assets.

#### EVM -> Near

When a user transfers assets from EVM to Near, the process begins with Stargate transferring the assets from EVM to the Aurora smart contract, carrying the actual cross-chain information (the destination address on the Near chain).&#x20;

Once the Aurora smart contract receives the cross-chain message, it reads this information and invokes the Rainbow Bridge, immediately transferring the assets from Aurora to Near.

#### Near -> EVM

When a user transfers assets from Near to EVM, the process starts with Rainbow Bridge transferring the assets from the Near chain to the Aurora smart contract, carrying the actual cross-chain message (the destination address on the EVM chain).&#x20;

Once the Aurora smart contract receives the cross-chain message, it reads this information and invokes Stargate, immediately transferring the assets from Aurora to EVM.

#### Supported EVM chains

Ethereum, Arbitrum, Optimism, Base, Scroll&#x20;

#### Fees

Users need to pay Stargate fees, which consists of two parts:&#x20;

1. **Layer0 Cross-chain Fees**
2. **Stargate Protocol Fees**

The former is charged in ETH, while the latter is a percentage of the bridged assets. For detailed information, refer to Stargate's documentation: [Stargate Protocol Fees](https://stargateprotocol.gitbook.io/stargate/v/user-docs/tokenomics/protocol-fees%EF%BC%89).

#### How Near chain users provide Layer0 cross-chain fees (ETH) ?

When transferring assets from Near to EVM, users do not need to provide ETH for the fee. Instead, they only need to provide the bridged assets, as the ETH fee is covered by Ref's Aurora contract. Users will only need to pay an equivalent amount in bridged assets.


# Copy of RHEA Point System Season 2 done (with lending borrow LP)

## **Introduction**

The RHEA Points System is designed to incentivise platform activity by rewarding users for trading, liquidity provision, and community engagement. Points are accumulated based on specific actions and can be used to enhance user participation in the ecosystem.

In Season 2, **every action you take on RHEA can earn you points** — and those points can be redeemed for oRHEA during designated redemption windows (dates to be announced).

The more active you are, the more oRHEA you can secure.

## **Point Categories & Earning Mechanisms for oRHEA**

### **1. Trading Points**

Users earn points through token swaps, using the [aggregator bridge](https://dex.rhea.finance/bridge), and margin trading.

| Action                                                                                                       | Point Calculation                   | Rule                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap $100                                                                                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Swap more than $1000 in a single transaction                                                                 | 100 Points + 20% Boost = 120 Points | <p>Applies to Selected Pool Tokens:<br></p><ul><li><a href="https://app.rhea.finance/pool/6458">RHEA–NEAR</a></li><li><a href="https://app.rhea.finance/pool/4512">USDC–NEAR</a></li><li><a href="https://app.rhea.finance/sauce/5949">nBTC-NEAR</a></li><li><a href="https://app.rhea.finance/pool/4276">BlackDragon-NEAR</a></li><li><a href="https://app.rhea.finance/pools?activeTab=stable">Stable Pools </a></li><li><a href="https://app.rhea.finance/pool/6503">PUBLIC-NEAR</a></li><li><a href="https://app.rhea.finance/poolV2/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1%3C%3Etoken.rhealab.near@100">RHEA-USDC </a></li><li><a href="https://app.rhea.finance/pool/5154">NEAR-WBNB </a></li><li><a href="https://app.rhea.finance/sauce/6494">rNEAR-NEAR</a></li><li>wBTC Pools </li></ul> |
| Bridge $100 via the [Aggregator Bridge ](https://dex.rhea.finance/bridge)                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Bridge more than $1000 in a single transaction via the [Aggregator Bridge ](https://dex.rhea.finance/bridge) | 100 Points + 20% Boost = 120 Points | EVM to NEAR USDC bridge only                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Margin Trade $50                                                                                             | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Margin Trade more than $1000 in single transaction                                                           | 200 Points + 20% Boost = 240 Points | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### **Example Calculation:**

* A $1,000 total swap in Selected Pool Tokens:

  * Base points: **= 100 points**
  * **20% boost** for $1,000+ swap = **20 points**
  * **Total: 120 points**

### 2. Liquidity Pool

Users earn points by supplying assets to liquidity pools or borrowing assets.

#### Lending & Borrowing Rewards

| Action                    | Point Calculation | Rules                |
| ------------------------- | ----------------- | -------------------- |
| Supply $100 TVL for 1 Day | 50 Points         | Receives Point Daily |
| Borrow $100 TVL for 1 Day | 100 Points        | Receives Point Daily |

> \*Note: Minimum deposit & borrow is $100 per transaction, no points for amounts below $100

#### Liquidity Pool Contributions

| Liquidity Pool      | Point Calculation                            | Boosted Pools                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $100 TVL in Pool    | 50 points per day                            | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| $10,000 TVL in Pool | 5000 Points per day + 5% Boost = 5250 Points | <p></p><p>Applies to Selected Pool Tokens:<br></p><ul><li><a href="https://app.rhea.finance/pool/6458">RHEA–NEAR</a></li><li><a href="https://app.rhea.finance/pool/4512">USDC–NEAR</a></li><li><a href="https://app.rhea.finance/sauce/5949">nBTC-NEAR</a></li><li><a href="https://app.rhea.finance/pool/4276">BlackDragon-NEAR</a></li><li><a href="https://app.rhea.finance/pools?activeTab=stable">Stable Pools </a></li><li><a href="https://app.rhea.finance/pool/6503">PUBLIC-NEAR</a></li><li><a href="https://app.rhea.finance/poolV2/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1%3C%3Etoken.rhealab.near@100">RHEA-USDC </a></li><li><a href="https://app.rhea.finance/pool/5154">NEAR-WBNB </a></li><li><a href="https://app.rhea.finance/sauce/6494">rNEAR-NEAR</a></li><li>wBTC Pools </li></ul> |

> Note: Locked LP from users will not count toward points as Locked LP is intended for LP deployers to utilize the feature and provide a sense of safety for the community.

### 3. Community Points

Earn points through social media engagement, referrals, and platform advocacy.

We reward active **community builders and contributors**.

* RHEA Insider vault campaign - in Discord
  * The engage point will be converted to RHEA points by the end of the campaign
* Onboarding referrals
  * Counted by how many users have been onboarded through the RHEA referral link and will be added by the end of the campaign
* Kaito yapping (approved discussions & shilling)

  * read our [article](https://x.com/rhea_finance/status/1955283722187706621) on X&#x20;

  NOTE: Every tweet must tag @rhea\_finance

## Multipliers & Bonus Mechanisms

Users can earn bonus points by maintaining long-term engagement on Margin Trading and Supply/ Borrow

### Margin Trading

<table><thead><tr><th width="345.86328125">Activity Streak</th><th>Point Multiplier Applied</th><th data-hidden></th></tr></thead><tbody><tr><td>15 consecutive days of trades</td><td>1.2x every future trades</td><td></td></tr><tr><td>30 consecutive days of trades</td><td>1.5x every future trades</td><td></td></tr><tr><td>60 consecutive days of trades</td><td>2x every future trades</td><td></td></tr></tbody></table>

### Supply and Borrow&#x20;

<table><thead><tr><th width="147.7451171875">Activity Streak</th><th width="285.75390625">Point Multiplier Applied (After 30 Days)</th><th>Point Multiplier Applied (After 60 Days)</th></tr></thead><tbody><tr><td>$100 TVL supplied for 1 day = 50 points</td><td>1.2x</td><td>1.5x</td></tr><tr><td>$100 TVL borrowed for 1 day = 100 points</td><td>1.2x</td><td>1.5x</td></tr></tbody></table>

### Liquidity Provider

<table><thead><tr><th width="388.6396484375">Activity Streak</th><th>Point Multiplier Applied (After 30 Days)</th></tr></thead><tbody><tr><td>$100 LP supplied for 1 day = 100 points</td><td>1.2x</td></tr></tbody></table>


# Staking

Protocol revenue sharing model

First, make sure that you are connected to Ref Finance with your wallet.

### Step 1: Click on xREF and select Stake

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

### Step 2: Enter the amount of REF tokens you want to stake

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

### Step 3: Approve the transaction (i.e. using NEAR wallet)

![](/files/xp5QltE02qUPUMQGVRf8)

## Track your xREF balance

And how much REF you will get by unstaking

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

## Unstake

### Click on xREF and select Unstake. Enter the amount of xREF tokens you want to unstake.&#x20;

<figure><img src="/files/P1Dq2TbpaAEMc32Ibm5O" alt="" width="563"><figcaption></figcaption></figure>

### Approve the transaction (i.e. using NEAR wallet)

![](/files/xp5QltE02qUPUMQGVRf8)


# Vault

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

To realize RHEA's vision as a DeFi yiel Hub powered by NEAR Chain Signature, RHEA has developed the Vault feature—a dedicated page that will gradually list all DeFi projects within the NEAR ecosystem, providing clear and concise introductions to each project's core offerings.

#### Vault will be developed in three iterative phases:

* **Phase 1**: List detailed information on each product’s main features, along with direct links for easy navigation.
* **Phase 2**: Enable direct interactions within the Vault page, removing the need to navigate away.
* **Phase 3**: Integrate functions across different Vaults to allow seamless interaction, fully achieving the one-stop financial platform vision.


# xRHEA Lending Boost (draft)

### Lock xRHEA to boost yields on RHEA Lending &#x20;

xRHEA holders have the option to [lock their xRHEA](https://app.rhea.finance/stake?type=stake_lending) to earn increased yields on RHEA's Lending product. The longer the lock-up period, the greater the boost. The maximum lock-up period is at 6 months at the moment.

What yield opportunity does the lock boost provide?

Users who lock xRHEA will receive higher rewards from the Supply and Borrow incentives on [RHEA Lending](https://docs.satos.network/). These rewards allow users to earn more incentives than they would versus not locking xRHEA.  \[See image]&#x20;

> Note: The yield boost currently applies only to user incentives (the user's lending interest income) and not to Base yields.

<figure><img src="/files/l0WemeGE2s7FREYO5aBC" alt="" width="563"><figcaption><p> <a href="https://t.co/Bk0wJfmeZ8">xRHEA Lending Boost</a> interface with boost ratio range and lock-up up to 6 months</p></figcaption></figure>

### Boost Algorithm Details

The Boost algorithm consists of two parts: the Weight algorithm and the Farming multiplier algorithm.

The Weight algorithm calculates the Weight required to participate in the Farming multiplier based on the user's locked xRHEA Token and lock duration.

The Farming multiplier algorithm calculates the user's actual Boost Ratio based on the Weight obtained from the Weight algorithm.

### Weight Algorithm

Users can decide how long to stake their xRHEA tokens and will receive more Weight the longer they stake.&#x20;

Currently, xRHEA supports a Lock period ranging from 30 Days to 180 Days. If users stake X amount of xRHEA tokens for D days (up to 180 days), the total amount of Weight will be:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXceqSwH6u-FQUNceiWn4rFZx_RIM6S8odgR4RyPT1uKZARo9d6GLlW51S9U7rnSjYmFaVX3XE72xErD2lgHl1rKAVkuFNE-rO2Ibw1DzJn42sXtuMx6O9a1HU5FdLrUJsdIJBzcTA?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

X: xRHEA amount

Y: Weight amount

D: requested locking period

Dmax: the maximum locking duration, such as 180 days

Dmin: the minimum locking duration, such as 30 days

Mmax:  multiple BP ratio related to Mmin, say 30000

Mmin: base BP ratio literally is 10000

The table below shows the amount of xRHEA with lock duration and the corresponding Weight:

| xRHEA to Lock | Months to Lock | Weight to Receive |
| ------------- | -------------- | ----------------- |
| 100           | 1              | 100               |
| 100           | 3.5            | 200               |
| 100           | 6              | 300               |

### Farming Multiplier Algorithm

The Farming multiplier algorithm follows traditional farming logic. It first calculates each user's Share amount, and then distributes the rewards based on the proportion of each user's Share.

Boosted shares are calculated as follows:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd2ScQFY1W1y6mL9Z3P0-9gOOgS_Kn7gmJWsfcWvUjve7tfziZL1N2BFxy7AwZIlbjojB9NYt3H3kIM1OHUu0HksitkRBHJPQnzDmPqq1yKVu9uPGreTiNKrMe6t7QJxbEi_rp-?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcp_JdANf2DPOX7Wp8Wrp5V6RPlcYeRb_QTAZU41-WH3jylb-lRGlddjd7h74T2EIvDas7XI9KGTqJly0aruI3E4UYHLL3gcAX600BjU9MF4l2B_4kRBTAjDckezLjuUQt1UL07?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Y: Weight amount

boost\_suppress\_factor: The impact factor is fixed at 100

booster\_unit: The impact factor is fixed at 10^18

base: The base of the Log curve is fixed at 2137469933345874131511402299392/10^18

shares: The share obtained after the user supplies assets

### The table below shows the amount of Weight and the corresponding farming multipliers:

<table><thead><tr><th width="370.349853515625">Weight Amount</th><th>Farming Multiplier</th><th data-hidden></th></tr></thead><tbody><tr><td>500</td><td>1.056</td><td></td></tr><tr><td>5,000</td><td>1.137</td><td></td></tr><tr><td>50,000</td><td>1.218</td><td></td></tr><tr><td>500,000</td><td>1.3</td><td></td></tr><tr><td>5000,000</td><td>1.381</td><td></td></tr><tr><td>50,000,000</td><td>1.462</td><td></td></tr></tbody></table>

Farming multiplier is enabled for Lending Incentive rewards which apply to specific lending positions.

Here is an example illustrating how rewards are computed:

Say the USDC pool gives <sup><sub><mark style="color:$info;">200<mark style="color:$info;"><sub></sup> wNEAR per day, and there are two users - Alice and Bob.

* Alice supplies <sup><sub><mark style="background-color:$info;">500<mark style="background-color:$info;"><sub></sup> USDC and has <sup><sub><mark style="color:$info;">500,000<mark style="color:$info;"><sub></sup> Weight.
* Bob supplies <sup><sub><mark style="color:$info;">50<mark style="color:$info;"><sub></sup> USDC and has <sup><sub><mark style="color:$info;">500<mark style="color:$info;"><sub></sup> Weight.

Boosted shares are computed via the following:

* Alice gets a farming multiplier of <sup><sub><mark style="color:$info;">1.3x<mark style="color:$info;"><sub></sup>, so the number of boosted shares becomes <sup><sub><mark style="color:$info;">650<mark style="color:$info;"><sub></sup> (i.e., 500 \* 1.3).
* Bob gets a farming multiplier of <sup><sub><mark style="color:$info;">1.056x<mark style="color:$info;"><sub></sup>, so the number of boosted shares becomes <sup><sub><mark style="color:$info;">52.8<mark style="color:$info;"><sub></sup> (i.e., 50 \* 1.041).
* The total is <sup><sub><mark style="color:$info;">702.8<mark style="color:$info;"><sub></sup> boosted shares.

So Alice gets <sup><sub><mark style="color:$info;">92.48%<mark style="color:$info;"><sub></sup> (650/702.8) of the rewards, and Bob gets <sup><sub><mark style="color:$info;">7.51%<mark style="color:$info;"><sub></sup> (52.8/702.8) of the rewards. By the end of the day, Alice gets <sup><sub><mark style="color:$info;">184.96<mark style="color:$info;"><sub></sup> wNEAR, and Bob gets <sup><sub><mark style="color:$info;">15.2<mark style="color:$info;"><sub></sup> wNEAR.

Let's say Charlie supplies 1000 USDC and has 0 Weight:

* This adds <sup><sub><mark style="color:$info;">1000<mark style="color:$info;"><sub></sup> boosted shares for Charlie. Now the total amount of boosted shares is <sup><sub><mark style="color:$info;">1’702.8<mark style="color:$info;"><sub></sup>.
* Alice gets <sup><sub><mark style="color:$info;">38.17%<mark style="color:$info;"><sub></sup> (650/1’702.8) of the farm rewards resulting in <sup><sub><mark style="color:$info;">76.34<mark style="color:$info;"><sub></sup> wNEAR per day.
* Bob gets <sup><sub><mark style="color:$info;">3.1%<mark style="color:$info;"><sub></sup> (52.8/1’702.8) of the farm rewards resulting in <sup><sub><mark style="color:$info;">6.2<mark style="color:$info;"><sub></sup> wNEAR per day.

Charlie gets <sup><sub><mark style="color:$info;">58.72%<mark style="color:$info;"><sub></sup> (1000/1’702.8) of the farm rewards resulting in <sup><sub><mark style="color:$info;">117.44<mark style="color:$info;"><sub></sup> wNEAR per day.

## xRHEA Boost Program&#x20;

### Overview

xRHEA Boost allows users to lock xRHEA tokens in exchange for boosted incentive rewards on Rhea Lending. The longer the lock-up period, the greater the boost — up to a maximum of 6 months.

Note: Boost only affects incentive rewards. It does not impact base lending interest rates.

### How It Works

Lock xRHEA → Earn Weight → Get Boosted Rewards

The program operates in two sections:

1. Weight Algorithm – Calculates your Weight based on the amount and duration of xRHEA locked.\ <br>

Farming Multiplier – Converts your Weight into a reward boost factor.<br>


# RHEA Point System (Season 1 Done)

## **Introduction**

The RHEA Points System is designed to incentivise platform activity by rewarding users for trading, liquidity provision, and community engagement. Points are accumulated based on specific actions and can be used to enhance user participation in the ecosystem.

## **Point Categories & Earning Mechanisms**

### **1. Trading Points**

Users earn points through token swaps, using the [aggregator bridge](https://dex.rhea.finance/bridge), and margin trading.

| Action                                                                                                       | Point Calculation                   | Rule                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap $50                                                                                                     | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                              |
| Swap more than $1000 in a single transaction                                                                 | 200 Points + 50% Boost = 300 Points | <p>Applies to Selected Pool Tokens:<br></p><p>•<a href="https://dex.rhea.finance/pool/79"> Ref-NEAR</a><br>• <a href="https://dex.rhea.finance/pool/4512">USDC-NEAR</a><br>• <a href="https://dex.rhea.finance/sauce/5949">nBTC-NEAR</a><br>• <a href="https://dex.rhea.finance/meme">Meme Season Pools</a><br>•<a href="https://dex.rhea.finance/pools?activeTab=stable"> Stable pools (Stablecoin-BTC pair)</a></p> |
| Bridge $50 via the [Aggregator Bridge ](https://dex.rhea.finance/bridge)                                     | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                              |
| Bridge more than $1000 in a single transaction via the [Aggregator Bridge ](https://dex.rhea.finance/bridge) | 200 Points + 50% Boost = 300 Points | EVM to NEAR USDC bridge                                                                                                                                                                                                                                                                                                                                                                                               |
| Margin Trade $50                                                                                             | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                              |
| Margin Trade more than $1000 in single transaction                                                           | 200 Points + 50% Boost = 300 Points | Applies to all meme season pools                                                                                                                                                                                                                                                                                                                                                                                      |

### **Example Calculation:**

* A $1,000 total swap in Selected Pool Tokens:

  * Base points: **(1,000 ÷ 50) × 10 = 200 points**
  * **50% boost** for $1,000+ swap: **+100 points**
  * **Total: 300 points**

### 2. Liquidity Pool

Users earn points by supplying assets to liquidity pools or borrowing assets.

#### Lending & Borrowing Rewards

| Action                    | Point Calculation | Rules                |
| ------------------------- | ----------------- | -------------------- |
| Supply $100 TVL for 1 Day | 100 Points        | Receives Point Daily |
| Borrow $100 TVL for 1 Day | 300 Points        | Receives Point Daily |

> \*Note: Minimum deposit & borrow is $100 per transaction, no points for amounts below $100

#### Liquidity Pool Contributions

| Liquidity Pool    | Point Calculation                      | Boosted Pools                                                                                                                                                                                                                                                                                                                                  |
| ----------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $100 TVL in Pool  | 200 points per day                     | -                                                                                                                                                                                                                                                                                                                                              |
| $1000 TVL in Pool | 2,000 points + 50% boost = 3000 Points | <p><a href="https://dex.rhea.finance/pool/79">Ref-NEAR</a><br><a href="https://dex.rhea.finance/pool/4512">USDC-NEAR</a><br><a href="https://dex.rhea.finance/sauce/5949">nBTC-NEAR</a><br><a href="https://dex.rhea.finance/meme">Meme Season Pools</a><br><a href="https://dex.rhea.finance/pools?activeTab=stable">Stablecoin pools</a></p> |

**Example Calculation:**

* Provide a total of $1,000 in the USDC-NEAR pool:
  * Base points: **(1,000 x 2) = 2000 points**
  * **50% boost** for $1,000+ swap: **+1000 points**
  * **Total: 3000 points**

> Note: Locked LP from users will not count toward points as Locked LP is intended for LP deployers to utilize the feature and provide a sense of safety for the community.

### 3. Community Points

Earn points through social media engagement, referrals, and platform advocacy.

<table><thead><tr><th>Type </th><th width="280.83203125">Action</th><th>Point Calculation</th></tr></thead><tbody><tr><td>Twitter Thread (DeFi topic)</td><td>Must meet engagement criteria</td><td>To Be Determined</td></tr><tr><td>Educational Guide</td><td>Must be original &#x26; informative</td><td>To Be Determined</td></tr><tr><td>Referral (New User)</td><td>Referrers earn <strong>10% of their referees' points</strong></td><td><p><strong>Example:</strong></p><p></p><p><strong>Referee (B):</strong> Earns <strong>100 points</strong> upon joining.</p><p></p><p><strong>Referrer (A):</strong> Receives <strong>10% of the referee’s points</strong> (e.g., if B gets <strong>100 points</strong>, A gets <strong>10 points</strong>)</p></td></tr></tbody></table>

## Multipliers & Bonus Mechanisms

Users can earn bonus points by maintaining long-term engagement on Margin Trading and Supply/ Borrow

### Margin Trading

<table><thead><tr><th width="345.86328125">Activity Streak</th><th>Point Multiplier Applied</th><th data-hidden></th></tr></thead><tbody><tr><td>10 consecutive days of swaps</td><td>1.2x every future swaps</td><td></td></tr><tr><td>20 consecutive days of swaps</td><td>1.5x every future swaps</td><td></td></tr><tr><td>30 consecutive days of swaps</td><td>2x every future swaps</td><td></td></tr></tbody></table>

### Supply and Borrow&#x20;

<table><thead><tr><th width="184.37109375">Activity Streak</th><th width="285.75390625">Point Multiplier Applied (After 10 Days)</th><th>Point Multiplier Applied (After 20 Days)</th></tr></thead><tbody><tr><td>$100 TVL supplied for 1 day = 100 points</td><td>1.2x</td><td>1.5x</td></tr><tr><td>$100 TVL borrowed for 1 day = 300 points</td><td>1.2x</td><td>1.5x</td></tr></tbody></table>

### Liquidity Provider

<table><thead><tr><th width="183.46875">Activity Streak</th><th>Point Multiplier Applied (After 10 Days)</th><th>Point Multiplier Applied  (After 20 Days)</th></tr></thead><tbody><tr><td>$100 LP supplied for 1 day = 200 points</td><td>1.2x</td><td>1.5x</td></tr></tbody></table>


# Untitled


# PassKey Account

To reduce onboarding friction and improve the cross-chain user experience, CrossChain Lending supports Passkey-based accounts. Allows users to create and access an account without managing private key

Below is a **clean, GitBook-ready version** with clearer structure, tighter language, and consistent terminology. I’ve kept it neutral and product-focused, suitable for user + dev docs.

***

### Passkey and CrossChainLendingAccount Relationship

Account Creation Mechanism

Users can create a **CrossChainLendingAccount** using only a Passkey.

How it works:

* The **Passkey public key** is recorded in a smart contract on the **NEAR blockchain**
* The contract treats this public key as a **valid account control credential**
* The Passkey **does not store or expose a private key**

> ⚠️ **Important**\
> A Passkey is **not an on-chain wallet**.\
> It is an **identity and signing mechanism** only.

***

#### Security & Risk Considerations (Critical)

Passkeys have important limitations:

* ❌ Private keys **cannot be exported**
* ❌ Strong dependency on the device and system environment\
  (browser, OS, biometric setup)
* ❌ Device loss or environment changes may result in **permanent loss of access**

As a result, a Passkey-only account **may become unrecoverable** if no backup control method is added.

***

### Mandatory Security Policy: External Wallet Binding

#### Binding Requirement

After creating a CrossChainLendingAccount with a Passkey, users **must bind a wallet from another blockchain**, such as:

* EVM-compatible Wallets
* Solana Wallets
* NEAR Wallets
* Other supported chains

***

#### Purpose of Wallet Binding

Binding an external wallet:

* Provides a **recoverable backup control method**
* Prevents permanent account loss if the Passkey is unavailable
* Enables the bound wallet to act as:
  * An account management tool
  * A signer for critical operations
  * The primary **access recovery method**

***

#### Product-Level Constraints (Recommended)

After Passkey account creation, the UI should:

* Prompt users to **bind an external wallet immediately**
* Restrict **Supply / Borrow** actions until binding is completed
* Display a clear warning:

> **“Passkeys are not recoverable. Please bind another blockchain wallet immediately.”**

***

### Functional Scope of Passkey-Based Accounts

General Principle

If an operation **does not transfer assets out** of the CrossChainLendingAccount, it is considered **safe** for Passkey-based accounts.

***

#### Supported Operations

**✅ Supply**

* Assets are supplied **into** the CrossChainLendingAccount
* The `to` address is the CrossChainLendingAccount
* No outbound asset movement

✅ **Fully supported, low risk**

***

**✅ Repay**

* Assets flow from an external chain **into** the account
* No asset withdrawal involved

✅ **Fully supported, low risk**

***

**✅ Adjust**

* Adjust operations only modify:
  * Internal parameters
  * Risk or position settings
* No asset transfers occur

✅ **Fully supported, very low risk**

***

**⚠️ Borrow**

* Borrow operations transfer assets **out of** the CrossChainLendingAccount
* The destination address can be:
  * Any external blockchain address
  * Including the **bound wallet address**

**Conclusion:**

* Borrow is **technically supported** for Passkey-based accounts
* From a safety and product perspective:
  * **Borrow is strongly recommended only after an external wallet is bound**

***

### Recommended Usage Flow

Standard Flow (Recommended)

1. Create a CrossChainLendingAccount using a Passkey
2. Immediately bind an external blockchain wallet
3. Use all supported features:
   * Supply
   * Repay
   * Adjust
   * Borrow (using the bound wallet as the recipient)

***

#### &#x20;High-Risk Flow (Not Recommended)

1. Create a Passkey-based account
2. Do **not** bind an external wallet
3. Use critical functions such as Borrow

⚠️ If the Passkey is lost, **account control cannot be recovered**

<br>


# RHEA Multi-Chain: TRON Energy Rental

This guide explains the implementation of Energy Rental on the TRON network using the TRXX integration. By utilizing this service, users can significantly reduce TRX burn fees during TRC20 transactions (e.g., USDT).

It covers:

* The TRON resource model
* How energy rental works
* System architecture
* Order flow
* Security and reliability
* External integration capabilities

### Notes

This guide focuses on mechanism, workflow, interfaces, and operational considerations.

It does not include detailed code implementation.<br>

***

## TRON Energy Rental

This page explains how TRON Energy rental works and how to integrate with TRXX.

On TRON, TRC20 transfers such as USDT are contract calls, so they mainly consume Energy. If a wallet does not have enough Energy, the fee is paid in TRX instead. Energy rental is designed to reduce that TRX cost before the user submits the transfer.

### Overview

TRON transaction execution depends on two resources:

* Bandwidth: Used for normal transfers and transaction data
* Energy: Used for smart contract execution

Because TRC20 transfers are contract calls, they primarily consume Energy.

#### Why TRX is Burned

When an address lacks sufficient Energy to cover a contract execution, the network burns TRX to pay for the resource. Typically, a USDT transfer may consume 7–14 TRX depending on network conditions if no Energy is available.

***

### Core Mechanism: Resource Delegation

Energy rental is not a token transfer.

Instead, a provider freezes or stakes TRX to generate Energy, then delegates that Energy to a user address for a limited time.

The flow is:

1. TRXX freezes TRX in its resource account
2. Energy is generated from that staked balance
3. TRXX delegates that Energy to the user address
4. The user consumes that Energy when making a TRC20 transfer
5. TRXX later reclaims the resource when the RENTAL ENDS or is no longer needed

This is the core mechanism behind TRON Energy rental.

### Benefit

Once Energy has been delegated to the user address, the wallet can use that Energy first when sending a TRC20 transfer.

If the delegated Energy is enough, the TRX burn fee is greatly reduced and may be close to zero.

Keep in mind:

* if Energy is not sufficient, some TRX may still be charged
* Bandwidth may still be required
* if Bandwidth is also insufficient, that cost may also be converted into TRX

This is why delegated Energy can directly reduce user transaction costs.

### Architecture

A typical TRON Energy rental integration includes both off-chain and on-chain components.

#### Frontend

The frontend is responsible for:

* Initiating the rental request
* Showing price quotes
* Displaying order status

#### RHEA Backend

Our backend acts as the order coordinator. It is responsible for:

* Creating rental orders
* Signing and authenticating requests
* Syncing order status
* Handling idempotency and recovery logic

#### TRXX

TRXX is responsible for the on-chain execution layer. It handles:

* Maintaining the resource pool account
* Delegating Energy on-chain
* Reclaiming Energy on-chain
* Returning order information
* Sending status callbacks

#### Current architecture flow:

<br>

### Core Processes

1. #### Pre-Quote

Before creating an order, the system should determine:

* The rental period, such as 1H, 1D, 3D, or 30D (Defaults will be 1H)
* The required Energy amount, such as 65,000 Energy

System then requests pricing from TRXX.

The quote is typically used to:

* Show the cost to the user before ordering
* Help the frontend decide whether the rental is worth using\ <br>

2. #### Create Order

When creating an order, the main inputs are:

* receiveAddress: The TRON address that will receive delegated Energy
* period: The rental duration
* energyAmount: The amount of Energy requested

After receiving the order, TRXX will usually:

* Select available resources from its pool
* Delegate Energy to the user address on-chain
* Return an order identifier such as serial
* Return the payable amount\ <br>

3. #### Status Sync

Energy delegation is not always instant, so status synchronization is important.

A reliable integration should use three complementary sync methods:

* #### Webhook (Push)

TRXX pushes a callback when the order succeeds or fails.

This is the fastest update path, but it should not be the only one.

* #### Polling

Rhea backend should periodically check pending orders as a fallback.

This prevents missed updates if a webhook is delayed or lost.

* #### Lazy Refresh

When the user opens or refreshes an order that is still pending, the system can fetch the latest status from TRXX and update it immediately.

This prevents the UI from staying stuck in a stale pending state.

#### Common Status

Typical order states include:

* pending: Delegation is in progress
* delegated: Delegation succeeded and Energy is available
* failed:  Delegation failed
* reclaimed:  Energy has been reclaimed, either manually or after expiry

This three-way sync model improves consistency and reduces missed orders.

4. #### Consume Energy&#x20;

Once an order reaches delegated, the user can submit a TRC20 transfer on TRON.

At that point:

* The wallet consumes delegated Energy first
* The TRX burn fee should drop significantly

Please note:

If there is insufficient Energy, TRX fees may still apply.

A small amount of bandwidth may still be required (if no bandwidth is available, this will be converted to TRX).

5. #### Reclaim

After the user finishes the transfer and no longer needs the delegated Energy, the rental can be reclaimed.

The system calls the reclaim interface, and TRXX revokes the delegation or reclaims the resource on-chain.

The order then moves into reclaimed.

This helps:

* Reduce unnecessary resource usage
* Improve the turnover efficiency of the resource pool

### Security

Because the flow involves billing, resource allocation, and asynchronous callbacks, authentication and anti-tampering protections are required.

#### Request Auth

Requests from RHEA backend to TRXX should be protected using API credentials such as an API key and secret.

Request signing should help ensure:

* The request has not been modified
* Replay attacks are prevented through timestamp and time-window checks

#### Webhook Auth

Webhook callbacks from TRXX should also be verified with signatures.

The system should also support idempotent handling so that the same event is not processed multiple times.

#### Client Auth

If the RHEA system exposes public APIs to the frontend, additional client-side authentication or token protection is recommended.

### Reliability

Because on-chain delegation is asynchronous, a robust integration should not rely on a single update path.

The recommended approach is:

* Webhook for speed
* Polling for recovery
* Refresh on query for UI accuracy

The goal is to ensure:

* Consistent status
* Idempotent retries
* Recoverable failures

### Conditions and Notes

There are several practical considerations during integration.

#### Energy Size

Energy usage is estimated, not fixed.

USDT transfer cost may vary depending on:

* Contract behavior
* Account state
* Whether this is the first interaction
* Current network parameters

A practical approach is to choose a slightly higher Energy amount than the average requirement. For example, 65k Energy is commonly used as a reference value.

#### Activation

In some cases, additional resource usage may happen because of address state or execution path.

In practice, some integrations may use a small TRX transfer to activate an address or ensure enough Bandwidth, depending on the business flow.

#### Concurrency

The same address may create multiple orders in a short time.

The system should clearly define:

* Whether Energy can stack
* Whether one order overrides another
* Whether only the largest allocation should apply

Rate limiting or order merging may also be useful.

#### Failure

Delegation can fail for several reasons, such as:

* Insufficient pool resources
* Network congestion
* Risk-control policies

A clear failure-handling strategy, such as:

* Retry
* Refund
* Switching to another resource pool
* Prompting the user to try another period or Energy level

### API

At a high level, the integration usually only needs the following external capabilities:

1. GetPrice(period, energyAmount)
2. CreateOrder(receiveAddress, period, energyAmount)
3. GetOrder(orderId / serial)
4. ReclaimOrder(orderId / serial) (optional)
5. Webhook: OrderStatusChanged(serial, status, txid...)

These interfaces are enough to support a standard rental flow.

## Flow

A typical integration flow looks like this:

1. User selects a rental period and Energy amount
2. Frontend requests a price quote
3. Backend creates an order with TRXX
4. TRXX delegates Energy on-chain
5. Backend syncs status through webhook, polling, and refresh
6. User sends a TRC20 transfer using the delegated Energy
7. Backend optionally reclaims the order after usage

This matches the document’s intended integration pattern and operating model.

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

## Summary

TRON Energy rental is fundamentally a resource delegation model.

TRXX provides the resource pool and the on-chain execution layer. RHEA system is mainly responsible for order orchestration, authentication, status synchronization, and user-facing integration.

By delegating Energy before the user submits a TRC20 transfer, the system can significantly reduce the TRX burned as transaction fees.

<br>


# &#x20;NEAR Chain Guides

A comprehensive guide for the NEAR community on using RHEA Finance’s NEAR-native products, covering key features, workflows, and best practices.

* **RFQ DEX** – Core trading execution with best pricing and low slippage
* **Liquidity Pools** – Provide liquidity to earn trading fees
* **Liquidity Pools Farming** – Incentivized LP participation with additional rewards
* **Lending and Borrowing** – Use assets more efficiently by earning interest or accessing liquidity while borrow against it&#x20;
* **Margin Trading** – Amplify trading strategies using borrowed capital
* **Yield Boost** – Enhance yields through protocol incentives and optimizations with $RHEA token
* **NEAR Liquid Staking Token (LST)** – Earn staking yield while maintaining liquidity
* **RHEA’s Bridge Aggregator** – Seamless cross-chain asset movement into the ecosystem
* **RHEA Point System** – Track and reward user activity and protocol participation
* **RHEA Credits** – Fair, controlled redemption mechanism aligned with long-term engagement. A layer of reputation from Point System&#x20;


# RFQ DEX

The liquidity on RHEA Finance is provided by Liquidity Providers (LPs) who stake their tokens in the associated 'Pools'. In return, they receive LP (Liquidity Provider) tokens, which can be staked to earn REF and other tokens in the 'Farms'.&#x20;

When you trade (swap) on RHEA Finance, you will pay the pool fee (trading fee), which is broken down as follows:

![](/files/3efWEtc3ueu0SVsLSaSO)

For traders, the fee is always taken on the amount paid. The Protocol and Referral fees translate into LP tokens.

{% hint style="info" %}
For regular pools (Swap function), if there is no account to receive the Referral Fee, it goes to all LPs of that pool as a form of increased LP tokens.x3

For stablecoin pools (StableSwap function), if there is no account to receive the Referral Fee, it goes to the Protocol Fee as a form of increased LP tokens.

To learn more about this subject, click the link for additional details: <https://gov.ref.finance/t/contract-upgrade-1-7-0-referral-fee/823> <br>
{% endhint %}


# Swap

## To start trading on the Lite version:

Make sure you are connected to RHEA Finance with your wallet.

### Step 1: Select the pair you want to swap, such as NEAR to DAI.

<figure><img src="/files/8Mz7XcXMFUvleNbyIji0" alt="" width="375"><figcaption></figcaption></figure>

### Step 2: Review and adjust your Transaction Settings if necessary.

<figure><img src="/files/p3C0yYyK9l8XwZAstjSy" alt="" width="375"><figcaption></figcaption></figure>

### Step 3: Click on Details and verify the transaction elements.

<figure><img src="/files/AyhCqa4IwqklUwcS3vEJ" alt="" width="375"><figcaption></figcaption></figure>

### Step 4: Initiate the swap & approve the transaction (i.e. using NEAR wallet).

<img src="/files/aUoaMXDDjDrU9WxNC8zd" alt="" width="365">


# Limit Orders

Limit Orders using Ref v2's DCL Pools

### Introduction

In addition to the improvements that [Discretized Concentrated Liquidity](/near-chain-guides/liquidity-pools/rhea-v2-pools) (DCL) brings, Ref v2 also includes a built-in limit order functionality, that allows for a Centralised Exchange-like trading experience. Consequently, this means that a limit order can only be placed when a DCL pool exists containing both the "buy" and "sell" tokens.  &#x20;

### Creating Limit Orders

To create a limit order, go to the Limit Order tab on the Trade page, and select the tokens you are going to use for the order. The "sell" token is the one in your wallet that you are going to trade for the "buy" token.&#x20;

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

When creating a limit order, you must choose a swap rate that has a corresponding bin within the DCL pool (see [Pooling - DCL Pools](/near-chain-guides/liquidity-pools/rhea-v2-pools) for more info). This is not a real issue, because the difference separating one bin from the next is very small, and if you enter a rate that does not have a corresponding bin, the site will automatically change it to the closest rate that does.

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

Clicking "Market Rate" sets the price to the bin closest to the current market rate. Use the "+" and "-" buttons to change the rate to the next or previous bin. Clicking the "loop" icon to the left of the token name changes whether the price is based on the "buy" token or "sell" token. When the lock is enabled, changing the quantity of the "buy" token will change the quantity of the "sell" token so that it matches the rate. When it is unlocked, changing the "buy" amount will keep the "sell" amount the same, and alter the price to reflect the quantities desired.&#x20;

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

Click the "Create Order" button when you are done setting the quantities and price for your order.

### Viewing Limit Orders

You can view your current and previous limit orders by clicking "Order(s)" at the bottom of the Limit Order tab.&#x20;

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

The Orders page has an "Active" and "History" tab. Active orders are ones that have not been filled, have been partially filled, or have been fully filled but have not been "Claimed". Partially filled orders can be identified by the fact that both their Claim and Cancel buttons are enabled.

### Canceling Orders

Unfilled orders can be canceled, as well as the unsold portion of partially filled orders. There is no fee or penalty for canceling an order. When an order is canceled, the unsold tokens are returned to your wallet. Canceling a partially filled order will transfer the purchased tokens to your wallet, cancel the unfilled portion of your order, and return the unsold tokens back to your wallet. &#x20;

### Claiming Orders

Once an order has been filled, you need to "Claim" it to transfer the purchased tokens to your wallet. There is no time limit on when you can claim an order once it has been filled.&#x20;

Clicking "Claim" on a partially filled order will transfer the tokens that have been purchased to your wallet, but will not cancel the unfilled portion of the order, so that it may eventually be filled.&#x20;


# Liquidity Pools


# Adaptive Liquidity Market Maker (ALMM)

Adaptive Liquidity Market Maker (ALMM) aim to enhance the trading experience by providing minimal swap price impact on volatile pools.

These pools are seeded with one volatile and one stable asset or two volatile assets but they employ the [Stableswap AMM](https://guide.ref.finance/products/overview/pooling#stablepool) instead of the Constant Product one. This choice enables traders to achieve an unparalleled efficiency as they can swap one asset for another at a 1:1 dollar ratio with little to no price impact.

In standard market conditions, ALMM are expected to gather a much higher trading volume than their standard counterparts.

#### ALMM Example <a href="#gitbookdegenpool-example" id="gitbookdegenpool-example"></a>

Assume there are two XYZ/USDC pools. One uses the Constand Product AMM and the other, the ALMM, uses the Stableswap AMM. Assume the pool TVL is $ 2 mln and that XYZ trades at 10 USDC.

A trader that wants to swap 50,000 USDC for XYZ would receive 4,762 XYZ by swapping in the standard pools and approximately 5,000 XYZ by swapping in the ALMMM. The higher swap efficiency of the ALMM amounts to 5% (5,000 / 4,762 -1 ) in this specific case, without considering swap fees.

#### ALMM Risk factors <a href="#gitbookdegenpool-riskfactors" id="gitbookdegenpool-riskfactors"></a>

Liquidity providers (LPs) that deposit capital in ALMM must be aware of the following risk factors:

* **Impermanent loss:** ALMM can expose LPs to a much higher impermanent loss compared to standard pools. This is because allowing traders to swap at a 1:1 dollar ratio could quickly deplete liquidity of either asset in case of large trading volume.
* **Oracle risk**: ALMMs use external oracle price feeds for the prices of the tokens traded in the pool. An oracle malfunctioning could result in incorrect price feeds which could result in losses to liquidity providers.


# Concentrated Liquidity Market Maker (CLMM)

Concentrated Liquidity Market Maker (CLMM) was built based on the Discretized Concentrated Liquidity (DCL) pool, initially founded by Izumi Team.

Here, we discuss some concepts and behaviors that are important for users and researchers to have a better understanding of ref-v2.

## From Price to Point

In a pool with two types of tokens, like token X and token Y, the price tells you how many of token Y you need to give to get one of token X. If we take an example of a pool with wnear and usdt, and say the price is 4.05 USDT for one wnear, that's what we call the **decimal price**.

Now, there's also something called the **undecimal price**. Since wnear and usdt don't have the same number of decimal places (wnear has 24 and usdt has 6), we have to adjust the price by taking into account these decimals. The price now  comes to **4.05 \* 106 / 1024**

Next, comes the important part. We need to map this continuous price into a discrete one (what we call ***price point*** or just ***point***), in a way that lets 1.0001 \*\* ***point*** be the price splitter. Practically, we limit point in a \[-800,000, 800,000) range, which can represent an undecimal price range of 1.81e-35 to 6.52e+34, that is 1.81e-17 to 6.52e+52 decimal price range in that wnear<>usdt pool.

Now, each point represents a very small price range, and we use the exact price computed from that point to be the fixed price when swapping in this range, which we call a ***constant sum formula*** model. For example, in the previous pool, point -400520 represents a price range of \[4.041169… , 4.041573…). And when swapping in this small range, we take 4.041169… as a fixed swap price.

In a word, we map continuous prices into small ranges of points. For the curve comprised of those points, we take the classic constant production formula for swap. But in those small ranges, we take a constant sum formula for swap.

## From Point to Slot, From Slot to Bin

For those tokens with strong correlation, even a very small price movement will reflect a major change in market. So we allow users to mint liquidity, and place orders on each point.

But for those pool that hold weak correlation even non-correlation tokens, the market price vary frequently and drastically. To get a better performance, we group ***points*** into ***slots***, and only allow users to mint liquidity or place orders on those slot borders.

For example, let’s say take 40 points per slot in the previous wnear-usdt pool, we have three conjunctive slot borders -400560, -400520, -400480, they represent three conjunctive human-readable prices: 4.025040, 4.041574, 4.057366. And the current point is -400498, which means a price of 4.050069. Then If Alice wants to place an order that is just one step over the current price, she can only choose 4.057366. Or to place an order one step below the current one, that would be 4.041574. Seems complex? Don’t worry, our frontend will take care of all this stuff for users. They can just simply click up or down to have a small adjustment of price.

Furthermore, we associate pool fee policy (we call it fee-tier) with the slot. There are 4 fee tiers on REF-V2:

* 0.01% fee rate and 1 point per slot (suitable for stable coins swap pool);
* 0.04% fee rate and 8 points per slot;
* 0.2% fee rate and 40 points per slot;
* 1% fee rate and 200 points per slot;

However, the number of slots for a liquidity pool is still too many, we further group the ***slots*** into ***bins***, and users on Ref UI can only mint liquidity or place orders on bin borders.

## Three Roles And What They Are Capable Of

1. **Liquidity provider**, classic maker, passive party in trade, with swap fee income;
2. **Order owner**, one-way maker, passive party in trade, no swap fee income;
3. **Swapper**, taker, and active party in trade need to pay a swap fee according to the fee tier of the pool;

### Swapper

On ref-v2, the user can directly initiate a swap from token contracts through their ***ft\_transfer\_call*** interface. We support chained swaps, which means the user can swap A to C in a chained way (A→B and B→C) in one TX. The swapped-out token would be auto-transferred back to the user’s wallet and furthermore, all wnear would be unwrapped to near when transferred back to the user.

There are 3 swap modes for the user to choose.

* Normal Swap, support chained swap, swap all token-in into token-out;
* Swap by Output Amount, support chained swap, swap to get given amount of token-out;
* Swap with a Stop Point, only on the single pool, swap all token-in or part of it if the point goes to the stop limit.

For the swap of any point, we always consume orders first and then the liquidity. Liquidity Provider won’t complain about it, cause all swap fee (excluding those that go to protocol), including those generated on swapping of those orders, goes to LP.

### Order Owner

Here, order means limit order. It is a kind of one-way liquidity. A selling order is an order that is placed on a point equal to or above the current point, to sell token X for Y with the price on that point. On the contrary, a buying order is an order that sells token Y for X on a point equal to or below the current point. Just a kind reminder, we have talked it through that orders can only placed at slot borders.

We say the order is one-way liquidity, which means, let’s look at a selling order, if the current price passes the order point from left to right, we ensure this order will be fulfilled and the earned token Y won’t go back to token X even if current price drop back to the left of order point again.

There is a possibility that a race condition would come up. As a contract aggregates all user orders at the same point into one point order, it can NOT tell whose user order is filled and whose not when the point order is partially filled. In this case, order owners come to a race condition that obeys to a first-claim-first-get policy.

If user places a selling order on a point below the current point or a buying order on a point above the current point, we would first try to do a swap-with-stop-point action and if there is any amount left, then an order with the remaining amount would be established. But need to notice, that a swap fee would be charged on swap action.

As a passive party of trader, the earned token won’t auto transfer to the order owner’s wallet, they need to call a claim interface to explicitly harvest their earnings. Currently, this claim interface is combined with the cancel interface, where you put a 0 as cancel amount, which means a pure claim action.

Order owner can cancel / partially cancel his order, and as we just said, it will be claimed internally before trying to cancel. So, it is possible the order has been fulfilled or the remaining amount is less than the requested cancellation amount. But don’t worry, it won’t cause any trouble, we will try to cancel as many as you requested.

User may get some token X or Y back after canceling, an order earning a refund from cancel, or both. Those tokens would directly transfer to user’s wallet.

To save contract storage, we have some limits on the contract level. Each user can only have a maximum of 64 active orders in total. An active order means it still has remaining tokens waiting to sell. Users can either wait for it to be fulfilled or cancel all remaining to save room for new orders. Those non-active orders will go to the user’s history order list. Likewise, the contract only stores the latest 16 history orders per user. But user can fetch all history through our centralized data service.

### Liquidity Provider

User mints liquidity with a range, which is one or several slots. Here we use the word mint, it implies that liquidity is a kind of NFT in REF-V2, but user are free to modify their liquidity NFT by adding or removing its amount.

Only liquidity providers would get benefits from swap fee. Those swap fees in the form of tokens X or Y, won’t go back to pool liquidity. They just stand there waiting for LP to claim, like order earnings but without any race condition in liquidity fee.

The add and remove actions, just like order, would imply an internal claim fee action. And to remove zero amount of liquidity means a pure claim too.

No matter whether to add or remove liquidity, the user may get some token X or Y back, a swap fee income, a refund from removal, or both. Those tokens would directly transfer to user’s wallet.

## About Fee

Although we may have touched on this topic in previous chapters, it is better to have a dedicated chapter to discuss fees.

Basically, we only charge swap fees from those swappers (active party of swap). In other words, we only have a fee for the taker. The fee would be charged in the form of a token-in. For example, on a 0.2% fee pool, when the swapper starts a swap of 100 token-in, he actually uses 99.8 to do the swap, and the 0.2 left is the fee we charged.

For those fees charged, we split them between liquidity in that swap range and protocol. Currently, the share ratio is 50%. This means a 0.2% fee pool, liquidity got 0.1% and the protocol got another 0.1%.

For those fees belonging to liquidity, LP should explicitly call the claim interface to get them back to wallets. If this liquidity has been transferred to a new owner, then the original owner lost all unclaimed fees.


# Classic Pools

"Classic" Liquidity Pools

Classic pools are based on the Uniswap v2 algorithm. They are fully permissionless, meaning that anyone can create a classic pool, and set the fee for that pool.

## Adding liquidity to a Classic Pool

### 1. Go to the Classic Pools tab on the Liquidity Pools page

The Liquidity Pools page can be found in the top menu under "Earn"

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

Make sure you are on the "Classic Pools" tab.&#x20;

<figure><img src="/files/8cOKIGKqSf4cDCLMqsGv" alt=""><figcaption></figcaption></figure>

### 2. Locate a specific pool

There's a search box to filter pools by token, and check boxes to filter by characteristics, such as pools with Farms

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

Incentivized pools have a "Farms" tag next to their token pairs, and those with multiple reward tokens will include a special icon within the tag.&#x20;

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

### 3. Open the "Details" page for a pool&#x20;

Clicking on a pool on the Pools page opens that pool's "Details" page. The pool's Details page shows, well, details about the pool, like the current and historical TVL and 24-hour volume. The pool's Details page also includes an "Add Liquidity" button to open the form for depositing tokens into the pool.

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

The pool's Details page has an "Add Liquidity" button that, when clicked, will open the form for depositing tokens into the pool. If you currently have liquidity in the pool, the button will be named simply "Add", and there will be a "Remove" button next to it.&#x20;

<figure><img src="/files/GIuevMGeQnpT8Xt8Idva" alt="" width="494"><figcaption></figcaption></figure>

<figure><img src="/files/T4yhNhhTvskUzdXiuTO6" alt="" width="497"><figcaption></figcaption></figure>

### 4. Use the Add Liquidity form to add tokens to the pool

After clicking the the "Add Liquidity" button on the pool's Detail page, the Add Liquidity Form will open. Use this form to enter the amount of tokens you want to deposit. The amounts must be in the same proportion as the balance of the pool at that point in time. When you enter an amount for one token, the form will automatically set the proper amount for the second token. You must have **both** tokens in your wallet to add liquidity to a classic pool.

If you click on the numbers to the text "Balance", the form will automatically enter the balanced amount of that token that is maxed in your wallet.&#x20;

<figure><img src="/files/6sPCqnsJRASJtaJhSu4r" alt="" width="375"><figcaption></figcaption></figure>

Click "Pool Stats" at the bottom of the Add Liquidity form to see details about the pool, including the balance of tokens, and the fee for swaps that take place on that pool.

<figure><img src="/files/xU0HlYMiWePGmqyLIbDp" alt="" width="375"><figcaption></figcaption></figure>

## Removing liquidity from a pool

### 1. Go to the Your Liquidity page

You can see all pools you have liquidity in by going to the Your Liquidity page. You can get to the Your Liquidity page by clicking Earn > Your Liquidity in the main menu of the site.&#x20;

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

### 2. Unstake shares from a farm, if necessary

If your shares are staked on a farm you must unstake them before you can remove your liquidity from the pool. If only some shares are staked, you will be able to remove the liquidity for the unstaked portion. See [Farming](/near-chain-guides/liquidity-pool-farming) for more details about staking and unstaking shares.

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

### 3. Use the Remove Liquidity form to withdraw tokens from the pool

After clicking the Remove button, the Remove Liquidity form will appear. You can enter an amount of shares to remove, or click the "MAX" button to remove the liquidity for all your shares.

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

Increase the slippage tolerance If you receive slippage related errors when attempting to remove liquidity from a pool. This may be necessary if there are a lot of swaps occurring on the pool at that time, especially if the pool does not have a lot of liquidity in it.

## Creating a new Classic pool

There are several reasons why you may want to create a new Classic pool on Ref Finance:

1. A pool with the token pairs does not currently exist.
2. A pool with the token pairs exists, but you believe their fees are too high or too low.
3. A pool with the token pairs exists, but you believe the ratio of the token pairs (Amount of Token A / Amount of Token B) is not accurate.

### 1. Click the "Create Pool" button on the Pools page.

The Liquidity Pools page can be found in the top menu under "Earn". Make sure you are on the "[Classic Pools](https://dex.rhea.finance/pools?activeTab=classic)" tab.&#x20;

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

### 2. Use the "Create New Pool" form to configure the new pool

After clicking the "Create Pool" button on the Pools page, the "Create New Pool" form will open. Select the token pairs, enter the total fee for the pool, and then click the "Create" button. You will be able to add liquidity to the pool after it is created. Once a pool is created, the fee cannot be changed.&#x20;

To set the total fee, click on one of the three predefined fees (0.20%, 0.30%, 0.60%), or use the text box to enter any value from 0.01% to 19.99%.

<figure><img src="/files/D1wH8taDP9PjhTVLUnkR" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="/files/0RCgdNVpcsGKlCuFAEzl" alt="" width="375"><figcaption></figcaption></figure>

When trades occur on a Classic pool, 80% of the total fee will be shared among liquidity providers, while the remaining 20% will go toward the Protocol fee and/or Referral fee.&#x20;

### 3. Deposit tokens into the newly created Pool

After the new pool is created, you will be taken to the pool's Details page. Since this pool has just been created, all values are set to zero.

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

### 4. Use the Add Liquidity form to add tokens to the new pool

Just like when [adding liquidity to an existing pool](#4.-use-the-add-liquidity-form-to-add-tokens-to-the-pool), you click the Add Liquidity button on the new pool's Details page to open the Add Liquidity form. The only difference between adding liquidity to a newly created pool vs an existing one, is that for newly created pools, you can set any amount to deposit for both tokens. The amounts you choose will determine the starting ratio of the tokens. This ratio will change whenever a trade takes place on the pool.&#x20;

It is recommended that you do your own research before deciding on the initial balance of a pool. Choosing an incorrect amount can result in a significant loss of funds within seconds of your initial deposit, as arbitrage bots take advantage of the difference between your pool's token balance and those on existing pools, exchanges, or prices on other types of trading services.&#x20;


# Stable & Rated Pools

Stable pools, which can contain two or three tokens, use Curve's StableSwap algorithm. Rated pools are for yield-bearing tokens, and are based on a variation of Curve's StableSwap algorithm.

## How to add liquidity to a Stable or Rated Pool

### 1. Go to the Stable Pools tab on the Liquidity Pools page

The Liquidity Pools page can be found in the top menu under "Earn"

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

Make sure you are on the "Stable Pools" tab.&#x20;

### 2. Locate a specific pool

There's a search box to filter pools by token, and sub-tabs to filter by type of pool.&#x20;

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

"USD" pools are stable pools where all tokens are pegged to the US dollar. BTC are pools where both tokens are pegged to Bitcoin. "NEAR" are Rated pools where one of the tokens is wNEAR, and the second is a a yield-bearing, or "liquid staking", token like STNEAR, NEARX, and LINEAR.

Incentivized pools have a "Farms" tag next to their token pairs, and those with multiple reward tokens will include a special icon within the tag.&#x20;

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

### 3. Open the page for the Stable or Rated pool&#x20;

Clicking on a Stable or Rated pool on the Pools page will open a page with tabs to Add or Remove liquidity

<figure><img src="/files/YcSDYQ3xzPi6jfgFViKe" alt="" width="375"><figcaption></figcaption></figure>

### 4. Enter the amounts to deposit

You have three choices when adding liquidity to a Stable or Rated pool. You can deposit any amount of one or more of the pool tokens, deposit amounts that are in the same proportion as the current balance of the pool, or deposit all the tokens in your wallet for that pool.&#x20;

<div align="center"><figure><img src="/files/UFlIGqhLISu8RLYDUUwR" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/gHWluiFrjk4sGIWaesbo" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/TgUeOmCIf69JBf62Y6Zt" alt="" width="375"><figcaption></figcaption></figure></div>

Once you have entered the amounts you wish to add, click "Add Liquidity" to deposit the tokens. You will need to approve the transaction(s) on your wallet for the deposit to be made.&#x20;

## How to remove liquidity from a Stable or Rated pool

### 1. Go to the Your Liquidity page

You can see all pools you have liquidity in by going to the Your Liquidity page. You can get to the Your Liquidity page by clicking Earn > Your Liquidity in the main menu of the site.&#x20;

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

### 2. Unstake shares from a farm, if necessary

If your shares are staked on a farm you must unstake them before you can remove your liquidity from the pool. If only some shares are staked, you will be able to remove the liquidity for the unstaked portion. See [Farming](/near-chain-guides/liquidity-pool-farming) for more details about staking and unstaking shares.

<figure><img src="/files/Yun4HFDhAeuKCiZDVnjb" alt=""><figcaption><p>Pool shares are currently staked on a Farm and must be unstaked in order to remove tokens from the pool.</p></figcaption></figure>

### 3. Use the Remove Liquidity tab on the Stable or Rated pool

Clicking the Remove button on a Stable or Rated pool will take you to the Remove Liquidity tab on the pool's page.&#x20;

You have the option to remove your liquidity by Share, or by Token. If you remove by Share, you will get back amounts of all the tokens in the pool, proportional to the current balance of those tokens within the pool. If you remove by Token, you decide which tokens you will receive and at what amounts. The current balance of the tokens in the pool will determine how many shares the amounts you entered are worth.

<div><figure><img src="/files/vO07CJ4RtJsxM5V6Sphh" alt="" width="375"><figcaption><p>Removing tokens from a Stable pool by shares.</p></figcaption></figure> <figure><img src="/files/Xt4QRgjtS4Ug07orQBA5" alt="" width="375"><figcaption><p>Removing liquidity from a Stable pool by Token.</p></figcaption></figure></div>

Increase the Slippage Tolerance If you receive slippage related errors when attempting to remove liquidity from a pool. This may be necessary if there are a lot of swaps occurring on the pool at that time, especially if the pool does not have a lot of liquidity in it.


# RHEA v2 Pools

Pooling with RHEA v2's Discretized Concentrated Liquidity AMM

### Introduction

RHEA v2's Discretized Concentrated Liquidity (DCL) pools are based on [iZUMi Finance’s Discretized Liquidity AMM](#user-content-fn-1)[^1]. Each DCL Pool is divided into many separate bins, each of which represents a slightly different swap rate between the two tokens in the pool.&#x20;

When a Liquidity Provider (LP) deposits their assets in a DCL Pool, they select a range of swap rates for which their assets can be used for swapping. In other words, their liquidity is “concentrated” within a specific range of swap rates, which is then distributed among separate, or “discrete”, bins along that range. This differs from the pools in RHEA v1, where liquidity is evenly distributed throughout the curve of the constant product formula (x \* y = k).

<figure><img src="/files/i79EZvPqbT3HwzBWSsed" alt=""><figcaption><p>Liquidity Distribution in a DCL Pool</p></figcaption></figure>

To determine the swap rate, the exchange uses a virtual constant product curve, derived from the total liquidity in the pool and how it is distributed. When a swap takes place, the exchange identifies which bins to use for the transaction. It treats each bin as if it were a pool, and manages each one separately using a method based on the constant sum formula (x + y = z).

<figure><img src="/files/0XizfRBi6fytsNtOYNnS" alt=""><figcaption><p>Virtual vs Real Reserves in DL Pools</p></figcaption></figure>

When a swap takes place against a DCL pool, only the LPs with assets placed within bins utilised for the swap will receive a share of the swap fees, in proportion to their share of the liquidity within those bins. This differs from the pools in RHEA v1, where fees are shared among all LPs in proportion to their share of the liquidity within the entire pool. Another way RHEA v2 differs is that a LP’s share of the fees is immediately allocated to them, and are not part of the pool’s liquidity.

### Types of DCL Strategy

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

* **Uniform (Flat) Liquidity**: In this model, liquidity is distributed evenly across all price ranges. No matter what the current price is, the liquidity is the same for each price point. This is the simplest form of liquidity distribution and is used by some of the earliest AMMs. It's like spreading a fixed amount of resources across a battlefield evenly, without concentrating forces at any strategic point.
* **Normal (Bell Curve) Liquidity**: Here, liquidity is distributed according to a normal distribution, with most of it concentrated around a certain price, which is usually the current or the expected future price of the asset. The further away from this price, the less liquidity is available.
* **Skewed (Asymmetric) Liquidity**: In a skewed distribution, liquidity is not evenly distributed and is instead biased towards a certain price direction. A skewed distribution could look like a normal distribution that has been pushed to one side. This is akin to placing more soldiers on one flank of an army in anticipation of the main attack coming from that direction.<br>

### Risks with DCL Pools

The more concentrated a LP’s liquidity is (i.e. the smaller the range of swap rates they choose when they deposit), the higher their share of the fees will be when their liquidity is used for a swap, compared to how much they would have received had they spread their liquidity over a wider range. However, there is also increased risk. If the overall swap rate goes outside the bounds they have chosen, their entire position will be converted to the token that is decreasing in value relative to the other.&#x20;

For example, if a LP deposits USDC.e and NEAR within the range of 2.23572 - 2.730688 USDC.e/NEAR, and the value of NEAR drops below 2.23572 USDC.e, then their entire position will be converted to NEAR. If the value of NEAR goes above 2.730688 USDC.e, then their entire position will be converted to USDC.e.

<figure><img src="/files/HT42K2wLF3S2ZAXXS4vC" alt=""><figcaption><p>Price points at which a position is converted into one token. The more concentrated a LP’s liquidity is, the higher the risk that their entire position will be converted to the token whose value is decreasing relative to the other.  </p></figcaption></figure>

### Depositing Liquidity

To deposit liquidity in a DCL pool, first go to the "V2 Pools" tab on the Pools Page, click on a pool, and then click "Add liquidity".

<figure><img src="/files/mNJUETNhZUkEbuiPI8r5" alt=""><figcaption><p>DCL Pools are found in the "V2 Pools" tab of the Pools Page.</p></figcaption></figure>

<figure><img src="/files/cin6DuXXXIOd5F6I3qK4" alt=""><figcaption><p>The "Add Liquidity" button is on each pool's detail page. </p></figcaption></figure>

Choose a minimum and maximum rate that your assets can be used for swaps, and the amounts to deposit. There may be pools with multiple "Fee Tiers" to choose from. The higher the fee, the more you make from swaps that utilize your pool, but your pool is less likely to be selected for swaps than pools with lower fees.&#x20;

<figure><img src="/files/8kQF9hjofotsHc4yebI7" alt=""><figcaption><p>The Add Liquidity form for a DCL pool.</p></figcaption></figure>

### Claiming Swap Fees

With RHEA v2's DCL Pools, your share of the swap fees are immediately allocated to your account, and are not part of the pool’s liquidity. You can “claim” your share of the fees at any time, without removing any liquidity from the pool. However, adding or removing liquidity will automatically transfer any unclaimed tokens to your wallet. &#x20;

<figure><img src="/files/mL9ZhvX0lhIG97zqhi86" alt=""><figcaption><p>Clicking the "Claim" button will transfer your share of the swap fees to your wallet.</p></figcaption></figure>

### Adding More Liquidity

If you want to add more liquidity to a pool, you will be given two choices. You can add more liquidity to your existing position, or you can create a new position and select a different range to deposit your liquidity in.&#x20;

<figure><img src="/files/c8Hv6BNb06RRjbSPY8fc" alt=""><figcaption><p>You are presented with this form when adding liquidity to a pool that you already have a position in.</p></figcaption></figure>

### Removing Liquidity

After clicking the "Remove" button on the pool page, you will have the option of removing all your liquidity, or only a portion of it. Removing any liquidity will automatically transfer any unclaimed tokens from swap fees to your wallet.&#x20;

<figure><img src="/files/DcGGHqaRqRXgraHCfgqv" alt=""><figcaption><p>You can remove some or all of your liquidity.</p></figcaption></figure>

[^1]: <https://izumi.finance/paper/dswap.pdf>


# Liquidity Pool Farming

Farming or Yield Farming is defined as the process of staking your LP tokens into a farm, to earn additional rewards, on top of your existing liquidity position(s) swap fee revenue.

Like pools, all farms are contained in one single contract (v2.ref-farming.near). Plus, a farm can support up to 16 different reward tokens.

Liquidity incentives are usually used by projects' owners to attract liquidity and to facilitate trading.

{% hint style="info" %}
When you stake LP tokens into a farm, you also continue to earn trading fees from the corresponding liquidity pool
{% endhint %}

## How to farm?

First, make sure that you are connected to Ref Finance with your wallet.

### Step 1: Click on Farms and choose a relevent pool

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

In the Farms section, you can view all old, live, and future farms and filter them by different criteria.

To farm, you need LP tokens, which means you need to provide liquidity initially for the corresponding pool. To provide liquidity, please refer to the [Pooling section](/near-chain-guides/how-rhea-finance-works/pooling).&#x20;

{% hint style="info" %}
Farms are limited to a certain number of pools, not all pools have a yield farming option &#x20;
{% endhint %}

You can check the associated pool of a farm by either clicking on the pool, choosing Add liquidity or Get LP Tokens

<figure><img src="/files/5ZaHfUTvOSIy8qgF7yTE" alt=""><figcaption></figcaption></figure>

### Step 2: Click on Stake after adding liquidity

Note that you can do some yield simulations by clicking on ROI calculator. Please be careful as the simulations are 'other things being equal' (i.e. not taking into account potential Divergence Loss).

Enter the amount of LP tokens you want to stake.

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

### Step 3: Stake & approve the transaction (i.e. using NEAR wallet)

![](/files/xp5QltE02qUPUMQGVRf8)

## Track, claim and withdraw farming rewards

First, make sure that you are connected to RHEA Finance with your wallet.

### Step 1: Click on Farms and select Yours, Click your farm

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

### Step 2: Claim your rewards

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


# Lending & Borrowing

The lending & borrowing platform is a decentralized, non-custodial, pool-based interest rates platform that enables users to supply assets to earn interest, and to borrow against them to unlock liquidity, similar in nature to Aave, Compound, and other pool-based protocols.

The platform runs natively on the NEAR blockchain, a layer 1, proof-of-stake, sharded blockchain with a WebAssembly runtime. The protocol's smart contracts are written in Rust.

The protocol aims to unlock liquidity for interest-bearing assets, particularly layer 1 staking derivatives such as stNEAR and stETH. For instance, users will be able to deposit stNEAR as collateral, then borrow more NEAR to create a leveraged staking position, or borrow a stablecoin to create a self-repaying position.

Access the app at: <https://lending.rhea.finance/>

[<br>](https://docs.burrow.finance/product-docs/introduction/audits-and-risks)


# Supplying

## Introduction

Users can supply assets to the protocol and immediately begin earning passive interest. The [interest rates](https://app.gitbook.com/o/-MhIAeiN1ghyR-ugLhMu/s/-MhIB0bSr6nOBfTiANqT-2910905616/~/changes/141/products/guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model) are variable and will fluctuate based on the utilization rate for the given asset.

Users can withdraw their supplied assets at any time, as long as the utilization rate for the asset will be less than 100% after the withdrawal. If the withdrawal will raise the utilization rate to 100%, the withdrawal will be temporarily unavailable (note: if this does occur, it will be a very expensive situation for borrowers, and lucrative for suppliers)

Users can also designate a percentage of their supplied assets as collateral. Assets not designated as collateral will not be subject to liquidation and will continue to accrue interest. Users can manage which assets are designated as collateral (and what percentage of each asset) at any time.

#### Supported Assets <a href="#supported-assets" id="supported-assets"></a>

* NEAR
* STNEAR
* LINEAR
* NearX
* AURORA
* WOO
* ETH
* wBTC
* USDC
* USDT
* DAI
* USN
* BRRR


# Borrowing

## Introduction

Users can borrow against their supplied assets. All positions must be over-collateralized. If the value of a user's collateral drops below the minimum collateral ratio, their collateral will be liquidated to pay off their debt.

On the borrowing platform, each asset has a unique minimum collateral ratio, as each asset carries unique risk. The collateral ratios of each asset can be found here

The aggregate risk of an account can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

To learn more about how the health factor is calculated, click here


# APY

## Introduction <a href="#introduction" id="introduction"></a>

\
Annual Percentage Yield (APY) is the compounding interest on a deposit or a loan after a year, calculated based on the initial principal. Each asset has its own market of supply and demand with its own APY that evolves with time. You may find more details about Burrow's interest rate model [here](/near-chain-guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model)

## Supply APY <a href="#supply-apy" id="supply-apy"></a>

Supply APY is the current interest APY of the asset when you supply. Each asset has a different set of parameters that determines its actual yield at different points. You may find more details about the  interest rate model [here](/near-chain-guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model).

When you supply, you may get liquidity mining rewards like BRRR, USN, or other tokens. As a result, the actual supply APY may be higher.

## Borrow APY

Borrow APY is the current interest APY of the asset when you borrow. Each asset has a different set of parameters that determines its actual yield at different points. You may find more details about the interest rate model [here](/near-chain-guides/lending-and-borrowing/how-lending-and-borrowing-works/interest-rate-model).

When you borrow, you may get liquidity mining rewards. As a result, the actual borrow APY may be lower.


# Health Factor

## Introduction <a href="#introduction" id="introduction"></a>

Users can borrow against their supplied assets. All positions must be over-collateralized. The risk of a position can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

## Computation <a href="#computation" id="computation"></a>

The Health Factor is computed per account instead of per asset.

Each asset has a configuration value `collateral_factor` which indicates the expected price stability factor.

The higher the factor, the higher expectation of the stability of the price of the corresponding asset.

To compute the current health factor for the account, we need to know the current prices of all collateral and borrowed assets.

Firstly, we compute the adjusted sums of all collateral assets and borrowed assets.

`adjusted_collateral_sum = sum(collateral_i * price_i * collateral_factor_i) adjusted_borrowed_sum = sum(borrowed_i * price_i / collateral_factor_i)`

Now we can compute the health factor:

`health_factor = adjusted_collateral_sum / adjusted_borrowed_sum`

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

In the Lending & Borrowing smart contracts, `collateral_factor` is also named `volatility_ratio`

## Example <a href="#example" id="example"></a>

Account `alice.near` supplied to collateral `1000 wNEAR` and borrowed `4000 nDAI`.

Let's say (note: the numbers are hypothetical for illustration purposes only):

* the price of `wNEAR` is `10`
* the price of the `nDAI` is `1`
* the `collateral_factor` of `wNEAR` is `0.5`
* the `collateral_factor` of `nDAI` is `1`

The health factor of `alice.near` is the following:

* `adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 5000 / 4000 = 125%`


# Audits & Risks

## Audits <a href="#audits" id="audits"></a>

The Lending & Borrowing Platform has undergone two smart contract audits by the independent auditing firm [BlockSec](https://www.blocksecteam.com/) between February and March of 2022.

For the full reports, see below:

* [Security Audit Report by BlockSec, February 2022 ](https://github.com/NearDeFi/burrowland/blob/main/blocksec-audit-signed-1.pdf)
* [Security Audit Report by BlockSec, March 2022](https://github.com/NearDeFi/burrowland/blob/main/blocksec-audit-signed-2.pdf)

Audits, though a good practice to maintain security standards and minimize potential risks, are not an end-all-be-all when it comes to protocol security. The completed audit of specific contracts does not equate to the security of the entire protocol and does not relate to other layers of risk such as runtime pricing or the human influence on protocols. Moreover, security does not mean the elimination of risk inherent in financial products: always do your own research and manage risk appropriately.

## Risks <a href="#risks" id="risks"></a>

Although we take a multitude of safety precautions and the contracts have been audited, participating in DeFi comes with certain risks. Below is a list of potential risks associated with using the protocol.

## **Smart Contracts Risks**

While our smart contracts have been audited by third-party firms, they could theoretically have vulnerabilities.

## **Liquidation**

Assets that are deposited or borrowed on the protocol could fluctuate in value due to the systemic risks of the issuing platforms or market volatility, including the loss of peg of certain pegged assets. This could result in the [liquidation](https://docs.burrow.finance/product-docs/introduction/audits-and-risks#liquidation-risks) or closing of a user's position.

## **Bad Debt**

The risk of debt accrued by underwater positions in case liquidators do not liquidate in time during a period of high market volatility.

While we do our best to eliminate all the possible risks, DeFi is an industry where events that no one predicted can occur(the dreaded black swans). So please don’t invest your life savings, or risk assets you can’t afford to lose. Try to be as careful with your funds as we are with our code. [😊](https://emojipedia.org/smiling-face-with-smiling-eyes/)


# LP as Collateral

Increase the capital efficiency of LP assets!

LP tokens are no longer limited to farming, they can also be supplied to Burrow as collateral to borrow other assets at the same time.

## **Use Case** <a href="#use-case" id="use-case"></a>

When capital is tight and you want to both retain LP income and borrow other assets, you can use LP as collateral.

## LP Price <a href="#lp-price" id="lp-price"></a>

The price of LP is ensured by Ref's contract. The Burrow contract will automatically fetch the price from the Ref contract during on-chain operations to ensure real-time accuracy.

## Separate position <a href="#separate-position" id="separate-position"></a>

From a security perspective, LP Collateral positions are independent. Each LP token type has its own separate position. When borrowing other assets, users need to select the collateral position they wish to use.

\ <br>


# How Lending & Borrowing works


# Health Factor

## Introduction <a href="#introduction" id="introduction"></a>

Users can borrow against their supplied assets. All positions must be over-collateralized. The risk of a position can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.

## Computation <a href="#computation" id="computation"></a>

The Health Factor is computed per account instead of per asset.

Each asset on Burrow has a configuration value `collateral_factor` which indicates the expected price stability factor.

The higher the factor, the higher expectation of the stability of the price of the corresponding asset.

To compute the current health factor for the account, we need to know the current prices of all collateral and borrowed assets.

Firstly, we compute the adjusted sums of all collateral assets and borrowed assets.

`adjusted_collateral_sum = sum(collateral_i * price_i * collateral_factor_i) adjusted_borrowed_sum = sum(borrowed_i * price_i / collateral_factor_i)`

Now we can compute the health factor:

`health_factor = adjusted_collateral_sum / adjusted_borrowed_sum`

If the health factor is higher than 100%, it means the account is in a good state and can't be liquidated.

If the health factor is less than 100%, it means the account can be partially liquidated and can't borrow more without repaying some amount of the existing assets or providing more collateral assets.

> In lending & borrowing smart contracts, `collateral_factor` is also named `volatility_ratio`

Example\ <a href="#computation" id="computation"></a>
-----------------------------------------------------

Account `alice.near` supplied to collateral `1000 wNEAR` and borrowed `4000 nDAI`.

Let's say (note: the numbers are hypothetical for illustration purposes only):

* the price of `wNEAR` is `10`
* the price of the `nDAI` is `1`
* the `collateral_factor` of `wNEAR` is `0.5`
* the `collateral_factor` of `nDAI` is `1`

The health factor of `alice.near` is the following:

* `adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 5000 / 4000 = 125%`


# Interest Rate Model

The platform uses a compounding interest model similar to [Aave](https://docs.aave.com/risk/liquidity-risk/borrow-interest-rate).

Each asset defines interest rate configuration with the following values:

* `target_utilization` - the utilization rate targeted by the model, e.g. 80% borrowed comparing to the total supplied.
* `target_utilization_r` - the constant to use as a base for computing compounding APR at the target utilization.
* `max_utilization_r` - the constant to use as a base for computing compounding APR at the 100% utilization.
* `reserve_ratio` - the percentage of the acquired interest reserved for the platform.

Based on these values we define 3 points of utilization: `0%`, target utilization and `100%`. For each of these points we have the `r` constant: `1.0`, `target_utilization_r` and `max_utilization_r` respectively.

To compute the APR, we can use the following formula:

`1 + APR = r ** MS_PER_YEAR`, where MS\_PER\_YEAR is the number of milliseconds in a year equal to `31536000000`.

Based on the current supplied, reserved and borrowed balances, the current utilization is defined using the following formula:

`utilization = borrowed / (supplied + reserved)`

To compute the current APR, we need to find the current `r` constant based on the linear interpolation between utilization points:

* if `utilization <= target_utilization`, `r = target_utilization_r * (utilization / target_utilization)`
* if `utilization > target_utilization`, `r = target_utilization_r + (max_utilization_r - target_utilization_r) * (utilization - target_utilization) / (1 - target_utilization)`

To calculate the amount of interest acquired for the duration of `t` milliseconds, we can use the following formula:

`interest = (r ** t) * borrowed`

The interest are distributed to `reserved` and `supplied`, based on `reserve_ratio`, so the new values are: `reserved_interest = interest * reserve_ratio new_reserved = reserved + reserved_interest new_supplied = supplied + (interest - reserved_interest) new_borrowed = borrowed + interest`


# Liquidations

## Introduction

A liquidation is triggered when an account's Health Factor goes below 100%, due to its collateral value not being sufficient to cover the debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value.

Burrow's liquidation mechanism is designed to make liquidators compete for the profit that they make during liquidations to minimize the loss taken by unhealthy accounts. This is achieved by introducing a variable discount with variable liquidation size, Instead of offering a fixed profit that is used in other protocols.

## Liquidation rules <a href="#liquidation-rules" id="liquidation-rules"></a>

Liquidations on Burrow follow 3 basic rules:

1. The initial health factor of the liquidated accounts has to be below 100%
2. The discounted sum of the taken collateral should be less than the sum of repaid assets
3. The final health factor of the liquidated accounts has to stay below 100%

The first rule only allows liquidating accounts in an unhealthy state. The second rule prevents from taking more collateral than the repaid sum (after discount). The third rule prevents the liquidator from repaying too much of the borrowed assets, only enough to bring closer to the 100%.

A liquidation action consists of the following:

* `account_id` - the account ID that is being liquidated
* `in_assets` - the assets and corresponding amounts to repay form borrowed assets
* `out_assets` - the assets and corresponding amounts to take from collateral assets

The discount is computed based on the initial health factor of the liquidated account:

`discount = (1 - health_factor) / 2`

Now we can compute the taken discounted collateral sum and the repaid borrowed sum:

* `taken_sum = sum(out_asset_i * price_i)`
* `discounted_collateral_sum = taken_sum * (1 - discount)`
* `repaid_sum = sum(in_asset_i * price_i)`

Once the action is completed, we can compute the final values and verify the liquidation rules:

1. `health_factor < 100%`
2. `discounted_collateral_sum <= repaid_sum`
3. `new_health_factor < 100%`

## Liquidation example

Account `alice.near` supplied to collateral `1000 wNEAR` and borrowed `4000 nDAI`.

Let's say (note: the numbers are hypothetical for illustration purposes only):

* the price of `wNEAR` is `10`
* the price of the `nDAI` is `1`
* the `collateral_factor` of `wNEAR` is `0.5`
* the `collateral_factor` of `nDAI` is `1`

The health factor of `alice.near` is the following:

* `adjusted_collateral_sum = sum(1000 * 10 * 0.5) = 5000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 5000 / 4000 = 125%`

Let's say the price of `wNEAR` drops to `8`

* `adjusted_collateral_sum = sum(1000 * 8 * 0.5) = 4000`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 4000 / 4000 = 100%`

The health factor is 100%, so the account still can't be liquidated.

Let's say the price of `wNEAR` drops to `7`

* `adjusted_collateral_sum = sum(1000 * 7 * 0.5) = 3500`
* `adjusted_borrowed_sum = sum(4000 * 1 / 1) = 4000`
* `health_factor = 3500 / 4000 = 0.875 = 87.5%`

The health factor is below 100%, so the account can be liquidated. The discount is the following:

`discount = (1 - 0.875) / 2 = 0.0625 = 6.25%`

It means anyone can repay some `nDAI` and take some `wNEAR` from `alice.near` with `6.25%` discount.

Account `bob.near` decides to liquidate `alice.near`

`bob.near` wants to repay `1000 nDAI`, we can compute the maximum sum of the collateral to take:

* `repaid_sum = sum(1000 * 1) = 1000`
* `max_taken_sum = repaid_sum / (1 - discount) = 1000 / (1 - 0.0625) = 1066.666`

And based on the `wNEAR` price, we can compute the maximum amount:

`max_wnear_amount = max_taken_sum / wnear_price = 1066.666 / 7 = 152.38`

But to avoid risk, `bob.near` takes `152` `wNEAR` - a bit less to avoid price fluctuation for the duration of the transaction.

Let's compute the liquidation action:

* `taken_sum = sum(out_asset_i * price_i) = sum(152 * 7) = 1064`
* `discounted_collateral_sum = taken_sum * (1 - discount) = 1064 * (1 - 0.0625) = 997.5`
* `repaid_sum = sum(in_asset_i * price_i) = sum(1000 * 1) = 1000`
* `new_adjusted_collateral_sum = sum((1000 - 152) * 7 * 0.5) = 2968`
* `new_adjusted_borrowed_sum = sum((4000 - 1000) * 1 / 1) = 3000`
* `new_health_factor = 2968 / 3000 = 0.9893 = 98.93%`

Now checking the liquidation rules:

`1. 87.5% < 100% 2. 997.5 <= 1000 3. 98.93% < 100%`

All rules were satisfied, so the liquidation was successful.

Now, let's compute the profit of `bob.near` (or the loss for `alice.near`) for this liquidation:

`profit = taken_sum - repaid_sum = 1064 - 1000 = 64`

Notes:

* During the time when the price of `wNEAR` was falling from `8` to `7`, if someone liquidated `alice.near`, they would have made less profit, by liquidating a smaller amount with a smaller collateral discount.
* To fully realize the profit, `bob.near` has to make another transaction to swap received `152` `wNEAR` for `nDAI`, which may involve extra fees and transactional risks. That's why liquidators may wait for higher discount.

## Liquidation Bot <a href="#liquidation-bot" id="liquidation-bot"></a>

You can find an example liquidation bot [here](https://github.com/NearDeFi/burrowland-liquidation-bot).<br>


# Oracle

## Price Oracle <a href="#price-oracle" id="price-oracle"></a>

The platform uses a MakerDAO-inspired whitelisted oracle. The oracle currently has five independent operators and may be easily extended into a decentralized, self-sustainable network. For a price to be reported on-chain, the majority of oracles must propose the current price within a tight range.

Relevance of the price is less than 1 minute.

In the future, the DAO will consider adding other robust oracle solutions supported on NEAR, such as Flux.

The oracle code can be found here:

* [Smart Contract](https://github.com/NearDeFi/price-oracle)
* [Price Updater Bot](https://github.com/NearDeFi/near-price-oracle-bot) (system service)

### Pyth Oracle <a href="#pyth-oracle" id="pyth-oracle"></a>

The [Pyth Network](https://pyth.network/) is a first-party financial data oracle network that delivers low-latency price data for various assets to blockchains securely.

The Pyth protocol aggregates the data providers' inputs to produce a single aggregate price and confidence interval every 400ms for each price feed. This aggregation mechanism lives on an application-specific blockchain called Pythnet.

Pyth Network introduces a unique architecture called the Pull Oracle. With the Pull Oracle design, data users can “pull” or request a price update from the Pyth protocol when needed.

Learn more, refer to the [Pyth documentation](https://docs.pyth.network/home).<br>


# Step by Step Guide

## Supply

Step 1: Access <https://lending.rhea.finance/> and connect your wallet

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

Step 2: Select one asset from the list and click “Supply”

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

Step 3: Enter your desired number and turn on “Use as Collateral” (Optional)

<div data-full-width="false"><figure><img src="/files/dtzvHeKqkEOp9oUXeSYr" alt="" width="375"><figcaption></figcaption></figure></div>

Step 4: Supply and sign the transaction

<figure><img src="/files/siizd38gCVsOLb1ZweAL" alt="" width="352"><figcaption></figcaption></figure>

## Borrow

Make sure you have already supplied your asset (and turned on Use as collateral button) first before borrowing.

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

Step 1: Select a token you want to borrow

I will borrow $DAI using $USDT as collateral in this situation

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

Step 2: Choose an appropriate amount

<figure><img src="/files/yBhTpe48NqgvONW82Io8" alt="" width="375"><figcaption></figcaption></figure>

Step 3: Verify all the details and confirm the transaction

### Repay

Step 1: Click on Repay Button

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

Step 2: Enter an appropriate amount&#x20;

<figure><img src="/files/eDXvByDunmTysrCji1Ll" alt="" width="375"><figcaption></figcaption></figure>

Notice that Health Factor changes every time you increase/decrease the repayment amount

Step 3: Confirm the transaction

### Withdraw

Step 1: Click the [Dashboard](https://lending.rhea.finance/dashboard) button & choose the token you wish to withdraw

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

Step 2:  Choose an appropriate amount

<figure><img src="/files/nGRhAybclsk9GFtwtfac" alt="" width="375"><figcaption></figcaption></figure>

Step 3: Verify the details and confirm your transaction

### Adjusting collateral

Step 1: Select the token and click "Adjust" button

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

Step 2: Enter an appropriate amount&#x20;

Keep an eye on your Health Factor since it will adjust following your collateral position

<figure><img src="/files/33doXa58VMkO47GN0rHB" alt="" width="375"><figcaption></figcaption></figure>

Step 3: Confirm the transaction


# Margin Trading

Margin Trading is built on top of Rhea’s Lending product, allowing users to provide sufficient collateral to access 1–3x leverage.

## <sub>**Technical Implementation**</sub>

Reference Document:[ https://hackmd.io/@MarcoSun/SkW-\_2Z\_yl](https://hackmd.io/@MarcoSun/SkW-_2Z_yl)

### Loop-Based Leverage (Before Margin Trading)

Before Margin Trading was introduced, users could manually implement leveraged trading through a series of looping actions:

* **Shorting:**\
  Supply USDC → Borrow NEAR → Swap NEAR to USDC → Supply USDC → Borrow NEAR → ...<br>
* **Longing**:\
  Supply USDC → Borrow USDC → Swap USDC to NEAR → Supply NEAR → Borrow USDC → ...

## Margin Trading

Margin Trading simplifies the user's repeated loop operations into a single action, with steps managed by smart contracts. This makes leveraged trading more accessible and user-friendly.

***

Margin trading is available for:

* **Meme tokens (Selected assets)**
* **NEAR**
* **nBTC**

Users can deposit Stablecoins (USDC, DAI, or USDt) as collateral to open long or short positions with up to 2x leverage on Meme Tokens and 3x leverage on NEAR and nBTC.

<figure><img src="/files/7sQMgdWUlnl9dy1RQkD3" alt=""><figcaption><p>Margin Trading markets as of current assets</p></figcaption></figure>

## Isolated Positions for Meme Tokens

Due to the low liquidity and high volatility of Meme Tokens, and to avoid impacting the $200M liquidity pool of the main Lending product, we’ve created separate smart contracts (forked Lending contracts) for Meme Tokens. This isolates risk at the contract level.

All USDC used for long and short positions on Meme Tokens comes exclusively from these dedicated Meme Token lending contracts.

## Meme Token Listing Criteria

Not all Meme Tokens can be listed on Margin Trading. To ensure the safety of users and the platform, a Meme Token must have over $100K liquidity on Rhea’s DEX to be eligible for listing.

***

## Liquidation

Liquidation in Margin Trading differs from Lending:

* **Lending:**\
  Uses partial liquidation — only enough assets are liquidated to bring the user's health factor back to a safe level, avoiding full liquidation.<br>
* **Margin Trading:**\
  Involves full liquidation (similar to a total position wipeout). Once a position is liquidated, all assets in that position are sold to repay the Lending debt and compensate the liquidator.<br>

***

## Open-Source Liquidation Bot

The Margin Trading liquidation bot is open-source and available here:\
<https://github.com/burrowHQ/burrowland-liquidation-bot/tree/margin_trading><br>


# Guide

Disclaimer: Margin trading carries risks. Volatility & leverage can lead to rapid fluctuations and losses. Always DYOR & apply risk management.

#### Step 1: Access <https://lending.rhea.finance/marginTrading> and connect your wallet

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

#### Step 2: Select the market you would like to margin trade:

Example shown using nBTC as the asset choice

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

#### Step 3: Navigate the Margin trading Interface.&#x20;

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

**Chart on the left indicates price movement, and the interface on the right displays 3 interactive buttons:**&#x20;

1. Long/Short nBTC
2. Stablecoin choice, token balance, input amount for trading
3. &#x20;Leverage Bar

Lets break it down:

1. Users can choose to Long or Short an Asset using the Navigation Bar&#x20;

<figure><img src="/files/olfedRkFAxdGrrv8hEA5" alt="" width="375"><figcaption><p>Long nBTC</p></figcaption></figure>

<figure><img src="/files/2yqBULxRz4TuMFkBVPfT" alt="" width="375"><figcaption><p>Short nBTC</p></figcaption></figure>

2. Pick your asset choice and fill in the desired number&#x20;

<figure><img src="/files/KUKYUPS5lKGyzxLCjBlO" alt="" width="375"><figcaption></figcaption></figure>

3. Adjust the leverage that you are comfortable with. Notice that the liquidation price varies varies depending on the leverage.&#x20;

   Note: Its important to keep track of the liquidation price to ensure your position is not liquidated.

   1. If you go long on an asset, your position will be liquidated if its below the liquidation price
   2. If you shorted an asset, your position will be liquidated if its above the liquidation price&#x20;

<figure><img src="/files/0rHpVctNo0CkDYsBogMH" alt="" width="375"><figcaption></figcaption></figure>

Step 4: Click on the button and confirm the transaction

<figure><img src="/files/NZqAlYSGV4T7IcPvps3R" alt="" width="563"><figcaption></figcaption></figure>

Step 5: Done! Your can track your positions at the bottom of the interface or your one stop dashboard at <https://lending.rhea.finance/dashboard>&#x20;

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


# Yield Boost


# xRHEA Farming Boost

### Overview

xRHEA Farming Boost allows users to lock xRHEA tokens in exchange for boosted incentive rewards on their [farm APYs](https://app.rhea.finance/pools?activeTab=farm). The longer the lock-up period, the greater the boost — up to a maximum of 6 months.

<div data-full-width="true"><figure><img src="/files/RkE43mRGiZCpbRF0UPcA" alt="" width="563"><figcaption><p><a href="https://app.rhea.finance/stake"> xRHEA Farming Boost</a> interface with boost ratio range and lock-up period up to 6 months</p></figcaption></figure></div>

### List of 7 Boosted farm Pools on RHEA

| Farm Pools     | Link                                  |
| -------------- | ------------------------------------- |
| rNEAR-NEAR     | <https://app.rhea.finance/sauce/6494> |
| RHEA-NEAR      | <https://app.rhea.finance/pool/6458>  |
| NEAR-ZEC       | <https://app.rhea.finance/pool/6065>  |
| NEAR-PUBLIC    | <https://app.rhea.finance/pool/6503>  |
| mpDAO - STNEAR | <https://app.rhea.finance/pool/5438>  |
| nBTC - NEAR    | <https://app.rhea.finance/sauce/5949> |
| DOG - NBTC     | <https://app.rhea.finance/pool/6424>  |

### How it works

Lock xRHEA → Earn Weight → Get Boosted APYs on Farming

The program operates in two sections:

1. Weight Algorithm – Calculates your Weight based on the amount and duration of xRHEA locked.
2. Farming Multiplier Algorithm – Converts your Weight into a reward boost factor.

### 1. Weight Algorithm

Your Weight is determined by:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK-zvUam_7OLgZSrZecUvTX29tv-8DFbtOY6-QNkVTB5c8GnGMUsgEs3-E2AuqxlkqffiIBH3xSXW0bhyElyJp3ysTbblAI57GFpYB0r4wmIs3eBngR-4OPKkf1v16e2PwZXFgjw?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = Weight
* X = The amount of xRHEA locked
* D = Lock duration (from 30 to 180 days)
* D\_min = 30
* D\_max = 180
* M\_min = 10,000

M\_max = 30,000

### Example Weight Table&#x20;

| xRHEA Locked | Lock Duration | Weight Received |
| ------------ | ------------- | --------------- |
| 100 xRHEA    | 1 Month       | 100             |
| 100 xRHEA    | 3.5 Months    | 200             |
| 100 xRHEA    | 6 Months      | 300             |

> The longer you lock, the higher the Weight (up to 3x boost at 180 days)

### 2. Farming Multiplier Algorithm

Once Weight is calculated, it’s converted into a Farming Multiplier, which boosts the user’s share of the incentive rewards pool.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK09JUsm53m6a0pSoXwiZeeeyL0UgYuCJCVztKYFq2N_a3BdOQBfLlAgfhbmibp3a-ejRVcZVWRswzD5ZrXZs_KLw33B3edUfFSAFkTtzuD52v6nnvfk5J0z6MMw4ScIVMGhqMTg?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = user's Weight
* boost\_suppress\_factor = 100
* base = 38634105686174997042188779520

#### Farming Multiplier Table

| Weight Amount | Farming Multiplier |
| ------------- | ------------------ |
| 1,500         | 1.111x             |
| 15,000        | 1.205x             |
| 150,000       | 1.300x             |
| 1,500,000     | 1.394x             |
| 15,000,000    | 1.488x             |

### Example: How Rewards Are Distributed

Imagine the rNEAR-NEAR farm emits 9.89% APY in incentive rewards.

#### Case 1:  New User Without xRHEA Lock when farming

<table><thead><tr><th width="82.4423828125">User</th><th width="207.7041015625">USD value staked in farm</th><th width="107.9534912109375">Weight </th><th width="111.199951171875">Multiplier</th><th width="79.728515625">APY</th><th>Boosted APY</th></tr></thead><tbody><tr><td>Charlie</td><td>1,000</td><td>0</td><td>1.000x</td><td>9.89%</td><td>-</td></tr></tbody></table>

#### Case 2: xRHEA Lock Boosted Users when farming&#x20;

<table><thead><tr><th width="87.64453125">User</th><th width="207.65869140625">USD value staked in farm</th><th width="96.72119140625">Weight </th><th width="110.9932861328125">Multiplier</th><th width="86.28125">APY</th><th>Boosted APY </th></tr></thead><tbody><tr><td>Alice </td><td>500</td><td>150,000</td><td>1.300x</td><td>9.89%</td><td>12.85%</td></tr><tr><td>Bob</td><td>50</td><td>150</td><td>1.056x</td><td>9.89%</td><td>10.44%</td></tr></tbody></table>

### Updated incentive rewards allocation for rNEAR-NEAR farm

**Alice: 12.85% APY**

**Bob: 10.44% APY**

**Charlie: 9.89% APY (Not Boosted)**

## How to stake xRHEA for farming boost: Step by Step walkthrough

### Step 1: Go to <https://app.rhea.finance/stake> and connect your wallet&#x20;

### Step 2: Click Farming Boost:  &#x20;

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

<p align="center"></p>

### Step 3: Choose RHEA or xRHEA:  &#x20;

<figure><img src="/files/PZvtEvSlcwPG9a2l7viv" alt=""><figcaption><p>Stake requires minimum of 1.7 RHEA/xRHEA</p></figcaption></figure>

### Step 4: Pick Boost Ratio Range based on your Lock time.&#x20;

<figure><img src="/files/SNxQqSPNOf44SreuqX6g" alt=""><figcaption><p>Lock-up period from 1~6 month</p></figcaption></figure>

### Step 4.1: If you hover to the Boosted ratio text, there will be a quick preview pop-up of your Boosted Farm APYs based on Stake Amount and Lock time of xRHEA

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

<p align="center"></p>

### Step 5: Click Stake and you're done!&#x20;

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

### Step 6:  you head over to the [farms section](#step-1-go-to-https-app.rhea.finance-stake-and-connect-your-wallet) on Liquidity tab, you can now see your boosted APY figures under the APYs.&#x20;

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


# xRHEA Lending Boost

### Overview

xRHEA Lending Boost allows users to lock xRHEA tokens in exchange for boosted incentive rewards on Rhea Lending. The longer the lock-up period, the greater the boost — up to a maximum of 6 months.

Note: Boost only affects incentive rewards. It does not impact base lending interest rates.

<figure><img src="/files/oprMzZ8ShXvperFlMYsF" alt=""><figcaption><p> <a href="https://t.co/Bk0wJfmeZ8">xRHEA Lending Boost</a> interface with boost ratio range and lock-up period up to 6 months</p></figcaption></figure>

### How it works

Lock xRHEA → Earn Weight → Get Boosted Rewards

The program operates in two sections:

1. Weight Algorithm – Calculates your Weight based on the amount and duration of xRHEA locked.
2. Farming Multiplier Algorithm – Converts your Weight into a reward boost factor.

### 1. Weight Algorithm

Your Weight is determined by:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK-zvUam_7OLgZSrZecUvTX29tv-8DFbtOY6-QNkVTB5c8GnGMUsgEs3-E2AuqxlkqffiIBH3xSXW0bhyElyJp3ysTbblAI57GFpYB0r4wmIs3eBngR-4OPKkf1v16e2PwZXFgjw?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = Weight
* X = The amount of xRHEA locked
* D = Lock duration (from 30 to 180 days)
* D\_min = 30
* D\_max = 180
* M\_min = 10,000

M\_max = 30,000

### Example Weight Table&#x20;

| xRHEA Locked | Lock Duration | Weight Received |
| ------------ | ------------- | --------------- |
| 100 xRHEA    | 1 Month       | 100             |
| 100 xRHEA    | 3.5 Months    | 200             |
| 100 xRHEA    | 6 Months      | 300             |

> The longer you lock, the higher the Weight (up to 3x boost at 180 days)

### 2. Farming Multiplier Algorithm

Once Weight is calculated, it’s converted into a Farming Multiplier, which boosts the user’s share of the incentive rewards pool.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcK09JUsm53m6a0pSoXwiZeeeyL0UgYuCJCVztKYFq2N_a3BdOQBfLlAgfhbmibp3a-ejRVcZVWRswzD5ZrXZs_KLw33B3edUfFSAFkTtzuD52v6nnvfk5J0z6MMw4ScIVMGhqMTg?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Where:

* Y = user's Weight
* boost\_suppress\_factor = 100
* base = 2137469933345.874131511402299392

#### Farming Multiplier Table

| Weight Amount | Farming Multiplier |
| ------------- | ------------------ |
| 500           | 1.056x             |
| 5,000         | 1.137x             |
| 50,000        | 1.218x             |
| 500,000       | 1.300x             |
| 5,000,000     | 1.381x             |
| 50,000,000    | 1.462x             |

### Example: How Rewards Are Distributed

Imagine the USDC lending pool emits 200 wNEAR/day in incentive rewards.

#### Case 1: Boosted Users Only&#x20;

| User  | Supplied USDC | Weight  | Multiplier | Boosted Shares |
| ----- | ------------- | ------- | ---------- | -------------- |
| Alice | 500           | 500,000 | 1.300x     | 650            |
| Bob   | 50            | 500     | 1.056x     | 52.8           |

* Total Boosted Shares: 702.8<br>
* Reward Allocation:
  * Alice: 184.96 wNEAR/day
  * Bob: 15.2 wNEAR/day

#### Case 2:  New User Without xRHEA Lock

| User    | Supplied USDC | Weight | Multiplier | Boosted Shares |
| ------- | ------------- | ------ | ---------- | -------------- |
| Charlie | 1,000         | 0      | 1.000x     | 1,000          |

* New Total Boosted Shares: 1,702.8<br>
* Updated Reward Allocation:
  * Alice: 76.34 wNEAR/day
  * Bob: 6.2 wNEAR/day
  * Charlie: 117.44 wNEAR/day


# NEAR Liquid Staking Tokens (LST)

RHEA’s NEAR LST — Liquid Staking for $NEAR, Multichain

RHEA LST is the first multichain liquid staking protocol purpose-built for $NEAR. It allows users to stake $NEAR and receive $rNEAR, a yield-bearing token that can be used across chains — all from their original wallets, on their original chains.

### What is $rNEAR?

$rNEAR is the receipt token users receive upon staking $NEAR with the rNEAR Protocol. As PoS rewards continuously accrue, the value of $rNEAR increases relative to $NEAR.

Users can unstake $rNEAR at any time to get their staked $NEAR back.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0JU8mxOPjEmHQrBGgR8qWXXYFyxHdWfbmXKATAdCeauvR2jAV__tjha0G2keys9oR-saa_Wi7KOTaUNrnBcF0ldswcJTunrUUFOnBJdZ6rELuruyqslqnVy_Q6pyDK3TpKHpP-Q?key=jj6huYDscW93vCrr-SeUvA" alt=""><figcaption></figcaption></figure>

* $rNEAR is minted when users stake $NEAR and is burned when they unstake.
* It accrues staking rewards over time — its value increases as the NEAR it represents grows.
* $rNEAR follows the **NEP-141 standard** and can be bridged easily to other ecosystems (ERC-20, SPL, etc.).<br>

> $NEAR holders on other chains like Solana, BSC, etc, can also access NEAR liquid staking natively on their chain

### Native Staking & Unstaking&#x20;

* Stake: Deposit $NEAR into the RHEA contract → instantly receive $rNEAR at the current exchange rate.
* Unstake:
  * Instant Unstake – withdraw immediately via RHEA DEX with a small fee
  * Standard Unstake – wait 4 epochs(\~30hours)<br>

Each $rNEAR is backed by more $NEAR over time as staking rewards are accrued — increasing its value in NEAR terms.

### Validator Strategy

RHEA maintains a decentralized, weighted pool of NEAR validators selected based on:

* Reward performance (with time-weighting)
* Online uptime stability
* Staking ratio
* Community reputation<br>

Scores are calculated automatically and periodically reviewed by the RHEA DAO for optimal decentralization and performance.

### Common Questions:

> #### Why Can’t I Get 1 rNEAR by Staking 1 NEAR?

As PoS rewards accumulate over time, $rNEAR appreciates in value, meaning the price of $rNEAR will always be higher than the price of $NEAR.&#x20;

You don’t need to worry about staking a certain amount of NEAR and receiving less when you unstake.&#x20;

The amount of $NEAR you receive when you unstake will always be greater than or equal to the amount you initially staked.

> #### When Does Staked NEAR Start Earning PoS Rewards?

PoS rewards are based on Epochs, not Blocks. An Epoch lasts approximately 7 hours, depending on the block production speed.

Staked $NEAR does not immediately start generating PoS rewards because PoS rewards require the staked $NEAR to be present from the start of the Epoch. NEAR added after the Epoch begins will not earn rewards for that Epoch.

To reduce frequent staking actions, we will automatically stake the NEAR in the current LST contract at the end of the current Epoch.

> #### If I Stake NEAR, Does the Current Epoch Not Generate Any Rewards?

No, users still earn rewards during the current Epoch. However, these rewards do not come from PoS rewards. Instead, they come from the Incentive Mechanism.

To encourage more users to migrate to rNEAR, we have activated the incentive mechanism to compensate for the loss of rewards in the first Epoch.

> #### How Does the Incentive Mechanism Work?

Every 10 minutes, the incentive mechanism checks the current $rNEAR price against the price from 30 days ago and calculates the PoS Reward APY.

Based on this APY, the incentive mechanism adds an additional 1% through a compensation system.

### The Technology Behind: Cross Chain NEAR Liquid Staking

While most LST protocols operate within a single chain, RHEA aligns with NEAR’s multichain vision, enabling liquid staking of $NEAR to be initiated and utilized across multiple source and destination chains, with a native user experience.

### How it Works&#x20;

**If Cross-Chain Messaging Is Available**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOR_oCMV1p-yQu4tbkKuqw-zcveiTWhM42dUguaQEt3lpnPrnxwbIqLe1WJEEETHnL26kih93nYASdtPs_m5w92E_uYpvA41a2HgG9VpObBZGNW8S7ym-w9-3lsPybnyga_TpqVw?key=SLv95-TUbNFtc6871tvhRw" alt=""><figcaption></figcaption></figure>

\
RHEA deploys a lightweight **Account Abstraction (AA) contract:**<br>

* Receives user-signed staking instructions via message bridge or direct wallet intent
* Delivers $NEAR or $rNEAR back to the user on their original chain

✅ Advantage: To the user, staking feels native—like using any local DeFi protocol.

#### If Only Token Bridge Is Available

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeh-w5rfMrmI70xo2i4B7G-EjCEmY2mZdC17D92ZMkAZZ_mJBedeYQDTDcdD0-Anp0L9iv-GB1ln21GVdk0t1iPK9gkwCTkFkjND1YsPICx5PLdTukZqcD_H6gGSEHQvQew6N8SSw?key=SLv95-TUbNFtc6871tvhRw" alt=""><figcaption></figcaption></figure>

RHEA uses External Account Management (EAM) via NEAR Chain Abstraction:

1. Sub-account Creation – A NEAR sub-account is created and linked to the user’s wallet using derived keys.
2. Authorization – User signs a one-time request to link an embedded NEAR wallet to their sub-account.
3. Interaction – Users control the sub-account via RHEA frontend to stake, unstake, or access NEAR DeFi.

✅ Advantage: Users gain full access to NEAR staking and DeFi, using their existing wallet and chain.

### Summary:

* $rNEAR appreciates over time due to PoS rewards.
* The price of $rNEAR will always be higher than the price of $NEAR.
* Staked NEAR starts earning PoS rewards only at the beginning of an Epoch.
* Incentive mechanism compensates users in the first Epoch to encourage migration to rNEAR.
* Incentive mechanism adds an additional 1% on top of the PoS Reward APY to further boost earnings.

**RHEA LST makes $NEAR staking borderless, non-custodial, and yield-optimized.**


# Aggregator Bridge

How to bridge?

#### Step1: Click on the "Bridge" tab and choose Aggregate Bridge&#x20;

<figure><img src="/files/7pLPyqBs2GWuL5vPJhAM" alt=""><figcaption></figcaption></figure>

#### Step2: Select the chain you want to bridge "from" and "to" for the asset you want to bridge.&#x20;

<figure><img src="/files/UMufRTcBcCYGTQiFPi9c" alt="" width="563"><figcaption></figcaption></figure>

#### Step3: Connect the wallet of the chain you selected.

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

#### Step4: Enter the amount of the assets you want to bridge.&#x20;

The aggregator will automatically calculate and choose the best amount out.

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

#### Step 5: Click "**Preview"** to view the bridge preview.

<figure><img src="/files/4Ns97nsCl4aoSx7QgMfo" alt="" width="563"><figcaption></figcaption></figure>

#### Step 6: Click "**Transfer"** to sign transaction. You can check the progress anytime through the "Bridge Transaction History" page

<figure><img src="/files/hDuTPqlCl69XJeEwCLy0" alt="" width="563"><figcaption></figcaption></figure>

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


# RHEA Point System

## **Introduction**

The RHEA Points System is designed to incentivise platform activity by rewarding users for trading, liquidity provision, and community engagement. Points are accumulated based on specific actions and can be used to enhance user participation in the ecosystem.

In Season 2, **every action you take on RHEA can earn you points** — and those points can be redeemed for oRHEA during designated redemption windows (dates to be announced).

The more active you are, the more oRHEA you can secure.

## **Point Categories & Earning Mechanisms for oRHEA**

### **1. Trading Points**

Users earn points through token swaps, using the [aggregator bridge](https://dex.rhea.finance/bridge), and margin trading.

| Action                                                                                                       | Point Calculation                   | Rule                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap $100                                                                                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Swap more than $1000 in a single transaction                                                                 | 100 Points + 20% Boost = 120 Points | <p>Applies to Selected Pool Tokens:<br></p><ul><li><a href="https://app.rhea.finance/pool/6458">RHEA–NEAR</a></li><li><a href="https://app.rhea.finance/pool/4512">USDC–NEAR</a></li><li><a href="https://app.rhea.finance/sauce/5949">nBTC-NEAR</a></li><li><a href="https://app.rhea.finance/pool/4276">BlackDragon-NEAR</a></li><li><a href="https://app.rhea.finance/pools?activeTab=stable">Stable Pools </a></li><li><a href="https://app.rhea.finance/pool/6503">PUBLIC-NEAR</a></li><li><a href="https://app.rhea.finance/poolV2/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1%3C%3Etoken.rhealab.near@100">RHEA-USDC </a></li><li><a href="https://app.rhea.finance/pool/5154">NEAR-WBNB </a></li><li><a href="https://app.rhea.finance/sauce/6494">rNEAR-NEAR</a></li><li>wBTC Pools </li></ul> |
| Bridge $100 via the [Aggregator Bridge ](https://dex.rhea.finance/bridge)                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Bridge more than $1000 in a single transaction via the [Aggregator Bridge ](https://dex.rhea.finance/bridge) | 100 Points + 20% Boost = 120 Points | EVM to NEAR USDC bridge only                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Margin Trade $50                                                                                             | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Margin Trade more than $1000 in single transaction                                                           | 200 Points + 20% Boost = 240 Points | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### **Example Calculation:**

* A $1,000 total swap in Selected Pool Tokens:

  * Base points: **= 100 points**
  * **20% boost** for $1,000 swap = **20 points**
  * **Total: 120 points**

### 2. Lending

Users earn points by supplying or borrowing selected assets.

<table><thead><tr><th>Supply (Points per $100)</th><th width="205.69921875">Borrow (Points per $100)</th><th>Assets</th></tr></thead><tbody><tr><td>50 pts</td><td>50 pts</td><td><a href="https://app.rhea.finance/tokenDetail/xtoken.rhealab.near?pageType=main">xRHEA</a>, <a href="https://app.rhea.finance/tokenDetail/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1?pageType=main">USDC</a>, <a href="https://app.rhea.finance/tokenDetail/usdt.tether-token.near?pageType=main">USDt</a>, <a href="https://app.rhea.finance/tokenDetail/lst.rhealab.near?pageType=main">rNEAR</a>, <a href="https://app.rhea.finance/tokenDetail/6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near?pageType=main">DAI</a></td></tr><tr><td>25 pts</td><td>50 pts</td><td><a href="https://app.rhea.finance/tokenDetail/nbtc.bridge.near?pageType=main">nBTC</a>, <a href="https://app.rhea.finance/tokenDetail/zec.omft.near?pageType=main">ZEC</a>, <a href="https://app.rhea.finance/tokenDetail/wrap.near?pageType=main">NEAR</a>, <a href="https://app.rhea.finance/tokenDetail/853d955acef822db058eb8505911ed77f175b99e.factory.bridge.near?pageType=main">FRAX</a>, <a href="https://app.rhea.finance/tokenDetail/eth.bridge.near?pageType=main">ETH</a></td></tr></tbody></table>

### 3. Community Points

Earn points through social media engagement, referrals, and platform advocacy.

We reward active **community builders and contributors**.

* RHEA Insider vault campaign - in Discord
  * The engage point will be converted to RHEA points by the end of the campaign
* Onboarding referrals
  * Counted by how many users have been onboarded through the RHEA referral link and will be added by the end of the campaign
* Kaito yapping (approved discussions & shilling)

  * read our [article](https://x.com/rhea_finance/status/1955283722187706621) on X&#x20;

  NOTE: Every tweet must tag @rhea\_finance

## Multipliers & Bonus Mechanisms

Users can earn bonus points by maintaining long-term engagement on Margin Trading and Supply/ Borrow

### Margin Trading

<table><thead><tr><th width="345.86328125">Activity Streak</th><th>Point Multiplier Applied</th><th data-hidden></th></tr></thead><tbody><tr><td>15 consecutive days of trades</td><td>1.2x every future trades</td><td></td></tr><tr><td>30 consecutive days of trades</td><td>1.5x every future trades</td><td></td></tr><tr><td>60 consecutive days of trades</td><td>2x every future trades</td><td></td></tr></tbody></table>

### Supply and Borrow&#x20;

<table><thead><tr><th width="439.80645751953125">Activity Streak</th><th width="388.8056640625" align="center">Point Multiplier Applied </th></tr></thead><tbody><tr><td>30 consecutive days of  $100+ TVL in Supply or Borrow</td><td align="center">1.2x (After 30 Days)</td></tr><tr><td>60 consecutive days of  $100+ TVL in Supply or Borrow</td><td align="center">1.5x (After 60 Days)</td></tr></tbody></table>

### Liquidity Provider

<table><thead><tr><th width="440.23272705078125">Activity Streak</th><th align="center">Point Multiplier Applied</th></tr></thead><tbody><tr><td>30 consecutive days of $100+ in LP Supply</td><td align="center">1.2x (After 30 Days)</td></tr></tbody></table>


# RHEA Credits

### Overview

The Credit Model is introduced in welcoming Season 3 while recalculate **Season 2 distribution** to improve the fairness of oRHEA redemption.

Previously, oRHEA redemption relied entirely on Points, which led to heavy concentration—where a small number of high-volume users accumulated the majority of redeemable supply. This limited redemption access for most users.

To address this, **Credit** is introduced as a new, daily-based redemption unit while keeping the existing Points system intact for activity tracking.

***

### Key Changes at a Glance

* **Credit replaces Points as the unit for oRHEA redemption**
* Credit is **calculated daily** based on points earned that day
* Credit **accumulates over time**
* Daily Credit gains are **capped by tiers**
* Historical data for **Season 2 will be recalculated**

***

### Definitions

| Term   | Description                                          |
| ------ | ---------------------------------------------------- |
| Points | Original points generated from daily user activity   |
| Credit | New daily, cumulative unit used for oRHEA redemption |
| Season | A defined activity period (current: Season 2)        |
| oRHEA  | Reward asset redeemable using Credit                 |

***

### What Is Credit?

* Credit is a **daily reward unit derived from Points**
* It is calculated **once per day**
* Credits **accumulate over time**
* Credits are used to redeem **oRHEA**
* Points remain unchanged and are still used for tracking and history

***

### Credit Calculation Rules

#### Daily Calculation Principle

* Credit is calculated **independently each day**
* Only the **highest eligible tier** per day is counted
* Credits do **not stack within the same day**
* Points below the minimum threshold earn **no Credit**

***

#### Daily Points → Credit Mapping

| Daily Points Earned | Credit Earned |
| ------------------- | ------------- |
| ≥ 20                | 1 Credit      |
| ≥ 40                | 2 Credits     |
| ≥ 80                | 3 Credits     |
| ≥ 160               | 4 Credits     |

**Notes:**

* Thresholds increase exponentially
* Only tiers successfully reached within the same day are counted toward that day’s Credit total.
* Credits are earned daily based on achieved tiers, not capped at a fixed maximum.
* Each new tier requires approximately double the trading volume of the previous tier.
* Daily Credit calculation resets every day, but total Credits accumulate across the season.

**Examples:**

* 10 Points → 0 Credits
* 45 Points → 2 Credits
* 160 Points → 4 Credits
* ...
* 2560 Points → 8 Credits
* ...

***

### Credit Accumulation

* Credits are **added daily**
* Each day is calculated independently
* Once earned, Credits **cannot be adjusted or removed**
* Total Season 2 Credit is the **sum of all daily Credits**

#### Example

| Day   | Daily Points | Credit Earned | Total Credit |
| ----- | ------------ | ------------- | ------------ |
| Day 1 | 25           | 1             | 1            |
| Day 2 | 90           | 3             | 4            |
| Day 3 | 10           | 0             | 4            |
| Day 4 | 160          | 4             | 8            |

***

### Season 2 Historical Recalculation

#### Scope

* Credit will be recalculated for **all historical days in Season 2**
* Based on each user’s **daily points record**

#### Logic

1. Retrieve daily Points data for Season 2
2. Calculate daily Credit using the tier rules
3. Sum all daily Credits
4. Store Credit as a **new Season 2 field**

**Important:**

* Points data remains unchanged
* Season 1 data is not included

***

### Credit → oRHEA Redemption

* oRHEA redemption now uses **Credit instead of Points**
* Redemption pricing and logic remain unchanged
* Users can only redeem up to their available Credit balance
* Credit cannot go negative
* Over-redemption is not supported

### Difference from RHEA ticket Trade Competitions

| Aspect            | Trade Competition | Credit Model             |
| ----------------- | ----------------- | ------------------------ |
| Calculation Cycle | Campaign-based    | Daily                    |
| Accumulation      | Rule-dependent    | Always cumulative        |
| Volume Advantage  | High              | Capped daily             |
| Focus             | Short-term volume | Consistent participation |
| Redemption Unit   | Points            | Credit                   |

***


# How RHEA Finance Works

### RHEA Finance is an open-source software.&#x20;

Inspired by Uniswap v2, Curve Finance, and iZiSwap, RHEA Finance is an automated liquidity protocol powered by two constant product functions, and a discretized concentrated liquidity function:

* Swap function: x \* y = k
* StableSwap function: χDn−1 \* ∑ xi + ∏ xi = χDn + ( D / n )n&#x20;
* StableSwap function for yield-bearing tokens (Rated pools)
* iZiSwap function for Discretized Concentrated Liquidity Pools (Ref v2)

For more information, please refer to:

* Swap function
  * Uniswap v2 Whitepaper: <https://uniswap.org/whitepaper.pdf>
* StableSwap function
  * Curve StableSwap Whitepaper: <https://curve.fi/files/stableswap-paper.pdf>
* StableSwap function for yield-bearing tokens (Rated pools)

{% file src="/files/xFfW749Z6kspOO4kQqvO" %}
Rated pools document
{% endfile %}

* Discretized Concentrated Liquidity
  * iZiSwap Discretized Concentrated Liquidity Whitepaper: <https://izumi.finance/paper/dswap.pdf>

RHEA Finance is implemented on the NEAR blockchain. The platform is fully permissionless and removes the need for trusted intermediaries, prioritising decentralisation and censorship resistance. Anyone can trade and/or become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token in return for pool tokens (LP tokens). These tokens track pro-rata LP shares of the total reserves, and can be redeemed for the underlying assets at any time.

Unlike Uniswap, RHEA Finance smart contract (v2.ref-finance.near), which manages the automated market maker functions; swap and provide liquidity, contains all pairs or liquidity pools, made of reserves of two or three [NEP-141](https://nomicon.io/Standards/FungibleToken/Core) tokens ([ERC-20](https://eips.ethereum.org/EIPS/eip-20) equivalent on NEAR).

When a LP creates a new pool, the pool fee is customisable. Every pool has the same fee structure, as shown below.

![](/files/bbwkctMuCWT52rCl9czF)

## Ecosystem Participants

![](/files/aRD4VGzBKM9FltTljIMQ)

The RHEA Finance ecosystem is primarily comprised of five types of users: traders, liquidity providers, stakers, lenders & borrowers, voters and developers.&#x20;

* Traders can swap [NEP-141](https://nomicon.io/Standards/FungibleToken/Core) tokens
* Liquidity providers are incentivised to provide these tokens to liquidity pools
* Stakers are receiving pro-rata shares of the shared protocol revenue
* Lenders & Borrowers can unlock the liquidity of Near Ecosystem
* Voters can participate in the governance of the project and the allocation of liquidity incentives
* Developers can integrate directly with RHEA Finance smart contracts to empower users in their interactions with tokens, trading interfaces, trading strategies, and more

### Traders

There are different types of traders interacting with the protocol:

* Speculators can use a wide range of strategies from fundamental to technical analysis, to 'ape' approach (process of buying a token shortly after the token project launch without conducting thorough research)
* Hig-frequency bots can cover different strategies, such as market-neutral arbitrage or long/short strategies
* Dapp users buy tokens for use in other applications on NEAR, for example, buying PixelDapp tokens to play games
* Smart contracts that execute trades by implementing swap functionality, from products like DEX aggregators to custom scripts
* Legal entities (can be for-profit or not-for-profit organisations) and/or DAOs (can be a smart contract) that execute trades to manage their affairs, such as the settlement of an invoice in a differrent currency/token&#x20;

{% hint style="info" %}
Traders are all subject to the same fee for trading on the platform
{% endhint %}

### Liquidity Providers

Liquidity providers, or LPs, are a fragmented group, mainly made of:

* Passive LPs are token holders who passively invest to accumulate trading fees, they generally do not actively monitore their positions and divergence loss
* Sophisticated LPs are focused on market making as their primary strategy, they usually develop custom tools and monitore actively their positions and divergence loss
* Token projects sometimes choose to become LPs to 'initiate' liquidity, by creating a liquid pool for their token
* Protocol-oriented or 'politicised' LPs are focused primarily on the REF<>NEAR pool and the vetoken [model](broken://pages/JL4foBrFvtyJef4LYTyC),  allowing them to participate in the governance of the protocol (also see Voters)

### Stakers

Stakers can have different objectives and belong to specific subgroups:

* Long-term stakers are usually interested in a more predictable source of revenue, deriving from the protocol revenue, while holding the protocol token and participating in the governance (Under Development)
* Short-term or intra-strategy stakers are staking for a limited period of time, with the objective to optimise their returns, generally until the underlying token (REF) needs to be sold or used for a different purpose (i.e., liquidity provision)
* Voting-only stakers can be identified as users that stake only to vote the associated proposal(s), they are generally interested in participating/influencing the future of the protocol by voting on specific proposals

### Lender & Borrowers

Lenders & Borrowers are the key components in every DeFi Ecosystem, which can exist in all the following groups:

* Retail Investors: They have access to the current layer of liquidity and play a crucial role in accelerating DeFi activities within the ecosystem.
* Venture Capitalists: This group includes entities such as Maker Maker or any institution that can access the NEAR Ecosystem liquidity. They employ various DeFi strategies such as hedging, asset optimization, and flash loans to maximize their returns.

Please note that the information provided is based on general knowledge about DeFi ecosystems and may not reflect the latest developments or specific details about individual projects.

### Voters

$REF holders can participate in the governance of the projects by voting on key governance proposals and by voting on the allocation of REF tokens to specific farms for additional farming rewards.

Voters can be:

* Community members, organisations, or investors that are interested in participating in the development and strategic orientation of the project
* Project owners who want to support/grow their community by voting on the allocation of additional rewards for their corresponding farm
* Short-term farmers who want to maximise their farming APR by voting on the allocation of additional rewards for their corresponding farm

Once the veTokenomics function is released, this feature will become accessible.

### Developers

There are many ways RHEA Finance can be used by developers, some examples include:

* UX/UI experiments and front-ends built to give users access to the backend functionalities
* Data and analytics (e.g. <https://stats.ref.finance/>)
* Liquidity aggregation
* Yield aggregation
* DeFi dashboard projects (e.g. <https://app.odyssey.fi/>, <https://app.depocket.com/dashboard>)
* Trading bots

### RHEA Finance Team and Community

Finally, the RHEA Finance team along with the DAO (ref-finance.sputnik-dao.near) and the broader community drives development of the protocol and its ecosystem.


# Auto Router

Better prices, better liquidity utilisation

Auto Router, also known as Smart Routing, can be defined as the ability to find better prices for traders on RHEA Finance. This includes splitting the trade across multiple pools at once.

The Auto Router delivers a unique value proposition. Value that will be accumulated over time by Ref's users, in the form of better prices and liquidity utilisation.

{% hint style="info" %}
The Auto Router algorithm is open source, and available at the frontend/interface level of RHEA Finance
{% endhint %}

## High-Level Design&#x20;

RHEA Finance's Auto Router aims to find the best price for a trade. The algorithm takes advantage of all liquidity, using, when available:

1. Parallel pools
2. Intermediary pools

In a nutshell, the solution determines the best **allocation** across pools of the same pairs, and the best **path** using one hop or intermediary pool.

{% hint style="info" %}
The Auto Router also leverages the [StableSwap function](/near-chain-guides/how-rhea-finance-works), therefore combining both, normal and stable pools as potential intermediary pools
{% endhint %}

Find below a high-level description of the Auto Router.

![](/files/YK0wNqVEOvVFTs3w94Ms)

The Auto Router ultimately creates a win-win situation for market participants:

* Traders: better prices
* Liquidity Providers: fairer model (vs winner-takes-all approach)

For more details, please refer to:

* Parallel Swap solution: <https://github.com/giddyphysicist/ParallelSwapForRefFinance>
* Parallel Swap Liquidity Threshold Research Paper

{% file src="/files/8lbZPPdo6rY6ERFqEMVM" %}

* Smart Routing Multi Swap Optimization Research Paper

{% file src="/files/5NezaU1ly7Moznug1uN2" %}

* Smart Routing Test Plan

{% file src="/files/Cp6CkZ5NjEuDfO7PABFg" %}

## **Credit** <a href="#id-853e" id="id-853e"></a>

The Auto Router is the result of a successful collaboration between the team and Giddy & Dave.

Giddy is an avid learner of Web3 and DeFi. His background in mathematical modeling is aided by his experience with a doctorate in physics, and he likes to explore complex systems with the tools of modeling & simulation, algorithm development, and data analysis. He posts most of his work to <https://github.com/giddyphysicist>.

Dave is a DeFi enthusiast. He is also very interested in math, problem solving, and coding. His entrance into the DeFi world was solving some difficult optimization problems. He has three Master’s degrees, including physics and analytics.

Giddy & Dave won Ref's first Hackathon ([OpenDeFi Hackathon 3](https://github.com/near/bounties/issues/64)). The implementation of the Parallel Swap and Smart Routing followed their original winning [submission](https://github.com/giddyphysicist/ParallelSwapForRefFinance).&#x20;

Giddy & Dave are the creators and authors of the associated research papers (see above).


# Multi-chain Router

Swap Pro

Also called the multi-chain aggregator, the multi-chain router is a built-in function on RHEA Finance that aggregates data across Decentralised Exchanges on Aurora and NEAR protocols.&#x20;

Designed for traders, the solution leverages liquidity accross both environments to deliver not only better prices, but also:

* Deeper liquidity and improved price impact
* Lower trading slippage
* Improved token accessibility/visibility

## High-Level Design

The solution goes through the following logic:

1. Query trading data (price, slippage, fee, etc.) on Aurora using the Aurora’s Software Development Kits (SDKs)
2. Find optimal route (best price) for a specified amount of Token A to Token B accross all liquidity pools on Near and Aurora
3. Swap — Action that combines:

* Transfer of tokens to a mapping address on Aurora via a cross-network contract call
* Swap on Aurora using the user’s NEAR account keys
* Transfer of tokens from the mapping address on Aurora to the user’s NEAR wallet

***Note**: a mapping address is a “proxy address” which maps one’s Near account onto Aurora with a corresponding ETH address. It is generated by the user’s Near account ID, and triggers/generates all the actions on the Aurora network on behalf of the user. In other words, the user signs all transactions on Aurora from the mapping address using their Near wallet, removing the need to set up a separate ETH wallet to use Aurora.*

![Liquidity Aggregation: High-level Abstract](/files/8aznabjM3jPQ25Ur6Zvf)

## Credit <a href="#e0ae" id="e0ae"></a>

The Multi-chain Router is the result of a successful collaboration between the team and Evgeny & Vadim.

For more details, please check the following link: <https://defihub.pages.dev/>


# Pooling

Liquidity Pools

RHEA Finance offers [several types of Liquidity Pools](/near-chain-guides/how-rhea-finance-works), Classic, Stable, Rated, and DCL. Classic pools are based on the Uniswap v2 algorithm; Stable pools, which can contain two or more tokens, use Curve's StableSwap algorithm; Rated pools are for yield-bearing tokens, and are based on a variation of Curve's StableSwap algorithm; and [Ref v2's "DCL" Pools](/near-chain-guides/liquidity-pools/rhea-v2-pools), which are based on [iZUMi Finance’s Discretized Liquidity AMM](#user-content-fn-1)[^1].

Classic pools are fully permissionless, meaning that anyone can create a Classic pool, and set the fee for that pool. Currently only [Guardians](/developers/guardians) can create Stable, Rated, and DCL pools.

## Stable Pool

Stable Pools are designed for assets that are expected to regularly trade either very close to parity or at a predetermined exchange rate. The Algorithm design is based on [Stableswap](https://classic.curve.fi/files/stableswap-paper.pdf) (introduce by Curve Finance), which enable significant size swap to occur without triggering considerable price impact, greatly enhancing capital efficiency for swaps involving similar or correlated assets.

RHEA Finance offers a variety of pool types, including:&#x20;

* 4 pools: support USDT Native, USDC Native, USDT.e and USDC.e
* 3 pools: USDT.e, USDC.e and DAI
* Correlated Assets: tokens that swap near 1:R with some slowly changing exchange rate R (stNEAR, LINEAR, NearX)

To understand more about logic design behind the contracts, refer to this [paper](https://classic.curve.fi/files/stableswap-paper.pdf) from the Curve Finance Team.

###

## Trading Fees

Trades that take place using liquidity from a pool are charged a fee. The fee is defined at the creation of the pool, and cannot be modified once the pool is created. The pool fee usually varies from 0.05% to 0.3%.&#x20;

Users can earn a share of the trading fees by depositing tokens into the pool (also known as "adding liquidity"). When a trade is made, the share of the trading fees a liquidity provider receives is directly proportional to their share of the liquidity in the pool used for that trade. A user who has 1% of the total liquidity will receive 1% of the trading fees designated for liquidity providers.&#x20;

## Pool Tokens&#x20;

When a user adds liquidity to a pool, they will receive one or more tokens representing their share of the pool. Shares of Classic, Stable, and Rated pools are represented by LP Tokens (LPT). LPTs are fungible tokens where the quantity held is equal to the amount of shares of the pool (e.g. 1 LPT token = 1 pool share, and 0.25 LPTs = 0.25 pool shares). On the other hand, shares of DCL pools are represented by non-fungible tokens (NFT). When a user adds liquidity to a DCL pool, they will receive **one** NFT containing the details of their position, including the number of shares it is worth. In other words, a DCL NFT can be worth 1 pool share, or 0.25 pool shares. Users can hold multiple NFTs for the same DCL pool, each of which will represent a position in that pool.

## Pool APR

Pool APR is the yield you accrue by adding liquidity to a pool. You earn 80% of the pool fee for all trades on the associated pair (or triple for stablecoin pool) proportional to your share of the pool.&#x20;

![](/files/eCvsJN7dt9tXOFRCh7LF)

{% hint style="info" %}
For Classic pools, if there is no account to receive the Referral Fee, it goes to all LPs of that pool as a form of increased LP tokens. For the other types of pools, it goes to the Protocol Fee as a form of increased LP tokens
{% endhint %}

Fees are added to the pool, accrue in real-time, and can be claimed when you withdraw your Liquidity.

{% hint style="info" %}
Your share will be accrued in real-time and will be paid in addition to your existing position when you remove liquidity from the pool
{% endhint %}

## Viewing liquidity position(s)

There are two locations where users can see their liquidity positions, the Your Liquidity page, and the Portfolio page.&#x20;

### The "Your Liquidity" page

You can see all pools you have liquidity in by going to the Your Liquidity page. You can get to the Your Liquidity page by clicking Earn > Your Liquidity in the main menu of the site.&#x20;

You can see details like how many shares you have, the USD value of your shares, and the amount of each token your shares are worth. There are also buttons to add more liquidity and remove liquidity from the pool.

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

### The Portfolio page

The "Your Liquidity" tab of the Portfolio page shows you your current liquidity positions. You can get to the Portfolio page by clicking "Portfolio" on the main menu. Each item has a drop-down icon that, when clicked, will reveal details about the position.

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

## Risks

Providing liquidity is not without risk, as you may be exposed to *Divergence Loss* or *Impermanent Loss (IL).*

> Simply put, impermanent loss is the difference between holding tokens in an AMM and holding them in your wallet. - [Beginner’s Guide to (Getting Rekt by) Impermanent Loss](https://blog.bancor.network/beginners-guide-to-getting-rekt-by-impermanent-loss-7c9510cb2f22), Nate Hindman, 2020

[^1]: <https://izumi.finance/paper/dswap.pdf>


# Staking

## Concept

xREF is the main staking contract (xtoken.ref-finance.near) on the platform. When you stake your REF, you effectively exchange your REF for xREF. Over time, you will always earn more REF by holding xREF tokens.&#x20;

{% hint style="info" %}
There is no Divergence Loss when you stake REF for xREF tokens
{% endhint %}

Every swap executed on RHEA Finance generates revenue for the protocol.&#x20;

* 100% of the protocol fee will be used to buy back REF tokens, of which:
  * 75% will be transferred to the xREF contract (xtoken.ref-finance.near) and released linearly over time&#x20;
  * 25% will be allocated to a Community/Provision treasury. This treasury will be used to fund grants and other community initiatives/programs

![](/files/YdMRN0EHG7j78Sz5v91g)

## Execution <a href="#id-6306" id="id-6306"></a>

Like any liquidity provider, RHEA Finance collects its shares (16% of the total pool fee) in real-time and will be paid when it removes liquidity from the pool.&#x20;

Converting protocol LP tokens, resulting from the trading fees, involves the following actions:

1. Remove liquidity from pools
2. Withdraw corresponding tokens from RHEA Finance (v2.ref-finance.near) to the DAO (ref-finance.sputnik-dao.near)
3. Send tokens from the DAO to a specific execution account&#x20;
4. Buy (back) REF tokens (with the execution account)
5. Send REF tokens to the staking contract (xtoken.ref-finance.near)

The process happens on a quarterly basis.

{% hint style="info" %}
The first buy back involved as many as 35 DAO proposals&#x20;
{% endhint %}

Because the conversion from LP to REF tokens happens on a quarterly basis, and because the tokens collected might be very volatile on the same period, there might be a significant difference between the daily 'observable' revenue and the 'realised' revenue, after conversion.

Finally, rewards are being released linearly on a quarterly basis, and will have boosted markups for the first three years (subject to change):

* Year 1: 2x
* Year 2: 1.5x
* Year 3: 1.2x
* Year 4: 1x


# Aggregator Bridge

**Aggregator Bridge** is an important infrastructure to connect Near ecosystem and external ecosystems. It will aggregate all existing bridges within the Near ecosystem, including **Stargate**, **Rainbow**, **TokenBridge**, and **AllBridge**.

## Stargate Bridge

Bridging with Stargate is actually a collaboration between **Stargate** and **Rainbow** Bridge. Stargate handles the cross-chain transfer between EVM and Aurora, while Rainbow Bridge manages the transfer between Aurora and Near.

#### Why can users complete the bridge from EVM to Near with just one click?&#x20;

Ref has deployed a smart contract on the Aurora chain to receive and relay assets.

#### EVM -> Near

When a user transfers assets from EVM to Near, the process begins with Stargate transferring the assets from EVM to the Aurora smart contract, carrying the actual cross-chain information (the destination address on the Near chain).&#x20;

Once the Aurora smart contract receives the cross-chain message, it reads this information and invokes the Rainbow Bridge, immediately transferring the assets from Aurora to Near.

#### Near -> EVM

When a user transfers assets from Near to EVM, the process starts with Rainbow Bridge transferring the assets from the Near chain to the Aurora smart contract, carrying the actual cross-chain message (the destination address on the EVM chain).&#x20;

Once the Aurora smart contract receives the cross-chain message, it reads this information and invokes Stargate, immediately transferring the assets from Aurora to EVM.

#### Supported EVM chains

Ethereum, Arbitrum, Optimism, Base, Scroll&#x20;

#### Fees

Users need to pay Stargate fees, which consists of two parts:&#x20;

1. **Layer0 Cross-chain Fees**
2. **Stargate Protocol Fees**

The former is charged in ETH, while the latter is a percentage of the bridged assets. For detailed information, refer to Stargate's documentation: [Stargate Protocol Fees](https://stargateprotocol.gitbook.io/stargate/v/user-docs/tokenomics/protocol-fees%EF%BC%89).

#### How Near chain users provide Layer0 cross-chain fees (ETH) ?

When transferring assets from Near to EVM, users do not need to provide ETH for the fee. Instead, they only need to provide the bridged assets, as the ETH fee is covered by Ref's Aurora contract. Users will only need to pay an equivalent amount in bridged assets.


# Copy of RHEA Point System Season 2 done (with lending borrow LP)

## **Introduction**

The RHEA Points System is designed to incentivise platform activity by rewarding users for trading, liquidity provision, and community engagement. Points are accumulated based on specific actions and can be used to enhance user participation in the ecosystem.

In Season 2, **every action you take on RHEA can earn you points** — and those points can be redeemed for oRHEA during designated redemption windows (dates to be announced).

The more active you are, the more oRHEA you can secure.

## **Point Categories & Earning Mechanisms for oRHEA**

### **1. Trading Points**

Users earn points through token swaps, using the [aggregator bridge](https://dex.rhea.finance/bridge), and margin trading.

| Action                                                                                                       | Point Calculation                   | Rule                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap $100                                                                                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Swap more than $1000 in a single transaction                                                                 | 100 Points + 20% Boost = 120 Points | <p>Applies to Selected Pool Tokens:<br></p><ul><li><a href="https://app.rhea.finance/pool/6458">RHEA–NEAR</a></li><li><a href="https://app.rhea.finance/pool/4512">USDC–NEAR</a></li><li><a href="https://app.rhea.finance/sauce/5949">nBTC-NEAR</a></li><li><a href="https://app.rhea.finance/pool/4276">BlackDragon-NEAR</a></li><li><a href="https://app.rhea.finance/pools?activeTab=stable">Stable Pools </a></li><li><a href="https://app.rhea.finance/pool/6503">PUBLIC-NEAR</a></li><li><a href="https://app.rhea.finance/poolV2/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1%3C%3Etoken.rhealab.near@100">RHEA-USDC </a></li><li><a href="https://app.rhea.finance/pool/5154">NEAR-WBNB </a></li><li><a href="https://app.rhea.finance/sauce/6494">rNEAR-NEAR</a></li><li>wBTC Pools </li></ul> |
| Bridge $100 via the [Aggregator Bridge ](https://dex.rhea.finance/bridge)                                    | 10 Points per $100                  | Minimum transaction: $100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Bridge more than $1000 in a single transaction via the [Aggregator Bridge ](https://dex.rhea.finance/bridge) | 100 Points + 20% Boost = 120 Points | EVM to NEAR USDC bridge only                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Margin Trade $50                                                                                             | 10 Points per $50                   | Minimum transaction: $50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Margin Trade more than $1000 in single transaction                                                           | 200 Points + 20% Boost = 240 Points | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### **Example Calculation:**

* A $1,000 total swap in Selected Pool Tokens:

  * Base points: **= 100 points**
  * **20% boost** for $1,000+ swap = **20 points**
  * **Total: 120 points**

### 2. Liquidity Pool

Users earn points by supplying assets to liquidity pools or borrowing assets.

#### Lending & Borrowing Rewards

| Action                    | Point Calculation | Rules                |
| ------------------------- | ----------------- | -------------------- |
| Supply $100 TVL for 1 Day | 50 Points         | Receives Point Daily |
| Borrow $100 TVL for 1 Day | 100 Points        | Receives Point Daily |

> \*Note: Minimum deposit & borrow is $100 per transaction, no points for amounts below $100

#### Liquidity Pool Contributions

| Liquidity Pool      | Point Calculation                            | Boosted Pools                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $100 TVL in Pool    | 50 points per day                            | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| $10,000 TVL in Pool | 5000 Points per day + 5% Boost = 5250 Points | <p></p><p>Applies to Selected Pool Tokens:<br></p><ul><li><a href="https://app.rhea.finance/pool/6458">RHEA–NEAR</a></li><li><a href="https://app.rhea.finance/pool/4512">USDC–NEAR</a></li><li><a href="https://app.rhea.finance/sauce/5949">nBTC-NEAR</a></li><li><a href="https://app.rhea.finance/pool/4276">BlackDragon-NEAR</a></li><li><a href="https://app.rhea.finance/pools?activeTab=stable">Stable Pools </a></li><li><a href="https://app.rhea.finance/pool/6503">PUBLIC-NEAR</a></li><li><a href="https://app.rhea.finance/poolV2/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1%3C%3Etoken.rhealab.near@100">RHEA-USDC </a></li><li><a href="https://app.rhea.finance/pool/5154">NEAR-WBNB </a></li><li><a href="https://app.rhea.finance/sauce/6494">rNEAR-NEAR</a></li><li>wBTC Pools </li></ul> |

> Note: Locked LP from users will not count toward points as Locked LP is intended for LP deployers to utilize the feature and provide a sense of safety for the community.

### 3. Community Points

Earn points through social media engagement, referrals, and platform advocacy.

We reward active **community builders and contributors**.

* RHEA Insider vault campaign - in Discord
  * The engage point will be converted to RHEA points by the end of the campaign
* Onboarding referrals
  * Counted by how many users have been onboarded through the RHEA referral link and will be added by the end of the campaign
* Kaito yapping (approved discussions & shilling)

  * read our [article](https://x.com/rhea_finance/status/1955283722187706621) on X&#x20;

  NOTE: Every tweet must tag @rhea\_finance

## Multipliers & Bonus Mechanisms

Users can earn bonus points by maintaining long-term engagement on Margin Trading and Supply/ Borrow

### Margin Trading

<table><thead><tr><th width="345.86328125">Activity Streak</th><th>Point Multiplier Applied</th><th data-hidden></th></tr></thead><tbody><tr><td>15 consecutive days of trades</td><td>1.2x every future trades</td><td></td></tr><tr><td>30 consecutive days of trades</td><td>1.5x every future trades</td><td></td></tr><tr><td>60 consecutive days of trades</td><td>2x every future trades</td><td></td></tr></tbody></table>

### Supply and Borrow&#x20;

<table><thead><tr><th width="147.7451171875">Activity Streak</th><th width="285.75390625">Point Multiplier Applied (After 30 Days)</th><th>Point Multiplier Applied (After 60 Days)</th></tr></thead><tbody><tr><td>$100 TVL supplied for 1 day = 50 points</td><td>1.2x</td><td>1.5x</td></tr><tr><td>$100 TVL borrowed for 1 day = 100 points</td><td>1.2x</td><td>1.5x</td></tr></tbody></table>

### Liquidity Provider

<table><thead><tr><th width="388.6396484375">Activity Streak</th><th>Point Multiplier Applied (After 30 Days)</th></tr></thead><tbody><tr><td>$100 LP supplied for 1 day = 100 points</td><td>1.2x</td></tr></tbody></table>


# Staking

Protocol revenue sharing model

First, make sure that you are connected to Ref Finance with your wallet.

### Step 1: Click on xREF and select Stake

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

### Step 2: Enter the amount of REF tokens you want to stake

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

### Step 3: Approve the transaction (i.e. using NEAR wallet)

![](/files/xp5QltE02qUPUMQGVRf8)

## Track your xREF balance

And how much REF you will get by unstaking

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

## Unstake

### Click on xREF and select Unstake. Enter the amount of xREF tokens you want to unstake.&#x20;

<figure><img src="/files/P1Dq2TbpaAEMc32Ibm5O" alt="" width="563"><figcaption></figcaption></figure>

### Approve the transaction (i.e. using NEAR wallet)

![](/files/xp5QltE02qUPUMQGVRf8)


# Vault

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

To realize RHEA's vision as a DeFi yiel Hub powered by NEAR Chain Signature, RHEA has developed the Vault feature—a dedicated page that will gradually list all DeFi projects within the NEAR ecosystem, providing clear and concise introductions to each project's core offerings.

#### Vault will be developed in three iterative phases:

* **Phase 1**: List detailed information on each product’s main features, along with direct links for easy navigation.
* **Phase 2**: Enable direct interactions within the Vault page, removing the need to navigate away.
* **Phase 3**: Integrate functions across different Vaults to allow seamless interaction, fully achieving the one-stop financial platform vision.


# xRHEA Lending Boost (draft)

### Lock xRHEA to boost yields on RHEA Lending &#x20;

xRHEA holders have the option to [lock their xRHEA](https://app.rhea.finance/stake?type=stake_lending) to earn increased yields on RHEA's Lending product. The longer the lock-up period, the greater the boost. The maximum lock-up period is at 6 months at the moment.

What yield opportunity does the lock boost provide?

Users who lock xRHEA will receive higher rewards from the Supply and Borrow incentives on [RHEA Lending](https://docs.satos.network/). These rewards allow users to earn more incentives than they would versus not locking xRHEA.  \[See image]&#x20;

> Note: The yield boost currently applies only to user incentives (the user's lending interest income) and not to Base yields.

<figure><img src="/files/l0WemeGE2s7FREYO5aBC" alt="" width="563"><figcaption><p> <a href="https://t.co/Bk0wJfmeZ8">xRHEA Lending Boost</a> interface with boost ratio range and lock-up up to 6 months</p></figcaption></figure>

### Boost Algorithm Details

The Boost algorithm consists of two parts: the Weight algorithm and the Farming multiplier algorithm.

The Weight algorithm calculates the Weight required to participate in the Farming multiplier based on the user's locked xRHEA Token and lock duration.

The Farming multiplier algorithm calculates the user's actual Boost Ratio based on the Weight obtained from the Weight algorithm.

### Weight Algorithm

Users can decide how long to stake their xRHEA tokens and will receive more Weight the longer they stake.&#x20;

Currently, xRHEA supports a Lock period ranging from 30 Days to 180 Days. If users stake X amount of xRHEA tokens for D days (up to 180 days), the total amount of Weight will be:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXceqSwH6u-FQUNceiWn4rFZx_RIM6S8odgR4RyPT1uKZARo9d6GLlW51S9U7rnSjYmFaVX3XE72xErD2lgHl1rKAVkuFNE-rO2Ibw1DzJn42sXtuMx6O9a1HU5FdLrUJsdIJBzcTA?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

X: xRHEA amount

Y: Weight amount

D: requested locking period

Dmax: the maximum locking duration, such as 180 days

Dmin: the minimum locking duration, such as 30 days

Mmax:  multiple BP ratio related to Mmin, say 30000

Mmin: base BP ratio literally is 10000

The table below shows the amount of xRHEA with lock duration and the corresponding Weight:

| xRHEA to Lock | Months to Lock | Weight to Receive |
| ------------- | -------------- | ----------------- |
| 100           | 1              | 100               |
| 100           | 3.5            | 200               |
| 100           | 6              | 300               |

### Farming Multiplier Algorithm

The Farming multiplier algorithm follows traditional farming logic. It first calculates each user's Share amount, and then distributes the rewards based on the proportion of each user's Share.

Boosted shares are calculated as follows:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd2ScQFY1W1y6mL9Z3P0-9gOOgS_Kn7gmJWsfcWvUjve7tfziZL1N2BFxy7AwZIlbjojB9NYt3H3kIM1OHUu0HksitkRBHJPQnzDmPqq1yKVu9uPGreTiNKrMe6t7QJxbEi_rp-?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcp_JdANf2DPOX7Wp8Wrp5V6RPlcYeRb_QTAZU41-WH3jylb-lRGlddjd7h74T2EIvDas7XI9KGTqJly0aruI3E4UYHLL3gcAX600BjU9MF4l2B_4kRBTAjDckezLjuUQt1UL07?key=eHiEe45NobqJ6LiYnRuSDg" alt=""><figcaption></figcaption></figure>

Y: Weight amount

boost\_suppress\_factor: The impact factor is fixed at 100

booster\_unit: The impact factor is fixed at 10^18

base: The base of the Log curve is fixed at 2137469933345874131511402299392/10^18

shares: The share obtained after the user supplies assets

### The table below shows the amount of Weight and the corresponding farming multipliers:

<table><thead><tr><th width="370.349853515625">Weight Amount</th><th>Farming Multiplier</th><th data-hidden></th></tr></thead><tbody><tr><td>500</td><td>1.056</td><td></td></tr><tr><td>5,000</td><td>1.137</td><td></td></tr><tr><td>50,000</td><td>1.218</td><td></td></tr><tr><td>500,000</td><td>1.3</td><td></td></tr><tr><td>5000,000</td><td>1.381</td><td></td></tr><tr><td>50,000,000</td><td>1.462</td><td></td></tr></tbody></table>

Farming multiplier is enabled for Lending Incentive rewards which apply to specific lending positions.

Here is an example illustrating how rewards are computed:

Say the USDC pool gives <sup><sub><mark style="color:$info;">200<mark style="color:$info;"><sub></sup> wNEAR per day, and there are two users - Alice and Bob.

* Alice supplies <sup><sub><mark style="background-color:$info;">500<mark style="background-color:$info;"><sub></sup> USDC and has <sup><sub><mark style="color:$info;">500,000<mark style="color:$info;"><sub></sup> Weight.
* Bob supplies <sup><sub><mark style="color:$info;">50<mark style="color:$info;"><sub></sup> USDC and has <sup><sub><mark style="color:$info;">500<mark style="color:$info;"><sub></sup> Weight.

Boosted shares are computed via the following:

* Alice gets a farming multiplier of <sup><sub><mark style="color:$info;">1.3x<mark style="color:$info;"><sub></sup>, so the number of boosted shares becomes <sup><sub><mark style="color:$info;">650<mark style="color:$info;"><sub></sup> (i.e., 500 \* 1.3).
* Bob gets a farming multiplier of <sup><sub><mark style="color:$info;">1.056x<mark style="color:$info;"><sub></sup>, so the number of boosted shares becomes <sup><sub><mark style="color:$info;">52.8<mark style="color:$info;"><sub></sup> (i.e., 50 \* 1.041).
* The total is <sup><sub><mark style="color:$info;">702.8<mark style="color:$info;"><sub></sup> boosted shares.

So Alice gets <sup><sub><mark style="color:$info;">92.48%<mark style="color:$info;"><sub></sup> (650/702.8) of the rewards, and Bob gets <sup><sub><mark style="color:$info;">7.51%<mark style="color:$info;"><sub></sup> (52.8/702.8) of the rewards. By the end of the day, Alice gets <sup><sub><mark style="color:$info;">184.96<mark style="color:$info;"><sub></sup> wNEAR, and Bob gets <sup><sub><mark style="color:$info;">15.2<mark style="color:$info;"><sub></sup> wNEAR.

Let's say Charlie supplies 1000 USDC and has 0 Weight:

* This adds <sup><sub><mark style="color:$info;">1000<mark style="color:$info;"><sub></sup> boosted shares for Charlie. Now the total amount of boosted shares is <sup><sub><mark style="color:$info;">1’702.8<mark style="color:$info;"><sub></sup>.
* Alice gets <sup><sub><mark style="color:$info;">38.17%<mark style="color:$info;"><sub></sup> (650/1’702.8) of the farm rewards resulting in <sup><sub><mark style="color:$info;">76.34<mark style="color:$info;"><sub></sup> wNEAR per day.
* Bob gets <sup><sub><mark style="color:$info;">3.1%<mark style="color:$info;"><sub></sup> (52.8/1’702.8) of the farm rewards resulting in <sup><sub><mark style="color:$info;">6.2<mark style="color:$info;"><sub></sup> wNEAR per day.

Charlie gets <sup><sub><mark style="color:$info;">58.72%<mark style="color:$info;"><sub></sup> (1000/1’702.8) of the farm rewards resulting in <sup><sub><mark style="color:$info;">117.44<mark style="color:$info;"><sub></sup> wNEAR per day.

## xRHEA Boost Program&#x20;

### Overview

xRHEA Boost allows users to lock xRHEA tokens in exchange for boosted incentive rewards on Rhea Lending. The longer the lock-up period, the greater the boost — up to a maximum of 6 months.

Note: Boost only affects incentive rewards. It does not impact base lending interest rates.

### How It Works

Lock xRHEA → Earn Weight → Get Boosted Rewards

The program operates in two sections:

1. Weight Algorithm – Calculates your Weight based on the amount and duration of xRHEA locked.\ <br>

Farming Multiplier – Converts your Weight into a reward boost factor.<br>




---

[Next Page](/llms-full.txt/1)

