Running on a Host

Running a staked token auction keeper directly on a host

Prerequisites

Python 3.6+

Get RAI

Buy RAI from Uniswap v2 or open a SAFE and generate it.

Clone

git clone https://github.com/reflexer-labs/auction-keeper.git
cd auction-keeper
git submodule update --init --recursive

Install

This creates a virtual environment and installs all the keeper dependencies:

./install.sh

1) Start virtualenv

source _virtualenv/bin/activate

2) Modify model file as needed

A basic debt staked auction bidding model can be found in models/debt_staked_model.py. This model retrieves the latest FLX/USD price from Coingecko and will automatically place bids in an auction.

You probably want to modify the following variables in models/debt_staked_model.py:

  • MAXIMUM_FLX_MULTIPLIER: the maximum acceptable FLX price to use when bidding. Default: 0.90 meaning the maximum price to pay when biding for FLX (with RAI) is 90% of the current FLX/USD market price coming from Coingecko

  • MINIMUM_FLX_MULTIPLIER: the minimumum FLX price to use when bidding. This will determine your opening bid. Default: 0.50 meaning the minimumm price to pay when biding for FLX (with RAI) is 50% of the current FLX/USD market price from Coingecko

  • MY_BID_INCREASE: the bid increase (in RAI) to propose when outbidding another bidder. If the value is smaller than the staked token auction house's bidIncrease, then it will use the value set in the staked token auction house. Example: a value of 1.10 will use bid increases of 10%. Note: the current bidIncrease on mainnet is 1.05

Then:

chmod +x debt_staked_model.py

For more information about bidding models, see Bidding Models.

3) Modify keeper run file

Modify the following variables in run_debt_keeper_host.sh:

  • KEEPER_ADDRESS - the keeper's address. It should be in checksummed format (not lowercase)

  • ETH_RPC_URL - the URL of your Ethereum RPC connection

  • KEYSTORE_DIR - the full path of the directory where your keystore file is

  • MODEL_DIR - the full path of directory where your debt_model.py file is

  • KEYSTORE_FILE - your Ethereum UTC JSON keystore filename For more information about this keystore format and how to generate them, check keythereum or Ethereum UTC / JSON Wallet Encryption.

  • GAS_MAXIMUM -maximum gas price, in GWEI

Then:

chmod +x run_debt_staked_keeper_host.sh

4) Start the keeper and enter your keystore file password

./run_debt_staked_keeper_host.sh

Staked Token Auction Output

If debt from collateral auctions still exists after AccountingEngine.pop_debt_delay(), the debt staked auction-keeper will call popDebtFromQueue():

Settling debt

Before starting a staked token auction, the keeper will use any surplus to offset any existing debt. It does this by calling settleDebt():

Starting a Staked Token Auction

Finally, if debt still exists and is enough to start a staked token auction, the auction-keeper will call auctionAncestorTokens() in the StakingPool:

Bidding in a Staked Token Auction

To bid in staked token auctions, the auction-keeper calls increaseBidSize():

Settling a Staked Token Auction

To settle a staked token auction, the auction-keeper calls settleAuction():

Full Log Output

Last updated

Was this helpful?