Last updated
Last updated
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.
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 on Ethereum and Polygon, and quoted in USDC. See Contracts for smart contract addresses and the currently deployed pools. See Stablecoins for more information on the non-USD stablecoins that each pool contains.
An invariant is a mathematical property or relationship that remains unchanged under a set of operations. In the context of a decentralised 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 visualised with token balances on each axis.
Stabull pools dynamically adjusts swap pricing based on the balance of reserves in the pool relative to the oracle rate. This mechanism ensures that the pool remains efficient and closely tracks the external FX market.
Swaps that rebalance the pool are rewarded (incentivised).
Swaps that imbalance the pool are penalised (disincentivised).
Example: the NZDS/USDC pool is 68% NZDS (abundant) & 32% USDC (scarce).
rebalancing swap
adds the scarce asset & removes the abundant asset
swap NZDS for USDC
rewarded with part of the spread
unbalancing swap
adds the abundant asset & removes the scarce asset
swap USDC for NZDS
penalised with a higher spread
This dynamic pricing mechanism encourages users to rebalance the pool while discouraging swaps that exacerbate imbalances. Instead of viewing the pool as "unbalanced," it is more accurate to describe it as having a temporary deviation from the oracle rate (e.g., Stabull NZDS/USDC price β NZD/USD FX price).
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.
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.