About Solana AI agent - x402 payments, Swap tokens, manage wallets, transfer funds, and stake SOL - all without human intervention solana ai agent
AI-Agent-Solana-MVP is an early-stage JavaScript project in the AI payments / x402 ecosystem, focused on ai-agent, automated-trading, autonomous-agent, solana-ai-agent. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like solana-ai-agent-mvp, Franklin, mcp-server-bloomfilter, x402-app-template, portable-agent-usb, npm:agentpay-mcp.
Solana AI agent - Swap tokens, manage wallets, transfer funds, and stake SOL — all without human intervention. Which is integrated with x402 payments.
Solana AI Agent gives agents economic agency:
npm install solana-agent-kit
git clone https://github.com/roswelly/solana-ai-agent
cd solana-agent-kit
npm install
npm link
solana-agent wallet create
This creates a new wallet and saves it to ~/.config/solana/id.json (or path specified in SOLANA_WALLET_PATH).
solana-agent wallet balance
solana-agent swap quote SOL USDC 1000000000
solana-agent swap execute SOL USDC 1000000000
The CLI is designed for agents to shell out to. All commands output JSON for easy parsing.
solana-agent wallet create [path]
solana-agent wallet balance
solana-agent wallet tokens
solana-agent wallet address
solana-agent swap quote SOL USDC 1000000000
solana-agent swap execute SOL USDC 1000000000
solana-agent price SOL
solana-agent transfer <recipient> 0.1
solana-agent transfer <recipient> 1000000 --token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
solana-agent stake delegate jito 1.0
solana-agent stake list
solana-agent stake unstake <stake_account_address>
solana-agent stake withdraw <stake_account_address>
solana-agent stake validators
solana-agent tokens
Use the library directly in your Node.js code:
const { Wallet, Swapper, Transfer, Staking } = require('solana-agent-kit');
const wallet = Wallet.fromFile('~/.config/solana/id.json');
const newWallet = Wallet.create();
newWallet.save('./my-wallet.json');
const balance = await wallet.getBalance();
console.log(`Balance: ${balance} SOL`);
const tokens = await wallet.getAllTokenBalances();
const swapper = new Swapper(wallet);
const quote = await swapper.getQuote('SOL', 'USDC', 1000000000);
console.log(`Would receive: ${quote.outAmount} USDC`);
const result = await swapper.swap('SOL', 'USDC', 1000000000);
console.log(`Swapped! TX: ${result.signature}`);
const transfer = new Transfer(wallet);
await transfer.sendSol('recipient...', 0.1);
await transfer.sendToken('recipient...', 1000000, 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
const staking = new Staking(wallet);
await staking.stake('jito', 1.0);
const accounts = await staking.getStakeAccounts();
For agents that can't shell out, use the HTTP server:
solana-agent-server
solana-agent-server 8080
GET /health - Health checkGET /wallet/address - Get wallet addressGET /wallet/balance - Get SOL balanceGET /wallet/tokens - Get all token balancesPOST /swap/quote - Get swap quote
{
"from": "SOL",
"to": "USDC",
"amount": "1000000000",
"slippage": 50
}
POST /swap/execute - Execute swap
{
"from": "SOL",
"to": "USDC",
"amount": "1000000000",
"slippage": 50
}
GET /price?token=SOL - Get token price
POST /transfer/sol - Send SOL
{
"to": "recipient_address",
"amount": 0.1
}
POST /transfer/token - Send SPL token
{
"to": "recipient_address",
"amount": "1000000",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
POST /stake/delegate - Stake SOL
{
"validator": "jito",
"amount": 1.0
}
GET /stake/list - List stake accounts
POST /stake/unstake - Start unstaking
{
"stakeAccount": "stake_account_address"
}
POST /stake/withdraw - Withdraw unstaked SOL
{
"stakeAccount": "stake_account_address"
}
GET /tokens - List known token symbolsGET /validators - List known validatorsBuilt-in token symbols:
SOL - Native SolanaUSDC - USD CoinUSDT - TetherBONK - BonkJUP - JupiterWIF - dogwifhatPYTH - Pyth NetworkYou can also use any token by its mint address.
Pre-configured validators:
jito - Jitomarinade - Marinade Financesolflare - Solflareeverstake - Everstakeconst { AgentDEXClient } = require('solana-agent-kit');
const dex = new AgentDEXClient({
apiKey: 'adx_your_api_key',
});
const quote = await dex.getQuote(
'So11111111111111111111111111111111111111112', // SOL
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
1_000_000_000, // 1 SOL in lamports
50, // 0.5% slippage (basis points)
);
console.log(`Expected output: ${quote.outAmount} USDC`);
const result = await dex.swap(
'So11111111111111111111111111111111111111112',
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
1_000_000_000,
);
console.log(`TX: ${result.signature}`);
const portfolio = await dex.getPortfolio('YourWalletPublicKey...');
console.log(`Total value: $${portfolio.totalUsdValue}`);
for (const token of portfolio.tokens) {
console.log(` ${token.symbol}: ${token.balance} ($${token.usdValue})`);
}
const allPrices = await dex.getPrices();
const [solPrice] = await dex.getPrices(['So11111111111111111111111111111111111111112']);
console.log(`SOL: $${solPrice.priceUsd}`);
const order = await dex.createLimitOrder(
'So11111111111111111111111111111111111111112',
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
1_000_000_000,
180.50, // target price
);
console.log(`Order placed: ${order.id}`);
const orders = await dex.getLimitOrders();
await dex.cancelLimitOrder(order.id);
| Variable | Description | Default |
|---|---|---|
SOLANA_WALLET_PATH |
Path to wallet JSON file | ~/.config/solana/id.json |
SOLANA_RPC_URL |
Solana RPC endpoint | https://api.mainnet-beta.solana.com |
SOLANA_AGENT_PORT |
HTTP server port | 3030 |
AGENTDEX_API_KEY |
AgentDEX API key (adx_xxx) |
- |
AGENTDEX_BASE_URL |
Custom AgentDEX API base URL | https://api.agentdex.com |
.env fileSOLANA_WALLET_PATH=./wallet.json
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_AGENT_PORT=3030
AGENTDEX_API_KEY=adx_your_api_key_here
This toolkit is designed to be agent-friendly:
BALANCE=$(solana-agent wallet balance | jq -r '.balance')
if [ $(echo "$BALANCE > 1" | bc) -eq 1 ]; then
solana-agent swap execute SOL USDC 500000000
fi
import subprocess
import json
def get_balance():
result = subprocess.run(
['solana-agent', 'wallet', 'balance'],
capture_output=True,
text=True
)
data = json.loads(result.stdout)
return data['balance']
def swap_tokens(from_token, to_token, amount):
result = subprocess.run(
['solana-agent', 'swap', 'execute', from_token, to_token, str(amount)],
capture_output=True,
text=True
)
return json.loads(result.stdout)
balance = get_balance()
if balance > 1.0:
result = swap_tokens('SOL', 'USDC', 500000000)
print(f"Swapped! TX: {result['signature']}")
Important Security Notes:
# Create a wallet first
solana-agent wallet create
solana-agent wallet balanceIf you hit rate limits on the public RPC, use a dedicated RPC endpoint:
export SOLANA_RPC_URL=https://your-rpc-endpoint.com
solana-agent-kit/
├── index.js # Main entry point
├── src/
│ ├── cli.js # CLI interface
│ ├── server.js # HTTP server
│ ├── wallet.js # Wallet management
│ ├── swap.js # Token swapping
│ ├── transfer.js # Transfers
│ ├── stake.js # Staking
│ └── integrations/
│ └── agentdex.ts # AgentDEX client
npm test
MIT
Solana AI agent - x402 payments, Swap tokens, manage wallets, transfer funds, and stake SOL - all without human intervention solana ai agent.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
MCP server for Bloomfilter, a domain registration service for AI Agents.
Claude agent for use with the Mangrove Developer API & MCP Server.
Run Claude Code and OpenAI Codex directly from a USB drive without installation, leaving no trace on the host machine.
AgentPay MCP Server — Non-custodial x402 payment layer for AI agents. Multi-chain wallets, spending limits, and machine-to-machine payments.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The first agentic payment network: policy-controlled, gasless, and real money-ready. OmniClaw CLI + Financial Policy Engine let autonomous agents pay and earn safely at machine speed.
Multi-Agent AI Task Orchestrator 2026
Autonomous AI BD Agent for SolCex Exchange: 24/7 Cross-Chain Token Scoring & Payments 2026
HELP WANTED: AI AGENTS. Real bounties, real money, every payout sealed to a public ledger. The notice board for gofrantic.com