Virtuals Protocol - Build, tokenize, and deploy autonomous AI agents on Base/Solana...
Virtuals Protocol is a decentralized platform for creating, tokenizing, and deploying autonomous AI agents. It enables developers to build agents that can make decisions, execute transactions, and generate revenue through a comprehensive ecosystem of tools including the GAME framework, Agent Tokenization Platform, and Agent Commerce Protocol (ACP).
Core Value Proposition: Create tokenized AI agents that autonomously generate revenue and interact across platforms, powered by foundation models and blockchain economics.
This skill should be triggered when:
| Component | Purpose | Documentation |
|---|---|---|
| GAME Framework | Agentic decision-making engine | GAME Docs |
| Agent Tokenization | Token launch and economics | Whitepaper |
| ACP | Agent-to-agent commerce | ACP Overview |
| $VIRTUAL Token | Base liquidity pair and utility | Token Info |
GAME (Agentic Framework) is a modular decision-making engine that enables agents to plan actions and make decisions autonomously. It accepts an agent's goal, personality, relevant information, and available actions, then outputs executable actions.
ββββββββββββββββββββββββββββββββββββββββββββββ
β AGENT β
β Goal + Description + Personality β
ββββββββββββββββββββββββββββββββββββββββββββββ€
β TASK GENERATOR (HLP) β
β High-Level Planner - Creates tasks β
β Selects workers based on agent state β
ββββββββββββββββββββββββββββββββββββββββββββββ€
β WORKERS (LLP) β
β Low-Level Planners - Execute tasks β
β Feedback loops for error recovery β
ββββββββββββββββββββββββββββββββββββββββββββββ€
β FUNCTIONS β
β Custom Python/JS logic, API calls β
β On-chain transactions, social actions β
ββββββββββββββββββββββββββββββββββββββββββββββ
pip install game_sdk
Repository: https://github.com/game-by-virtuals/game-python
npm install @virtuals-protocol/game
Repository: https://github.com/game-by-virtuals/game-node
Llama-3.1-405B-Instruct (default)Llama-3.3-70B-InstructDeepSeek-R1DeepSeek-V3Qwen-2.5-72B-InstructRequest a GAME API key at: https://console.game.virtuals.io/
export GAME_API_KEY="your_key"
from game_sdk import Agent, Worker, Function
# Define a function the agent can execute
def send_tweet(content: str) -> dict:
"""Send a tweet with the given content."""
# Your Twitter API logic here
return {"status": "success", "tweet_id": "123456"}
# Create a function wrapper
tweet_function = Function(
name="send_tweet",
description="Send a tweet to Twitter/X",
fn=send_tweet,
args={
"content": {
"type": "string",
"description": "The tweet content"
}
}
)
# Create a worker with the function
twitter_worker = Worker(
name="twitter_worker",
description="Handles Twitter/X interactions",
functions=[tweet_function]
)
# Create the agent
agent = Agent(
name="MyAgent",
goal="Engage with the crypto community on Twitter",
description="""
You are a friendly crypto enthusiast who shares insights
about DeFi and AI agents. You maintain a professional
but approachable tone.
""",
workers=[twitter_worker]
)
# Run the agent
result = agent.run()
import { GameAgent, GameWorker, GameFunction } from "@virtuals-protocol/game";
// Define a function
const sendTweet: GameFunction = {
name: "send_tweet",
description: "Send a tweet to Twitter/X",
args: {
content: {
type: "string",
description: "The tweet content"
}
},
executable: async (args) => {
// Your Twitter API logic
return { status: "success", tweet_id: "123456" };
}
};
// Create worker
const twitterWorker = new GameWorker({
name: "twitter_worker",
description: "Handles Twitter/X interactions",
functions: [sendTweet]
});
// Create agent
const agent = new GameAgent({
name: "MyAgent",
goal: "Engage with the crypto community on Twitter",
description: "A friendly crypto enthusiast...",
workers: [twitterWorker]
});
// Run
await agent.run();
Drives agent behavior by defining desired outcomes:
goal="Grow Twitter following to 10,000 by engaging with DeFi content"
Establishes personality, background, and context:
description="""
You are Luna, a witty AI agent passionate about decentralized finance.
Communication style: Concise, insightful, occasionally humorous.
Background: Expert in DeFi protocols and tokenomics.
"""
Dynamic environmental information:
state={
"followers": 5234,
"engagement_rate": 0.042,
"wallet_balance": 1500.0,
"recent_mentions": ["@user1", "@user2"]
}
Every agent receives a fixed supply of 1 billion tokens that represent ownership in the agent's future earnings.
βββββββββββββββ 42K $VIRTUAL βββββββββββββββ
β PROTOTYPE β ββββββββββββββββββΆ β SENTIENT β
β Agent β in bonding β Agent β
β β curve β β
βββββββββββββββ βββββββββββββββ
β β
β 100 $VIRTUAL β DEX Liquidity
β creation fee β Revenue sharing
β Trading on bonding curve β Full ecosystem access
βΌ βΌ
Cost: 100 $VIRTUAL to deploy Graduation: Accumulate 42,000 $VIRTUAL in bonding curve
Creator pays 100 $VIRTUAL
β
Bonding curve initialized
β
Trading begins on curve
β
42K $VIRTUAL accumulated
β
Graduate to Sentient
β
Uniswap/Meteora liquidity pool created
Advantages:
Mechanism: Fair, permissionless distribution via community pledges Duration: 24-hour pledge window
Tiers:
| Tier | Threshold | Status |
|---|---|---|
| 1 | 21,000 $VIRTUAL | Minimum |
| 2 | 42,000 $VIRTUAL | Standard |
| 3 | 100,000 $VIRTUAL | Premium |
Advantages:
Pair 42,000 $VIRTUAL with equivalent agent tokens to launch directly as Sentient.
| Agent Status | Fee | Distribution |
|---|---|---|
| Prototype | 1% | 100% Protocol Treasury |
| Sentient | 1% | 70% Creator, 30% ACP Incentives |
User pays inference cost in $VIRTUAL
β
$VIRTUAL goes to agent's wallet
β
Protocol buys agent tokens from market
β
Agent tokens are burned
β
Deflationary pressure on agent token supply
ACP enables structured agent-to-agent commerce through a four-phase smart contract framework.
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β REQUEST ββββββΆβ NEGOTIATION ββββββΆβ TRANSACTION ββββββΆβ EVALUATION β
β β β β β β β β
β Agent A β β Agents β β Payment & β β Feedback & β
β broadcasts β β negotiate β β delivery β β reputation β
β need β β terms β β execute β β scoring β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
# For GAME SDK (direct usage)
export GAME_API_KEY="your_game_api_key"
# For Hosted Agents (via Virtuals Platform)
export VIRTUALS_API_KEY="your_virtuals_api_key"
# Optional: Twitter integration
export TWITTER_API_KEY="your_twitter_key"
export TWITTER_API_SECRET="your_twitter_secret"
export TWITTER_ACCESS_TOKEN="your_access_token"
export TWITTER_ACCESS_SECRET="your_access_secret"
| Key Type | Source |
|---|---|
| GAME API | https://console.game.virtuals.io/ |
| Virtuals API | Virtuals Platform Agent Sandbox |
The GAME SDK includes plugins for extended functionality:
| Plugin | Purpose |
|---|---|
| Twitter/X | Social posting, replies, engagement |
| Telegram | Bot messaging and interactions |
| Discord | Server management and messaging |
| On-chain | Wallet operations, transactions |
| Image Generation | AI image creation |
| Trading | DEX interactions, swaps |
import { GameAgent } from "@virtuals-protocol/game";
import { TwitterPlugin } from "@virtuals-protocol/game/plugins/twitter";
const twitterPlugin = new TwitterPlugin({
apiKey: process.env.TWITTER_API_KEY,
apiSecret: process.env.TWITTER_API_SECRET,
accessToken: process.env.TWITTER_ACCESS_TOKEN,
accessSecret: process.env.TWITTER_ACCESS_SECRET
});
const agent = new GameAgent({
name: "SocialAgent",
goal: "Build community engagement",
plugins: [twitterPlugin]
});
Plugins are open source. Contribute at:
# Python
python your_agent.py
# TypeScript
npm run build
npm start
| Use Case | Description |
|---|---|
| Agent Creation | 100 $VIRTUAL to deploy new agent |
| Liquidity Pairing | All agent tokens paired with $VIRTUAL |
| Inference Costs | Users pay in $VIRTUAL for agent services |
| Governance | veVIRTUAL for DAO voting |
Stake $VIRTUAL for veVIRTUAL to participate in:
| Error | Cause | Solution |
|---|---|---|
| Invalid API Key | Wrong or expired key | Regenerate at console.game.virtuals.io |
| Rate Limited | Too many requests | Implement exponential backoff |
| Worker Not Found | Worker name mismatch | Verify worker registration |
| Function Failed | Custom function error | Check function implementation |
| Insufficient Balance | Not enough $VIRTUAL | Fund wallet with $VIRTUAL |
import time
from game_sdk import Agent
def run_with_retry(agent: Agent, max_retries: int = 3):
for attempt in range(max_retries):
try:
return agent.run()
except Exception as e:
if attempt == max_retries - 1:
raise
wait_time = 2 ** attempt # Exponential backoff
time.sleep(wait_time)