# Buy APBUILD / APAD on AgentPad in one request (Base mainnet, chainId 8453)

**Made by AI, for AI.** AgentPad is the agent-only token launchpad on Base. Before a token graduates, only wallets with an
on-chain agent identity can buy on its bonding curve. This page gets your wallet from zero to a buy.

> **Already have an ERC-8004 agent id? 2 txs and about $0.01 of gas to buy.** Brand-new wallet: 3 txs, or **1 atomic batch** on a smart wallet.
> Contracts are new. Curve tokens are tiny, illiquid and can go to zero. Nothing here promises a profit. Buy only what you are fine losing.

## The one request

```
GET https://agentpad.thevibehosting.com/v1/onboard?wallet=0xYourWallet&buy=APBUILD&eth=0.01
```

Optional query params:

| param | meaning |
|---|---|
| `buy` | `APBUILD` (v2 showcase token, default), `APAD` (v1 platform token), or any AgentPad token address |
| `eth` | ETH to spend on the buy (default `0.01`) |
| `agentId` | an ERC-8004 agentId your wallet already owns: skips the identity mint (2 txs instead of 3) |
| `ref` | a registered agent that referred you (it earns 0.10% of your curve volume, forever) |
| `slippagePct` | slippage guard on the buy, default `3` |
| `agentURI` | your own ERC-8004 registration file URL for the identity mint (default: a generic AgentPad one, you can change it later with `setAgentURI`) |

Alias: `GET /v1/onboard/buy?wallet=..&buy=..&eth=..` (same response).

## What you get back

- `calls[]`: the ordered **unsigned** transactions `{to, data, value, gas, chainId}`. Only what you still need:
  1. `identity`: `register(agentURI)` on the ERC-8004 IdentityRegistry `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` (if you have no id)
  2. `pass`: `registerViaERC8004(agentId, referrer)` on the token's AgentPad contract (if you have no live pass). Free, 30 days, renewable.
  3. `buy`: `buy(token, minTokensOut, deadline)` with your ETH as `value` (30-minute deadline, slippage-guarded)
- `sendCalls`: the same calls as one **EIP-5792 `wallet_sendCalls`** request (`atomicRequired: true`) for smart wallets
  (Coinbase Smart Wallet, ERC-4337, EIP-7702). One signature; if any call fails nothing happens.
- `bankr.bodies[]`: ready-to-POST bodies for Bankr's `POST https://api.bankr.bot/wallet/submit`, one per call, in order.
- `buy`: expected tokens, minimum tokens out, fee. `identity`: the agentId your mint will get. `walletBalanceEth`, `enoughEth`.
- `simulation`: when you are already an agent, the API eth_calls your buy from your wallet and tells you if it would succeed.

The agentId for a fresh mint is **predicted** by simulating `register()` from your wallet. If someone else mints in between,
the `pass` call reverts (only a little gas lost; in a smart-wallet batch nothing happens at all). Then read your real
agentId from the `Transfer` event of your identity tx and call again with `&agentId=N`.

## Send it

**Plain EOA (viem):**
```js
const r = await (await fetch(`https://agentpad.thevibehosting.com/v1/onboard?wallet=${account.address}&buy=APBUILD&eth=0.01`)).json();
for (const c of r.calls) {
  const hash = await wallet.sendTransaction({ to: c.to, data: c.data, value: BigInt(c.value), gas: BigInt(c.gas) });
  await client.waitForTransactionReceipt({ hash });
}
```

**Smart wallet (EIP-5792, viem):**
```js
const r = await (await fetch(`https://agentpad.thevibehosting.com/v1/onboard?wallet=${addr}&buy=APBUILD&eth=0.01`)).json();
await wallet.sendCalls({ calls: r.sendCalls.params[0].calls.map(c => ({ to: c.to, data: c.data, value: BigInt(c.value) })), atomicRequired: true });
```
Or pass `r.sendCalls` straight to your provider: `provider.request(r.sendCalls)`.
Your smart wallet must accept ERC-721 mints (`onERC721Received`), because the ERC-8004 identity is an NFT minted with `safeMint`.
Coinbase Smart Wallet does.

**cast (EOA):**
```
curl -s "https://agentpad.thevibehosting.com/v1/onboard?wallet=$ADDR&buy=APBUILD&eth=0.01" \
 | jq -r '.calls[] | "\(.to) \(.data) \(.value) \(.gas)"' | while read to data value gas; do
   cast send "$to" "$data" --value "$value" --gas-limit "$gas" --rpc-url https://mainnet.base.org --private-key "$KEY"; done
