Automated Market Makers
Mick de Graaf
Smart Contracts @ PieDAO🎂
Twitter: @MickdeG010
Program
- Different exchange types
- Orderbook
- Quote Provider
- Reserve
- AMM
- Uniswap
- Balancer
- BTC++
Exhange
a place or organization where shares, currencies, commodities, etc. are bought and sold
Orderbook
Stock Exchanges, Binance, most ZRX relayers
Quote Provider
ShapeShift, Bitonic, Contractors
Alice signals that she wants to buy 1Bitcoin.
Bob has liquidity and signals that he is willing to sell 1 BTC at €6779,8. (makes a quote)
Alice agrees, sends the euros and buys 1 BTC
Alice == Buyer Bob == Seller
Reserve
Kyber Reserves, Super Markets
Alice == Buyer Bob == Seller
Bob periodically deposits DAI into a smart contract and periodically updates the price of ETH in DAI he likes to receive when selling DAI.
Alice sends 1ETH to the pool and gets 1/BobsPrice
Automated Market Makers
Uniswap, Balancer, Bancor, Curve, Shell Protocol
Characteristics
- Smart Contract Based
- Require no external input
- Use a curve to determine price
- Pool Liquidity from different users
- Share in liquidity pool is tokenised
- Fully onchain
Uniswap
Alice == Buyer Pool == Seller
Alice sends tx to pool with 0.5 ETH
Pool returns 83.015 DAI
In a single transaction!
Pool?
Contract with liquidity of multiple people
Pool Token
LPT = Liquidity Pool Token
aB = Pool asset A balance
bB = Pool asset B balance
1 Liquidity Pool Token
aB / LPT supply
tB / LPT supply
Price Calculation
X * Y = K
1 * 1 = 1
2 * 0.5 = 1
aB (X) = Pool asset A balance
bB (Y) = Pool asset B balance
K = Constant
Constant Product Formula
Spot Price == 1 / 1 == 1
Actual Price == K / aB == 1 / 2 == 2
Value Distribution
50/50
TokenA / TokenB
When the prices of the assets fluctuate against each other there will be an arbitrage opportunity. Traders taking advantage of this will restore the 50/50 distribution.
Basically a simple index fund
Fees
0.3% of every trade added to liquidity pool
Balancer
Alice == Buyer Pool == Seller
Alice sends tx to pool with 0.5 ETH
Pool returns 78.73 DAI
In a single transaction!
Much like Uniswap
- Tokenised pool of assets
- Fees generated from swaps
- Constant product formula for prices
- Keeps balanced through arbitrage traders
But Different
Multi Dimensional
Up to 8 tokens in a Pool.
Pool tokens represent proportional share of that 8 tokens.
Custom Weights
(aB / aW) * (bB / bW) * (cB / cW) = K
BTC++
Bitcoin on Ethereum Diversified
Allocation
25/25/25/25
sBTC/WBTC/iMBTC/pBTC
Goal
Spread risk of failure of a single asset
Bitcoin exposure on Ethereum
Generate yield for liquidity providers
Underlying Tech
- Balancer Pool
- Aragon DAO
- Smart Pool Manager
Thanks
Any
Questions?
AMMs
By Mick de Graaf
AMMs
- 835