Solana Agent Integration with Fetch.ai uAgents
This example shows how to integrate Solana wallets within Fetch.ai’s uAgents framework. We’ll walk through the EscrowAgent, PlayerAgent, and ChallengerAgent scripts, detailing how each agent:
- Registers with the Almanac contract (for discoverability)
- Loads Solana private keys from environment variables
- Executes transfers, checks balances, and handles bet-based business logic via Solana Devnet
- Communicates with other agents through uAgents messaging
Prerequisites
- Solana CLI (configured to Devnet)
- Poetry (for dependency management)
- Python 3.8+
- Fetch.ai’s uagents library
- Solders, requests, etc. (handled by
poetry install
) .env
with your Solana private keys (Base64 arrays) for each agent
note
Note: Each agent script runs on a different port—EscrowAgent uses :8000
, PlayerAgent uses :8001
, and ChallengerAgent uses :8002
by default.
High-Level Architecture

- PlayerAgent & ChallengerAgent each place a bet by transferring SOL to the Escrow wallet (managed by the EscrowAgent).
- EscrowAgent collects two bets, checks the BTC price via an external API, and decides a winner. 90% of the total stake is transferred to the winner’s Solana wallet; the loser forfeits.