market0x is agent-native. An autonomous agent can do everything a human can — read live listings with underlying contents priced at market, and buy, bid, list, accept, and cancel — non-custodially, settling on Seaport across Base, BNB Smart Chain, HyperEVM and Robinhood Chain. This page is the integration guide; the human/legal reference is in Docs.
Connect
market0x exposes a Model Context Protocol server over Streamable HTTP. Point your agent at it:
/api/mcp
Claude Code:
terminal
claude mcp add --transport http market0x https://www.market0x.com/api/mcp
An agent does everything a human can — read listings, and buy, bid, list, accept, and cancel. Every state-changing tool is prepare-only: it returns an unsigned transaction package (or an order to sign), and your own wallet signs and submits. The server never holds your keys or assets, and settlement is the same Seaport path the web app uses.
1 · prepare_*
Call a tool. Get approvals + Seaport calldata, or an EIP-712 order — plus a fresh contents snapshot.
2 · sign
Review the fields; sign in your own wallet. Listings/offers are a gasless signature; buys are a tx you submit.
3 · settle
Seaport executes atomically on-chain — asset and payment move together, or not at all.
Tool reference
13 tools, grouped below. read = pure query; prepare = returns an unsigned package/order for your wallet; signed action = performs a server-side write once you sign (no custody).
Reads
list_micro_marketsread
List the markets this marketplace facilitates — asset, chain, settlement currencies, and fee.
get_listingsread
Active listings and auctions for a market, each with its ask, underlying contents priced at market, and discount — sorted by discount.
get_listing_detailsread
Full detail for one order, including a fresh live snapshot of the position's contents.
get_recent_tradesread
Recently filled orders (sales) for a market.
get_ordersread
Orders created by an address — its listings, auctions, and offers.
get_owned_positionsread
Positions an address owns in a market, with per-position listability.
Buy & bid
prepare_purchaseprepare
Prepare the non-custodial package to buy a listing or accept an offer — ordered approvals plus Seaport fulfill calldata.
prepare_offerprepare
Prepare a bid/offer to sign — the Seaport order (EIP-712), the currency approval, and how to submit it.
Sell & manage
prepare_listingprepare
Prepare a sell listing or Dutch auction — verifies ownership and transferability, then returns the NFT approval plus EIP-712 order to sign.
prepare_cancelprepare
Prepare the on-chain Seaport cancel transaction for an active order (only the offerer can execute it).
Notifications
subscribe_notificationssigned action
Subscribe a wallet to push notifications via an HMAC-signed webhook — the agent-native alternative to polling.
list_subscriptionsread
List a wallet's notification subscriptions (webhook URLs redacted to origin).
unsubscribe_notificationssigned action
Delete a notification subscription.
Full parameter and return schemas are advertised by the server itself — call tools/list after connecting.
Worked examples
JavaScript with the MCP TypeScript SDK. call() and wallet are the helpers from Connect and your own signer; toOrderComponents/erc20Approve are small local helpers.
Buy the biggest discount
buy.ts
// 1) pick a market, 2) find the biggest discount, 3) prepare the buy.
const { markets } = await call("list_micro_markets");
const { listings } = await call("get_listings", {
marketId: "veaero", kind: "listing", minDiscountPct: 8, // >= 8% below underlying
});
if (!listings.length) return; // nothing cheap enough
const best = listings[0]; // sorted by discount desc
const { prepared, contents, valueDrift } = await call("prepare_purchase", {
orderHash: best.orderHash,
});
// prepared = { approvals:[...], fill:{to,data,value}, signed }
// Sign + submit with YOUR wallet — the server never holds keys:
for (const a of prepared.approvals) await wallet.sendTransaction(a);
await wallet.sendTransaction(prepared.fill);
Place an offer on a position
offer.ts
// Bid on a specific position. prepare_offer returns an order to SIGN.
const { order, orderHash, approval, signing } = await call("prepare_offer", {
marketId: "veaero", tokenId: "130647", currencySymbol: "USDC",
offerAmount: "3.10", // human amount the seller nets
buyer: myAddress,
});
// 1) approve the currency to the conduit so the offer is fillable:
await wallet.sendTransaction({ to: approval.token, data: erc20Approve(approval.spender, approval.amount) });
// 2) sign the EIP-712 order (the Seaport counter is already set — do not change it):
const signature = await wallet.signTypedData({
domain: signing.domain, types: signing.types, primaryType: signing.primaryType,
message: toOrderComponents(order),
});
// 3) POST the signed order to the book — settlement stays on Seaport:
await fetch("https://www.market0x.com/api/listings", {
method: "POST", headers: { "content-type": "application/json" },
body: JSON.stringify({ order, signature, orderHash }),
});
List a position for sale
list.ts
// List a position you own (or a Dutch auction with startAsk/endAsk).
const { order, orderHash, approval, signing } = await call("prepare_listing", {
marketId: "veaero", tokenId: "130647", kind: "listing",
currencySymbol: "USDC", seller: myAddress, ask: "3.10", // price you net
});
// one-time per collection: setApprovalForAll(conduit, true)
await wallet.sendTransaction({ to: approval.to, data: approval.data });
const signature = await wallet.signTypedData({
domain: signing.domain, types: signing.types, primaryType: signing.primaryType,
message: toOrderComponents(order),
});
await fetch("https://www.market0x.com/api/listings", {
method: "POST", headers: { "content-type": "application/json" },
body: JSON.stringify({ order, signature, orderHash }),
});
Subscribe to events (webhooks, not polling)
subscribe.ts
// Get pushed events instead of polling. Two steps: sign, then subscribe.
const now = Math.floor(Date.now() / 1000);
const base = {
wallet: myAddress, chainId: 8453, channel: "webhook",
webhookUrl: "https://my-agent.example.com/hook",
events: ["order_filled", "offer_received"], timestamp: now,
};
// 1) call WITHOUT a signature to get the exact message to personal_sign:
const { messageToSign } = await call("subscribe_notifications", base);
const signature = await wallet.signMessage({ message: messageToSign });
// 2) call again WITH the signature. The webhook HMAC secret is returned ONCE:
const { id, webhookSecret } = await call("subscribe_notifications", { ...base, signature });
// verify each delivery: hex(HMAC-SHA256(rawBody, webhookSecret)) === x-market0x-signature
Safety & trust
Non-custodial. Every action tool returns something for your wallet to sign. The server never holds keys or assets.
Bounded approvals. Buying/offering approves the exact amount (price + fee) to the Seaport conduit — never unlimited. Listing uses the ERC-721 collection approval, revocable from the dashboard.
Freshness checks. Contents are re-read on-chain at prepare_purchase; where a position can be hollowed without burning its id, a material drop returns value_dropped and the package is refused.
Transferability verified. A voted/attached/relay position that would revert on transfer is caught at prepare time with a clear reason, not handed back as a doomed fill.
Flat 1% fee, split 50/50 buyer/seller, appended to the signed order and enforced on-chain — identical across every asset and route (disclosure).
Markets & chains
Live on Base, BNB Smart Chain, HyperEVM and Robinhood Chain. An executing agent must sign on the market's own chain (smart-wallet signatures don't validate cross-chain). Use list_micro_markets for the machine-readable version.
Assets and markets the marketplace facilitates. Each market is a config record — adding an asset is a config row, not a code change.
bad_amount / currency_not_allowed — input rejected before any chain read.
Rate limit: 120 requests/minute per IP (HTTP 429). A malformed JSON-RPC body returns a -32700 parse error immediately.
Reference bot
A runnable agent lives in examples/discount-sniper — it connects over MCP, filters listings by a discount threshold, and prepares (optionally executes) a purchase. Copy it as a starting point. (It signs on Base; adapt the chain for markets on BNB, HyperEVM, or Robinhood.)
Roadmap
Reads are free during launch. Premium or high-frequency reads may later be gated via x402 (USDC) — the agent card's payment block will advertise it when live.