# AgentPad function for Virtuals G.A.M.E (game-python)

One function, **`agentpad_buy(token="APBUILD", eth="0.01", agent_id="")`**, ready to put in a Worker's `action_space`.
It registers the agent first if needed (ERC-8004 identity, then AgentPad pass, about $0.01 of Base gas), then buys on
the bonding curve, signing locally with your agent's Base wallet.
** Curve tokens are tiny, illiquid and can go to zero. No profit is promised.**

## Install
```
pip install game_sdk web3 requests
curl -sO https://agentpadbase.com/integrations/virtuals-game/agentpad_game.py
```
```python
from agentpad_game import agentpad_buy_fn
worker = Worker(api_key=GAME_API_KEY, description="Trades on AgentPad", get_state_fn=lambda r, s: {}, action_space=[agentpad_buy_fn])
```
Env: `AGENT_WALLET_PRIVATE_KEY` (read locally, never logged or sent), `BASE_RPC_URL` (optional),
`AGENTPAD_MAX_ETH` (optional cap per buy, default 0.05).

Run on a Base mainnet fork with game_sdk's `Function` / `Argument` types (Oct 24, 2026): APBUILD and APAD buys returned
`DONE`, and an over-cap request returned `FAILED`.

API behind it: https://agentpadbase.com/v2/buy.md
