Bidding Models
Information about bidding models for debt and surplus auction keepers
auction-keeper
maintains a collection of child processes, as each bidding model is its own dedicated process. New processes (new bidding model instances) are spawned by executing the command passed to --model
. These processes are automatically terminated (via SIGKILL
) by the keeper shortly after their associated auctions expire.
Whenever the bidding model process dies, it gets automatically respawned by the keeper.
Example:
Pass the auction status to each bidding model
auction-keeper
communicates with bidding models via their standard input and output. When the auction state changes, the keeper sends a one-line JSON document to the standard input of the bidding model process.
A sample message sent from the keeper to the model looks like:
Bidding models should never make an assumption that messages will be sent only when auction state changes.
At the same time, the auction-keeper
reads one-line messages from the standard output of the bidding model process and tries to parse them as JSON documents. It then extracts two fields from that document:
price
- the maximum (for debt auctions) or the minimum (for surplus auctions) pricethe model is willing to bid. This value is ignored for fixed discount collateral auctions
gasPrice
(optional) - gas price in WEI to use when sending the bid
Processing each bidding model output and submitting bids
Sample model output for a debt auction bidding model
A sample message sent from the debt model to the keeper may look like price
is PROT/System Coin
price.
Sample model output for a surplus auction bidding model
A sample message sent from the debt model to the keeper may look like:
price
is PROT/System Coin
price
Any messages written by a bidding model to stderr will be passed through by the keeper to its logs. This is the most convenient way of implementing logging from bidding models.
Currently there's no mechanism that prevents a keeper from bidding at an unprofitable price
Simplest possible bidding model
Specifying a gas price is optional. If you want to start with a fixed gas price, you can add it like this:
The model produces price(s) for the keeper. After the sleep
period, the keeper will restart the price model and read new price(s).
Collateral bidding models
Note: Currently, collateral keepers buy collateral at a fixed discount (specified in the auction house smart contract) and don't bid prices. So they should use a blank model file like this:
Other bidding models
banteg's Python boilerplate model
Last updated