SOL + SPL Token Support

Solana API
for AI Agents

Solana's 400ms block times and sub-cent transaction fees make it the ideal chain for autonomous AI agents that need to transact frequently. Purple Flea gives your agent a non-custodial Solana wallet, full SPL token support, and direct access to Jupiter swaps — all via a clean REST API. No RPC nodes to run. No KYC required.


400ms
Average finality time
$0.0001
Average transaction fee
65,000+
Transactions per second

Why Solana for AI Agents?

AI agents are fundamentally different from human users: they may need to execute dozens or hundreds of transactions per day, often for tiny amounts. Traditional blockchains like Ethereum charge $1 to $20 per transaction — economically prohibitive for any agent running at scale. Solana eliminates this friction entirely.

With fees averaging $0.0001 per transaction and block times of 400 milliseconds, Solana enables AI agents to perform micro-transactions, stream payments, and react to market events in near real-time. A Solana-powered agent can execute 10,000 transactions for roughly one dollar in fees. For agents that settle frequently or make small recurring payments, no other blockchain comes close.

Beyond speed and cost, Solana hosts a rich DeFi ecosystem. Jupiter aggregates liquidity from Raydium, Orca, Meteora, and dozens of other DEXes to deliver best-price swaps. The SPL token standard supports tens of thousands of tokens, from USDC to the most speculative memecoins. Purple Flea's Solana API gives your agent access to all of this through a single REST endpoint.


Supported Operations

The full Solana feature set, accessible via REST API from any language or framework.

Send SOL

Transfer native SOL to any Solana address. Fees deducted automatically from the transaction. Specify amount in SOL or lamports.

Send SPL Tokens

Transfer any SPL token by mint address. Associated token accounts are created automatically if the recipient doesn't have one.

Check Balances

Query SOL balance and any SPL token balance in a single call. Returns both raw lamports and human-readable amounts.

Jupiter Swaps

Swap any Solana token pair at the best available rate. Jupiter aggregates Raydium, Orca, Meteora, Phoenix, and more.

NFT Support

Query NFT holdings, transfer NFTs, and interact with Metaplex metadata. Your agent can hold and transfer Solana NFTs programmatically.

Transaction History

Retrieve confirmed transaction signatures and detailed transaction data for audit trails and agent accounting.


Derivation Path & Wallet Security

Solana wallets use the Ed25519 elliptic curve, which is different from the secp256k1 curve used by Ethereum and Bitcoin. The BIP-44 derivation path for Solana is m/44'/501'/0'/0', using coin type 501 as registered in the SLIP-0044 standard. This is the same path used by Phantom, Solflare, and Ledger.

Note that Solana's derivation uses hardened keys at every level (indicated by the apostrophes). This means you cannot derive child public keys without the private key — which is intentional and consistent with how all major Solana wallets work.

Your agent's Solana address is a 32-byte Ed25519 public key encoded in Base58. It is fully deterministic and recoverable from your BIP-39 mnemonic at any time using any standard Solana wallet. No vendor lock-in, no proprietary formats.

derivation.txt
# Solana BIP-44 derivation path m/44'/501'/0'/0' # Coin type 501 = Solana (SLIP-0044) # Ed25519 curve (not secp256k1) # Same path used by Phantom, Solflare, Ledger # All levels are hardened (indicated by ') # Derives to a Base58-encoded public key: # 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU

Solana Endpoints

All endpoints use the same authentication and base URL as the rest of the Purple Flea API.

GET /wallet/balance — Check SOL Balance

GET /wallet/balance?chain=sol
# Request GET https://api.purpleflea.com/wallet/balance?chain=sol X-API-Key: pf_sk_... # Response { "chain": "sol", "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "balance": "12.482", "balance_lamports": "12482000000", "usd_value": "2371.58" }

GET /wallet/balance — SPL Token Balance

GET /wallet/balance?chain=sol&token=USDC
GET https://api.purpleflea.com/wallet/balance ?chain=sol &token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v # Response { "chain": "sol", "token": "USDC", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "balance": "4500.00", "decimals": 6 }

POST /wallet/send — Send SOL

POST /wallet/send
{ "chain": "sol", "to": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "amount": "1.5", "asset": "SOL" } # Response — confirmed in ~400ms { "signature": "5xKT...abc", "status": "confirmed", "fee_lamports": 5000, "fee_sol": "0.000005" }

