Launching the Trisolaris Stable AMM

Trisolaris Labs
TriSolaris Labs
Published in
4 min readMar 30, 2022

All,

We are beyond pumped to announce the launch of the Trisolaris Stable AMM (beta version). With this launch, Trisolaris is the only decentralized exchange on Aurora where users can swap across multiple AMMs from one unified User Interface!

Context

  • The existing Trisolaris AMM, which is built upon Uniswap’s Constant Product invariant, is great for swapping any 2 assets, bootstrapping liquidity, and determining price without the use of a central third party. However, it does have some downsides when trading “similar assets”
  • To address these issues, Curve implemented the StableSwap invariant, which has significantly lower slippage for stablecoin trades than many other prominent invariants (e.g., constant-product)

Some of the pairs that can be used in a StableSwap Invariant include USD-pegged stable-coins (like UST, USDC, and DAI) and “like pairs” such as NEAR-stNEAR, TRI-xTRI or different versions of wrapped BTC.

Here is why this is important

With the launch of the Trisolaris Stable AMM, both traders and liquidity providers benefit from a significantly better trading experience

  • For Traders: Traders can trade stable pairs with lower slippage, lower fees, and higher capital efficiency
  • For Liquidity Providers: LPs can provide liquidity for one asset (vs. 50/50 for 2 assets), and impermanent loss suffered is significantly lower due to the StableSwap invariant algorithm
  • For xTRI Holders: a % of fees from the stableswap will be used to buy-back TRI, which further benefits xTRI holders (not yet live)

Smart-Order Routing

  • It can be confusing for users to choose whether they want to trade on the “Constant Product AMM” or the “Stable AMM”, therefore we implemented a Smart Order Router that powers our swap widget.
  • When users swap any 2 assets, we automatically direct the user to the AMM with the deepest liquidity, lowest slippage and most efficient execution!
Smart Order Router

What’s the roll-out plan

  • The Stable AMM is live with a USDT/USDC pool! But there are, currently, no incentives for providing StableSwap liquidity.
  • We are going to let the Stable AMM remain in this state for the next 1–2 weeks and monitor performance.
  • During this time users can add liquidity, remove liquidity, and swap!
  • Once this beta period ends, we will start migrating TRI emissions from the existing USDC/USDT pool to the new Stable AMM pools, and will also launch new pools such as 3TriPool with USDT/USDC/UST (with some special incentives). More on this later!

How can you use it today?

  • Head to the pools page, click the Stable AMM tab, and then click “Add” to add liquidity.
Add Liquidity Flow
  • Unlike Standard AMMs, LPs can add/remove liquidity for single assets. In the example below, LPs can choose to add add liquidity for only USDT, only USDC, or both assets in the ratio of choice (not necessarily 50/50).
  • Similarly, LPs can remove liquidity in one asset or split across multiple assets (we will add a more detailed guides in our docs by end of week!)

Contracts

This code is NOT AUDITED, please use at your own risk.

The smart-contracts are forked from saddle finance, which was audited by Certik, Quantstamp, and Open Zeppelin.

Note

LP Token contract cannot be verified, and is blocked by an internal transactions issue on aurorascan. Aurora team has said it can resolve in the issue in 2–3 weeks!

Key Variables:

  • Flash swap loan fee: 8bps
  • Swap fee: 10bps
  • Admin fee: 0bps — will be changet in future to buy back TRI
  • Amplification coefficient: 400
  • Amplification coefficient: The coefficient determines the ratio between stable curve and uniswap curve. The higher the Amplification Coefficient the more closer final stableswap invariant is to stable curve

About Trisolaris

Trisolaris is a community-owned decentralized exchange (DEX) with fast-settlement, low fees, and a democratic governance process. Built on NEAR’s Aurora EVM, TriSolaris is building the one-stop-shop for DeFi on NEAR!

Website | Twitter | Telegram | Discord | GitHub

--

--