Developer documentation

Build on Robin.
Launch and trade onchain.

Production contract addresses, canonical call surfaces, event layouts, and viem integration patterns for launching Robin tokens and executing BUY and SELL transactions.

01

Getting Started

The shortest path from a Node.js script to Robin mainnet.

Connect

Use Robinhood Chain Mainnet with chain ID 4663.

Read

Read quotes, fees, contract relationships, and live market state directly onchain.

Write

Simulate first, then submit the exact request that passed simulation.

npm install viem
02

Network & Contracts

Canonical Robin production addresses on Robinhood Chain Mainnet.

RPC
https://rpc.mainnet.chain.robinhood.com
Explorer
https://robinhoodchain.blockscout.com
RobinFactory
0x9297877b5E67F7d6A2bE7A3C0AfcdF6c940Cd719
RobinConfig
0x11d3F605d18e62813A06Ee329C8cf1278b97962a
RobinFeeVault
0xdC9DB7B483bf4fd1C51B2206fbe4a87fD63C9649
RobinToken Implementation
0x44b249F44F7F387dc579F956a8714D2462bDc6C9
RobinMarket Implementation
0x67Ac8245303354771118208545456582C5a28541
RobinMetadataRenderer
0x5f941910255f657f3efb2cc22B26CAbeEC3883cC
RobinFactory is the canonical discovery point. Integrations can verify RobinConfig, RobinFeeVault, RobinToken Implementation, and RobinMarket Implementation by reading the corresponding Factory getters onchain.
03

Curve Templates

Template IDs are fixed protocol inputs selected when a token is created.

curve-1
Template ID 1
1.0 ETH virtual ETH
curve-2
Template ID 2
2.0 ETH virtual ETH
curve-23
Template ID 3
2.3 ETH virtual ETH
curve-3
Template ID 4
3.0 ETH virtual ETH
curve-4
Template ID 5
4.0 ETH virtual ETH
04

Token Metadata

Structured metadata consumed by the Robin token creation path.

type TokenMetadata = {
  description: string;
  imageURI: string;
  website: string;
  twitter: string;
  telegram: string;
};

// UTF-8 byte limits
// name:        1-64
// symbol:      1-10
// description: max 500
// imageURI:    max 2048
// website:     max 512
// twitter:     max 512
// telegram:    max 512
05

Create a Token

Create a Robin token and its isolated permanent market in one Factory transaction.

createToken(
  string name,
  string symbol,
  TokenMetadata metadata,
  uint8 templateId,
  bytes32 userSalt
) payable returns (
  address token,
  address market
)
The transaction value must equal the live value returned by RobinConfig.createFeeWei(). Do not hard-code the creation fee in production integrations.
06

Create + Buy

Create a token and execute its first BUY atomically.

createAndBuy(
  string name,
  string symbol,
  TokenMetadata metadata,
  uint8 templateId,
  bytes32 userSalt,
  uint256 minTokensOutRaw,
  address tokenRecipient,
  address refundRecipient,
  uint256 deadline
) payable returns (
  address token,
  address market,
  uint256 tokensOutRaw,
  uint256 grossUsedWei,
  uint256 refundWei
)
msg.value is the live creation fee plus the initial BUY gross input. The Robin production UI currently uses 1.00% slippage protection and a 10-minute Create + Buy deadline.
07

Discover Token & Market

Use Factory state and confirmed events as canonical launch discovery surfaces.

marketOfToken(token) -> market
tokenOfMarket(market) -> token

isRobinToken(token) -> bool
isRobinMarket(market) -> bool

launchCount() -> uint256
launchAt(index) -> (token, market)

predictTokenAddress(
  creator,
  userSalt,
  name,
  symbol
) -> token
After a confirmed create transaction, parse the Factory TokenCreated event for the final token and market addresses.
08

Read Market State

Quote trades and inspect curve state without changing chain state.

quoteBuy(uint256 grossInputWei)
  -> BuyQuote

quoteSell(uint256 tokenInRaw)
  -> SellQuote

virtualEthWei()
tokensSoldRaw()
accountedReserveWei()
reserveAt(uint256 qRaw)
maxQRaw()
remainingCurveInventoryRaw()
BuyQuote {
  qBeforeRaw
  qAfterRaw
  tokensOutRaw
  grossInputWei
  grossUsedWei
  curveCostWei
  protocolFeeWei
  creatorFeeWei
  totalFeeWei
  refundWei
}

SellQuote {
  qBeforeRaw
  qAfterRaw
  tokenInRaw
  grossRefundWei
  protocolFeeWei
  creatorFeeWei
  totalFeeWei
  netETHOutWei
}
09

Buy Tokens

Quote immediately before the write and protect the trade with minTokensOutRaw.

buy(
  uint256 minTokensOutRaw,
  address tokenRecipient,
  address refundRecipient,
  uint256 deadline
) payable returns (
  uint256 tokensOutRaw,
  uint256 grossUsedWei,
  uint256 refundWei
)
const quote =
  await publicClient.readContract({
    address: market,
    abi: marketAbi,
    functionName: "quoteBuy",
    args: [grossInputWei],
  });

const minTokensOutRaw =
  quote.tokensOutRaw * 9900n / 10000n;

const simulation =
  await publicClient.simulateContract({
    address: market,
    abi: marketAbi,
    functionName: "buy",
    account,
    args: [
      minTokensOutRaw,
      account,
      account,
      deadline,
    ],
    value: grossInputWei,
  });

const hash =
  await walletClient.writeContract(
    simulation.request,
  );
10

Sell Tokens

