The place where we exterminate DeFi users that are taking too much risk.
Ensure you have the required environment variables specified below inside the .env
file, then start the bot with
yarn build && yarn start
This service will automatically liquidate undercollateralized ARCx Sapphire vaults.
It loads all the Sapphire Core contracts from the ARCx core contracts package, then continuously watches the opened vaults every hour, unless REFRESH_INTERVAL
specifies otherwise. When a vault can be liquidated, it executes the liquidate()
function on the ARCx liquidation contract (TODO link), that:
- Takes a flash loan from Aave
- Liquidates the vault
- Swaps the earned collateral into a supported stablecoin (taken from the core's pool)
- Transfers the profit to the wallet of the specified
WALLET_PRIVATE_KEY
- Repays the flash loan
ENV Variable | Description |
---|---|
WALLET_PRIVATE_KEY | REQUIRED Ethereum private key the dYdX account owner that will do the liquidations. Make sure that "0x" is at the start of it (MetaMask exports private keys without it). |
POLYGON_RPC_URL | REQUIRED The URL of the Polygon node to use |
DISCORD_WEBHOOK_URL | A webhook URL if you'd like this bot to publish its logger.info() calls to a discord channel. |