The Undocumented GraphQL Field That Reveals Every GMX Liquidation

GMX, the perpetuals exchange on Arbitrum, runs an official public subgraph. It’s free, needs no API key, and there’s no documentation that walks through how to actually pull liquidations out of it. Here’s the exact path, including the bug it cost us before we caught it.

The endpoint

https://gmx.squids.live/gmx-synthetics-arbitrum:prod/api/graphql

This is Subsquid infrastructure maintained by the GMX team itself — confirmed against their own SDK source, which points to the same URL. No auth header needed for reads.

There’s no “liquidations” field

The natural first move is to introspect the schema looking for something called liquidations. There isn’t one. GMX V2 doesn’t model liquidations as a first-class entity — they show up as a tradeActions row with a specific orderType.

Two fields on that entity matter: orderType and liquidationFeeAmount.

Confirming orderType 7 = Liquidation

Rather than guess, this is worth checking two independent ways: empirically, by filtering for liquidationFeeAmount_gt: "0" and confirming every row that comes back has orderType: 7; and against source, by checking GMX’s own contracts, which define the enum explicitly (Liquidation is the 8th value, index 7). Both agreed.

The bug: every liquidation fired twice

The first working filter used only orderType_eq: 7. It alerted the same liquidation twice — same transaction hash, same size, back to back.

tradeActions logs both OrderCreated and OrderExecuted as separate rows for the same order, and both can carry orderType: 7. The fix is one additional filter on eventName_eq: "OrderExecuted", plus a transaction-hash dedup set as a safety net in case some other event pattern does the same thing.

sizeDeltaUsd isn’t in dollars

It’s scaled by 1e30 — standard GMX V2 precision for USD amounts. Worth verifying by dividing a handful of known liquidations and checking the results look like real position sizes, not by trusting a number from a blog post.

marketAddress isn’t a symbol

It’s a contract address. Getting “ETH” or “SOL” out of it takes two hops: the subgraph’s markets(id, indexToken) maps the market to its index token address, and GMX’s official REST API at arbitrum-api.gmxinfra.io/tokens maps that token address to a symbol. Both are free, both are official GMX infrastructure, and the map only needs building once at startup.

We packaged this into a hosted Discord alert bot — real-time GMX liquidation alerts, asset, direction, size, and an Arbiscan link, delivered to your server within seconds. → GMX Liquidation Alerts on Whop ($19/mo, 3-day free trial)

Read the full build log

For the code and the exact GraphQL queries used at each step: full technical write-up on Dev.to.