Approve the exact RobinMarket when required, then re-quote immediately before SELL.

sell(
  uint256 tokenInRaw,
  uint256 minETHOutWei,
  address ethRecipient,
  uint256 deadline
) returns (
  uint256 netETHOutWei
)
const allowance =
  await publicClient.readContract({
    address: token,
    abi: tokenAbi,
    functionName: "allowance",
    args: [
      account,
      market,
    ],
  });

if (allowance < tokenInRaw) {
  const approvalSimulation =
    await publicClient.simulateContract({
      address: token,
      abi: tokenAbi,
      functionName: "approve",
      account,
      args: [
        market,
        (1n << 256n) - 1n,
      ],
    });

  const approvalHash =
    await walletClient.writeContract(
      approvalSimulation.request,
    );

  await publicClient.waitForTransactionReceipt({
    hash: approvalHash,
  });
}

const quote =
  await publicClient.readContract({
    address: market,
    abi: marketAbi,
    functionName: "quoteSell",
    args: [tokenInRaw],
  });

const minETHOutWei =
  quote.netETHOutWei * 9900n / 10000n;

const simulation =
  await publicClient.simulateContract({
    address: market,
    abi: marketAbi,
    functionName: "sell",
    account,
    args: [
      tokenInRaw,
      minETHOutWei,
      account,
      deadline,
    ],
  });

const hash =
  await walletClient.writeContract(
    simulation.request,
  );
RobinMarket pulls tokens through transferFrom(). Approval must target the exact canonical market for the token.
11

Events

Canonical event surfaces for launches, trades, and token transfers.

TokenCreated(
  indexed token,
  indexed market,
  indexed creator,
  launchId,
  templateId,
  virtualEthWei,
  name,
  symbol,
  metadataHash,
  effectiveSalt
)

Buy(
  indexed buyer,
  indexed tokenRecipient,
  indexed refundRecipient,
  qBeforeRaw,
  qAfterRaw,
  tokenOutRaw,
  grossInputWei,
  grossUsedWei,
  curveCostWei,
  protocolFeeWei,
  creatorFeeWei,
  refundWei
)

Sell(
  indexed seller,
  indexed ethRecipient,
  qBeforeRaw,
  qAfterRaw,
  tokenInRaw,
  grossRefundWei,
  protocolFeeWei,
  creatorFeeWei,
  netETHOutWei
)

Transfer(
  indexed from,
  indexed to,
  value
)

Approval(
  indexed owner,
  indexed spender,
  value
)
12

Fees & Configuration

Current production values and runtime configuration surfaces.

Config Admin
0xe6Fbcaa2f519305E20FFdfb09e06db90f3CA786f
Protocol Treasury
0x0Ceb468cBF6c1975126b0120c99Cfff00a061d0b
Create Enabled
true
Current Create Fee
0.0005 ETH
Current Protocol Fee
0.50%
Current Creator Fee
0.25%
Config Change Delay
24 hours
createEnabled()
createFeeWei()
protocolFeeBps()
creatorFeeBps()
protocolTreasury()
configChangeDelay()

pendingTradingFees()
pendingCreateFee()
pendingEnableCreation()
pendingProtocolTreasury()
Current values are shown for reference. Integrations should read configurable values from RobinConfig at runtime because they may change through the contract-defined delayed update process.
13

Complete viem Examples

A production-oriented integration pattern for Robinhood Chain Mainnet.

import {
  createPublicClient,
  createWalletClient,
  defineChain,
  http,
} from "viem";

const robinhoodChain =
  defineChain({
    id: 4663,
    name: "Robinhood Chain",
    nativeCurrency: {
      name: "Ether",
      symbol: "ETH",
      decimals: 18,
    },
    rpcUrls: {
      default: {
        http: [
          "https://rpc.mainnet.chain.robinhood.com",
        ],
      },
    },
    blockExplorers: {
      default: {
        name: "Explorer",
        url:
          "https://robinhoodchain.blockscout.com",
      },
    },
  });

const publicClient =
  createPublicClient({
    chain: robinhoodChain,
    transport: http(),
  });

const factory =
  "0x9297877b5E67F7d6A2bE7A3C0AfcdF6c940Cd719";

// Recommended write flow:
//
// 1. Read current protocol state.
// 2. Read a fresh quote.
// 3. Compute slippage protection.
// 4. simulateContract(...).
// 5. writeContract(simulation.request).
// 6. Wait for the receipt.
// 7. Parse confirmed event logs.
14

ABI Reference

The most important callable surfaces for third-party integrations.

Factory

createToken, createAndBuy, TokenCreated, marketOfToken, tokenOfMarket, predictTokenAddress, launchCount, launchAt

Market

quoteBuy, quoteSell, buy, sell, tokensSoldRaw, virtualEthWei, accountedReserveWei, remainingCurveInventoryRaw, Buy, Sell

Token

balanceOf, allowance, approve, transfer, transferFrom, tokenMetadata, metadataURI, creator, market

15

Errors & Safety

Fail closed around stale quotes, wrong markets, expired deadlines, and invalid metadata.

Simulate before every write

Submit the exact request that passed simulation instead of rebuilding a different request.

Approve only the exact market

SELL allowance should target the canonical market returned by RobinFactory for that token.

Re-quote immediately before trade

Quotes can become stale while a wallet is open or while an approval transaction confirms.

Use a deadline

Protect transactions from being mined after the intended execution window.

Protocol documentation

For permanent curve behavior, virtual ETH, protocol design, fees, and security assumptions, continue to the main Robin documentation.

Open Docs