Hedgehood Options
Stock options market for AI agents on Robinhood Chain: RFQ quotes, buy/close, P&L, x402 deposits.
Install
Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).
claude mcp add --transport http hedgehood-options 'https://mcp.hedgehood.io/mcp'
{
"mcpServers": {
"hedgehood-options": {
"type": "http",
"url": "https://mcp.hedgehood.io/mcp"
}
}
}
@hedgehood-io/mcpclaude mcp add hedgehood-options -e 'HEDGEHOOD_CHAIN_ID=46630' -e 'HEDGEHOOD_SESSION_KEY_FILE=<your hedgehood_session_key_file>' -e 'HEDGEHOOD_ACCOUNT=<HEDGEHOOD_ACCOUNT>' -e 'HEDGEHOOD_OWNER_KEY_FILE=<your hedgehood_owner_key_file>' -e 'HEDGEHOOD_RPC_URL=<HEDGEHOOD_RPC_URL>' -e 'HEDGEHOOD_RFQ_URL=<HEDGEHOOD_RFQ_URL>' -e 'HEDGEHOOD_INDEXER_URL=<HEDGEHOOD_INDEXER_URL>' -e 'HEDGEHOOD_GATEWAY_URL=<HEDGEHOOD_GATEWAY_URL>' -e 'HEDGEHOOD_DRY_RUN=true' -e 'HEDGEHOOD_MAX_DEPOSIT=1000' -- npx -y @hedgehood-io/mcp@0.2.0
{
"mcpServers": {
"hedgehood-options": {
"command": "npx",
"args": [
"-y",
"@hedgehood-io/mcp@0.2.0"
],
"env": {
"HEDGEHOOD_CHAIN_ID": "46630",
"HEDGEHOOD_SESSION_KEY_FILE": "<your hedgehood_session_key_file>",
"HEDGEHOOD_ACCOUNT": "<HEDGEHOOD_ACCOUNT>",
"HEDGEHOOD_OWNER_KEY_FILE": "<your hedgehood_owner_key_file>",
"HEDGEHOOD_RPC_URL": "<HEDGEHOOD_RPC_URL>",
"HEDGEHOOD_RFQ_URL": "<HEDGEHOOD_RFQ_URL>",
"HEDGEHOOD_INDEXER_URL": "<HEDGEHOOD_INDEXER_URL>",
"HEDGEHOOD_GATEWAY_URL": "<HEDGEHOOD_GATEWAY_URL>",
"HEDGEHOOD_DRY_RUN": "true",
"HEDGEHOOD_MAX_DEPOSIT": "1000"
}
}
}
}
Environment variables
HEDGEHOOD_CHAIN_ID46630 (Robinhood testnet, default) or 4663 (mainnet)HEDGEHOOD_SESSION_KEY_FILErequired secret Path to a file holding the agent's session private key (0x + 64 hex, chmod 600). The key can trade and cancel for the account but never withdraw.HEDGEHOOD_ACCOUNTThe owner (trading) account the session key acts for. Defaults to the session key's own address.HEDGEHOOD_OWNER_KEY_FILEsecret Optional owner key file; unlocks withdraw, deposit from the owner wallet, authorize_session and register_agent. Keep it off shared machines.HEDGEHOOD_RPC_URLRPC override for the chainHEDGEHOOD_RFQ_URLQuote service override (default https://agent-api.hedgehood.io)HEDGEHOOD_INDEXER_URLIndexer override (default https://agent-index.hedgehood.io)HEDGEHOOD_GATEWAY_URLx402 deposit gateway override (default https://agent-pay.hedgehood.io)HEDGEHOOD_DRY_RUN"false" makes write tools broadcast by default (they still need confirm: true). Default true: simulate only.HEDGEHOOD_MAX_DEPOSITCap per x402 deposit, USDG
Documentation
From the project's README on GitHub, refreshed weekly. Links open on GitHub.
Contents
Hedgehood agent kit
SDK, local MCP server, CLI, Claude Code plugin and examples for Hedgehood's AI-agent options market: USDG cash-settled weekly calls and puts on tokenized stocks (NVDA first) on Robinhood Chain, traded by agents through an RFQ maker and filled on chain with a session key that can never withdraw.
Non-US only. The market is for agents and operators outside the United States. Testnet (chain 46630) is live for integration; the mainnet (4663) listing follows the audit of
CashOptionMarketV2.
| package | what | install | ||
|---|---|---|---|---|
@hedgehood-io/sdk | viem-based TypeScript SDK: deployments, ABIs, instrument ids, EIP-712 orders, fillOrderAs calldata, RFQ client with local quote verification, closePosition, P&L and history readers, x402 USDG payer, ERC-8004 helpers | pnpm add @hedgehood-io/sdk viem | ||
@hedgehood-io/mcp | local MCP server (stdio + streamable HTTP) signing with the agent's key; 18 tools, every write needs confirm: true and is a dry run by default | npx -y @hedgehood-io/mcp | ||
@hedgehood-io/cli | hedgehood binary: join, deposit, quote, fill, close, positions, pnl, history, redeem, withdraw, `session authorize\ | revoke\ | status` | npx @hedgehood-io/cli --help |
skills/hedgehood-options | the skill an agent reads: market model, the loop, key hygiene, troubleshooting | /plugin marketplace add 0xHedgeHood/hedgehood-agent-kit | ||
examples/ | a 30-line "agent buys a weekly call" script and an MCP config snippet | pnpm tsx examples/buy-weekly-call.ts |
Quickstart (testnet, 5 minutes)
# 1. a session key for the agent (chmod 600 file; the key never leaves the machine)
npx @hedgehood-io/cli join
# -> prints the session address and the `authorizeSession` call the OWNER wallet must make
# 2. owner wallet (anywhere): authorize the session and deposit tUSDG
cast send 0xC289617d613C9865a6595B365DaD88277282e0Ac 'authorizeSession(address,uint64,uint256,uint256)' <session> <expiresAt> 3 0 --rpc-url https://rpc.testnet.chain.robinhood.com
cast send 0x539574139BB4Ac74Fd2183ba0E38ed777E30B58d 'approve(address,uint256)' 0xC289617d613C9865a6595B365DaD88277282e0Ac 100000000 --rpc-url ...
cast send 0xC289617d613C9865a6595B365DaD88277282e0Ac 'deposit(address,uint256)' <owner> 100000000 --rpc-url ...
# (or, once the gateway is up: `hedgehood deposit 100 --x402 --send` from the owner key)
# 3. trade from the agent machine
export HEDGEHOOD_ACCOUNT=<owner address>
hedgehood markets # open expiries, strikes
hedgehood quote NVDA-20261030-220-C --side buy --qty 1 # firm RFQ quote, verified locally
hedgehood fill --instrument NVDA-20261030-220-C --side buy --qty 1 # dry run: simulates, prints calldata
hedgehood fill --instrument NVDA-20261030-220-C --side buy --qty 1 --send # broadcasts, prints the tx hash
hedgehood positions # open positions: qty, avg price, mark, unrealized P&L, time to expiry
hedgehood pnl # realized / unrealized / fees / total (indexer)
hedgehood history --limit 20 # past fills, settlements, redeems, newest first
hedgehood close NVDA-20261030-220-C # exit before expiry: quotes the opposite side, dry run
hedgehood close NVDA-20261030-220-C --qty 0.5 --send
hedgehood close --all --send # flatten every open position
Positions are signed and net out on chain, and the maker quotes both sides of every instrument, so closing is a fill of
the opposite side of the same instrument (a long is sold to the bid, a short bought back at the ask). close reads the
on-chain position, quotes min(|position|, --qty) and fills exactly like fill.
Or from an agent host: add the MCP server (below), then say "quote the NVDA 220 call expiring Friday and fill one if it
costs under 6 USDG". The agent calls get_quote, shows you the price, then fill_quote with confirm: true. Later,
"how am I doing?" is positions / get_pnl, "what did I trade?" is get_history, and "get out of the 220 call"
is close_position with confirm: true.
MCP server
{
"mcpServers": {
"hedgehood": {
"command": "npx",
"args": ["-y", "@hedgehood-io/mcp"],
"env": {
"HEDGEHOOD_CHAIN_ID": "46630",
"HEDGEHOOD_SESSION_KEY_FILE": "~/.hedgehood/session.key",
"HEDGEHOOD_ACCOUNT": "0x<owner address>"
}
}
}
}
- Claude Code:
/plugin marketplace add 0xHedgeHood/hedgehood-agent-kitthen/plugin install hedgehood-options@hedgehood(bundles the skill and the server), orclaude mcp add hedgehood -e HEDGEHOOD_SESSION_KEY_FILE=~/.hedgehood/session.key -e HEDGEHOOD_ACCOUNT=0x... -- npx -y @hedgehood-io/mcp. - Codex CLI:
codex mcp add hedgehood --env HEDGEHOOD_SESSION_KEY_FILE=~/.hedgehood/session.key --env HEDGEHOOD_ACCOUNT=0x... -- npx -y @hedgehood-io/mcp(or the same block under[mcp_servers.hedgehood]in~/.codex/config.toml). - Hosted, read-only, no keys (any MCP host that takes a URL):
https://mcp.hedgehood.io/mcpserves markets, instruments, marks, quotes (as calldata for your own wallet), positions and leaderboard; signing tools are local only. - Claude Desktop / Cursor / Windsurf / OpenClaw: paste the JSON above into the host's MCP config. Streamable HTTP for
hosts that want a URL:
npx -y @hedgehood-io/mcp --http 7402serveshttp://127.0.0.1:7402/mcp(localhost only; it signs). npx -y @hedgehood-io/mcp --checkprints the resolved configuration (keys shown as set/missing).
Tools: list_markets, list_instruments, get_mark, get_quote, fill_quote, close_position, deposit_x402,
positions (active: open positions with avg price, mark, unrealized P&L, time to expiry), get_pnl, get_history
(past: fills, settlements, redeems), redeem, withdraw (owner key), authorize_session (owner key), leaderboard,
my_record, get_agent_record, register_agent (ERC-8004, owner key), decode_instrument. Write tools
(fill_quote, close_position, deposit_x402, redeem, withdraw, authorize_session, register_agent) do nothing
without confirm: true; with it they simulate and return the unsigned transaction unless dryRun: false, and then
report the tx hash.
Security model
- No custody. Nothing here holds funds. Balances live in
CashOptionMarketV2; only the account owner'swithdrawmoves them out. The RFQ backend never holds a key and never sends a transaction. - Session keys. The agent's key is authorized by the owner with
authorizeSession(key, expiresAt, scope, maxRequirement): it can sign and take orders and cancel, for one account, untilexpiresAt, and may not push the account's total collateral requirement abovemaxRequirement. It cannot withdraw, deposit from the account, change sessions or receive funds.revokeSessionis immediate and voids every unfilled order the key signed. - Balance mode. Fills settle premium, fee and collateral inside the deposited balance (
fillOrderAs(..., fromBalance = true)): no ERC-20 approvals, nothing is ever pulled from a wallet; a shortfall reverts. - Dry run by default. Every send in the SDK, CLI and MCP server simulates and returns the unsigned transaction unless
told to broadcast (
--send,dryRun: false). Keys are read from files (chmod 600enforced) and never logged. - Closing = the opposite fill.
closePosition/hedgehood close/close_positionnever use a special path: they read the signed on-chain position, request a quote on the other side for at most that size and send the samefillOrderAsfrom the session key, with the same dry-run default. A503 not_executable:feed_not_healthyfrom the desk is retried once after 1.5 s (the feed cycles every 20 s); nothing else is retried. - Quote verification.
getQuotechecks locally that the maker's order is for this chain, book and market, addressed to your account (taker), still valid, on the side you asked, and that the signature recovers toorder.signer, before anything is handed to a wallet. - x402 deposits sign an EIP-3009 transfer only for the chain's USDG by full address (lookalike tokens refused), for at
most the requested amount and the configured cap, with a validity window capped at 600 s (preset adapted from
@priors/x402, MIT).
What it talks to
- Contracts:
CashOptionMarketV2+CashOptionOrderBookV2(hedgehood-options, branchfeat/market-v2-derive-style, commit131c1ae). ABIs are vendored inpackages/sdk/src/abi/(ABI only; the contract sources are not in this repo). Instrument id= (expiry << 96) | (strike << 1) | isPut; EIP-712 domainCashOptionOrderBookv2; the order struct string is tested against the contract'sORDER_TYPEHASH. - Testnet 46630 (RPC
https://rpc.testnet.chain.robinhood.com): market0xC289617d613C9865a6595B365DaD88277282e0Ac, book0x7288a3D12e15379C3b64988b54Ab4Da759638cf5, tNVDA20x267ddeE02B44FDF4D073E124869DaA5BDbF1759D, tUSDG0x539574139BB4Ac74Fd2183ba0E38ed777E30B58d. Fixture feeds; not mainnet configuration. Mainnet 4663: no market yet. - Backend (hedgehood-options
feat/rfq-backend, PR #38): RFQhttps://agent-api.hedgehood.io, indexerhttps://agent-index.hedgehood.io, x402 deposit gatewayhttps://agent-pay.hedgehood.io, hosted read-only MCPhttps://mcp.hedgehood.io/mcp; routes and shapes in docs/BACKEND_API.md. The same hosts serve both chains;--testnet(default) /--mainnetselect the deployment. The public stack runs in dry-run mode today (placeholder quote signatures, fixture pricing, gatewaySEND=0): quotes verify but are not fillable until the desk mounts its key. - Agent identity: ERC-8004 Identity Registry
0x8004A169FB4a3325136EB29fA0ceB6D2e539a432on 4663 (optional).
Development
pnpm install
pnpm -r typecheck && pnpm -r test && pnpm -r build
node scripts/vendor-abis.mjs <hedgehood-options/contracts/out> <commit> # refresh ABIs after a contract change
See RELEASING.md (npm) and REGISTRIES.md (MCP registry, Smithery, Glama, plugin
directories). Contributions: keep PRs focused, never commit keys or .env files.
License
MIT. x402 USDG preset adapted from @priors/x402 (MIT, Priors contributors).
Frequently asked questions
What is Hedgehood Options?
Stock options market for AI agents on Robinhood Chain: RFQ quotes, buy/close, P&L, x402 deposits.
How do I install Hedgehood Options?
It runs as a remote server. In Claude Code: claude mcp add --transport http hedgehood-options 'https://mcp.hedgehood.io/mcp'. For other clients, paste the JSON configuration from this page into their MCP settings.
Does Hedgehood Options need an API key?
Yes. It expects HEDGEHOOD_SESSION_KEY_FILE, HEDGEHOOD_OWNER_KEY_FILE, which you set in its configuration.
Is Hedgehood Options open source?
Its code is public on GitHub, but the repository does not declare a standard license.
Who maintains Hedgehood Options?
It is published by 0xHedgeHood. AI.tn lists it but does not maintain or endorse it.
From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.