Building a Just-in-time (“JIT”) liquidity bot on top of the Ethereum pending transaction stream.
The JIT service consumes a config.yaml
file which specified its runtime parameters. The service establishes a connection to the Ethereum mainnet in order to monitor the pending Ethereum transactions pool. We watch for Uniswap V2 transactions and use the Web3 API with a local Anvil node and an external mainnet provider to extract all information necessary to determine whether performing a JIT attack is desirable.
To install Anvil, enter the following in the terminal window:
curl -L https://foundry.paradigm.xyz | bash
brew install libusb
foundaryup
Example config.yaml
file:
provider: infura
api_key: <YOUR INFURA KEY HERE>
abi_json_path: ./abi
tx_retry_times: 2
tx_retry_period: 1000
api_server_address: 127.0.0.1:8000
tx_retry_interval
is in milliseconds.
cargo run <optional: /path/to/config.yaml>
- Ethereum RPC node providers
- Using a Ganache instance with Rust
- How to connect to a WebSocket provider
- Uniswap v3 JIT Liquidity MEV Transactions
- Uniswap v3 JIT Liquidity MEV Transactions Cost
- Simple JIT Math
- Comprehensive Guide on JIT
- Flashbot bundles js
- Flashbot bundles rs
- Removing liquidity example