Smart Contracts @ PieDAO🎂
Twitter: @MickdeG010
- Different exchange types
- Orderbook
- Quote Provider
- Reserve
- AMM
- Uniswap
- Balancer
- BTC++
a place or organization where shares, currencies, commodities, etc. are bought and sold
Stock Exchanges, Binance, most ZRX relayers
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
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
Uniswap, Balancer, Bancor, Curve, Shell Protocol
- 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
Alice == Buyer Pool == Seller
Alice sends tx to pool with 0.5 ETH
Pool returns 83.015 DAI
In a single transaction!
Contract with liquidity of multiple people
LPT = Liquidity Pool Token
aB = Pool asset A balance
bB = Pool asset B balance
1 Liquidity Pool Token
aB / LPT supply
tB / LPT supply
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
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
0.3% of every trade added to liquidity pool
Alice == Buyer Pool == Seller
Alice sends tx to pool with 0.5 ETH
Pool returns 78.73 DAI
In a single transaction!
- Tokenised pool of assets
- Fees generated from swaps
- Constant product formula for prices
- Keeps balanced through arbitrage traders
Up to 8 tokens in a Pool.
Pool tokens represent proportional share of that 8 tokens.
(aB / aW) * (bB / bW) * (cB / cW) = K
25/25/25/25
sBTC/WBTC/iMBTC/pBTC
Spread risk of failure of a single asset
Bitcoin exposure on Ethereum
Generate yield for liquidity providers
- Balancer Pool
- Aragon DAO
- Smart Pool Manager