Ref Finance: Rated Stable Pools on DEX

Generic rated swap pool with custom peg on NEAR Protocol

DeFi DEXdApps Smart сontract NEAR

Ref Finance is a core project in the DeFi ecosystem on Near Protocol. Its main objective is to bring together the core components of DeFi, namely, decentralized exchange (DEX), lending protocol, synthetic asset issuer, and more.

Challenges

1

To develop a generic rated swap pool with custom peg and implementation for stNEAR/NEAR.

2

To develop a complex smart contract on Rust.

1

Team member

Blockchain Team Lead

2

Weeks

It took us to develop the feature

Interested in your DeFi project development?

Implementation

Implementation

Development stage

Based on the StableSwapPool source code, we developed a generic RatedSwapPool and implementation for stNEAR/wNEAR pool with the next changes:

  • Added rates to swap & add / predict / remove_liquidity calculations.
  • Math upgraded to 24 decimals using U384.
  • Generic rates acquisition from another smart contract via cross-contract call with caching.
  • Added minimum boilerplate for rates acquisition implementation.
  • Added sample implementation of rates acquisition for stNEAR.

Project outcome

We implemented support for stable pools with an accurate calculation of the value of liquid staking assets on NEAR. It allowed for attracting additional liquidity and led to an increase in the number of transactions and users.

Contact us to realize your most daring ideas with an expert development team

INC4 © 2024