01 / THE SIGNAL

我们发现了什么

通过 Pear Protocol MCP 服务器,赋予 Claude(或任何 AI 智能体)在 Hyperliquid 上进行永续合约配对交易的能力。标题:使用 MCP 构建 Pear Protocol DeFi 交易智能体 URL 来源:https://dev.to/marvelcodes/build-a-pear-protocol-defi-trading-agent-with-mcp-499o 发布时间:2026-07-18T23:35:46Z Markdown 内容:

  • 来源:DEV Community(发现于 2026-07-19)
  • 证据等级:D · 发现产品或需求信号,暂未获得可核验的商业证据。
  • 商业模式:待核验
  • 主题:AI Agent
  • 初筛评分:14.9/100 · 收录 1 次
#工作流自动化#待验证#产品发现
02 / SOURCE & EVIDENCE

证据,比故事更重要。

发现产品或需求信号,暂未获得可核验的商业证据。

规则清洗与初筛,未经人工商业核验。原文语境、实际客户和付费情况仍需自行验证。

引用与数字披露

来源类型(原作者自述/第三方测算/媒体转引)需采集端标注,本版尚未落字段。

短句引用
作者
未标注
抓取日期
来源类型
未标注
数字口径
币种
未标注
口径
未标注
披露主体
未标注
披露日期
未标注

中文辅助译文(全文)

title: "使用 MCP 构建 Pear Protocol DeFi 交易代理" published: true description: "通过 Pear Protocol MCP 服务器,让 Claude(或任何 AI 代理)能够在 Hyperliquid 上进行永续合约的配对交易。读取市场、持仓和组合,并在选择启用后执行交易。" tags: mcp, ai, defi, hyperliquid

如果你想要一个能够真正交易的 AI 代理,而不只是聊聊图表,那么 Model Context Protocol(MCP)就是将模型接入真实交易所的最简洁方式。本文构建一个 Pear Protocol DeFi 交易代理:一个能够浏览配对市场、读取你的持仓和组合,并在(你开启该功能后)开仓和平仓 Hyperliquid 上杠杆配对交易的代理。

我们将使用 mcp-pear,这是一个开源的 MCP 服务器,封装了 Pear Protocol 的 API。 什么是 Pear Protocol?

Pear Protocol 是一个由 Hyperliquid 支持的配对交易平台。你做多一个篮子、做空另一个篮子,构成单一仓位,从两者之间的比率向有利方向变动中获利,无论整体市场方向如何。经典示例:如果你认为 ETH 将跑赢 BTC,就做多 ETH、做空 BTC,而无需押注整个加密市场。

Pear 在 Hyperliquid 上结算,因此每个配对仓位实际上都是在链上执行的一对永续合约腿。 什么是 MCP,以及为什么在这里使用它?

Model Context Protocol 是一个开放标准,允许 LLM 通过统一的接口调用外部工具。你不必手动把 Pear 的 REST API 粘合到你的模型上,只需运行一个 MCP 服务器,让它向模型描述自己的工具,任何 MCP 客户端(Claude Desktop、Cursor、Cline 或你自己的代理)都可以使用这些工具。

mcp-pear 将 Pear 暴露为一组 MCP 工具: · 公共(无需认证):listmarkets、getactivemarkets、getpairratio、gethealth · 已认证读取:getopenpositions、getopenorders、getportfolio、gettradehistory、getaccountsummary · 写入(选择启用):openposition、closeposition、adjustposition、adjustleverage、setriskparameters、cancelorder 步骤 1:运行服务器

无需安装。npx 即可获取:

公共工具零配置即可使用,因此你的代理可以立即浏览市场和配对比率。 步骤 2:接入 Claude Desktop

将以下内容添加到你的 Claude Desktop MCP 配置中:

重启 Claude,然后问:"目前 Pear 上涨幅最大的配对市场有哪些?" 它会调用 getactivemarkets 并根据实时数据作答。 步骤 3:添加你的账户(读取工具)

要读取你的持仓和组合,请铸造一个 Pear API 密钥:

这会打开浏览器,要求你用钱包进行一次签名,并写入 PEARAPIKEY + PEAR_ADDRESS。将它们添加到配置中:

现在 "本周我的组合表现如何?" 就可以工作了。它会使用你的真实盈亏调用 get_portfolio。 步骤 4:让代理进行交易(请谨慎)

交易执行默认关闭。你需要明确选择启用:

设置该标志后,代理就可以调用 open_position。一个配对交易看起来像这样:做多 ETH、做空 BTC、3 倍杠杆、100 美元名义价值。

open_position 还支持 TRIGGER、TWAP 和 LADDER 执行类型,并可附加 stopLoss / takeProfit。Pear 在服务器端对交易进行签名,因此 MCP 服务器从不持有你的私钥。

两个 Hyperliquid 的常见坑值得了解: · 每笔订单最低约 10 美元名义价值。较小的订单会被拒绝。 · 现货与永续余额。桥接到 Hyperliquid 的 USDC 通常会落到你的现货余额中。需要先将其移至永续余额,否则 open_position 会因保证金不足而失败。 综合应用

使用它的代理循环大致如下: · getactivemarkets 查找动量强劲的配对 · getpairratio 检查当前比率和资金费率 · 模型决定方向 · openposition 并附加止损 · 轮询 getopenpositions,然后在论点兑现时 closeposition

一切都是工具调用,因此模型基于实时数据进行推理和操作。无需自定义 API 粘合代码。 安全提示 · 在测试只读行为之前,请保持 PEARTRADEENABLED 关闭。 · 从很小的名义价值开始。 · 写入工具会使用真金白银执行真实交易。像对待任何交易机器人一样约束代理、监控它并设置风险参数。 链接 · 仓库:https://github.com/MarvelNwachukwu/mcp-pear · npm:https://www.npmjs.com/package/@marvelcodes/mcp-pear · Pear Protocol:http://pear.garden/

mcp-pear 是一个独立的开源社区项目,与 Pear Protocol 没有关联。欢迎提交 PR 和 issue。

译文由上游机器翻译生成,可能有误;判断请以英文原文为准。

英文原文(来源本站未改写)

title: "Build a Pear Protocol DeFi trading agent with MCP" published: true description: "Give Claude (or any AI agent) the ability to pair-trade perps on Hyperliquid via the Pear Protocol MCP server. Read markets, positions, and portfolio, and, opt-in, execute trades." tags: mcp, ai, defi, hyperliquid

If you want an AI agent that can actually trade, not just chat about charts, the Model Context Protocol (MCP) is the cleanest way to wire a model to a real exchange. This post builds a Pear Protocol DeFi trading agent: one that can browse pair markets, read your positions and portfolio, and (when you turn it on) open and close leveraged pair trades on Hyperliquid.

We'll use mcp-pear, an open-source MCP server that wraps Pear Protocol's API. What is Pear Protocol?

Pear Protocol is a Hyperliquid-backed platform for pair trading. You go long one basket and short another in a single position, and profit from the ratio between them moving your way, regardless of overall market direction. Classic example: long ETH, short BTC if you think ETH outperforms, without betting on crypto as a whole.

Pear settles on Hyperliquid, so every pair position is really a pair of perp legs executed on-chain. What is MCP, and why use it here?

The Model Context Protocol is an open standard that lets an LLM call external tools through one uniform interface. Instead of gluing Pear's REST API to your model by hand, you run an MCP server that describes its tools to the model, and any MCP client (Claude Desktop, Cursor, Cline, or your own agent) can use them.

mcp-pear exposes Pear as a set of MCP tools: · Public (no auth): listmarkets, getactivemarkets, getpairratio, gethealth · Authenticated read: getopenpositions, getopenorders, getportfolio, gettradehistory, getaccountsummary · Write (opt-in): openposition, closeposition, adjustposition, adjustleverage, setriskparameters, cancelorder Step 1: run the server

No install needed. npx fetches it:

The public tools work with zero config, so your agent can browse markets and pair ratios right away. Step 2: wire it into Claude Desktop

Add this to your Claude Desktop MCP config:

Restart Claude and ask: "What are the top gaining pair markets on Pear right now?" It calls getactivemarkets and answers from live data. Step 3: add your account (read tools)

To read your positions and portfolio, mint a Pear API key:

This opens a browser, asks you to sign once with your wallet, and writes PEARAPIKEY + PEAR_ADDRESS. Add them to the config:

Now "How's my portfolio doing this week?" works. It calls get_portfolio with your real PnL. Step 4: let the agent trade (carefully)

Trade execution is off by default. You opt in on purpose:

With that flag set, the agent can call open_position. A pair trade looks like this: long ETH, short BTC, 3x, $100 notional.

open_position also takes TRIGGER, TWAP, and LADDER execution types, plus attached stopLoss / takeProfit. Pear signs the trade server-side, so the MCP server never holds your private keys.

Two Hyperliquid gotchas worth knowing: · ~$10 minimum notional per order. Smaller orders get rejected. · Spot vs Perps balance. USDC bridged onto Hyperliquid often lands in your Spot balance. Move it to Perps first or open_position fails with insufficient margin. Putting it together

Here's the shape of an agent loop that uses it: · getactivemarkets to find pairs with strong momentum · getpairratio to check the current ratio and funding · Model decides direction · openposition with a stop-loss attached · Poll getopenpositions, then closeposition when the thesis plays out

Everything is a tool call, so the model reasons over live data and acts. No custom API glue. Safety notes · Keep PEARTRADEENABLED off until you've tested read-only behaviour. · Start with tiny notionals. · The write tools execute real trades with real money. Constrain the agent, monitor it, and set risk parameters like you would any trading bot. Links · Repo: https://github.com/MarvelNwachukwu/mcp-pear · npm: https://www.npmjs.com/package/@marvelcodes/mcp-pear · Pear Protocol: http://pear.garden/

mcp-pear is an independent, open-source community project, not affiliated with Pear Protocol. PRs and issues welcome.

出处https://dev.to/marvelcodes/build-a-pear-protocol-defi-trading-agent-with-mcp-499o抓取日期 · 采集源 DEV Community

03 / EVIDENCE GAPS

这条还缺什么证据?

下面每条都由本条已有字段推出(等级、理由、商业模式、来源次数、是否演示), 本站不生成推测性结论;通用验证方法放在方法论页。

  • 可核验的收入或付费证据查官网定价页与付费口径;第三方数据源(如 GetLatka)只作旁证,需标注来源与时点。
  • 商业模式未定确认按席位/按用量/授权还是开源托管版收费;开源项目另查 LICENSE 与是否存在付费版。
  • 只有单一来源找一手站点或其他渠道是否重复出现同一产品;社区热帖数量不等于商业进展。

通用验证清单(谁有这个问题/谁愿意付费/一个人能交付哪一小步)见我们的筛选方法。

04 / SIGNAL HISTORY

发现时间线