Jumpstart your next liquidation bot with Hook
The modern Rust boilerplate for building reliable, asynchronous and slim liquidation bots for Pike protocol
- Latest Rust for speed and robustness
- Tokio for async operations
-
Initialization: The bot begins by establishing a connection to the RPC provider via HTTP or WebSocket. This allows the bot to interact with the blockchain and the Pike protocol's smart contracts.
-
Event Subscription: Once connected, the bot subscribes to a stream of events. Add more events depending on your strategy!
-
State Reconstruction: As events are received, the bot parses each one and updates its internal representation accordingly. This allows the bot to maintain an up-to-date understanding of each user's position with minimal calls to the smart contracts, improving efficiency.
-
Liquidation Check: The bot checks for potential liquidations by examining the health factor of users' positions.
-
Liquidation Execution: If a user is found to be in a state where they can be liquidated (health factor is less than 1), the bot calls the Pike contract's liquidation function to initiate the liquidation process.
-
Debt Liquidation: The bot liquidates the user's debt, effectively repaying what they owe to the protocol.
-
Continual Monitoring: The cycle continues indefinitely.
Join Pike community to get help now!
- Discord
@gakonst