埋在GMX订单薄中的“不定时炸弹”:Keeper机制是否会引发内部作恶?

吴说区块链Published on 2022-12-01Last updated on 2022-12-01

Abstract

9 月 18 日,GMX 遭遇了价格操纵攻击,攻击者利用 GMX 的最小价差和 0 滑点的特性对 AVAX/USD 进行价格操纵,赚取了 56.5 万美元的 AVAX。

引言

9 月 18 日,GMX 遭遇了价格操纵攻击,攻击者利用 GMX 的最小价差和 0 滑点的特性对 AVAX/USD 进行价格操纵,赚取了 56.5 万美元的 AVAX。关于其中细节可以参考《如何利用 GMX 的交易机制进行价格操纵?外部攻击与内部作恶的方法分析》,此次攻击是“合理但恶意”地利用了 GMX 的交易机制,属于外部攻击。文章提到,除了外部攻击外,GMX 还存在潜在的内部攻击风险。

链茶馆文章:

https://mp.weixin.qq.com/s/kIcQ56uQM38KQ2_vW22d2A

关于 Keeper 机制所带来的作恶隐患,详细分析如下:

https://im0xalpha.notion.site/GMX-A-Can-Be-Evil-AMM-bf22717230864f458e94fc5482e304ff

GMX 依赖于一个集中的喂价机制,即“Keeper”,它完全由团队控制。

Keeper 决定了所有的交易价格,因此可以随心所欲地使任何一方(交易者和 LP)受损或受益。

有了 Keeper 的绝对权力,GMX 很容易作恶,甚至比任何中心化的交易所更容易。

# 细节中的魔鬼:GMX 的 Keeper

最近 GMX 遭遇的价格操纵攻击使我们注意到了 GMX 的 Keeper 机制。事实上,外部操纵的攻击并不是最大的问题,因为外部操纵是一个可预防的问题。但 Keeper 所带来的的内部操纵隐患是没有办法避免的(甚至没有办法发现它)。

在 GMX 上交易存在两个步骤:

1. 下单。在这一步中,除了常规的交易费用外,你还需要支付额外的 ETH/AVAX(称为执行费),以便 Keeper 执行你的交易。

2. Keeper 以所谓的预言机价格执行你的订单,该价格完全由 Keeper 决定。

