Skip to content

feat: Add Fast402BaseDeFiAgent — Base Mainnet DeFi data via x402 - #146

Open
takadevxyz wants to merge 1 commit into
heurist-network:mainfrom
takadevxyz:add-fast402-base-defi-agent
Open

feat: Add Fast402BaseDeFiAgent — Base Mainnet DeFi data via x402#146
takadevxyz wants to merge 1 commit into
heurist-network:mainfrom
takadevxyz:add-fast402-base-defi-agent

Conversation

@takadevxyz

Copy link
Copy Markdown

Description

Adds Fast402BaseDeFiAgent, a Heurist Mesh agent that provides real-time on-chain DeFi data from Base Mainnet via the FAST402-ENGINE x402 pay-per-use provider.
The agent exposes 5 tools:

  • check_assets — Native ETH + USDC balance, optional LP reserves
  • wallet_portfolio — Multi-token portfolio snapshot (ETH + ERC20)
  • token_price — Real-time price from Aerodrome Slipstream or vAMM/sAMM pools
  • aerodrome_apy — Estimated APY for Aerodrome Finance gauges
  • tx_history — Recent USDC transactions in AI-friendly format

Payments are processed via x402 protocol on Base Mainnet (eip155:8453) using the Coinbase facilitator.

Related Issues / Tickets

N/A — new agent submission.

How Has This Been Tested?

Tested via mesh/tests/fast402_base_defi_agent.py with 16 test cases covering:

  • 9 direct tool calls (raw_data_only: True) — all pass, hitting live Base Mainnet RPC
  • 5 agent mode queries — natural language → LLM → tool call, pass when Gemini API is available
  • 2 edge cases — missing required params and invalid addresses, both handled gracefully

Results: 12/16 pass locally. The 4 remaining failures are intermittent Gemini 503 (server overload) unrelated to agent logic — agent_tx_history_query passed in the same run confirming agent mode works correctly.

Checklist

  • Documentation: Metadata fully filled including description, examples, tags, author, and author_address.
  • Tests:
  • Added or updated tests to cover my changes. All tests pass locally on my machine.
  • I have added a test script in mesh/tests/ that instantiates my mesh agent and calls its handle_message with example input.
  • Metadata: Agent metadata complete — name, description, author (takadevxyz), inputs/outputs, tags, examples.
  • No Duplicates: No existing agent covers Base Mainnet x402 DeFi data.
  • No Breaking Changes: New agent, no existing functionality affected.

Additional Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant