Grant Proposal Application - TriAngle-Exchange, a extremely low slippage stable swap & AMM Protocol

1) Funding Tier:

Tier 1 - 3 whole development process : Funding amount requested - $ 30 K

2) Project Overview

2.1. Project title and description of the project.

Project Title: Triangle Exchange
Project Description:
Triangle Exchange is a Stable Swap & AMM Protocol with extremely low slippage. It was created to achieve the perfect swap between different stablecoins, such as AUSD & USDT or USDC, therefore empowering AUSD and TAD ecosystem.
Triangle Exchange is the most essential basic infrastructure of the AUSD ecosystem. Unlike the traditional Uniswap V2 system(which support the swap between unstable coins and tokens, like swappi), Triangle Exchange will focus on swapping for stablecoins, offering the best slippage on low liquidity.

2.2. Why does Triangle need Triangle-Exchange?

For Stablecoin Lending Protocol–TriAngle DAO, AUSD is the most essential part. The users can borrow AUSD by depositing their CFX, therefore using AUSD to buy any assets such as TAD or CFX. However, most of the Swaps based on Uniswap V2 will distribute liquidity within the range of (0, ∞), which makes it unsuitable for swapping the stablecoin. Therefore, the TriAngle team designed an AMM Protocol with low slippage for stablecoins–TriAngle Exchange.

2.3. Scope of the system

The Scope of the system includes four core functions: Swap, Pool, Add Liquidity, and Remove Liquidity:

2.4. Objectives and success criteria of the project

We hope TriAngle Exchange to empower the AUSD and TAD ecosystem and become the most essential application in the Conflux Espace, to be more specific:

  1. Stable coin swap with low slippage, which concentrates 60% of the liquidity for 0 slippage swap.
  2. Swap for tokens other than stablecoins with low slippage on eSpace in the future.
  3. Become the Swap Protocol with the largest TVL on eSpace.

3) Project Detail:

Triangle exchange is an exchange protocol for stablecoins (AUSD/USDC, Cfx/xCFX) with low slippage and protection against anchor breakage. The purpose of Triangle-exchange is to use a constant and 1:1 exchange rate within the range Beta centered on A by referencing the price from the oracle without generating slippage; when out of range, it will yield slippage and no longer anchor 1:1; when the imbalance increases, the transaction will be halted at a certain level and protect the asset that pooled in the liquidity pool.

To demonstrate how different parameters affect the shape of the curves (and thus affect the behavior of the model), we superimposed two curves onto one of the plots in one Fig. Curve 1 (green) has a lighter no-slip zone than curve 2 (orange), with β1 = 0.5 and β2 = 0.05. And curve 1 has a lower slip parameter than curve 2, with ∆1 = 2.5 and ∆2 = 0.185. Thus, both curves have the same stopping point at B and C.

When a stablecoin deviates from its peg, arbitrage traders will trade against the pool until it reach the balance. If a curve has a wider range for a 1:1 swap, it will lose more liquidity when there is high price volatility. If a curve has a narrower range for a 1:1 swap and a higher curvature, it will lose less liquidity when the market is volatile. Therefore, curve 2 is more suitable for markets with relatively high volatility. And curve 1 is more suitable for markets with relatively low volatility.

Triangle-Exchange Algorithm

The Triangle-Exchange algorithm is essentially a segmentation function around the oracle offered price feed , divided into three segments:

  1. stable exchange within range of β
  2. price slip movement when price exceeds the range of β but not reaches 1-α and α
  3. broken pile protection. As the figure below shows.

1. Constant swap within the range of β

When the depth ratio of pool A and pool B is less than β, y denotes the depth of Pool B; x denotes the depth of Token A:

2. slippage occurs when exceeding the range of β

Once exceeding the range of β, the rate of increase in price slippage (elasticity) is determined by the parameter ∆. The higher the value ∆, the faster the increase in slippage.

3. Protection against the collapse of a stablecoin

Broken Stake Protection: To prevent the stable coins from being redeemed out, the pool has a minimum and maximum allocation for each token. The allocation is determined by α. The larger the value of α means the lower the minimum allocation percentage and the higher the maximum allocation percentage. If the weighting percentage is lower or higher than the corresponding percentage of α during the process of adding liquidity or trading, trading will be halted.

4. FEE

There are 3 parts of fee in Triangle-swap

  1. fixed fee: epsilon_, 350000000000000 represents 3.5 parts per 10 thousand
  2. dynamic fees: if the pool weight of 2 tokens has changed during the operation, additional fee may be charged.
  3. lambda_: imbalance fee and rebalancing subsidies, the trades make the pooling ratio more balanced will be subsidized by lambda as a multiplier.

4) Triangle-Exchange ---- Ausd Curve.

