forked from makerdao/auction-keeper
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dba21b
commit f20ef02
Showing
9 changed files
with
101 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule pyflex
updated
6 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import os | ||
import json | ||
|
||
# Example stdin input | ||
""" | ||
{"id": "6", "bid_amount": "0.000000000000000000", "amount_to_sell": "0.000000000000000000000000500000000000000000000", "block_time": 1651155568, "auction_deadline": 1651412740, "price": null, "bid_increase": "1.030000000000000000", "high_bidder": "0x6073E8FE874B53732b5DdD469a2De4047f33C64B", "surplus_auction_house": "0xCdaA2ec0975eD41202E1078b21a4833E414f6379"} | ||
""" | ||
|
||
# FLX Price to bid | ||
MAX_BID_PRICE = 60 | ||
MIN_BID_PRICE = 0.00000000001 | ||
|
||
while True: | ||
for auction_state in sys.stdin: | ||
auction_state = json.loads(auction_state) | ||
|
||
# If we are already the high bidder, do nothing | ||
if auction_state['high_bidder'] == os.environ['ACCOUNT_ADDRESS']: | ||
continue | ||
|
||
# No bids yet | ||
if float(auction_state['bid_amount']) == 0: | ||
bid = {'price': str(MIN_BID_PRICE)} | ||
print(json.dumps(bid), flush=True) | ||
else: | ||
my_bid_price = float(auction_state['price']) * float(auction_state['bid_increase']) | ||
if my_bid_price <= MAX_BID_PRICE: | ||
bid = {'price': str(my_bid_price)} | ||
print(json.dumps(bid), flush=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
while true; do | ||
echo "{\"price\": \"50.0\"}" | ||
sleep 120 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
KEEPER_ADDRESS=<KEEPER ADDRESS> | ||
ETH_RPC_URL=<ETH RPC URL> | ||
|
||
KEYSTORE_DIR=<FULL PATH OF KEYSTORE DIR> | ||
KEYSTORE_FILE=<KEYSTORE FILE> | ||
MODEL_DIR=<FULL PATH OF MODEL DIR> | ||
MODEL_FILE=<MODEL FILE> | ||
|
||
docker pull reflexer/auction-keeper:latest | ||
|
||
docker run -it \ | ||
-v ${KEYSTORE_DIR}:/keystore \ | ||
-v ${MODEL_DIR}:/models \ | ||
--env ACCOUNT_ADDRESS=${KEEPER_ADDRESS} \ | ||
reflexer/auction-keeper:latest \ | ||
--type surplus \ | ||
--model /models/${MODEL_FILE} \ | ||
--rpc-uri ${ETH_RPC_URL} \ | ||
--eth-from ${KEEPER_ADDRESS} \ | ||
--eth-key "key_file=/keystore/${KEYSTORE_FILE}" \ | ||
--block-check-interval 30 \ | ||
--bid-check-interval 30 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters