Smart contract for populating matching-market orderbook.
function linearOffers(
MarketLike otc, TokenLike baseToken, TokenLike quoteToken, uint midPrice, uint delta, uint baseAmount, uint count
) public
Adds count
buy and count
sell offers for trading baseToken
and quoteToken
to market otc
by the following scheme:
- buy
count
:baseAmount
atmidPrice
+count
*delta
- ...
- buy 1:
baseAmount
atmidPrice
+delta
- spread: midPrice
- sell 1:
baseAmount
atmidPrice
-delta
- ...
- sell
count
:baseAmount
atmidPrice
-count
*delta
Takes funds from sender:
baseToken
:baseAmount
*count
quoteToken
:baseAmount
*count
* (midPrice
-delta
* (count
+1)/2)
The intention is that no new offers match when adding. It is up to the caller to ensure that.
function cancelMyOffers(MarketLike otc, TokenLike baseToken, TokenLike quoteToken) public
Cancels all offers created by the sender for trading baseToken
and quoteToken
to market otc
.
Returns all funds to the sender.