Unlike Uniswap or other constant product AMMs, Stabull is a proactive AMM. Instead of waiting for arbitrageurs to align prices with other sources of liquidity, the Stabull AMM dynamically concentrates liquidity around an off chain FX oracle to provide lower slippage. This lends itself naturally to FX and RWA's where the majority of price discovery occurs off chain. As well as providing price improvement for traders and relieving peg pressure for token issuers, this model greatly reduces impermanent loss for LP's, because their liquidity is dynamically recentered around the oracle price, without leaking profit to arbitrageurs.
Pool
A Stabull pool (or pair) is a smart contract which manages a reserve of two fiat-backed, ERC-20 stablecoins. There are two main operations a user can perform on a Stabull pool...
Liquidity Providers (LPs) can deposit & withdraw Liquidity from pools, changing the total reserves of the two tokens.
Traders can Swap between the two tokens, changing the proportion of token reserves.
At launch, Stabull pools are deployed to Ethereum and Polygon, with more chains in the roadmap. See Contracts for smart contract addresses on both chains.
Invariant
An invariant is a mathematical property or relationship that remains unchanged under a set of operations. In the context of a decentralized exchange, the invariant defines the relationship between the balances of pool tokens and parameters, that remains unchanged after swapping, deposits or withdrawals. The Stabull invariant is a hybrid of constant product and constant sum invariant, resulting in a flattened curve when visualized with token balances on each axis.
Events that affect a pool
Event | Affect | Invariant |
---|---|---|
Deposit or Withdrawal | the total reserves change. the proportion of reserves (and the swap price) remain the same. | the invariant ensures that deposits & withdrawals can only be made in the same proportion as the current pool reserves. |
Swap | the proportion of reserves, and therefore the swap price changes. | the invariant ensures that a swap cannot reduce the total reserves, although the spread collected on each swap will slightly increase total reserves. |
Oracle Update | liquidity is dynamically shifted around the oracle price. the swap price changes. | The oracle price is used to determine token proportions, slippage and halt boundary's. |
Oracles
The oracle rate for each pool is determined by two oracle price feeds. One for each token in the pool:
the base oracle is the price of the fiat currency in USD e.g. TRY/USD
the quote oracle is the price of the quote stablecoin in USD e.g. USDC/USD
At present, oracles are supplied by Chainlink Data Feeds.
Rebalancing the pool
A trader that is bringing the scarce asset scarce asset gets a better price than oracle (bonus) and the Trader TAKING the scarce asset gets a worse price (slippage). This ensures there is always an arbitrage incentive to return the pool to balanced
since the NZDS is scarce in pool = overprice and the USDC is abundant = underpriced
a trader is incentivized to rebalance the pool...
(1) there is an arbitrage profit to collect by adding (selling) his NZDS for USDC (buying).
(2) as an LP he will benefit from a balanced pool due to increased swap volume and fees.
Last updated