Try ALEX Bitcoin DeFi Now →
Blog
/
Main
Introducing Trading Pool
January 20, 2023

ALEX builds DeFi primitives for developers creating the Bitcoin DeFi economy through Stacks. We focus on the trading and lend/ borrow of crypto assets with Bitcoin as the settlement layer and Stacks as the smart contract layer.

Our Mainnet launched January 2022, and thanks to our incredible community, we have grown to become the top DeFi protocol on Stacks,

We have since launched an AMM DEX, Launchpad , Lend/Borrow, Orderbook and Bridge.

At our core is the automated market making (“AMM”) protocol, which allows users to trustlessly exchange one crypto asset for another. The AMM protocol is the heart of the ALEX ecosystem because it delivers liquidity to where it is needed, whether for the Launchpad or Orderbook.

We’ve taken every effort to ensure our AMM protocol stays relevant and is future-proof. The result is the Trading Pool, which implements Generalised Mean Equation and, with a suitable parameterisation, supports both risky pairs (i.e. xy=L), stable pairs (i.e. x+y=L) and any linear combination in-between (i.e. Curve). You can view our whitepaper for a more rigorous treatment of this subject.

Among the many benefits to our community, Trading Pool will allow:

  • Permission-less pool creation,
  • Efficient swap routing logic and,
  • Greater capital efficiency (similar to Uniswap V3).

This article will elaborate further on the benefits listed above.

Permission-less Pool Creation

A pair can be registered (i.e. a pool can be created) by providing the information of the token pair, the factor t (which determines the AMM curve), the governance address and the initial liquidity.

Trading Pool is permission-less in the sense anyone can register a pair, so long as the two tokens are pre-approved (this is to prevent introducing malicious tokens to the platform).

Semi-fungible pool tokens

The pool token implements SIP013. This makes permission-less pool creation possible, because it removes the need for introducing and having to approve a new pool token each time a pool is created.

Each pool is mapped to a unique id (pool-id) with associated liquidity mapped to the balance under that id.

Efficient Swap Routing

With Trading Pool, we are moving the swap routing logic off-chain, so that we are not bound by on-chain constraints.

The idea is not dissimilar to Balancer SOR, which routes within Balancer pools.

Trading Pool provides a number of functions to combine multiple swaps into one — swap-helper-a, swap-helper-b and swap-helper-c that facilitates “multi-hop” swaps of two/three/four pools, respectively. This allows our swap routing logic to intelligently route across multiple pools and combine them in one transaction, instead of having to perform multiple swaps.

Greater Capital Efficiency

In our whitepaper, we showed that our invariant function maps L to the liquidity distribution of Uniswap V3.

Uniswap V3 allows for better capital efficiency than a simple constant product formula (xy=L), because it concentrates liquidity into a bucket, instead of between negative infinity and positive infinity.

We showed that the higher the t, the flatter the liquidity distribution is. When t approaches 1, i.e. AMM converges to the constant product formula, the liquidity distribution is close to a flat line. When t approaches 0, the distribution concentrates around a point.

This means a series of what is essentially a stableswap-like pool can replicate the price bands of a particular pair from the negative infinity to the positive infinity and liquidity providers can choose to inject/remove liquidity to the relevant bucket they see fit, thereby achieving much greater capital efficiency.

When is the Release?

We are very excited about Trading Pool and are preparing to roll it out as soon as possible.

The first deployment is expected to be our first stableswap pair between xUSD and USDA, which we are launching in partnership with Arkadiko. This is not only the first stableswap on ALEX, but on the whole Stacks ecosystem.

Following that, our upcoming Tokenomics upgrade gives us an opportunity to consolidate and migrate all our existing AMM pools to the Trading Pool. By mid 2023, we hope to have migrated all of our existing AMM pools to the Trading Pool, to bring its many benefits to our community.

To participate and to stay updated on all ALEX related matters: