Guides
Token launch API: create an ERC-20 programmatically
The short answer: openfair exposes a typed REST API (https://api.openfair.app, OpenAPI 3.1) and a TypeScript SDK (npm install @openfair/sdk) that create real ERC-20 tokens on Robinhood Chain – each one a standalone, auto-verified contract with Uniswap V3 liquidity locked forever. Your integration's wallet is recorded on-chain as the referrer and earns half of the platform's fee share of every referred token, forever.
Quote first, sign last
The API separates preparation from signing. A quote validates the whole config server-side and prices it:
curl -X POST https://api.openfair.app/launches/quote \
-H 'Content-Type: application/json' \
-d '{"mode":"instant","token":{"name":"My Token","symbol":"MTK"}}'
The response carries the creation fee, a gas estimate with a safety margin, the exact required value in wei and a config hash. POST /launches/simulate then dry-runs the transaction (balance, self-referral, contract eth_call) before any wallet opens. Signing happens only client-side – the API never holds keys.
The SDK pipeline
import { Openfair } from '@openfair/sdk';
const sdk = new Openfair({ referrer: '0xYourWallet' });
await sdk.connect();
const quote = await sdk.launch.quote({ mode: 'instant', name: 'My Token', symbol: 'MTK' });
const sim = await sdk.launch.simulate(quote);
const op = await sdk.launch.execute(quote, { onProgress: console.log });
const done = await op.wait({ waitForIndexer: true });
Progress events cover every stage from metadata pinning to indexing; errors are typed with a machine-readable code, the failed stage and a suggested action.
What you get per launch
- A standalone immutable ERC-20 contract, source auto-verified on the explorer.
- Fair launch (community-funded bonding curve, 5 ETH target) or instant Uniswap V3 listing with zero capital.
- LP locked forever in a harvester contract with no withdrawal path.
- Immutable on-chain referral: half of the platform's fee share of the token flows to your integration wallet.
Also available
A zero-code iframe embed of the create form, and an MCP server for AI agents at mcp.openfair.app. Full reference, OpenAPI spec and examples: openfair.app/developers.