rDEX V1 Solution By StaFi Protocol

Muhammad Randy Chaniago
5 min readJan 31, 2022

Introduction

rDEX V1 is a DEX developed by StaFi that seeks to solve the problems associated with rToken liquidity. It will provide decentralized transaction services for all rTokens based on the StaFi Chain. Being an important part of the StaFi rToken ecosystem, rDEX V1 will be deployed on the StaFi chain. Native rTokens minted by users can directly be traded through the DEX for better liquidity. This will eliminate the need for cross-chain to Ethereum or other ecosystems.

What Is rDex?

rDEX V1 key features: low slippage for small and medium-sized transactions; FIS token will be basic trading asset for all rToken trading pairs; Impermanence loss protection with FIS rewards; support pool tokens asymmetrically

What Is The Purpose Of This rDEX?

The target of rDEX is to improve the liquidity function and maintain the value of rToken

  1. Completely decentralized, independent of third-party prices
  2. Support to provide liquidity asymmetrically, but encourage to provide liquidity symmetrically
  3. Make up for LP’s impermanent losses through shared trading fees and mining incentives

Why Did StaFi Create rDEX?

Because of the problem with slippage, which is the usual case
where when we swap if the slippage is too high then
the fees will also be high and it affects large transactions especially in compressing liquidity

Then is there a working way or Architecture of this rDEX?

Of course there is, below this picture we can see the work process flow

The overall structure is shown in the following figure:

Mining Module

The modified module mainly provides mining program incentives for Liquidity Provider:

  1. Deposit Function: Liquidity provider stakes the LP token to participate in mining program
  2. Withdraw Function: The user withdraws LP token and stops mining, and the corresponding mining reward will be issued at this time
  3. Claim Function: Withdraw the mining rewards

Lpbalance Module
Responsible for mint burn swap of LP token, etc.

What Are The Advantages Of This rDEX

there are many advantages and solutions in this rDEX

  1. Liquidity Pool Model
  2. StaFi rDEX V1 will be developed with reference to Thorchain’s Continuous Liquidity Pools (CLP) model.
  3. AMM CLP MODEL
    The market maker formula for user transactions under the AMM CLP Model
  4. Liquidity Provider Fee
    Under the CLP market maker mechanism, the Liquidity Fee charged by the StaFi rDEX V1 Liquidity
  5. Different Deposit Types
    rDEX V1 will allow Liquidity providers to support liquidity with one single token. If they offer two, they will be provided the flexibility to decide the ratio.
  6. Pool Share
    When users provide liquidity for rDEX V1, it needs to calculate the liquidity Pool Share provided by them. The Pool Share calculation formula taking into account the slippage adjustment

How about the mechanism in Loss Protection

rDEX also provides permanent loss protection
the value of the asset at the time of withdrawal is not lower than the time of deposit if the Liquidity Provider serves for a certain period of time (for example, 100 days).

What About Participants

rDEX V1 Key participants include traders and liquidity providers:
1)Trader
A trader can exchange one token for another token through rDEX V1 using the price determined by the liquidity pool ratio.
2)Liquidity Provider
Liquidity provider adds rToken or FIS token to their corresponding rDEX V1 pair pool to earn liquidity provider fees as revenues or liquidity mining rewards.

Then How Does Trading Pairs And Fees Work?

rDEX V1 will support trading pairs between rToken and FIS, such as rATOM/FIS, rDOT/FIS, rKSM/FIS, rSOL/FIS, rBNB/FIS, rMATIC/FIS, etc. In the future, all rTokens supported by StaFi will be listed.

The Fee types supported by rDEX V1 are mainly Liquidity Provider Fees and Gas Fees:

What Utility Does rDEX Use?

rDEX’s goal is also to promote FIS utilities through various aspects

1) The underlying transaction assets of rToken in rDEX V1 are all FIS, which will be an important medium for promoting rToken liquidity.
2) Since rDEX V1 is directly applied to the StaFi chain, users have to pay FIS as gas fee when using rDEX V1.
3) FIS will be used for the Reserved Variable Loss Protection Fund to motivate Liquidity Providers.
4) FIS will be used for rDEX V1 liquidity mining incentives.
5) FIS will be used by community members to choose the liquidity mining weight of each rToken pool.
6) rDEX V1 transaction fee income will be collected by the Treasury and used for Buyback and FIS burning.

How will rDEX go in the future?

That rDEX V1 is just the start of the StaFi team building liquidity for rToken Holders. After rDEX V1 is launched, there will be even better developments later and this is where the important role of the rDEX Bug Bounty carried out by the StaFi team

The article above is a summary about rDEX that I took from the source

  1. https://commonwealth.im/stafi/discussion/2776-rdex-v1-solutionan-amm-dex-for-rtokens
  2. https://commonwealth.im/stafi/discussion/3354-rdex-technical-architecture
  3. https://docs.rdex.finance/welcome-to-rdex/rDEX-The%20AMM%20DEX%20for%20rTokens/the-testing-guide-for-rdex-on-testnet

For those who are curious about the StaFi Protocol, you can follow the social media and visit the website

Website: www.stafi.io
rToken App:
https://app.stafi.io
Twitter:
@Stafi_Protocol
Telegram Chat:
https://t.me/stafi_protocol
Telegram Announcements:
https://t.me/stafi_ann
Discord:
https://discord.com/invite/jB77etn
Forum:
https://commonwealth.im/stafi

--

--