๐Ÿ”ง Plugin Tools (5)
For AI Agents

Plugin Tools

Every VAEA plugin (Agent Kit, GOAT, MCP) exposes 5 core tools. Here's what each one does, with examples.

vaea_check_capacity ๐Ÿ‘๏ธ Read-only

Discover available flash loan liquidity. Returns all tokens or filter by symbol. Always call this first to know what's available.

Agent prompt: "What tokens can I flash borrow?" ยท "How much SOL is available?" ยท "Show me flash loan liquidity"

typescript
// Agent Kit
const result = await agent.methods.vaea_check_capacity({ token: "SOL" });
// โ†’ { total_tokens: 67, tokens: [{ symbol: "SOL", max_amount: 245000, ... }] }

// GOAT โ€” called automatically by the LLM, no code needed

vaea_get_quote ๐Ÿ‘๏ธ Read-only

Get the exact fee breakdown before borrowing. Shows protocol fee + VAEA fee + total cost.

Agent prompt: "How much would it cost to borrow 1000 SOL?" ยท "What's the fee for a 5000 USDC flash loan?"

typescript
const quote = await agent.methods.vaea_get_quote({ token: "SOL", amount: 1000 });
// โ†’ { source: "kamino", protocol_fee_bps: 0.1, vaea_fee_bps: 2,
//     total_fee_sol: 0.03, total_fee_usd: 4.50 }

vaea_find_best_route ๐Ÿ‘๏ธ Read-only

Compare all protocols and find the cheapest source. Returns ranked candidates.

Agent prompt: "Find the cheapest flash loan for 5000 USDC" ยท "Compare routes for 100 SOL"

typescript
const route = await agent.methods.vaea_find_best_route({ token: "USDC", amount: 5000 });
// โ†’ { best_route: { protocol: "marginfi", cost_bps: 2.0 },
//     candidates: [
//       { protocol: "marginfi", cost_bps: 2.0 },
//       { protocol: "kamino",   cost_bps: 2.1 },
//       { protocol: "juplend",  cost_bps: 2.0 }
//     ] }

vaea_check_profitability ๐Ÿ‘๏ธ Read-only

Verify a strategy is profitable after all costs โ€” VAEA fee, network fee, Jito tip. The agent should call this before building a TX.

Agent prompt: "Is this arb profitable?" ยท "Check if borrowing 1000 SOL for 0.5 SOL revenue makes sense"

typescript
const profit = await agent.methods.vaea_check_profitability({
  token: "SOL", amount: 1000,
  expected_revenue_sol: 0.5, jito_tip_sol: 0.001
});
// โ†’ { verdict: "โœ… PROFITABLE", net_profit_sol: 0.12,
//     costs: { vaea_fee: 0.03, network_fee: 0.00025, jito_tip: 0.001 } }

vaea_build_flash_loan ๐Ÿ”ง Build

Build the atomic flash loan transaction. Returns prefix and suffix instructions that wrap the agent's custom logic. The agent inserts its swap/arb/liquidation instructions between them.

Agent prompt: "Build a 1000 SOL flash loan for my wallet" ยท "Create a flash loan transaction"

typescript
const tx = await agent.methods.vaea_build_flash_loan({
  token: "SOL", amount: 1000,
  user_pubkey: "7nYvRrpJLDfWZqxfhBFSGQ8n1KFjxJHf2bnvStRcSVEv"
});
// โ†’ { prefix_instructions: [...],  // begin_flash
//     suffix_instructions: [...],  // end_flash + fee transfer
//     lookup_tables: [...]         // for VersionedTransaction }
โš ๏ธ Warning
This is the only tool that creates a transaction. The agent must not sign or send โ€” it returns the unsigned TX for the user to review and sign separately.

Summary

ToolTypeInputOutput
vaea_check_capacity๐Ÿ‘๏ธtoken? (optional)Available liquidity per token
vaea_get_quote๐Ÿ‘๏ธtoken, amountFee breakdown
vaea_find_best_route๐Ÿ‘๏ธtoken, amountRanked protocol routes
vaea_check_profitability๐Ÿ‘๏ธtoken, amount, revenue, tipProfit/loss verdict
vaea_build_flash_loan๐Ÿ”งtoken, amount, pubkeyUnsigned TX instructions
โš ๏ธ Devnet Only
Mainnet โ€” April 2026
๐Ÿ”