Add Balancer plugin for Base MCP#74
Open
tiago-hansen wants to merge 1 commit into
Open
Conversation
Collaborator
🟡 Heimdall Review Status
|
stephancill
reviewed
Jun 4, 2026
stephancill
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the submission. The frontmatter and structure are spec-conformant and the v3 swap path builds and submits correctly. There is a blocking correctness issue in the build script:
Required
- Revert the
SKILL.mdplugins-table row. Plugins shouldn't add themselves to the registry — maintainers will register them when the program is ready. Limit the PR toplugins/balancer.md. build-swap.mjsomitssender/recipienton the basis that "v3 makes msg.sender the sender/recipient." That is v3-only. The SOR routes through both v2 and v3 depending on liquidity, and v2-routed pairs causebuildCallto throw:Input Validation: Swap input missing parameter sender/recipient for Balancer v2. A significant share of common Base pairs currently route v2 (e.g. WETH->cbETH, USDC->DAI, WETH->BAL), so the headline example fails intermittently. Passsender/recipient(the wallet fromget_wallets) whenever any path hasprotocolVersion: 2.- v2 settles through the V2 Vault, so the Permit2 onchain-allowance batch in
## Submissionis v3-specific. Document the version-dependent submission (v2 uses Vault approval, not Permit2).
New hybrid plugin (skills/base-mcp/plugins/balancer.md): read pools and SOR quotes from the public Balancer GraphQL API, encode swap/liquidity calldata with @balancer/sdk (version-aware for Balancer v2/v3 routing), and submit via send_calls. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
89f614e to
59be9eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a native Base MCP plugin for Balancer, authored against
skills/base-mcp/references/plugin-spec.md.skills/base-mcp/plugins/balancer.md— single file; registry entry left to maintainers.Integration:
hybridThe Balancer GraphQL API (
api-v3.balancer.fi, public / keyless) returns swap paths and pool data — not calldata. Calldata is encoded by the@balancer/sdkTS library (Swap.buildCall()/AddLiquidity.buildCall()), whosequery()simulation needs Node + an RPC URL. That splits cleanly across surfaces:sorGetSwapPaths,poolGetPools) → HTTP, every surface →## Endpoints## CommandsSubmission lands on
send_calls(unsigned EIP-5792 batch).v2 / v3 routing (version-aware)
The SOR routes each pair through Balancer v2 or v3 by liquidity, and the two settle differently — the plugin handles both:
msg.senderis sender/recipient.0xBA1222…BF2C8); a plain ERC20 approval to the Vault, andbuildCallrequiressender/recipient(otherwise it throwsmissing parameter sender/recipient for Balancer v2).The build script detects v2 from the SOR paths, passes
sender/recipientonly when needed, and emitsprotocolVersionso the agent assembles the correct approval batch.Frontmatter
integrationhybridchains[base, ethereum, arbitrum, optimism, avalanche](Balancer V3 ∩ Base MCPsend_calls)requires.shelloptionalauthnonerisk[slippage, low-liquidity]Conformance
Self-reviewed against the spec's Authoring Checklist: all required + conditional sections present, canonical heading names and order, shell-less/chat-only behavior stated in
## Surface Routing, and## Submissionnamessend_callswith the exact{ to, value, data }mapping and version-dependent approval batching.Opening as a draft for maintainer review.
🤖 Generated with Claude Code