这个细节中存在魔鬼:此 Keeper 不属于任何链上或透明机制。相反,它是一个由 GMX 拥有的地址签署的程序,并在 GMX 自己的集中式服务器上运行。而 Keeper 的核心作用不仅仅是执行订单,也是决定交易价格。在非常弱的约束条件下,Keeper 可以直接用它选择的任何价格执行你的交易。而正是这个弱约束也只会让交易员的价格变得更糟(https://www.notion.so/47fc5ed832e243afb9e97e8a4a036353,与 ChainLink 价格的偏差大于 2.5% 将触发买卖价差)。

# 如何作恶?

非常简单!

由于每笔交易的交易价格完全由 Keeper 决定,运行 Keeper 的人可以做任何他们想做的事情。例如,按其意愿提供有利于或不利于交易者的价格,通过为交易提供不好的价格(长线交易的价格较高,短线交易的价格较低),从每笔交易中获利是非常方便的。

而这可以以一种非常秘密的方式进行:Keeper 只需要使价格比公平价值稍差(例如高出或低于 0.1%),这样就很难注意到。那么大量的利润(0.1% 的交易量)就会从交易中被偷走。

你可能认为这种偷窃对 LP 有利。在这种特殊情况下,确实如此。但有了这样的绝对权力,从 LP 那里偷窃也同样容易。Keeper 只需要用优于公平的价格(多头交易的价格较低,或空头交易的价格较高)喂养其附属账户,就可以将利润转移到这个账户。这一点非常容易理解:如果攻击中的外部操纵者(https://www.binance.com/en/news/top/7204043)可以通过操纵价格来源使他们的账户受益,那么 Keeper 通过直接操纵价格使特定账户受益只会更直接。唯一的区别是,前者是以中心化交易所(即 Binance)的价格为成本的,而后者则是零成本。而且,这也可以通过保持足够小的偏差来避开外界关注,同时又能非常隐蔽地获利。

这种交易机制是如此不透明,以至于比任何基于订单簿的中心化交易所更容易作恶。对于后者,你通过查看订单簿上的报价,提前对你的交易价格有一个合理清晰的预期。如果报价不公平,你可以选择不交易。相比之下,在 GMX 上,交易完全掌握在 Keeper 手中。

# 他们是否已经作恶?

从技术上讲,答案是我们不知道,因为这没有办法从外部验证。

然而,当你问出这个问题,你可能已经忽略了重点。从“不作恶”转换为“不能作恶”是加密世界的基本价值之一,也是重大的进步。一个依靠权力所有者的善意而运作的系统不应该属于这个世界。

无论一个“能作恶”的项目如何声称他们不会作恶,都不应该给予信任。这不是 Web3 的工作方式!

# 作恶成本有多大

分析师 @NintendoDoomed 对 GMX 的作恶成本进行了分析。

通过操纵价格发动攻击的可能性是存在的,在其他协议上也发生过,但是攻击成本比大多数人想的要高。GMX 有千分之一的交易费用,一笔交易开平仓就有千分之二的费用,因此在操纵预言机价格时,对价格的影响必须要大于千分之二才有意义。

对于 BTC 而言就是 $30+ 的价差,并不是一个小的数字。GMX 的预言机聚合了数个头部中心化交易所的价格,基本需要操纵整个市场的定价才能攻击GMX。对于 Avax 之类流动性较差的小币种可能是划算的,但是对于 BTC/ETH 则未必。此前有消息称有人操纵 AVAX 价格,这主要是因为 AVAX 流动性相对较差,操纵成本较低。因此,通过操作价格对 GMX 发动攻击目前只适用于流动性较差的 Token,但对于主流币暂时不会构成威胁。

此外,GMX 对于仓位规模有上限设置,开平仓都存在时间差,这进一步提升了攻击成本。这个上限是会低于 LP 存入对应 Token 的规模, 比如 LP 存入 ETH 有 $80M,那么 ETH Long Position 可能就会设置成 $50M,因此可以全额兑付。

https://twitter.com/NintendoDoomed/status/1597223938563919872

https://foresightnews.pro/article/detail/16360

Trending Cryptos

Related Reads

Bitwise Chief Investment Officer: Revenue Reigns Supreme, The Valuation Logic for Crypto is Being Rewritten

The valuation logic of crypto assets is shifting from speculative models to a focus on real revenue and earnings, according to Bitwise CIO Matt Hougan. For years, a key criticism was that crypto tokens lacked fundamental value as they didn't generate cash flows for holders, partly due to a restrictive regulatory environment. This changed following the 2023 Ripple lawsuit and subsequent regulatory shifts, allowing projects to direct protocol revenues to token holders. Hyperliquid pioneered this model, using ~99% of its fee revenue to buy back and burn its HYPE token, creating a direct link between network activity and token value. Its success has inspired widespread adoption. Uniswap now uses all fee revenue to burn UNI, Aave has implemented automated buybacks, and new platforms like shturl.c and Lighter have built revenue-sharing mechanisms from inception. Even layer-1 blockchains like Solana and Aptos are adjusting fee models to benefit token holders. Hougan draws a parallel to early internet companies that eventually monetized their user bases. He argues that top crypto platforms possess significant pricing power and that the market undervalues them because many investors, both inside and outside crypto, have not yet recognized this fundamental shift. While tokens carry different risks than equities (e.g., governance-based revenue rights), the growing alignment of revenue with token value could lead to a significant re-rating of crypto asset valuations in the coming 12-24 months.

marsbit6m ago

Bitwise Chief Investment Officer: Revenue Reigns Supreme, The Valuation Logic for Crypto is Being Rewritten

marsbit6m ago

Shanghai Automotive Chip 'Little Giant' to IPO, Aiming to Raise 3.489 Billion Yuan

"Shanghai-based auto chip 'Little Giant' Gatsland Aims for IPO, Seeking to Raise 3.489 Billion CNY" Gatsland Microelectronics, a Shanghai-based automotive-grade millimeter-wave radar and ultra-wideband (UWB) chip company recognized as a national-level "Little Giant" specializing in core technologies, has filed for an IPO on Shanghai's STAR Market. Founded in 2014, the company is a key player in China's automotive semiconductor sector. It achieved a milestone in 2017 by mass-producing the world's first automotive-grade 77GHz mmWave radar RF front-end single-chip using CMOS process technology, breaking the industry's reliance on GaAs and SiGe multi-chip solutions. Gatsland claims to be the fourth-largest global and second-largest domestic supplier of automotive mmWave radar chips, and a leader in CMOS-based solutions. Financially, Gatsland has shown strong revenue growth, with figures rising from 206 million CNY in 2023 to 632 million CNY in 2025. However, the company remains unprofitable, reporting net losses for the reported periods, including a loss of 193 million CNY in 2025. Despite this, it maintains high gross margins, averaging around 47%, which are notably above industry peers. Over 97% of its recent revenue comes from automotive mmWave radar chips. The company's products, including its Alps and Kunlun platform chips, are used in advanced driver assistance systems (ADAS), autonomous driving, and in-cabin sensing. Its chips have been adopted by major Chinese automakers like BYD, Geely, and NIO, and it has begun supplying European Tier 1 suppliers and international OEMs including Volvo and Rivian. Gatsland's customer base is highly concentrated, with its top five direct clients accounting for over 99% of sales in recent periods. Its supply chain also relies significantly on overseas partners for wafer fabrication, packaging, and EDA tools. Notably, the National Integrated Circuit Industry Investment Fund Phase II ("Big Fund II") is among its shareholders. The management team, including founder and CEO Chen Jiashu, holds strong academic and industry backgrounds from institutions like UC Berkeley and companies such as Texas Instruments. For its IPO, Gatsland plans to raise approximately 3.489 billion CNY to fund R&D and production projects for next-generation mmWave radar and high-precision UWB chips, as well as a new innovation center. The company operates in a highly competitive landscape dominated by international giants like Infineon, NXP, and TI. While it has gained significant market share in China, Gatsland acknowledges it still faces gaps in comprehensive R&D strength and global customer reach compared to these established players.

marsbit7m ago

Shanghai Automotive Chip 'Little Giant' to IPO, Aiming to Raise 3.489 Billion Yuan

marsbit7m ago

Tether Finally Gets Audited by a Big Four Firm, But USDT's Transparency Issues Are Far From Over

Tether announced that KPMG U.S. has completed its first independent audit of Tether International's financial statements as of December 31, 2025, issuing an unqualified opinion—the highest level of assurance. The audit confirms Tether's assets exceeded liabilities by $6.814 billion at that date, with physical verification of gold bars and examination of underlying records. This represents a significant step beyond the quarterly reserve attestations Tether previously received, moving to a full financial statement audit that examines internal controls, transaction sampling, and accounting policies. However, the article highlights several ongoing transparency questions. The full KPMG audit report has not been publicly released, preventing independent verification of details like asset classification or related-party transactions. The audit covers a specific entity, "Tether International, S.A. de C.V.," leaving the scope concerning Tether's complex corporate structure unclear. Furthermore, the $6.8 billion excess reserves confirmed for end-2025 had shrunk to approximately $4.1 billion by Q2 2026. Risks within the reserve composition, particularly concerning secured loans, persist even with an audit. The audit's data is also already 8 months old, while USDT's circulation has grown rapidly. Strategically, the audit is seen as a move to bolster Tether's position amid U.S. regulatory developments like the GENIUS Act, which mandates audits for stablecoin issuers but leaves a path for foreign entities like Tether. While the KPMG opinion is a strong credibility signal, the article concludes that full transparency and regulatory compliance require further steps, starting with the publication of the complete audit report.

marsbit38m ago

Tether Finally Gets Audited by a Big Four Firm, But USDT's Transparency Issues Are Far From Over

marsbit38m ago

After Tokenized U.S. Treasury Bonds, Tokenized Stocks Are Becoming the New Battleground for RWA

**Tokenized Stocks Emerge as the New RWA Battleground** Following the initial surge of tokenized U.S. Treasuries, the tokenized stock market is rapidly expanding in both scale and quality. Unlike the currently stagnating treasury tokenization market, tokenized stock offerings are seeing significant growth and attracting major players from traditional finance, fintech, crypto exchanges, and native Web3 platforms. The U.S. SEC has outlined a framework for tokenized securities, which applies to stocks: **Issuer-Sponsored Tokenized Securities** (direct tokenization by the issuer, inheriting all shareholder rights but with strict compliance, e.g., Securitize); **Custodial Tokenized Securities** (tokenization of custodied interests, e.g., DTCC, Ondo's recent IVV/MU tokens); **Linked Securities** (tokenized debt notes backed by the stock, offering price exposure and greater on-chain utility, e.g., Ondo, xStocks, Robinhood's new Stock Tokens); and **Security-Based Swaps** (tokenized derivatives contracts, e.g., Robinhood's earlier Classic Stock Tokens). Key platforms are pursuing different strategies: * **Securitize** leads with an issuer-sponsored model, ensuring full rights but limiting on-chain interactions via its compliance-enforcing DS Protocol. * **Ondo** and **xStocks** use the linked security structure for broad accessibility on CEXs and DeFi, though this fragments liquidity and excludes U.S. users. * **Robinhood** recently launched linked security-based Stock Tokens, leveraging its user base and new Robinhood Chain. * Traditional infrastructure giants like **DTCC**, the **NYSE**, and **Nasdaq** are actively developing pilots and platforms for tokenized settlement and trading. * **Coinbase** has announced plans for tokenized stocks, likely using a structure that offers on-chain utility while excluding U.S. customers. Despite different approaches, all players are converging on tokenized stocks as the next major catalyst for the RWA sector. The evolving regulatory landscape and market adoption will shape this competitive new battlefield.

marsbit1h ago

After Tokenized U.S. Treasury Bonds, Tokenized Stocks Are Becoming the New Battleground for RWA

marsbit1h ago

Trading

Spot

Hot Articles

What is $BITCOIN

DIGITAL GOLD ($BITCOIN): A Comprehensive Analysis Introduction to DIGITAL GOLD ($BITCOIN) DIGITAL GOLD ($BITCOIN) is a blockchain-based project operating on the Solana network, which aims to combine the characteristics of traditional precious metals with the innovation of decentralized technologies. While it shares a name with Bitcoin, often referred to as “digital gold” due to its perception as a store of value, DIGITAL GOLD is a separate token designed to create a unique ecosystem within the Web3 landscape. Its goal is to position itself as a viable alternative digital asset, although specifics regarding its applications and functionalities are still developing. What is DIGITAL GOLD ($BITCOIN)? DIGITAL GOLD ($BITCOIN) is a cryptocurrency token explicitly designed for use on the Solana blockchain. In contrast to Bitcoin, which provides a widely recognized value storage role, this token appears to focus on broader applications and characteristics. Notable aspects include: Blockchain Infrastructure: The token is built on the Solana blockchain, known for its capacity to handle high-speed and low-cost transactions. Supply Dynamics: DIGITAL GOLD has a maximum supply capped at 100 quadrillion tokens (100P $BITCOIN), although details regarding its circulating supply are currently undisclosed. Utility: While precise functionalities are not explicitly outlined, there are indications that the token could be utilized for various applications, potentially involving decentralized applications (dApps) or asset tokenization strategies. Who is the Creator of DIGITAL GOLD ($BITCOIN)? At present, the identity of the creators and development team behind DIGITAL GOLD ($BITCOIN) remains unknown. This situation is typical among many innovative projects within the blockchain space, particularly those aligning with decentralized finance and meme coin phenomena. While such anonymity may foster a community-driven culture, it intensifies concerns about governance and accountability. Who are the Investors of DIGITAL GOLD ($BITCOIN)? The available information indicates that DIGITAL GOLD ($BITCOIN) does not have any known institutional backers or prominent venture capital investments. The project seems to operate on a peer-to-peer model focused on community support and adoption rather than traditional funding routes. Its activity and liquidity are primarily situated on decentralized exchanges (DEXs), such as PumpSwap, rather than established centralized trading platforms, further highlighting its grassroots approach. How DIGITAL GOLD ($BITCOIN) Works The operational mechanics of DIGITAL GOLD ($BITCOIN) can be elaborated on based on its blockchain design and network attributes: Consensus Mechanism: By leveraging Solana’s unique proof-of-history (PoH) combined with a proof-of-stake (PoS) model, the project ensures efficient transaction validation contributing to the network's high performance. Tokenomics: While specific deflationary mechanisms have not been extensively detailed, the vast maximum token supply implies that it may cater to microtransactions or niche use cases that are still to be defined. Interoperability: There exists the potential for integration with Solana’s broader ecosystem, including various decentralized finance (DeFi) platforms. However, the details regarding specific integrations remain unspecified. Timeline of Key Events Here is a timeline that highlights significant milestones concerning DIGITAL GOLD ($BITCOIN): 2023: The initial deployment of the token occurs on the Solana blockchain, marked by its contract address. 2024: DIGITAL GOLD gains visibility as it becomes available for trading on decentralized exchanges like PumpSwap, allowing users to trade it against SOL. 2025: The project witnesses sporadic trading activity and potential interest in community-led engagements, although no noteworthy partnerships or technical advancements have been documented as of yet. Critical Analysis Strengths Scalability: The underlying Solana infrastructure supports high transaction volumes, which could enhance the utility of $BITCOIN in various transaction scenarios. Accessibility: The potential low trading price per token could attract retail investors, facilitating wider participation due to fractional ownership opportunities. Risks Lack of Transparency: The absence of publicly known backers, developers, or an audit process may yield skepticism regarding the project's sustainability and trustworthiness. Market Volatility: The trading activity is heavily reliant on speculative behavior, which can result in significant price volatility and uncertainty for investors. Conclusion DIGITAL GOLD ($BITCOIN) emerges as an intriguing yet ambiguous project within the rapidly evolving Solana ecosystem. While it attempts to leverage the “digital gold” narrative, its departure from Bitcoin's established role as a store of value underscores the need for a clearer differentiation of its intended utility and governance structure. Future acceptance and adoption will likely depend on addressing the current opacity and defining its operational and economic strategies more explicitly. Note: This report encompasses synthesised information available as of October 2023, and developments may have transpired beyond the research period.

1.8k Total ViewsPublished 2025.05.13Updated 2025.05.13

What is $BITCOIN

Discussions

Welcome to the HTX Community. Here, you can stay informed about the latest platform developments and gain access to professional market insights. Users' opinions on the price of BTC (BTC) are presented below.

活动图片