API reference
Launch tokens programmatically
Create a fixed-supply token with a one-sided, stablecoin-quoted market from your own code, signed with your own wallet.
Overview
The Pegpad launch API builds a Solana transaction that creates your token and its market. You sign it with your wallet and submit it to any RPC. Pegpad never holds your keys.
How it works
- Host a metadata JSON file (name, symbol, image, socials) at a public URL.
- POST the token details and your wallet address to the build endpoint.
- Receive a partially signed base64 transaction and the new mint address.
- Sign the transaction as fee payer and submit it to Solana.
Endpoint
Request body
All fields are required and sent as JSON.
| Field | Type | Description |
|---|---|---|
| name | string | Token name. Truncated to 28 characters on-chain. |
| symbol | string | Ticker symbol. Truncated to 8 characters on-chain. |
| uri | string | Public URL to a hosted metadata JSON file. |
| quoteToken | "USDC" | "USDT" | "USD1" | "JupUSD" | The stablecoin the token trades against. |
| payer | string | Base58 public key that signs and pays rent for the launch. |
Example request
curl -X POST https://pegpad.fun/api/launch/build \
-H "content-type: application/json" \
-d '{
"name": "My Pegpad Meme",
"symbol": "PGM",
"uri": "https://your-cdn.com/metadata.json",
"quoteToken": "USDC",
"payer": "YourWalletPublicKeyBase58"
}'A successful response returns:
{
"transaction": "<base64-encoded legacy transaction>",
"mint": "Cu5...9pk",
"config": "8Hb...2aa",
"totalTokenSupply": "2000000",
"lastValidBlockHeight": 301872455
}Sign and submit
The returned transaction is a legacy Solana transaction with the config and mint keypairs already partially signed. Add the fee payer signature and send it.
import { Connection, Keypair, Transaction } from '@solana/web3.js'
const payer = Keypair.fromSecretKey(/* your secret key */)
const connection = new Connection('https://your-rpc-endpoint', 'confirmed')
// 1. Ask Pegpad to build the launch transaction.
const res = await fetch('https://pegpad.fun/api/launch/build', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
name: 'My Pegpad Meme',
symbol: 'PGM',
uri: 'https://your-cdn.com/metadata.json',
quoteToken: 'USDC',
payer: payer.publicKey.toBase58(),
}),
})
const { transaction, mint } = await res.json()
// 2. Add the fee payer signature and submit.
// The config + mint keypairs are already partially signed server-side.
const tx = Transaction.from(Buffer.from(transaction, 'base64'))
tx.partialSign(payer)
const signature = await connection.sendRawTransaction(tx.serialize())
await connection.confirmTransaction(signature, 'confirmed')
console.log('Launched', mint, 'tx', signature)Quote tokens
A token trades against exactly one stablecoin, chosen at launch.
| Key | Name | Mint |
|---|---|---|
| USDC | USD Coin | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
| USDT | Tether | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB |
| USD1 | World Liberty USD | USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB |
| JupUSD | Jupiter USD | JuprjznTrTSp2UFa3ZBUFgwdAmtZCq4MQCwysN55USD |
| USDGComing soon | Global Dollar | 2u1tszSeqZ3qBWF3uNGPFc8TzMk2tdiwknnRMWGWjGWH |
| PYUSDComing soon | PayPal USD | 2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo |
Metadata format
The uri field must point to a publicly readable JSON file in the standard token metadata shape. Host it anywhere: your own CDN, IPFS, or Arweave.
{
"name": "My Pegpad Meme",
"symbol": "PGM",
"description": "A stable memecoin launched on Pegpad.",
"image": "https://your-cdn.com/logo.png",
"extensions": {
"twitter": "https://x.com/yourhandle",
"telegram": "https://t.me/yourgroup",
"website": "https://pegpad.fun/token/<mint>"
}
}Errors
Error responses return a JSON object with an error string.
| Status | Meaning |
|---|---|
| 400 | Invalid JSON body, a missing required field, or an unsupported quote token. |
| 400 | Invalid payer address (not a valid base58 public key). |
| 500 | Server RPC is not configured, or the transaction failed to build. |
