Drift Protocol v2

⌘K
👾Welcome to Drift Protocol
📺Drift DEX
👋Getting Started
📈Perpetual Futures
📊Spot Margin Trading
🏦Borrow & Lend
🏛️Staking
🏪Market Makers
🔬Technical Explanations
📏Accounting and Settlement
➗Borrow Interest Rate
📜Delisting Process
⛲Drift AMM
🏃Just-In-Time (JIT) Auctions
📚Keepers & Decentralised Orderbook
☠️Liquidators
💧Liquidity Providers (LPs)
📋Protocol Guard Rails
📝Risks
🖥️Developer Resources
📔Program/Vault Addresses
⌨️SDK Documentation
⌨️Tutorial: Bots
⚠️Troubleshooting
🛠️Keeper Bots
🛠️Trading Bots
⌨️Historical Data (v1)
⌨️API
🛡️Security
🛡️Audits
🛡️Bug Bounty
⚖️Legal and Regulations
📝Terms of Use
📝Disclaimer
📝Privacy Policy
📝Competition Terms and Conditions
Sweepstakes Details
📚Glossary
Docs powered by
Archbee
Developer Resources
...
Tutorial: Bots
Keeper Bots

Tutorial: Liquidation Bot

4min

Introduction

Liquidation Bots improve the overall health of the protocol by deleveraging users approaching bankruptcy.

The liquidation in the protocol is a liability transfer mechanism from the selected liquidatee (user in liquidation territory) to the liquidator (the user running the Liquidation Bot).

Liquidators inherit the liabilities they liquidate and receive an asset at a discount for doing so. In order to participate, liquidators must have even collateral in their account in order to satisfy the initial margin requirements for the transferred positions.

For more information on our liquidation system, please read Liquidations.

Getting Started

The reference implementation of a Liquidation Bot is available here.

A step-by-step guide to initialising and running the liquidator bot will be coming soon!

Advanced

If you're interested to make the liquidator bot run better, you can make edits to the above to improve its efficiency. In particular, you can:

  1. Sort users in an efficient data structure based on their liquidation price;
  2. Monitor the market's price to determine when to run liquidation checks / RPC checks.

We encourage the community to build out stronger liquidations engines and bots to secure our Insurance Fund and user collateral. If interested to chat or have any questions, please reach out to us on Discord or Twitter!

Updated 21 Feb 2023
Did this page help you?
PREVIOUS
Tutorial: Order Trigger Bot
NEXT
Trading Bots
Docs powered by
Archbee
TABLE OF CONTENTS
Introduction
Getting Started
Advanced
Docs powered by
Archbee