Monitors 1inch.exchange price pairs via the API and sends notifications via Telegram if price pair targets are met.
- LOG_LEVEL (default:
info
) Sets the log level. Available log levels aresilly|debug|verbose|http|info|warn|error
. - INTERVAL_SECONDS (default:
10
) Sets the number of seconds to wait between checks for all rules. All rules will are checked in parallel and the next check occurs after the interval. - API_VERSION (default:
v1.1
) Sets the API version to use. The latest version should be documented at API. - MAX_INFLIGHT (default:
3
) Maximum in-flight 1inch API requests. - TELEGRAM_BOT_TOKEN (required) Sets the Telegram Bot token to use for sending notifications.
- TELEGRAM_CHAT_ID (required) Sets the Telegram chat id to use for sending notifications.
- RULES (required) Defines rules to be used for alerting. More information below. New line separated.
Note: Rule parsing has changed. Please use the new format below. Rules are defined as follows.
<amountToSwap> <fromTokenSymbol>-<toTokenSymbol>[-<toTokenSymbol>] <comparitor> <amountToCompare> [!<disabledExchangesList>]
Symbols are chained together via a hyphen.
Gas alerting is also supported by using the following rule recipe where speed
can be one of SLOW
, STANDARD
, FAST
, or INSTANT
.
<speed> GAS <comparitor> <amountToCompare>
docker run \
--name 1inch-monitor \
-e TELEGRAM_BOT_TOKEN=CHANGEME \
-e TELEGRAM_CHAT_ID=CHANGEME \
-e RULES='1 USDC-DAI >= 1.01 !0X Relays \
1 DAI-USDC >= 1.01 !OX Relays,Uniswap,Kyber \
1 ETH-USDC >= 250 !AirSwap,Kyber,Uniswap \
250 DAI-ETH <= 1 \
STANDARD GAS <= 10' \
divthis/1inch-monitor
Use the following for your docker-compose.yml
.
version: '3'
services:
1inch-monitor:
image: divthis/1inch-monitor
environment:
TELEGRAM_BOT_TOKEN: CHANGEME
TELEGRAM_CHAT_ID: CHANGEME
RULES: |-
1 USDC-DAI >= 1.01 !0X Relays
1 DAI-USDC >= 1.01 !OX Relays,Uniswap,Kyber
1 ETH-USDC >= 250 !AirSwap,Kyber,Uniswap
250 DAI-ETH <= 1
STANDARD GAS <= 10
Run the following from the same directory as docker-compose.yml
.
docker-compose up