POST /wallet/swap — Jupiter Swap (SOL to USDC)

POST /wallet/swap
{ "chain": "sol", "from_asset": "SOL", "to_asset": "USDC", "amount": "2.0", "slippage_bps": 30, "dex": "jupiter" } # Response { "signature": "3yLM...xyz", "from_amount": "2.0 SOL", "to_amount": "380.14 USDC", "route": "SOL → USDC via Orca (60%) + Raydium (40%)", "price_impact_pct": "0.02" }

Best-Rate Swaps with Jupiter

Jupiter is the leading swap aggregator on Solana, routing trades across every major DEX to find the best effective rate. When your agent calls POST /wallet/swap with dex: "jupiter", Purple Flea queries Jupiter's routing engine in real time and executes the optimal swap path.

Jupiter supports split routing — it can split a single trade across multiple pools simultaneously to reduce price impact. For example, a large SOL-to-USDC swap might be routed 60% through Orca's concentrated liquidity pool and 40% through Raydium's AMM, achieving a better effective rate than either pool alone.

Slippage protection is built in. Set slippage_bps to the maximum acceptable slippage in basis points (e.g., 50 = 0.5%). The transaction will fail if the actual price moves beyond this threshold, protecting your agent from sandwich attacks.

DEXes aggregated by Jupiter

Raydium AMM + CLMM
Orca Whirlpools
Meteora Dynamic AMM
Phoenix Central limit order book
+ 30 more All aggregated

SPL Token Support

Any SPL token by mint address. Built-in name lookup for the most common tokens.

USDC USDT BONK JUP PYTH WIF POPCAT RAY ORCA MNGO mSOL stSOL Any token by mint

Pass any SPL token mint address to send or check the balance of any token on Solana mainnet. Purple Flea handles associated token account (ATA) creation automatically — if the recipient does not yet have an ATA for the token being sent, one will be created as part of the transaction. The small SOL rent cost (~0.002 SOL) is charged to your agent's wallet.


Python Agent Example

An agent that monitors SOL price and automatically swaps to USDC if it drops below a threshold.

sol_price_guard.py
import requests import time import os API_KEY = os.environ["PURPLEFLEA_API_KEY"] BASE_URL = "https://api.purpleflea.com" HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"} PRICE_FLOOR = 150.0 # Swap to USDC if SOL drops below $150 GAS_RESERVE = 0.1 # Keep 0.1 SOL for transaction fees def get_sol_price() -> float: """Fetch current SOL price from CoinGecko.""" r = requests.get( "https://api.coingecko.com/api/v3/simple/price", params={"ids": "solana", "vs_currencies": "usd"} ) return r.json()["solana"]["usd"] def get_sol_balance() -> float: r = requests.get( f"{BASE_URL}/wallet/balance", params={"chain": "sol"}, headers=HEADERS ) return float(r.json()["balance"]) def swap_sol_to_usdc(amount: float): r = requests.post( f"{BASE_URL}/wallet/swap", json={ "chain": "sol", "from_asset": "SOL", "to_asset": "USDC", "amount": str(amount), "slippage_bps": 50, "dex": "jupiter", }, headers=HEADERS ) return r.json() def run_price_guard(): """Monitor SOL price every 60s. Swap to USDC on dip below floor.""" print(f"Price guard started. Floor: ${PRICE_FLOOR}") while True: price = get_sol_price() balance = get_sol_balance() print(f"SOL price: ${price:.2f} | Balance: {balance:.3f} SOL") if price < PRICE_FLOOR and balance > GAS_RESERVE: swap_amount = balance - GAS_RESERVE print(f"Price below floor! Swapping {swap_amount:.3f} SOL to USDC...") result = swap_sol_to_usdc(swap_amount) print(f"Swapped: received {result.get('to_amount', 'N/A')}") print(f"Signature: {result.get('signature', 'N/A')}") break # Exit after swap; re-start with new parameters time.sleep(60) if __name__ == "__main__": run_price_guard()

Explore more APIs.

Give your agent
a Solana-speed wallet.

400ms finality. $0.0001 fees. Full Jupiter swap access. No KYC.