According to the mechanism of Triangle, when the price of AU/USD is higher than 110%, it can be maintained by arbitrage to return AU/USD ratio to 1:1 and vice versa.
We also designed the parameters cleverly so that the liquidity is concentrated in the normal range. If the price is higher or lower than the predetermined range, the slippage will rise because of the lack of liquidity, but at the same time, it also gives the arbitrageurs higher profits.
The core idea: is to make liquidity more concentrated in the range where arbitrage is not needed while making arbitrage opportunities more profitable.
However, in practice, this is not possible in real life due to the liquidity pool constraint. So, we want to combine the properties of TriangleDAO arbitrage to concentrate the liquidity between a fixed interval, the ratios on this interval, and the liquidity pool all in accordance with the x + y = k curve.

Once the fixed interval is exceeded, the remaining liquidity will be allocated to the price range other than β , which means that there will be high slippage once it is exceeded, and at the same time the arbitrageur can have better arbitrage profits.

In brief, Ausd Curve:

  1. 1:1 exchange within range of β and no additional fees.
  2. Slippage occurs when exceeds the range of β: fee_ = fee_.us_mul(_delta);

5) Liquidity Management.

The Triangle team realizes the importance of liquidity for the Ausd, and also realized the drawbacks of dumping after mining, that’s why we need a systematic and sound liquidity management solution. We hope to introduce POL (protocol own liquidity) and PCL (protocol control liquidity) to manage liquidity through our next project, Triangle-Liquidity.

6) Aggregator Swap with smart order router algorithm.

Tips: Smart Order Router, or SOR, is an off-chain linear optimization of routing orders across pools for best price execution.

To complement Triangle-Exchange functions on non-stable coins, we will connect Swappi’s liquidity by developing an aggregator feature to swap tokens between non-stable coins. We will compute the optimal redemption routing path off-chain and execute the optimal routing path on-chain.

This part of the functionality will be developed in L3.

7) Team

●The TriAngle Exchange was proposed by a global-based decentralized autonomous organization. The core team and early contributors prefer to remain anonymous and firmly believe that a decentralized financial world should be initiated by a decentralized organization and further developed and governed by a Decentralized Autonomous Organization (DAO).

8) Development Roadmap:

Tier 1: Testing $ 5k, Estimated 0.5 month

●Product Design & UI Design
●Survey and Research on Stable Swap

Tier 2: Launch - Stable Swap $ 15k, Estimated 1 month

● Algorithm Design & Smart Contract Development
● App Testing & Bug Fixes
● Prepare Gitbook
● Espace Launch

Tier 3: Launch - Aggregator Swap $ 10 k, Estimated 0.5 month

● SOR Algorithm Design & Smart Contract Development
● App Testing & Bug Fixes
● Prepare Gitbook
● Espace Launch

9) Delivery Requirements:

Github repositories are required for the delivery of your project, including test suites (e.g. integration tests if applicable), and will guide you on how to run the project.

GitHub: https://github.com/triangle-dao/triangle-exchange-protocol

2 Likes

Hi what is XCFX?

Thanks for submitting your application @0xTriangle! Just a few follow up questions:

  1. Team - while keeping members anonymous, how many team members do you have? and what are thier roles/responsibilities/experience?
  2. Token - will you be issuing a governance token?
  3. Is this a Curve fork?
  4. Will the smart contracts be audited?

Thanks for all your questions, Geoff!

  1. We are the same members from TriangleDAO ( Grant Proposal Application - TriAngle DAO, the Borrowing and Lending Protocol for CFX Backed Algorithmic Stablecoin ). In this project, there are six members involved.
    a.【Full Time】Smart Contract Engineer & Defi Engineer: Responsible for Smart Contract Development, Testing, and Launch.
    b.【Full Time】Front-End Engineer & UI Designer: Responsible for UI Design and Front end development.
    c.【Part Time】Smart Contract Engineer: Responsible for Smart Contract Development, Testing, and Launch.
    d.【Part Time】Front-End Engineer: Responsible for front-end development.
    e.【Part Time】TL, Operating Officer and Product Designer: Responsible for Product design, UI design, and Market Activity
    f.【Part Time】Operating Officer.

Other members and part-time members are working in TriangleDAO V2 and Triangle-Liquidity Protocol.

  1. No. We will not issue a governance token in this project. To Manage the Triangle-Exchange Liquidity, we are working on the Triangle-Liquidity Protocol, a Protocol-Control-Liquidity Protocol.

  2. No. It is not a Curve fork. It is a DFX.finance fork ( same as the shell.finance ). The reason why we choose the DFX.finance mechanism is that the arbitrage of TriangleDAO and the DFX.finance complement each other, making AUSD more stable, and creating more arbitrage profit.

  3. Yes. The contract has been audited. (https://github.com/dfx-finance/protocol/blob/main/audits/2021-05-03-Trail_of_Bits.pdf)

1 Like

Hi @Yumingyuan .

XCFX is issued by staking derivative protocol, like rToken in Stafi (https://www.stafi.io/).

1 Like