# Liquidators

<figure><picture><source srcset="https://1690371742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsivfyCjOhJUkKrxqsPg4%2Fuploads%2Fi0GbcLwyzEAgMq8lTEWM%2Fbanner_liquidations.png?alt=media&#x26;token=79a62429-4d19-4ff3-8a03-2c1743421b02" media="(prefers-color-scheme: dark)"><img src="https://1690371742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsivfyCjOhJUkKrxqsPg4%2Fuploads%2FPmevHopB6ZtcZwNXrZua%2Fbanner_liquidation_l.png?alt=media&#x26;token=2c1bf97e-c535-417b-b2c8-0598433478d2" alt=""></picture><figcaption></figcaption></figure>

## What are Liquidators?

Anyone can be a liquidator and [request the AMM to liquidate a given trader](https://d8x.gitbook.io/d8x/perpetual-contracts-guide/liquidations). The AMM then either rejects the request if the trader margin is above the initial margin, or proceeds.

The [liquidator earns a fee](https://d8x.gitbook.io/d8x/perpetual-contracts-guide/fee-structure#liquidation-fees) that is subtracted from the trader margin. The liquidation fee is shared between the protocol and the liquidator.

## How can you liquidate positions?

There are different ways to liquidate traders on D8X:

* The [D8X Futures Node SDK provides functions to liquidate positions](https://d8x.gitbook.io/d8x/node-sdk/modules)
* The [D8X open-source liquidator bots](https://github.com/D8-X/d8x-liquidator) allow to liquidate positions
