Let Your AI
Play For You
StackMon's autonomous agent connects to the Unity WebGL game via long-polling, executes gameplay skills, and signs Solana transactions through MPP micro-payments and MagicBlock private ephemeral rollups — running 24/7 without human intervention.
Architecture
How the Agent Works
A reactive loop that listens, decides, pays, and plays — replacing fixed delays with intelligent long-polling.
Long-Poll for Game State
The agent connects to the backend API and long-polls for game state changes. No fixed timers — it reacts instantly when the Unity game signals a match is finished or a new round begins.
Execute Predefined Skills
When game state indicates an action is needed, the agent selects from predefined gameplay skills (defined in /api/skills). Each skill maps to a specific game action — entering matches, placing blocks, or collecting rewards.
Sign & Broadcast Transactions
The agent uses its Solana wallet to sign transactions through both the MPP SDK for micro-payments and MagicBlock for private ephemeral rollups — handling rewards, transfers, and match entries autonomously.
Loop & Repeat
After the action completes, the agent immediately resumes long-polling for the next state change. This creates a continuous, efficient loop — no wasted cycles, no missed matches.
Agent Payments
Dual-Layer
Transactions
The agent handles payments through two channels: Solana MPP for HTTP 402 micro-payment flows, and MagicBlock private ephemeral rollups for reward transfers and match settlements.
if (res.status === 402) {
// MPP micro-payment flow
const tx = await mpp.createPayment(res);
await wallet.signAndSend(tx);
}
// MagicBlock private rollup
await magicblock.submitAction({
type: "reward_transfer",
player: session.publicKey
});
Stack
Built With Modern Tools
Unity WebGL
Game runs in-browser via a WebGL build. No downloads.
@solana/mpp
Solana MPP SDK for 402 Payment Required micro-transaction flows.
MagicBlock
Private ephemeral rollups for reward transfers, match settlements, and on-chain game actions.
Solana Wallets
Phantom, Solflare & more via @solana/wallet-adapter-react.
Redis Sessions
Persistent state via Redis Cloud between backend, agent & Unity.
Next.js 15+
App Router with API routes for agent, game, skills & sessions.
Deploy Your Agent
Configure your agent wallet, set your skills, and let it compete autonomously. No babysitting required.
