ElizaOS plugin for A2A-Swap — the constant-product AMM built for autonomous AI agents on Solana.
A2A-Swap is a lightweight, agent-native decentralized exchange on Solana. Unlike traditional DEXes designed for human UIs, every instruction was designed for programmatic agent workflows:
- No tick ranges — constant-product x·y=k, simple to reason about
- No LP token mints — LP shares tracked on-chain in a
Positionaccount - Dual-approval mode —
approve_and_executerequires both agent + approver signatures, enabling multi-agent authorization workflows - Auto-compound — fees can be automatically reinvested into LP shares
Program ID: 8XJfG4mHqRZjByAd7HxHdEALfB8jVtJVQsdhGEmysTFq (mainnet-beta)
npm install @liqdlad/plugin-a2a-swapimport { createAgent } from '@elizaos/core';
import { a2aSwapPlugin } from '@liqdlad/plugin-a2a-swap';
const agent = createAgent({
plugins: [a2aSwapPlugin],
// ...
});| Variable | Required | Description |
|---|---|---|
AGENT_PRIVATE_KEY |
✅ | Agent wallet secret key as JSON byte array, e.g. [1,2,3,...] |
SOLANA_RPC_URL |
optional | Solana RPC endpoint (default: https://api.mainnet-beta.solana.com) |
Simulate a swap and get fee breakdown without spending funds.
Options: mintIn, mintOut, amountIn (atomic units)
Returns: pool address, direction, protocol fee (0.020%), LP fee, estimated output, effective rate, price impact
Trigger phrases: simulate swap, estimate swap, quote swap, swap preview
Execute an atomic token swap. Fully autonomous — no human approval needed.
Options: mintIn, mintOut, amountIn, optional maxSlippageBps (default: 50)
Trigger phrases: swap tokens, trade tokens, buy token, sell token
Deposit tokens into a pool and receive LP shares.
Options: mintA, mintB, amountA, optional amountB, optional autoCompound ("true"/"false")
Trigger phrases: provide liquidity, add liquidity, become LP
Fetch pool reserves, spot price, LP supply, and fee rate.
Options: mintA, mintB
Trigger phrases: pool info, pool stats, pool price, check pool
Show accrued trading fees across all LP positions for the agent wallet.
Trigger phrases: my fees, check fees, claimable fees, earned fees
| Pool | Address |
|---|---|
| SOL/USDC (30 bps) | BtBL5wpMbmabFimeUmLtjZAAeh4xWWf76NSpefMXb4TC |
Pools are permissionless — any agent can create a new pair.
- Program: Solscan
- TypeScript SDK: @liqdlad/a2a-swap-sdk
- GitHub: liqdlad-rgb/a2a-swap
MIT