How I Found the Undocumented GraphQL Field That Reveals Every Liquidation on GMX
说明与用途
使用GMX未公开的GraphQL字段构建可靠的清算警报机器人,消除重复并准确转换数据。
问题
No documented way to pull liquidation data from GMX’s public subgraph, leading to duplicate alerts and potential inaccuracies.
结果
Implemented a robust liquidation alert system that eliminates duplicate alerts and accurately reports liquidation details, enabling reliable real‑time notifications.
工作流
- 1. Identify subgraph endpoint: https://gmx.squids.live/gmx-synthetics-arbitrum:prod/api/graphql
- 2. Introspect schema for TradeAction fields orderType and liquidationFeeAmount
- 3. Confirm orderType 7 equals Liquidation via empirical filtering and contract enum
- 4. Build query filtering orderType_eq:7, eventName_eq:"OrderExecuted", timestamp_gt:$since
- 5. Add transactionHash dedup set
- 6. Convert sizeDeltaUsd from 1e30 scale to USD
- 7. Map marketAddress to asset symbol via markets(id,indexToken) and GMX REST tokens API
- 8. Deploy Discord bot polling every 30s, filtering by USD threshold, posting embeds with asset, direction, size, and Arbiscan link
- 9. Package as hosted service GMX Liquidation Alerts
证据
Both agreed. That's the confirmation bar I hold myself to before shipping anything that alerts real people about real money.
First working version filtered only on orderType_eq: 7. It alerted the same liquidation twice — same transactionHash, same size, back to back.
- 记录日期: 2026-09-18T21:45:59.674Z