Monex Protocol / Docs
MonexStock

MonexStock

Buy tokenized stocks on Robinhood Chain gasless over x402: pay USDG with a signature, Monex Protocol pays gas, swaps the verified pool, and delivers to your wallet.

MonexStock is an agentic stock market on Robinhood Chain. Agents (and humans, at stock.monexprotocol.org) buy official Robinhood tokenized stocks without ever holding gas: you pay USDG through an x402 exact payment (a Permit2 signature — no transaction from your side), Monex Protocol settles it, swaps through the on-chain-verified Uniswap v3 pool, and the router delivers the stock straight to your address, all in one request. If anything fails after your payment settles, you are refunded automatically.

https://www.monexprotocol.org/api/stock

Endpoints

EndpointPricePurpose
GET /api/stock/listfreeCatalog: 14 verified tokenized stocks with live prices, fees, limits
GET /api/stock/quote?symbol=NVDA&usdg=25freeOn-chain estimate + the exact total the buy will charge
POST /api/stock/buy?symbol=NVDA&usdg=25x402 (dynamic)The gasless buy; optional &recipient=0x… delivers elsewhere
GET /api/stock/order/{id}freeOrder status, settlement / swap / refund tx hashes
GET /api/stock/orders?payer=0x…&limit=20freeTransaction history, newest first (omit payer for the global feed)

Orders are 1–1000 USDG. Fees are currently zero — the challenge demands exactly the usdg you request. usdg is the amount you spend; the shares you receive float with the pool price, floored by a per-token slippage bound (re-quoted on-chain immediately before execution).

Buy flow for agents

  1. DiscoverGET /api/stock/list, pick a symbol.
  2. Quote (optional) — GET /api/stock/quote?symbol=NVDA&usdg=5.
  3. ChallengePOST /api/stock/buy?symbol=NVDA&usdg=5 with no payment header returns 402 with the terms in the body and the payment-required header. accepts[0] carries asset (USDG), amount (atomic, 6 decimals), payTo, and extra.spender (the canonical x402ExactPermit2Proxy).
  4. Sign — a Permit2 PermitWitnessTransferFrom EIP-712 signature (domain {name: "Permit2", chainId: 4663}), with permitted = {token: asset, amount}, spender = extra.spender, a random 256-bit nonce, a deadline within 300s, and witness = {to: payTo, validAfter: 0}. No gas is spent.
  5. Pay — retry the same POST with the payment-signature header: base64 of {"x402Version": 2, "payload": {"permit2Authorization": {…, "from": "0xYOU"}, "signature": "0x…"}}.
  6. Receive — the 200 body reports the order id, the settlement tx, the swap tx, and the exact amount delivered to your address.

The response also carries the standard payment-response header. A 502 after settlement means delivery failed — the body then includes the refund tx.

One-time setup: Permit2 approval

Your wallet needs a one-time USDG approval to Permit2 (0x000000000022D473030F116dDEE9F6B43aC78BA3). If it holds USDG but no ETH for that single approve, request sponsored gas:

curl -X POST https://www.monexprotocol.org/api/gas/sponsor \
  -H 'content-type: application/json' \
  -d '{"address": "0xYOUR_WALLET"}'

Then send approve(0x000000000022D473030F116dDEE9F6B43aC78BA3, max) on the USDG contract. Every payment after that is pure signatures.

Guarantees

  • Verified assets only. Each listed token is the official "• Robinhood Token" contract, and swaps route only through the factory-derived USDG pool pinned in config — the pool's token pair and fee are re-verified on-chain before any funds move, so counterfeit tokens and spoofed pools can never be selected.
  • Slippage-floored. The swap re-quotes via QuoterV2 at execution and reverts (→ refund) below the per-token floor.
  • Refund on failure. USDG settles to the relayer before the swap; any failure after settlement triggers an automatic USDG refund to the payer, and every order is queryable at /api/stock/order/{id}.

Selling back to USDG is coming next.

On this page