A simple liquidator bot written in JS for BAO Finance's synthetics protocol.
This bot is by no means top-of-the-line and is meant to be used as a reference / starting point for people attempting to create more robust liquidation bots for the protocol. JavaScript is no bueno for MEV searching. Feel free to run it as-is, however, here's your competition:
- Create proxy contract to batch liquidation operations into one transaction
- Submit transactions in flashbots bundles / to the flashbots RPC
- Consider profit/loss when executing liquidations
- Include gas expenditures & liquidation profit in consideration
- Use subgraph more to speed things up, no need to query contracts in several instances
- Auto-withdraw from bdTokens to receive underlying liquidity after successful liquidations.
- Copy
src/constants.default.ts
tosrc/constants.ts
and fill in blank values. - Create a file in the project root called
.secret
and include your liquidator wallet's private key - Run
yarn
- Run
ts-node ./src/indexv3.ts
Released under the WTFPL License. Have at it.