Skip to content

Instantly share code, notes, and snippets.

Last active July 31, 2022 18:48
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
boilerplate makerdao auction keeper model using python
#!/usr/bin/env python
import os
import sys
import json
import requests
discount = 0.15
def get_price():
resp = requests.get('', params={'ids': 'ethereum', 'vs_currencies': 'usd'})
return resp.json()['ethereum']['usd']
for line in sys.stdin:
signal = json.loads(line)
if signal['guy'] == os.environ['ACCOUNT_ADDRESS']:
oracle = get_price()
stance = {'price': oracle * (1 - discount)}
print(json.dumps(stance), flush=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment