lptOrderBook is a mechanism to allows a buyer and a seller to commit to a deal which involves the seller delivering Livepeer Tokens (LPT) before an agreed block height of Ethereum's blockchain.
Livepeer Token (LPT) is an ERC-20 Token on Ethereum. Livepeer's Protocol rewards LPT holders for bonding (staking, delegating) tokens to Livepeer's Network. For a holder to transfer their bonded LPT to another address, they must unbond and wait for an unbonding period.
The holder receives no rewards for the tokens that are unbonding.
Dai Stablecoin v1.0 (DAI) is another ERC-20 Token on Ethereum.
Alice has LPT, which is bonded to a node in Livepeer's network, and is earning Rewards and Fees. Alice also has DAI.
Bob has DAI.
Alice would like to exchange x LPT for y DAI.
Bob would like to exchange y DAI for x LPT.
Alice would like to be certain that they will receive y DAI before they unbond x LPT and waits for the unbonding period to lapse.
- Alice creates the order:
- Defines
x- the amount of LPT that Alice will provide - Defines
y- the amount of DAI Alice will receive in exchange forxLPT - Defines
p- the block by which Alice promises to provide the LPT - Sends
zDAI - a deposit which Alice will put at risk if she doesn't providexLPT by blockp
- Alice cancels the order, and withdraws
zDAI
- Alice creates the order:
- Defines
x- the amount of LPT that Alice will provide - Defines
y- the amount of DAI Alice will receive in exchange forxLPT - Defines
p- the block by which Alice promises to provide the LPT - Sends
zDAI - a deposit which Alice will put at risk if she doesn't providexLPT by blockp
-
Bob fills the order, sending
yDAI. -
Block
pis mined -
Bob withdraws
y + zDAI
- Alice creates the order:
- Defines
x- the amount of LPT that Alice will provide - Defines
y- the amount of DAI Alice will receive in exchange forxLPT - Defines
p- the block by which Alice promises to provide the LPT - Sends
zDAI - a deposit which Alice will put at risk if she doesn't providexLPT by blockp
- Bob fills the order, sending
yDAI.
Independently of this process, Alice unbonds x LPT, and waits for the unbonding period before withdrawing.
- Alice sends
xLPT, and receivesy + zDAI. Bob receivesxLPT.