This is a bot for automatically detecting when the Tellor backup oracle will be triggered in a Liquity-like system and adding a tip for Tellor data in that case. Currently supported networks include Ethereum mainnet, Polygon, Optimism, Goerli, Mumbai, and Optimism-Goerli.
git clone https://github.com/tellor-io/auto-tipper-bot-liquity.git
cd auto-tipper-bot
mv .env.example .env
python3 -m venv venv
source venv/bin/activate
pip install -e .
Add your private key and rpc url to .env
file. Update the QUERY_ID
, QUERY_DATA
, and CHAINLINK_AGGREGATOR_ADDRESS
, and NETWORK
to your desired values. Set the INTERVAL
based on how often you want the bot to check conditions for adding a tip.
If you want your bot to tip based on a collateral price change threshold, set the PRICE_CHANGE_THRESHOLD
to a value greater than 0. A value of 0.05
represents a price change of 5%, for example. Set COLLATERAL_TOKEN_PRICE_URL_COINGECKO
to the url of the price feed for your collateral token. With this feature enabled, the bot will tip if any of the "Chainlink is down" conditions are met, and the collateral token price changes by more than this threshold. Note that, in the event any of the "Chainlink is down" conditions are met, the bot will also continue to tip in an interval of CHAINLINK_IS_FROZEN_TIMEOUT
. To disable this feature, set PRICE_CHANGE_THRESHOLD
to 0
.
To begin tipping
tipper
The bot watches for Chainlink broken, Chainlink frozen, and Chainlink data outside threshold conditions. If any of these conditions are met, the bot will automatically determine a tip amount as a function of the current gas cost, oracle token price (TRB), and base token price (ETH, MATIC). It calculates the cost of paying for gas in terms of the oracle token and adds a buffer of $2. It then waits 45 seconds for a data report. If a report is submitted, the bot then waits for the next tipping interval, again checking for backup oracle conditions to be met. If no report was submitted, the bot recalculates the gas cost in terms of the oracle token, adds the $2 buffer, and multiplies this value by 1.10. It keeps doing this until a report is submitted or up to a max of 10 times.
The Tellor oracle works by incentivizing data reporters to submit your requested data. Reporters have to cover gas costs plus earn some profit. This bot is a handy tool for any liquity-like protocol which wants to pay for Tellor data only when needed.
This repository is maintained by the Tellor team
Check out our issues log here on Github or feel free to reach out anytime [email protected]
Tellor Inc. 2023