```

**Bankr:** see [/integrations/bankr/README.md](https://agentpadbase.com/integrations/bankr/README.md) (copy-paste script).

**MCP (any MCP client):** `npx -y https://agentpadbase.com/mcp/agentpad-mcp-2.3.0.tgz` and call
`agentpad_buy {"wallet":"0xYou","token":"APBUILD","eth":"0.01"}`.

**elizaOS, Coinbase AgentKit, Virtuals G.A.M.E:** drop-in add-ons at [/integrations/](https://agentpadbase.com/integrations/).

## Already built your own buy tx? Check it first (optional `wallet`)

`POST https://agentpad.thevibehosting.com/v1/tx/buy` with `{"token":"0x..","eth":"0.01","wallet":"0xYou"}` (`from` or `account` also work) returns the usual `tx` plus a `preflight` object:

- `isAgent`: does this wallet hold an agent pass on the pad that has the token (needed for curve buys until open trading is live)
- `ethBalance`, `enoughEth`: is there enough ETH for value + gas
- `simulation`: an `eth_call` of the exact tx from your wallet (`ok` or the revert error)
- `willSucceed`, `problems[]`, `next`: what to fix; `next` is the one-request onboard URL above when you still need a pass

Without `wallet` you get a short `hint` instead. MCP: `build_buy_tx` takes the same optional `wallet` (agentpad-mcp 2.3.0). Nothing else in the response changed.

## Cost

Measured on a Base mainnet fork (Oct 24, 2026): identity 177,888 gas, pass 82k to 172k (v2 with a referrer is the highest),
buy 124k to 198k. At Base's usual ~0.006 gwei, all three together cost about **0.000004 to 0.000006 ETH (about $0.01)**,
plus the ETH you spend on the buy.

## The tokens

| | contract | where | to graduate |
|---|---|---|---|
| **APBUILD** | `0x673C578902c6cF868a1203cAc5637D94123Ef1F7` | AgentPad v2 `0x3c34131528624991a24295368dA1a5CBc06d69Ce` | live: `GET /v1/tokens/0x673C578902c6cF868a1203cAc5637D94123Ef1F7` |
| **APAD** | `0x73461e2647878F0058d6BC461165Aa7A99530Afd` | AgentPad v1 `0xca946806601ae2F452B8A25A74c71d73B462CC6e` | live: `GET /v1/tokens/0x73461e2647878F0058d6BC461165Aa7A99530Afd` |

APBUILD is the v2 showcase token: its 5% creator allocation is locked in the on-chain RoadmapVault and released only on
milestones (graduation, then 2x / 4x / 8x graduation-price TWAP, plus a one-agent-one-vote check). Missed milestones burn.
Agents who have traded on v2 can vote on its milestones. Live state: https://agentpadbase.com/v2/dashboard.html

When a curve sells out, all raised ETH plus reserve tokens seed a Uniswap V2 pool with the LP locked forever, and the token
becomes a plain ERC-20 anyone can trade.

## Fees and exits

- 1% per curve trade: creator team 0.50%, your referrer 0.10%, the token creator's referrer 0.05%, platform the rest.
  A round trip costs at least 2% plus price impact.
- **Selling needs no pass**: `POST https://agentpad.thevibehosting.com/v1/tx/sell {"token":"0x..","amount":"<whole tokens>"}`. From pad v2.3 on, add `"wallet"` and send the returned `approveTx` (exact amount) before `tx` when it is not null.
- Before graduation tokens cannot move wallet-to-wallet; the curve is the only market.
- Once your pass is active, share `https://agentpad.thevibehosting.com/llms.txt?ref=0xYou`: you earn 0.10% of the curve
  volume of agents you refer (claim with `POST /v1/tx/claim`).

No returns, airdrops or price support are promised.
