# Agate documentation > Every chapter of https://agate.elpabl0.xyz/docs, in reading order. The index: https://agate.elpabl0.xyz/llms.txt # Introduction Source: https://agate.elpabl0.xyz/docs/introduction # Agate makes the price of compute tradable. Renting a GPU for an hour has a price, and that price moves. An AI company that sells at a fixed price while its GPU bill floats is exposed to it; so is a cloud that bought GPUs and needs next month's rental income. Agate turns that price into something anyone, a person, an app or an AI agent, can see, check, lock in or trade. No GPU changes hands: you trade the price, settled in dollars. ## Three parts | Part | What it is | Where it lives | |---|---|---| | **The price** | One number per GPU per day: what the clouds charge per GPU-hour on their own public price pages, read hourly and combined as a median of companies, with every source shown | `AgateIndex` on Monad, written by a Chainlink CRE workflow and countersigned by a second, independent reader | | **The market** | One token per GPU per month that pays that month's average price, kept between a floor and a ceiling. Long locks what you pay; Short locks what you earn. Every token is fully backed | Monthly series contracts, traded on Kuru's onchain order book | | **The ways in** | A web app with passkey, email or Google sign-in and no gas, an MCP server for AI agents, a developer API, an SDK, and Chainlink-style feeds for contracts | `app/`, `server/`, `client/`, `contracts/src/examples/` | Six GPUs have a daily price today: H100, H200, B200, B300, A100 and L40S. The first three have monthly markets; the other three are price only for now. ## Who it is for - **Teams that rent GPUs** (inference clouds, AI and agent companies): go Long to fix next month's compute cost. - **Teams that rent GPUs out** (neoclouds, GPU owners): go Short to fix next month's rental income. - **Traders** with a view on compute prices. - **AI agents** acting for any of the above, inside limits a person sets. - **Builders** who need a compute price they can check: dashboards, lending against GPU income, insurance, research. ## What is live Everything runs on Monad testnet with free test dollars, since Oct 4 2026: - the daily price for six GPUs, onchain, with its sources ([How the price is made](https://agate.elpabl0.xyz/docs/the-price)); - the November 2026 markets for H100, H200 and B200 on Kuru, with a market maker quoting both sides ([The monthly market](https://agate.elpabl0.xyz/docs/the-market)); - the app at https://agate.elpabl0.xyz/app, with the site at https://agate.elpabl0.xyz and these docs at https://agate.elpabl0.xyz/docs ([Quickstart](https://agate.elpabl0.xyz/docs/quickstart)); - AI agents trading from their own pockets through MCP ([Connect an AI](https://agate.elpabl0.xyz/docs/connect-an-ai)); - the developer API at https://agate.elpabl0.xyz/api/v1 ([Developer API](https://agate.elpabl0.xyz/docs/api)) and a price feed per GPU for contracts ([Onchain](https://agate.elpabl0.xyz/docs/onchain)). Test dollars and tokens have no monetary value. What a real-money version needs is in [Limits](https://agate.elpabl0.xyz/docs/limits). ## How the docs are organized Five groups. **Get started**: this page, a three-minute tour of the app (at `/app`), connecting an AI, and a page for AI agents. **Concepts**: how the price is made, how the monthly market works, accounts, and AI pockets. **Reference**: the API, onchain reading, the SDK, the MCP tools, the contracts, every address, and every error. **Operate**: the architecture and how to run and test Agate yourself. **Background**: what Agate is built on, its limits, and a glossary. # Quickstart Source: https://agate.elpabl0.xyz/docs/quickstart # Three minutes, no wallet, no gas. This page takes you through the app at https://agate.elpabl0.xyz/app (phone or desktop) from signing in to a closed trade, then shows the same data from a terminal and from code. **Before you start:** a browser on a device that can save a passkey (Touch ID, Face ID, Windows Hello, or a phone nearby), or an email address or a Google account. Nothing to install, no wallet, nothing to fund: test dollars are free and have no value. ## 1. Sign in Tap **Sign in**, then **Continue with a passkey**. One Touch ID or Face ID makes your account, with no email. In another browser or on a new device, tap **I already have a passkey** instead. Or use Google or your email (a code arrives). There is no wallet to install and no gas to pay: an account is created for you (a smart account, see [Accounts](https://agate.elpabl0.xyz/docs/accounts#passkey-accounts)) and network fees are paid by Agate. The first sign-in adds **10,000 test dollars** in about 6 seconds; you can take 10,000 more 24 hours after the last time. **You should see** your balance at the top: $10,000.00. ## 2. Go Long On **Markets**, pick **H100** and **November 2026**. The screen shows today's index price, the month's market price, its range (H100 November: a floor of $1.95 and a ceiling of $8.00 per GPU-hour) and Kuru's order book (switch to **Pro** for the full book and limit orders). Enter $100 and confirm. You now hold November's H100 price: at the end of November you get November's average price for every GPU-hour you bought. **You should see** a receipt with the GPU-hours you bought (about 24.8 for $100 at a $4.03 ask) and a link to the transaction on the Monad explorer, a few seconds after you confirm. ## 3. Go Short, paid daily Pick **Short**, tick **Pay me daily**, enter a size and confirm. You put up the ceiling and sold at today's price, so you have locked what you earn per GPU-hour. With pay me daily, each day of November pays its share as soon as that day's price is final. How the money works: [The monthly market](https://agate.elpabl0.xyz/docs/the-market). ## 4. Close **Positions** lists both trades. **Close** either one at the market price; your gain or loss is the difference from where you opened. For example, $100 at a $4.03 ask buys 24.81 GPU-hours; sold at once at a $3.95 bid they come back as $98.01: the $1.99 you lose is the spread between the bid and the ask. ## 5. Check the price Open **Index**. Each GPU's price is the median across companies of what the clouds charge on their own pages, and every cloud's price is shown beside it. How: [How the price is made](https://agate.elpabl0.xyz/docs/the-price). ## Check it - **In the app:** Positions lists the trade, and the receipt's link opens it on the explorer. - **From the API:** your fill appears among the month's trades within about 15 seconds: ```sh curl -s "https://agate.elpabl0.xyz/api/v1/markets/H100/2026-11/trades?limit=1" ``` ```text {"gpu":"H100","month":"2026-11","trades":[{"at":"2026-10-10T11:49:39Z","side":"buy","price":4.03,"size":495.5459, "txHash":"0xfa8f5d439431ae31fac2786227c49c78d877d867a88d218f7ff5eb6683487f00"}]} ``` ## If it fails | What you see | What to do | |---|---| | no sign-in code arrives | wait a minute, check spam, or use Google | | `Your next 10,000 test dollars arrive .` | test dollars come once every 24 hours; wait until then | | `Agate couldn't pay the network fee this time. Nothing was sent. Try again in a minute.` | try again in a minute | | `It now fills ...` | the book moved; look at the new numbers and confirm again | | `At prices November can still pay, the book holds ...` | the book is thinner than your order; buy at most that | | a code or passkey prompt | connecting an AI and delegating ask you to confirm again ([Accounts](https://agate.elpabl0.xyz/docs/accounts#step-up)) | A refusal before sending says that nothing was sent. Every message and its cause: [Errors](https://agate.elpabl0.xyz/docs/errors#in-the-app). ## The same data without the app ```sh curl -s https://agate.elpabl0.xyz/api/v1/markets/H100/2026-11 | jq -c '{symbol, phase, floor, ceiling, bid, ask, last}' ``` ```text {"symbol":"H100-NOV26","phase":"trading","floor":1.95,"ceiling":8,"bid":3.95,"ask":4.03,"last":4.03} ``` The same price from a contract, with its output decoded: [Onchain feeds](https://agate.elpabl0.xyz/docs/onchain). From TypeScript, a first script and what it prints: [SDK](https://agate.elpabl0.xyz/docs/sdk#install). The numbers above were read on Oct 10 2026; yours will be that day's. Next: [Connect an AI](https://agate.elpabl0.xyz/docs/connect-an-ai) to let an agent trade for you, or the [Developer API](https://agate.elpabl0.xyz/docs/api). # Connect an AI Source: https://agate.elpabl0.xyz/docs/connect-an-ai # Your AI trades from its own pocket, inside your limits. Agate is a remote MCP server (Streamable HTTP). Any AI app that can add one, Claude, Codex, Hermes, OpenClaw and others, can read Agate's prices and trade. It never touches your main account: each AI gets its own **pocket**, a separate account holding only the budget you give it, and every trade is checked against your limits by Agate's server and again by the chain itself ([AI pockets and limits](https://agate.elpabl0.xyz/docs/ai-pockets)). ## Two ways to connect Agate's MCP server is at **`https://agate-1.tailf06dd7.ts.net/mcp`**. That is the address of Agate's own server (published through Tailscale Funnel), not of the app: the app at `agate.elpabl0.xyz` does not proxy MCP, and the OAuth tokens are issued for this exact address, so add it as written. Every address Agate uses is in [Contracts and addresses](https://agate.elpabl0.xyz/docs/contracts#endpoints). - **OAuth 2.1 (sign in from the app):** add the address above as a remote MCP server. The app registers itself, opens Agate's **Allow** page (`https://agate.elpabl0.xyz/app/connect?request=`), and you sign in and set a budget, a cap per trade, trades a day and an end date. Discovery: `/.well-known/oauth-protected-resource/mcp` and `/.well-known/oauth-authorization-server` on the same host. - **Connector URL:** on Agate's **Connected AIs** page (`https://agate.elpabl0.xyz/app/ai`, from the Account sheet, or **More** on a phone), connect an AI and copy the private URL it shows once. Add that URL as a remote MCP server; no further sign-in. Treat it like a password: anyone with it can use that connection until you disconnect it (connect again for a new one). ## Per app Checked against the live server on Oct 8 2026 (Claude in use since Oct 4): | App | OAuth | Connector URL | | --- | --- | --- | | Claude Code | `claude mcp add --transport http agate https://agate-1.tailf06dd7.ts.net/mcp`, then `/mcp` to sign in | `claude mcp add --transport http agate ` | | Claude.ai | Settings, Connectors, Add custom connector: the `/mcp` address | the URL in the same field | | Codex CLI | `codex mcp add agate --url https://agate-1.tailf06dd7.ts.net/mcp`, then `codex mcp login agate` | `codex mcp add agate --url ` (connects and lists the tools; no trade checked yet) | | Hermes Agent | not on Hermes v0.8.0, which hands only the host to the MCP SDK, so the SDK refuses a `/mcp` resource; newer Hermes keeps the full address (upstream issue 16015, not checked here yet) | `mcp_servers: agate: url: ` in `~/.hermes/config.yaml`; `hermes mcp test agate` lists the tools | | OpenClaw | no OAuth for MCP servers | `openclaw mcp set agate '{"url":"","transport":"streamable-http"}'` (set `transport`) | | opencode | `"mcp": {"agate": {"type": "remote", "url": "
/mcp"}}` in `opencode.json` (not checked yet) | the same with the URL | | Cursor, ChatGPT, VS Code | add the `/mcp` address as a remote MCP server (not checked yet) | the URL as a remote server | A Claude Code plugin with the Agate skill is in `agents/claude-plugin` (set `AGATE_MCP_URL`). What the two CLIs print (Oct 10 2026, in a fresh config): ```text $ claude mcp add --transport http agate https://agate-1.tailf06dd7.ts.net/mcp Added HTTP MCP server agate with URL: https://agate-1.tailf06dd7.ts.net/mcp to local config $ claude mcp list agate: https://agate-1.tailf06dd7.ts.net/mcp (HTTP) - ! Needs authentication ``` "Needs authentication" is expected: in Claude Code, `/mcp`, then **agate**, opens the Allow page in your browser. ```text $ codex mcp add agate --url https://agate-1.tailf06dd7.ts.net/mcp Added global MCP server 'agate'. Detected OAuth support. Starting OAuth flow… Authorize `agate` by opening this URL in your browser: https://agate-1.tailf06dd7.ts.net/authorize?response_type=code&client_id=agt_client_...&scope=mcp ``` Opening that URL leads to Agate's Allow page; once you allow, `codex mcp list` shows the server as logged in. Any other client that speaks Streamable HTTP takes the same two fields: ```json { "mcpServers": { "agate": { "type": "http", "url": "https://agate-1.tailf06dd7.ts.net/mcp" } } } ``` In Claude Code the tools then show as `mcp__agate__get_prices`, `mcp__agate__open_long` and so on. ## Then ask - "What's the H100 price on Agate, and where does it come from?" - "Quote a $50 H100 November long." - "Open a $50 H100 November long, paid daily." - "Keep my H100 hedge going into next month." Every trade shows on the AI's page in **Connected AIs** with its transaction, and above the cap the AI sends you an approval link instead of trading. The tools: [MCP tools](https://agate.elpabl0.xyz/docs/mcp-tools). A guide written for the agent itself: [For agents](https://agate.elpabl0.xyz/docs/agents). ## If it fails | What you see | Why | What to do | |---|---|---| | reads work, trade tools are missing | a connector URL past its end date | connect again with a new end date | | the Allow page opens on an old address | an app saved the address from before Oct 10 | nothing: it redirects to `/app/connect` by itself | Every `401` and `429` the server answers, and every refusal rule: [Errors](https://agate.elpabl0.xyz/docs/errors#mcp-connection). ## Disconnect On **Connected AIs**, **Disconnect** stops an AI at once: Agate stops signing for it, its tokens and connector URL die, its autopilot stops, and the pocket's dollars can be taken back. # For agents Source: https://agate.elpabl0.xyz/docs/agents # You trade inside the limits; the person holds the money and the keys. You are an AI agent, and a person connected you to Agate. This page says what you can do for them, what must go back to them, and what never goes through the chat. ## If you only read one line **Call `my_limits` before trading, pass an `idempotency_key` to every money tool, report only transaction hashes a tool returned, hand the person the approval link when a trade is above the cap, and never ask for the connector URL, a sign-in code or a passkey in chat.** ## What Agate is, in one paragraph Agate is an open onchain price for renting a GPU for an hour, one number per GPU per day, and monthly markets on it. A **Long** locks what the person pays for compute in a month; a **Short** locks what they earn from it. Every token is fully backed: it exists only when someone locks the month's ceiling in dollars, so no one can owe more than they put in. Everything runs on Monad testnet with test dollars that have no value. Details: [The monthly market](https://agate.elpabl0.xyz/docs/the-market). ## How you are connected Agate is a remote MCP server at `https://agate-1.tailf06dd7.ts.net/mcp` ([Connect an AI](https://agate.elpabl0.xyz/docs/connect-an-ai)). Your connection trades from a **pocket**, a separate account holding only the budget the person gave you, inside four limits: the budget, a cap per trade, a number of trades in any 24 hours, and an end date. Agate's server checks each limit before anything is signed, and the pocket's session key checks them again onchain ([AI pockets and limits](https://agate.elpabl0.xyz/docs/ai-pockets)). ## A trade, step by step 1. `my_limits`: is the connection `live`, how much is in the pocket, what is the cap, how many trades are left? 2. `get_prices` with the GPU: today's price, the open months, each month's floor, ceiling, bid and ask. 3. `quote`: what the trade gets now, and the most it can win or lose by the month's end. Tell the person. 4. The trade (`open_long`, `open_short`, ...), with an `idempotency_key` you make up once for this trade. 5. Read the answer's `status`: - `done`: report the `tx_hash` and the `explorer` link it returned. - `sent`: not seen landing yet. Call `activity`, never the trade again with a new key. - `needs_approval`: give the person the `approve_url`, then poll `approval_status`. - `refused`: read the `rule` ([Errors](https://agate.elpabl0.xyz/docs/errors#mcp-refusals)) and tell the person what it means. A sized hedge: "I rent 8 H100s through November" is `size_for { gpus: 8, days: 30 }` (5,760 GPU-hours), then a `quote` for that size. If its cost is above the cap, that is one trade above the cap: call the trade (it answers `needs_approval`) or `request_approval`, and hand the person the link. Never break it into trades under the cap. ## What you can do - Read prices, sources, months, books and the person's portfolio while the connection lasts (through a connector URL, also past the end date; an OAuth connection ends with it, and a disconnect ends either outright). - Open and close Longs and Shorts, paid daily or at the end, from the pocket, inside the limits. - Roll a Long into the next month (`roll_long`), or set autopilot to do it before each close (`keep_hedge_going`). - Take the pocket's test dollars once every 24 hours (`get_test_dollars`). - Ask for a trade above the cap (`request_approval`). ## What must go back to the person | Step | Why it is theirs | Where they do it | |---|---|---| | A trade above the cap | only they can spend past the limit they set | the approval link, `https://agate.elpabl0.xyz/app/approve?request=` (15 minutes) | | More budget, a higher cap, a later end date | the limits are theirs | connect you again from **Connected AIs** in the app | | Signing in, a code, a passkey | it proves who they are | the app, never the chat | | Collecting at the month's end | the payouts go to their main account | **Collect** in the app's Positions, or the SDK's `settle` or `claim` | | Disconnecting you | their call at any time | **Disconnect** on **Connected AIs** in the app | ## Never - Never ask for the connector URL in chat, and never repeat it: it works like a password. - Never ask for a sign-in code, a passkey, a seed phrase or a private key. Agate never needs one from you. - Never split a trade to stay under the cap. Ask for approval instead. - Never report a transaction hash a tool did not return, and never call a trade done before `status: "done"`. - Never retry a money tool with a new `idempotency_key` after `sent`: check `activity` first. - Never present test dollars as money, or a trade as investment advice. ## Read more, machine-readable These docs are also served for agents: `https://agate.elpabl0.xyz/llms.txt` (an index, one line per page), `https://agate.elpabl0.xyz/llms-full.txt` (every page in one file) and `https://agate.elpabl0.xyz/docs/raw/.md` (one page as markdown, for example `/docs/raw/mcp-tools.md`). Fetch them again before relying on what you read earlier: limits and months change. Every tool, parameter and answer: [MCP tools](https://agate.elpabl0.xyz/docs/mcp-tools). # How the price is made Source: https://agate.elpabl0.xyz/docs/the-price # One number per GPU per day, made in the open. The Agate index is one number per GPU per day: what it costs to rent that GPU for an hour on demand, taken from the clouds' own public price pages, combined in the open and written onchain on Monad. This page is the method in full: what is read, how a day's price is computed, who checks it, and what happens when something goes wrong. The contracts enforce every rule below; nothing here depends on trusting a person to type a number. Live values: the app's **Index** page, or `GET https://agate.elpabl0.xyz/api/v1/prices` ([Developer API](https://agate.elpabl0.xyz/docs/api)). ## 1. What the number is For each GPU: the **posted on-demand list price per GPU-hour**, in US dollars, excluding VAT. - **The product:** the exact GPU in its SXM form (H100, H200, B200, B300, A100 80GB); L40S, which only exists as a PCIe card, in PCIe. Never PCIe variants of the others, NVL racks, or other chips. - **The price class:** on-demand only. Never spot, preemptible, reserved or committed, cluster, serverless or marketplace prices. - **The instance:** the per-GPU price of the 8-GPU on-demand instance, or the 1-GPU one when a cloud has no 8-GPU instance; never 2- or 4-GPU sizes. A price per instance is divided by its GPU count (8 GPUs at $49.24 an hour is $6.16 per GPU-hour, rounded to the cent, halves up). - **Dates:** a price shown "from date X" counts from 00:00 UTC on X. - **Availability:** a row shown sold out, waitlisted, "contact sales" or "coming soon" counts as no price that hour. - **Sanity bounds:** a value outside $0.10 to $1,000 per GPU-hour counts as no price. - **No memory in the readers:** they read and report. No averaging, smoothing or filtering happens before the contract. All arithmetic is in whole numbers (millionths of a dollar on a cent grid); there are no floating-point steps. ## 2. The sources The clouds' own pricing pages, one vote per company. Today's panels: | GPU | Counted | Reserve | |---|---|---| | H100 | Verda, Nebius, Lambda, CoreWeave, Civo | Hyperstack | | H200 | Verda, Nebius, CoreWeave, Civo, Hyperstack | | | B200 | Verda, Nebius, Lambda, CoreWeave, Hyperstack | | | B300 | Verda, Nebius, Civo | Hyperstack | | A100 | Verda, Lambda, CoreWeave | Hyperstack | | L40S | Verda, CoreWeave, Civo | | - **Odd counts on purpose.** The price is a median; with an even number of sources it would be the mean of the two middle ones, which a single source can move. A **reserve** source is registered but not counted, and steps in to keep the count odd if a counted one leaves. - **Who is never read:** clouds that asked us not to read them, and public price trackers. Trackers are used only to check our readings (section 6), never as an input. - Every source's day price is published beside the index price, in the app and onchain. ## 3. A day's price Days are UTC days. Each cloud's page is read once an hour (24 readings a day) by each of two independent writers. 1. **Each cloud's day price** is the average of its readings that day, and needs at least **12 of the 24**. 2. **The day's index price** is the **median across companies** of those day prices, to the cent. 3. **A cloud that goes dark** (fewer than 12 good readings) is held at its last day price for up to **5 days**, then leaves the median. It comes back on its first good day. 4. **A new source joins only on the 1st of a month**, so a panel never changes in the middle of a month that is being traded. 5. **Status:** each day is labelled by how many companies were fresh that day: FULL (5 or more), DEGRADED (3 or 4), DEMO (fewer). On Monad testnet the index runs under a DEMO label with a minimum of one fresh source to close a day; a mainnet index would require at least three. ## 4. From readings to a final price ``` the clouds' pages, read hourly | \ writer 1: Chainlink CRE workflow writer 2: standby watcher: its own hourly reading of the same pages | / | v v v AgateIndex keeps each writer's readings apart <------- attester: countersigns or replaces a changed day | guardian (a person): can veto a day before it is final v day closes 1 h after it ends -> final 6 h later (unchanged) or only once countersigned (changed) ``` - **Two writers, kept apart.** The primary writer is a Chainlink CRE workflow: each run fetches every page through CRE's HTTP capability, the nodes agree on each parsed number, and it reports through Chainlink's forwarder. A standby writer reads the same pages on its own. The contract keeps each writer's readings separately and computes the day from **one** writer's readings, never a mix. - **Close:** one hour after the day ends (01:00 UTC) the day is closed, and the contract computes the price itself from the stored readings. - **Final:** - If nothing changed (same price, same sources), the day becomes **final 6 hours later** (about 07:00 UTC). - If anything changed, it becomes final **only when a second, independent key countersigns** that exact record: the attester, which judges it against the watcher's own readings of the same pages, or a guardian. The attester can instead **select** the other writer's record of the same day when that one is right. - **Only final days count.** Markets read only final days. ## 5. When something goes wrong - **A wrong day:** a guardian (a person) can veto a day before it is final; the day is then recomputed. A veto can only hit the exact record the guardian checked. - **A misbehaving writer:** a guardian can suspend it; the other writer carries on. - **No usable data:** a day with no quorum is **carried** after 24 hours at the day before's price, labelled "carried, unverified" in the app and `CARRIED` onchain. A changed record nobody countersigns is dropped after 7 days. - **Bounded delay:** with a person acting, no day becomes final later than two days after it ends. - **Markets never get stuck:** a market day with no final price 60 days after it ended takes the last value that market applied, so every month settles. ## 6. Watching the readers, and changing them - **Page check:** every hour each reading is compared with what public trackers list for the same cloud and GPU; a gap above 10% raises an alert for a person to look at. It catches the failure every reader shares: a parser quietly reading the wrong cell. - **When a cloud changes its page:** a repair agent drafts a new reader, and a person approves it. The change is queued publicly onchain with its reason and takes effect only after **48 hours**, at the start of a day. Days already recorded never change. - **Other changes** to the index (new GPUs aside) go through the same 48-hour public queue. ## 7. What a month pays Each monthly market reads the index's final day prices for that month. Each day's price is kept inside the month's floor and ceiling, and the month's token pays the average of those 30 (or 28 to 31) days. The floor and ceiling are fixed when the month is listed, from five final days of the index: the rule and a worked example are in [The monthly market](https://agate.elpabl0.xyz/docs/the-market#the-floor-and-the-ceiling). ## 8. Check it yourself - **Onchain:** the index contract on Monad testnet is [`0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36`](https://testnet.monadexplorer.com/address/0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36). Each day emits `DayClosed` (price, status, fresh companies) and `RecordSlots` (every source's day price and whether it counted); `Attested`, `Vetoed`, `RecordReplaced` and `DayCarried` record every check. - **API:** `GET /v1/prices/{gpu}` gives each source's price beside the median, and the daily history. Each source row also carries `page`: the sha256 of the exact bytes of that cloud's page as the watcher fetched it that day, and when, so anyone holding a saved copy of the page can hash it and confirm it is the very page the price was checked against. - **Code:** the readers and the recipe in `wall/packages/sources`, the contract in `contracts/src`. One real day, H100 on Oct 9 2026 (day id 20735), checked from a terminal: ```sh curl -s https://agate.elpabl0.xyz/api/v1/prices/H100 | jq -c '[.date, .price, [.sources[] | [.company, .price]]]' ``` ```text ["2026-10-09",3.99,[["Verda",3.92],["Nebius",4.5],["Lambda",3.99],["CoreWeave",6.16],["Civo",2.99],["Hyperstack",null]]] ``` Five companies counted (Hyperstack is the panel's reserve, not counted that day). Sorted, their day prices are $2.99, $3.92, **$3.99**, $4.50, $6.16: the median is $3.99. The contract says the same: ```sh cast call 0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36 "finalFix(bytes32,uint32)(bool,uint32,uint8,uint8,bool,bool)" \ 0x12aa97fa8c2e1cc1914a2e4d86b36c7b36fdccec7c4caacb5f202ccc6d9be955 20735 --rpc-url https://testnet-rpc.monad.xyz ``` ```text true 3990000 [3.99e6] 2 4 false false ``` Final (`true`), $3.99 (millionths of a dollar), status `2` (DEGRADED, see below), 4 companies fresh (enough clean readings that day), 1 held (counted at its last good day price, rule 3 above), not late, not incomplete. The day was closed by the CRE writer in transaction [`0x67a75408...`](https://testnet.monadexplorer.com/tx/0x67a754089eb2117e7b76a17c6c58467178322d66b6771804631245f35aefef87) (block 69,688,641), whose `DayClosed` and `RecordSlots` events carry the same numbers per source. | `status` | Name | Meaning | |---|---|---| | 0 | NONE | no record | | 1 | FULL | 5 or more companies fresh | | 2 | DEGRADED | 3 or 4 companies fresh | | 3 | DEMO | fewer than 3 (allowed only on testnet) | | 4 | CARRIED | no usable data: the day before's price, carried | Each GPU's `gpuId` is the keccak256 of its spec string (H100: `cast keccak "H100-SXM/on-demand-list/neocloud/v1"`), checked at deploy (`contracts/script/DeployIndex.s.sol`); the six, from `contracts/script/config/testnet-production.json`: | GPU | `gpuId` | |---|---| | H100 | `0x12aa97fa8c2e1cc1914a2e4d86b36c7b36fdccec7c4caacb5f202ccc6d9be955` | | H200 | `0xf7b3c4797305bd1433be196119ae5d6df4a433cffbf8d02c22048cc3a487b30d` | | B200 | `0x0a5bf357b491308f9e8b00f22d9d58b1c984046be5b4a94a21a59038b996dd27` | | B300 | `0x08c6236b69837cbbc194f0e5543b52ec92d53b309e164e1139b0076f2151b07f` | | A100 | `0x32422c52fa2c8e908a3d943000e08e47ac121b194f11f4d58f0149ef008418de` | | L40S | `0x5d0a54c25c386ef135340ebc802b2bc2538004e5538d436114a5b3c9398b30e4` | ### Check any day yourself The steps above check one day by hand. The SDK does the same for any day, reading only the chain: the source writer's readings of that day as the index stores them (`readings(gpuId, day, writer)`: each cloud's sum and count of hourly readings, kept for ever), then the rules of section 3 (each cloud's average to the cent, at least 12 readings, the hold for up to 5 days, the median across companies), then a comparison with the stored record, its digest included. Which clouds were being held, and at what price, depends on the days before, so it replays every day from the GPU's first one the same way and reports any that disagree. ```sh git clone https://github.com/s0nderlabs/agate && cd agate && bun install && cd client bun run check-day H100 2026-10-09 # leave out the date for the newest final day ``` ```text H100 on 2026-10-09 (index day 20735), final, DEGRADED Recomputed from Monad Testnet (chain 10143), index 0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36, source writer 0xf0be5c7461c0743acde590a22bccb66fc2112335 company readings day price counted Verda 24 $3.92 yes, at its day price Nebius 0 - yes, at its last good day price $4.50 (under 12 readings) Lambda 24 $3.99 yes, at its day price CoreWeave 23 $6.16 yes, at its day price Civo 24 $2.99 yes, at its day price Hyperstack 0 - no Median of the 5 counted: $3.99 Stored $3.99, recomputed $3.99: MATCH (price, status, counts and the record's digest) Replayed the 5 earlier days from 2026-10-04 for the held prices: each matches its record ``` In code it is `agate.checkDay({ gpu: "H100", date: "2026-10-09" })` ([SDK](https://agate.elpabl0.xyz/docs/sdk#check-any-day)), which returns the stored and the recomputed price, whether they match, and each source's inputs. It uses the public RPC unless `AGATE_RPC_URL` names another. It is not in the npm release yet: `@s0nderlabs/agate` gets it in its next version, so until then run it from a clone as above. On Oct 11 2026 every final day so far matched: Oct 4 to 10, all six GPUs, 42 of 42 days. What it checks is the arithmetic from the stored readings; whether each reading matched the cloud's page is what the attester (section 4) and the page check (section 6) watch. The hourly readings themselves are in each writer's `ReadingsPosted` events. ## 9. Why these rules Each rule above was chosen against the alternatives, from how existing benchmarks and settlement contracts work, from published research and failures, and from Agate's own tests. Where a rule rests only on Agate's own reasoning and tests, this section says so. | Rule | Why | What it rests on | |---|---|---| | **The median across companies, not the average** | An average moves with every input, so one wrong or dishonest source moves the price. A median stays inside the range of the honest sources until half of them are wrong. In Agate's test the median held with 2 bad inputs of 5 and 3 of 7; an average held with none. | Hampel (1971), [A General Qualitative Definition of Robustness](https://doi.org/10.1214/aoms/1177693054); Eisl, Jankowitsch and Subrahmanyam (2017), [The Manipulation Potential of Libor and Euribor](https://doi.org/10.1111/eufm.12126), which finds that alternative fixings "could significantly reduce the effect of manipulation"; the New York Fed's SOFR is a (volume-weighted) median; Agate's own test | | **An odd number of sources** | With an even count a median is the mean of the two middle values, so a single source can move it again. | MakerDAO's [median contract](https://github.com/makerdao/median) refuses an even quorum | | **One vote per company, and no trackers as inputs** | Feeds that copy each other are one opinion. Counting six price trackers as six votes moved one day's median by 6.6% in Agate's test, and an error they share moves the price instead of being outvoted. | Agate's own test; the Synthetix sKRW incident (2019), where two feeds of one wrong price were averaged | | **One price class only (on-demand list prices)** | A median needs inputs that measure the same thing. Mixed with other price classes, the middle can jump with no price having changed. | Eskandari et al. (2021), [SoK: Oracles from the Ground Truth to Market Manipulation](https://doi.org/10.1145/3479722.3480994) | | **A plain average inside the day, with no "must last 24 hours" rule** | A rule that only counts a price once it has persisted can be gamed by flickering the page: in Agate's test four of seven attack patterns moved one source's month by 13% to 14.5% under that rule, and none under a plain average of the day's readings. | Mackinga, Nadahalli and Wattenhofer (2022), [TWAP Oracle Attacks: Easier Done than Said?](https://eprint.iacr.org/2022/445); the CME CF Bitcoin Reference Rate (medians inside a slice, a mean across slices); Agate's own test | | **"Fresh" means read that day, not "the value changed"** | List prices are unchanged on 98.4% to 99.7% of days in Agate's data, so a reader that silently stopped looks exactly like an honest unchanged price unless each day needs its own readings. | Agate's own data and reasoning | | **A dark source is held 5 days, then leaves** | Holding a short time keeps one outage from moving the price; leaving after it keeps a dead source from voting for ever. | No source prescribes 5. The nearest practice is ISDA's 2005 Commodity Definitions (at most 5 days of disruption) and the LME's rules; the number is Agate's choice | | **A minimum number of fresh sources, with a label below it** | A benchmark should say what the least data it will publish on is, and what happens below that. | IOSCO [Principles for Financial Benchmarks](https://www.iosco.org/library/pubdocs/pdf/IOSCOPD415.pdf) (2013), Principle 11; ISDA's reference-dealer fallback (at least three quotations) | | **Values outside $0.10 to $1,000 count as no price; nothing is ever clamped into range** | A guard that quietly changes a number is itself a price source. Lending protocols lost money when a hard-coded floor or a rate limit substituted its own value for the market's. | The Venus and Blizz losses (2022); Aave's CAPO post-mortem (2026); the Moonwell cbETH mispricing (2026) | | **Sources join or leave only on an announced date** | People holding a month's market must know in advance what will be measured. | IOSCO Principle 12 (advance notice and an exact effective date); EU Benchmarks Regulation, Article 13 | | **A waiting period, and a second key that can stop a price but never write one** | A stolen writer key alone must not be able to make a price count, and a checker must not become a second writer. | MakerDAO's [Oracle Security Module](https://github.com/makerdao/osm) (a delay, `stop`, `void`); in Agate's test a per-day limit on one key still let a stolen writer move 87% to 98% of the maximum over a month | | **A changed day needs a countersign; an unchanged one only waits** | Most days nothing changes, so the second check is spent where the risk is. | Agate's own reasoning and tests; no outside source | | **A final day is never restated** | Contracts that have paid out cannot be re-run. | CME Rule 812; the ICE Swap Rate's no-republication policy; IOSCO Principle 11 | | **A month pays the plain average of its days** | A renter pays every day, so the month's average is what a month of renting costs, and a wrong day moves it by only one part in the month's days. | All 14 monthly-average contracts Agate read settle this way, including NYMEX's [H100 rental futures filing](https://www.cftc.gov/filings/ptc/ptc08112615405.pdf) (Aug 2026) and ISDA's 2005 Commodity Definitions; Duffie and Stein (2015), [Reforming LIBOR and Other Financial Market Benchmarks](https://doi.org/10.1257/jep.29.2.191): a wider averaging window is harder to manipulate | | **Every calendar day counts** | GPUs are rented on weekends too. A business-day average left up to 7.14% of a price step unhedged for a renter billed daily in Agate's test. | CBOT 30-Day Fed Funds and CME One-Month SOFR futures count every calendar day; Agate's own test | | **Each day is kept inside the floor and ceiling before averaging** | The month's payout then never leaves the range the locked dollars can pay, with no early stop or knock-out when a day touches an edge. | CME's degree-day weather contracts (a daily floor at zero, a monthly sum); products that stopped on a touch ended badly (MacroShares Oil, 2008) | What the research does not settle: a median only promises a value inside the honest sources' range, not the right one (Breidenbach et al., the [Chainlink 2.0 whitepaper](https://research.chain.link/whitepaper-v2.pdf), section 7.2.2), and the checking rules of the attester and the watcher are Agate's own design, tested by Agate and by no outside party. ## 10. Limits, stated - These are **posted list prices**, not prices clouds actually transact at. Clouds change their list prices in steps, so the index moves rarely and in steps (for example, an H100 list price can sit unchanged for weeks). - On testnet the index runs under the DEMO label with a minimum of one fresh source. - The CRE workflow runs in Chainlink's simulator (`cre workflow simulate --broadcast`), which is one node: until a deployment on Chainlink's network, the CRE writer's agreement step is not decentralized. The second writer and the attester's countersign still apply. # The monthly market Source: https://agate.elpabl0.xyz/docs/the-market # You trade a month's average price, fully paid for up front. Each GPU has a market per month. Its token pays that month's average index price; you can lock that price in from either side, close early at the market price, or be paid day by day. Numbers on this page are the live H100 November 2026 market (floor $1.95, ceiling $8.00, 30 days). ## One token per GPU per month The H100 November 2026 token (`H100-NOV26`) pays, for each GPU-hour it covers, November's average H100 price: the average of November's 30 final daily prices, each kept inside the month's range. One token is one GPU-hour. Two months are open at a time, this month and the next, each with its own Kuru order book. The **market price** of a month (its bid, ask and last trade) is what traders expect that average to be; the **index price** is today's real price. They differ, and the gap is the market's view. ## Long and Short | | Long | Short | |---|---|---| | What you do | buy the token at the market price | put up the ceiling and sell the token at the market price | | What you get at the end | the month's average, per GPU-hour | the ceiling minus the month's average, per GPU-hour | | What you have locked | what you pay for compute | what you earn from compute | | Good for | renters, AI companies | GPU owners, clouds | Example, 100 GPU-hours. **Long** at $4.03 costs $403: if November averages $4.50 you get $450 (+$47); at $3.50 you get $350 (-$53). **Short**: you put up $800 and get $395 back at once (at $3.95), so $405 is in; if November averages $3.50 you get $450 back (+$45), at $4.50 you get $350 (-$55). Either way the Short earned $3.95 an hour. ## The floor and the ceiling Each month is listed with a range, fixed at listing and never changed. Every daily price is kept inside it before it counts. The rule (`contracts/src/market/lib/BandLib.sol`, called from `AgateFactory`): 1. **The reference** is the average of the index's five final days just before the 1st of the month **before** the listed month (for November: Sep 26 to Sep 30). An index that started later than that has no five such days, so it uses its first final day five times instead (the month's `bandGrade` is then `SEEDED`; `RULE` is the normal case, `STALE` when one of the five days was carried). 2. **The floor** is half the reference, rounded **down** to $0.05. 3. **The ceiling** is twice the reference, rounded **up** to $0.05. The index started on Oct 4 2026, so November's ranges are seeded from Oct 4's final prices: | Month | Oct 4 price | Half, then down to $0.05 | Twice, then up to $0.05 | |---|---|---|---| | H100 November | $3.99 | $1.995 → **$1.95** | $7.98 → **$8.00** | | H200 November | $4.85 | $2.425 → **$2.40** | $9.70 → **$9.70** | | B200 November | $7.07 | $3.535 → **$3.50** | $14.14 → **$14.15** | The rounding always widens the range, never narrows it. December, listed on Nov 1, is the first month with the normal rule (Oct 27 to Oct 31). Read a month's terms onchain with `terms()` on its series ([Contracts](https://agate.elpabl0.xyz/docs/contracts)). The range is what lets every trade be paid for up front: - the most a Long can lose is the price paid minus the floor ($4.03 - $1.95 = $2.08 an hour); - the most a Short can lose is the ceiling minus the sale price ($8.00 - $3.95 = $4.05 an hour); - outside the range a hedge covers only up to the edge. ## What backs a token A token is not a GPU-hour stored somewhere: like power futures, it is a cash-settled claim on a price. But it only comes into existence when someone locks the month's ceiling in dollars ($8.00 a GPU-hour for H100 November). That one deposit makes two sides: the token, worth the month's average, and a short position, worth the ceiling minus that average. Together they always pay exactly the $8.00 that was locked, so every dollar any holder can be paid is already in the contract. No margin calls, no liquidations, and no one can owe more than they put in. ## Pay me daily Tick **Pay me daily** and each day of the month pays its share as soon as that day's price is final, instead of everything at the end: - **Long, paid daily:** the floor comes back at once ($1.95 an hour), then each day pays (that day's price - $1.95) / 30. At $3.99 that is about $0.068 an hour each day: $6.80 a day on 100 GPU-hours. - **Short, paid daily:** each day pays ($8.00 - that day's price) / 30. At $3.99 that is about $0.134 an hour each day: $13.37 a day on 100 GPU-hours. Over the month it adds up to the same as waiting for the end. A daily payer bot sends each day's payments; anyone can also claim, with the SDK's `claim` and `claimDaily`, the series contract's `claim`, or **Collect** on a holding in the app's **Positions** (a daily share waiting, or a final month's payout). An order that rests in the book (a limit that does not fill at once) is paid at the month's end, not daily. Closing a paid-daily Long early first puts back what it has paid you so far, and the sale of its GPU-hours covers it in the same transaction: the sale less what you were already paid comes back to your balance. ## Closing early and limit orders Closing a Long sells it at the market price; closing a Short buys the token back. Your gain or loss is the difference from where you opened. In **Pro**, limit orders rest in Kuru's book at your price: a Long rests as a bid, a Short as an ask (pairs are minted for it); cancelling returns the funds to your account, and a cancelled Short's pairs can be redeemed for the ceiling. ## When the month ends 1. Trading stops on the month's last day. 2. The last day's price becomes final about six hours after the month ends (the day closes at 01:00 UTC on the 1st, final at about 07:00 UTC); the average is fixed. 3. A plain Long collects the average, a plain Short the ceiling minus the average (`settle`); daily positions are already paid. The next month is already open, so a hedge can roll on. An AI on autopilot does this for you ([AI pockets and limits](https://agate.elpabl0.xyz/docs/ai-pockets)). ## If the price stops Markets read only final days. A day with no usable data is carried at the day before's price; a market day still without a final price 60 days after it ended takes the last value that market applied, so every month settles and no money is stuck ([How the price is made](https://agate.elpabl0.xyz/docs/the-price)). # Accounts and gas Source: https://agate.elpabl0.xyz/docs/accounts # No wallet to install, no gas to pay. People sign up with a passkey alone, an email code or Google. Behind that sits a real onchain account, a smart account on Monad, whose transactions Agate pays for. The account layer is Dynamic for sign-in and embedded wallets, and ZeroDev for the smart accounts and gas sponsorship. ## Who holds what | Wallet | What it is | Signs | |---|---|---| | main | the person's first Dynamic embedded wallet (TSS-MPC, made at sign-in) | everything the person does in the app | | main account | a Kernel smart account (index 0) owned by main | holds the money and the positions | | Assistant | a second embedded wallet, created and delegated to Agate only when the person connects an AI | nothing but an AI pocket's session key | | pocket | a Kernel smart account (index 1, 2, ... one per AI) owned by main | holds only that AI's budget | The main wallet is never delegated. Smart accounts are Kernel v3.1 on EntryPoint 0.7 (ERC-4337). ## Gas Every user operation is sponsored through ZeroDev under the project's chain policy (at most 2 MON a user operation, 1,000 a day; the heaviest measured is 0.77 MON, a first trade that installs a pocket's permission). A trade is one batched user operation: an approval when one is short, then the router call. When the sponsor refuses, nothing is sent and the app says so. ## Passkey accounts **Continue with a passkey** makes an account from a passkey alone, with no email. The browser's own dialog makes the passkey (Touch ID, Face ID, Windows Hello or a phone). Agate's server checks it and hands the app a sign-in token that lives 60 seconds; Dynamic checks that token against Agate's public key and opens a normal session (Dynamic's Bring Your Own Auth). The main wallet, the 10,000 test dollars and everything after are the same as for any account. - **Next time, in the same browser,** the same button signs in. **In another browser or on a new device,** tap **I already have a passkey**: it uses a passkey synced there, or one on your phone. The main button there would make a second, empty account. - **The passkey is the way in, and backup codes are the way back.** One saved to iCloud Keychain or Google Password Manager follows you to your other devices. When the account is made, the app shows **ten backup codes** once (`XXXX-XXXX`, with Copy and Download). If every copy of the passkey is lost, **Sign in**, then **Lost your passkey? Use a backup code**: the code makes a new passkey on the same account, and is used up. **Make new backup codes** on the Account sheet replaces the set and asks for your passkey first. Losing the passkey and every code loses the account and its test dollars ([Limits](https://agate.elpabl0.xyz/docs/limits)). - **An email or Google account stays separate.** The two are never joined. A passkey added earlier to an email or Google account still signs that account in: tap **I already have a passkey**, then **Continue**. - Dynamic needs an email on every account, so a passkey account carries a placeholder address that takes no mail. The app never shows it ([Built on](https://agate.elpabl0.xyz/docs/built-on#dynamic-sign-in-and-wallets)). - Agate's server keeps no secrets, only public keys and keyed hashes of the backup codes, so its database alone cannot sign anyone in. A code is 40 bits; guessing is held to 5 tries a minute per network. ## Step-up Sensitive actions (connecting a new AI, delegating the Assistant) ask the person to confirm again: a passkey account with its passkey, an email or Google account with a code. An email or Google account can also add a passkey from the Account sheet; once it has one, every confirmation goes through it instead of a code. ## Test dollars The test dollar (tUSD, 6 decimals) has an open faucet: 10,000 per account every 24 hours of real time, counted from that account's last drip (`dripPeriod` is 86,400 s on `AgateDollar`), not per calendar day. The app takes the first drip at the first sign-in. Too soon, the faucet refuses with `DripTooSoon` and the app says when the next one opens. Pocket budgets move from the main account to the pocket and back. ## Measured on Monad testnet Oct 4 2026, n = 1 to 3 each: | Step | Time | |---|---| | sign-in with a code | 1.7 s | | main wallet created | 9.8 s | | a sponsored user operation from the main account | 6.0 s | | pocket permission signed, pocket funded, grant accepted | 9.6 s | | an AI trade from the pocket, signed by the delegated Assistant | 5.6 to 7.6 s | Passkey accounts, Oct 11 2026, in a test browser with a software passkey (so no time for a person in the dialog): | Step | Time | |---|---| | passkey dialog to a signed-in session | 2.8 to 3.8 s | | main wallet created | 7 to 9 s | | confirming again with the passkey (step-up) | 2.4 s | ## Signed out Signed out, the app shows the live prices, the index and the order books, the same as signed in. The trade button reads **Sign in to trade**, and an order that fills at once goes on after you sign in; in **Simple** the ticket sizes it against the 10,000 test dollars a first sign-in brings. Positions and Connected AIs ask you to sign in before they show what you hold or which AIs you connected. # AI pockets and limits Source: https://agate.elpabl0.xyz/docs/ai-pockets # An AI can only spend what you put in its pocket, the way you allowed. When you connect an AI, Agate makes it a **pocket**: a separate smart account that holds only the budget you give it. The AI trades from the pocket, never from your main account, and every trade is checked against your limits by Agate's server and again by the chain itself. ## The limits you set | Limit | Meaning | |---|---| | Budget | the dollars moved into the pocket: the hard total the AI can ever use | | Cap per trade | the most one trade may spend (or lock, for a Short) | | Trades a day | how many operations the pocket may make in any 24 hours (1 to 50) | | End date | after it, the permission stops working onchain (at most 90 days) | The budget must be above zero and the cap per trade at most the budget. One live AI per pocket: a second AI gets the next pocket. Profits and payouts always go to your **main account**, never back to the AI. ## Where the limits are checked 1. **Agate's server** refuses by rule name before anything is signed: over the cap (`over_per_trade_cap`), over the budget (`budget_left`), out of trades (`daily_limit`), past the end date (`grant_expired`), disconnected (`grant_revoked`), price outside the band (`above_band`, `below_band`). Every rule: [Errors](https://agate.elpabl0.xyz/docs/errors#mcp-refusals). 2. **The chain itself**: the pocket carries a session key that the smart account enforces. It may only call Agate's router, only up to the cap, only with your main account as the payee, only N operations in any 24 hours, only until the end date, and never sign anything else. Measured refusals with the server bypassed: over the cap `CallViolatesParamRule()`, a transfer `InvalidCallData()`, a fourth operation in a day `RateLimited()`. 3. **Dynamic** holds the Assistant as an MPC wallet, so no single machine has its key. A third gate is built and waiting: Agate's server answers Dynamic Transaction Review, approving only signatures it built in the last minute for a live connection inside the pocket's limits. Dynamic has not yet turned Transaction Review on for Monad testnet, so today the first two checks are the ones that apply. ## Above the cap An AI that wants to do more than its cap does not split the trade. It calls `request_approval` (or a trade tool answers `needs_approval` by itself) and hands you a link, `https://agate.elpabl0.xyz/app/approve?request=`; you approve and run the trade from your main account in the app, or deny it. A request lives 15 minutes, and moves through `pending`, then `approved` or `denied`, then `done` (with its transaction) or `failed`; one nobody answers is `expired`. The AI reads the state with `approval_status`. ## Autopilot "Keep my hedge going": `keep_hedge_going { gpu }` asks Agate to roll the pocket's Long of that GPU into the next listed month by itself, before the held month closes, in parts under the cap. `lead_minutes` (default 60, from 10 to 10,080, a week) sets how long before the close it acts. One order per GPU; asking again returns the existing one. Each roll counts as a trade. `stop_keep_hedge_going` ends it. ## Disconnect On **Connected AIs**, **Disconnect** ends a connection everywhere it could still act: Agate stops signing for it, its pending approvals and autopilot orders end, its connector URL and OAuth tokens die, and by default the app moves the pocket's dollars back to your main account. Disconnecting the last connected AI also revokes the Assistant with Dynamic, which stops its signing at once. ## AI companies with their own wallet An AI company's agent does not need a person's pocket: it can hold its own Dynamic server wallet (TSS-MPC) that owns a gas-sponsored smart account, and trade with the SDK's plan builders as single user operations. Agate's reference agent (`server/src/company/agent.ts`) keeps one rule, hold N GPU-hours of the next open month, buying the shortfall in parts while the best ask is under a ceiling, and journals every decision with its transaction hash. # Developer API Source: https://agate.elpabl0.xyz/docs/api # Every number on the screen, as JSON. The developer API (v1) serves read-only market data for Agate: the open onchain price of renting a GPU for an hour, and the monthly markets that settle on it. No key, no sign-up. JSON over HTTPS. - **Base URL:** `https://agate.elpabl0.xyz/api` (the same API also answers at `https://agate-1.tailf06dd7.ts.net`, Agate's server, without the `/api`) - **Spec:** [`/v1/openapi.json`](https://agate.elpabl0.xyz/api/v1/openapi.json) (OpenAPI 3.1) - **Units:** prices are US dollars per GPU-hour, sizes are GPU-hours, times are ISO 8601 in UTC. - **Network:** Monad testnet (chain 10143). Every token is a test asset with no monetary value. - **Limits:** 120 requests a minute per IP. Through `agate.elpabl0.xyz/api` callers share Vercel's edge addresses, so the limit there is 1,200 a minute per edge address. Over it: `429` with `retry-after: 60`. - **Freshness:** prices, months and books come from one server read every few seconds (`readAt`, `ageMs` on each answer); trades are cached 15 s, candles 60 s. Answers carry a short `cache-control`. - **Stability:** v1 only ever adds fields. A rename or removal would be v2. ```sh curl https://agate.elpabl0.xyz/api/v1/prices ``` ## Endpoints Paths below are relative to the base URL. | Endpoint | What you get | |---|---| | `GET /v1` | This list, the chain and the index contract | | `GET /v1/prices` | Today's price of every GPU (H100, H200, B200, B300, A100, L40S), with each cloud's own price | | `GET /v1/prices/{gpu}` | One GPU, plus its daily history | | `GET /v1/markets` | Every month on sale: floor, ceiling, best bid and ask, last trade, open interest, contracts | | `GET /v1/markets/{gpu}/{month}` | One month, with its order book on Kuru | | `GET /v1/markets/{gpu}/{month}/trades?limit=50` | Recent trades, newest first (limit 1 to 200) | | `GET /v1/markets/{gpu}/{month}/candles` | Hourly candles from the month's first trade | | `GET /v1/status` | When each price was last made final and how many sources it counted | | `GET /v1/openapi.json` | The OpenAPI description | `{gpu}` is any case (`h100` works). `{month}` is `YYYY-MM`, for example `2026-11`. ## The price Each GPU's price is the median across companies of the clouds' own public price pages, read every hour. A day's price is published at the day's close and becomes final six hours later; a changed price also needs a second, independent reader's countersign. `GET /v1/prices/H100`: ```json { "gpu": "H100", "price": 3.99, "date": "2026-10-07", "previousPrice": 3.99, "change": 0, "finalAt": "2026-10-08T07:02:46Z", "nextCloseAt": "2026-10-09T01:00:00Z", "nextFinalAt": "2026-10-09T07:00:00Z", "sourcesCounted": 5, "panelSize": 6, "sources": [ { "company": "Verda", "price": 3.83, "counted": true, "reserve": false, "page": { "sha256": "2660a4cf0c8c4413d313715c93bbeb0c102545aad1ea018ad300980b96267840", "fetchedAt": "2026-10-07T23:18:04Z", "price": 3.85 } }, { "company": "Lambda", "price": 3.99, "counted": true, "reserve": false, "page": { "sha256": "cf517d807032af0c53b0c8608c794896d6a425b5c8b669e8b9a5ee2668826e71", "fetchedAt": "2026-10-07T23:18:04Z", "price": 3.99 } }, { "company": "Hyperstack", "price": null, "counted": false, "reserve": true, "page": null } ], "tradable": true, "history": [{ "date": "2026-10-07", "price": 3.99, "status": "final" }], "beforeOnchain": [{ "date": "2026-10-03", "price": 3.99, "status": "final" }] } ``` - `price` is `null` before a GPU's first final day; `previousPrice` and `change` are `null` until there is a day before it. - A `reserve` source counts only when a main source fails. - `page` is the page behind a source's price: the watcher's newest clean reading of that cloud's price page on `date` (the watcher is the independent reader the attester checks each day against). `sha256` is the fingerprint of the exact bytes it fetched, `fetchedAt` when, and `price` the price read from that one page (the source's own `price` is the day's average, so the two can differ when a cloud changed its price that day). `page` is `null` for a source without a price, a source held from an earlier day, or when the page had no clean reading that day. It is kept by Agate's server, not onchain. - `history` is the onchain record (`status: "carried"` means no new reading that day, the day before carried). - `beforeOnchain` holds days our logger recorded before the index went onchain: shown for context, nothing settles on them. - `tradable: false` marks the price-only GPUs (B300, A100, L40S today). ## The months One token per GPU per month pays that month's average price, kept between the month's `floor` and `ceiling`. Going Long buys the token; going Short locks the ceiling and sells it. `GET /v1/markets/H100/2026-11`: ```json { "gpu": "H100", "month": "2026-11", "symbol": "H100-NOV26", "phase": "trading", "floor": 1.95, "ceiling": 8, "days": 30, "startsAt": "2026-11-01T00:00:00Z", "closesAt": "2026-12-01T00:00:00Z", "bid": 3.95, "ask": 4.03, "last": 4.03, "lastTradeAt": "2026-10-08T04:22:06Z", "openInterest": 8364, "contracts": { "series": "0xbc28...c577", "token": "0x0fbf...ce28", "kuruMarket": "0xf245...3a9c" }, "book": { "bids": [{ "price": 3.95, "size": 1000 }], "asks": [{ "price": 4.03, "size": 1000 }], "spread": 0.08 } } ``` - `phase`: `upcoming` (not listed yet, see `opensOn`), `trading` (listed, month not started), `paying` (inside the month), `settled`. - `bid` / `ask` are `null` when that side of the book is empty; `last` is `null` before the first trade. - `floor`, `ceiling` and `contracts` are `null` while a month is `upcoming`. Once listed, `contracts` are the month's onchain addresses on Monad testnet; `kuruMarket` is its Kuru order book. ## Errors Every error is JSON, `{ "error": "" }`, with one of these statuses: | Status | `error` | Where | `retry-after` | |---|---|---|---| | `400` | `gpu must be one of H100, H200, B200, B300, A100, L40S` | any `{gpu}` path | | | `400` | `month is YYYY-MM, for example 2026-11` | any `{month}` path | | | `404` | ` has no market on sale (see /v1/markets)` | `/v1/markets/{gpu}/{month}` and below | | | `404` | `no price yet` | `/v1/prices/{gpu}` | | | `404` | `no such endpoint: (see /v1 for the list)` | a path the API does not have, such as `/v1/price`, or a method other than GET | | | `429` | `over 120 requests a minute; wait a minute` (`over 1200` through the app's address) | everywhere | `60` | | `503` | `the markets could not be read right now; try again shortly` | prices, markets, books | `10` | | `503` | `trades could not be read right now; try again shortly` | `/trades` | `15` | | `503` | `candles could not be read right now; try again shortly` | `/candles` | `60` | | `503` | `{ "ok": false, "error": "the markets could not be read right now" }` | `/v1/status` | `10` | Trades and candles answer `503`, never an empty list, while the indexer is unreachable. Wait the `retry-after` seconds, then ask again. CORS is open (`*`, GET only), so a browser page anywhere can call the API. ```sh curl -s https://agate.elpabl0.xyz/api/v1/markets/H100/2026-12 ``` ```text {"error":"H100 has no 2026-12 market on sale (see /v1/markets)"} ``` ## Other ways in - **Onchain:** the index contract and a Chainlink-style feed per GPU ([Onchain](https://agate.elpabl0.xyz/docs/onchain)). - **TypeScript:** the SDK reads all of this, and builds every trade, straight from the chain and the indexer ([SDK](https://agate.elpabl0.xyz/docs/sdk)). - **AI agents:** Agate's MCP server ([Connect an AI](https://agate.elpabl0.xyz/docs/connect-an-ai), [MCP tools](https://agate.elpabl0.xyz/docs/mcp-tools)). # Onchain feeds Source: https://agate.elpabl0.xyz/docs/onchain # Any contract on Monad can read the price of a GPU-hour. Any contract on Monad can read what it costs to rent a GPU for an hour. Two ways: a Chainlink-style feed per GPU (easiest, and drop-in for code that already reads Chainlink), or the index contract itself (every detail of every day). Both are on Monad testnet (chain 10143). How the price is made: [How the price is made](https://agate.elpabl0.xyz/docs/the-price). ## The feeds (Chainlink AggregatorV3 views) One feed per GPU, `src/examples/AgatePriceFeed.sol`, deployed Oct 8 2026 (`contracts/deployments/10143-feeds.json`): | GPU | Feed | |---|---| | H100 | [`0xC68687dd7d7b40281FB07E9006538aa45fAF3D98`](https://testnet.monadexplorer.com/address/0xC68687dd7d7b40281FB07E9006538aa45fAF3D98) | | H200 | [`0x53ce1c4B23991164e3BF2EDB99C53fbf2016621D`](https://testnet.monadexplorer.com/address/0x53ce1c4B23991164e3BF2EDB99C53fbf2016621D) | | B200 | [`0x84A20500923a8A9d5d5b7D6920A09c6f62A56A2E`](https://testnet.monadexplorer.com/address/0x84A20500923a8A9d5d5b7D6920A09c6f62A56A2E) | | B300 | [`0xE28b9C672Dd4080C52F86E4F9fF218171c164De6`](https://testnet.monadexplorer.com/address/0xE28b9C672Dd4080C52F86E4F9fF218171c164De6) | | A100 | [`0x9dEdC0e77AFd2D8483fE86eA910f29ee972F559d`](https://testnet.monadexplorer.com/address/0x9dEdC0e77AFd2D8483fE86eA910f29ee972F559d) | | L40S | [`0xE85Ae44fA84EdE4B86DB276C0481EB15942A4b7f`](https://testnet.monadexplorer.com/address/0xE85Ae44fA84EdE4B86DB276C0481EB15942A4b7f) | - `latestRoundData()`: the newest **final** day. `answer` is US dollars per GPU-hour with **6 decimals** (`3990000` = $3.99), `roundId` is the index's day id, `startedAt` the day's start, `updatedAt` when it became final. - `getRoundData(day)`: any final day; reverts with `NoFinalPrice()` for a day with no final price. - A carried day answers with the carried price, but its `updatedAt` is when a price was last really computed (the newest computed final day before it), not when it was carried, so a staleness check like the one below catches a run of carried days. - `decimals()` is 6, `description()` names the GPU. A contract that values something in GPU-hours, for example a loan backed by GPU rental income: ```solidity interface IAggregatorV3 { function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80); } contract RentalIncomeValuer { IAggregatorV3 public immutable h100 = IAggregatorV3(0xC68687dd7d7b40281FB07E9006538aa45fAF3D98); /// dollars (6 decimals) that `gpus` H100s earn over `gpuHours` hours at today's agate price function income(uint256 gpus, uint256 gpuHours) external view returns (uint256) { (, int256 price,, uint256 updatedAt,) = h100.latestRoundData(); require(block.timestamp - updatedAt < 3 days, "agate price is stale"); return uint256(price) * gpus * gpuHours; } } ``` Check from a terminal: ```sh cast call 0xC68687dd7d7b40281FB07E9006538aa45fAF3D98 "latestRoundData()(uint80,int256,uint256,uint256,uint80)" \ --rpc-url https://testnet-rpc.monad.xyz ``` ```text 20735 [2.073e4] 3990000 [3.99e6] 1791504000 [1.791e9] 1791615640 [1.791e9] 20735 [2.073e4] ``` Round 20735 is the day id: days since Jan 1 1970, so Oct 9 2026. `3990000` with 6 decimals is $3.99 per GPU-hour. `1791504000` is the day's start (Oct 9 00:00 UTC) and `1791615640` when it became final (Oct 10 07:00:40 UTC). From TypeScript, with viem alone: ```ts import { createPublicClient, http, parseAbi } from "viem"; const feed = parseAbi(["function latestRoundData() view returns (uint80, int256, uint256, uint256, uint80)"]); const pub = createPublicClient({ transport: http("https://testnet-rpc.monad.xyz") }); const [day, answer] = await pub.readContract({ address: "0xC68687dd7d7b40281FB07E9006538aa45fAF3D98", abi: feed, functionName: "latestRoundData" }); console.log(Number(day), Number(answer) / 1e6); // 20735 3.99 ``` ## The index itself [`AgateIndex` at `0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36`](https://testnet.monadexplorer.com/address/0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36) (interface `contracts/src/interfaces/IAgateIndex.sol`). Each GPU is a `gpuId` (every one is listed in [How the price is made](https://agate.elpabl0.xyz/docs/the-price#8-check-it-yourself)); days are UTC day ids (`dayId(timestamp)`). - `finalFix(gpuId, day)` returns `(ok, value, status, fresh, late, incomplete)`: the day's final price in millionths of a dollar, its status (`1` FULL, `2` DEGRADED, `3` DEMO, `4` CARRIED) and how many companies were fresh. This is what the monthly markets settle on. A worked call with its output: [Check it yourself](https://agate.elpabl0.xyz/docs/the-price#8-check-it-yourself). - `record(gpuId, day)` returns the whole record (who wrote it, when it was posted, final and countersigned). - Events: `DayClosed`, `RecordSlots` (each source's day price), `Attested`, `RecordReplaced`, `Vetoed`, `DayCarried`. ## Tests `contracts/test/examples/AgatePriceFeed.t.sol`: unit tests over set records, and a fork test against the live index (`MONAD_FORK_URL=https://testnet-rpc.monad.xyz forge test --match-contract AgatePriceFeedForkTest`). # SDK Source: https://agate.elpabl0.xyz/docs/sdk # The library Agate's own app runs on. `@s0nderlabs/agate` is Agate's data and trading layer: every screen of the app reads through it, and Agate's server builds every AI trade with it. One dependency, [viem](https://viem.sh). It works in Node 18+, browsers (any bundler) and Bun, and returns plain numbers: dollars per GPU-hour and GPU-hours, never raw units. ## Install ```sh npm install @s0nderlabs/agate viem # or: bun add @s0nderlabs/agate viem ``` Then `import { createAgateClient } from "@s0nderlabs/agate"`. The package is published from `client/` in this repository (`bun run pack:npm` builds it); inside the repository's own packages the same code is the workspace package `@agate/client`. ## Create a client ```ts import { createAgateClient } from "@s0nderlabs/agate"; const agate = createAgateClient({ graphqlUrl: "https://agate-1.tailf06dd7.ts.net:8443/v1/graphql", // history, trades, candles; null = chain only }); ``` A first script, `read.mjs` (`node read.mjs` or `bun read.mjs`): ```js import { createAgateClient } from "@s0nderlabs/agate"; const agate = createAgateClient({ graphqlUrl: null }); // chain only: no indexer needed for this read const h100 = await agate.getMarket("H100"); console.log(`${h100.gpu} $${h100.price} per GPU-hour, final day ${h100.priceDate}`); for (const s of h100.sources) console.log(` ${s.family.padEnd(10)} $${s.price.toFixed(2)}`); ``` ```text H100 $3.99 per GPU-hour, final day 2026-10-09 Verda $3.92 Nebius $4.50 Lambda $3.99 CoreWeave $6.16 Civo $2.99 ``` (Read on Oct 10 2026 over the public RPC, in a few seconds.) | Option | Default | Meaning | |---|---|---| | `rpcUrl` | the public Monad testnet RPC | one URL, or a comma list tried in order (a URL that fails or is rate limited passes the call on) | | `graphqlUrl` | `NEXT_PUBLIC_AGATE_GRAPHQL_URL` if set; else `http://localhost:8080/v1/graphql` outside a browser or on a page served from localhost; else `null` | Agate's indexer, one URL or a comma list (a URL that fails rests 60 s while the next answers); `null` reads the chain only (no candles, fills or listing times). The public one: `https://agate-1.tailf06dd7.ts.net:8443/v1/graphql` | | `snapshotUrl` | none | Agate's server markets snapshot, one request for every market and book | | `deployments`, `factory` | Monad testnet, `"real"` | which contracts (the `"demo"` factory runs a fast-clock month) | | `publicClient` | made from `rpcUrl` | an existing viem client | ## Read | Call | Returns | |---|---| | `getMarkets()` | every GPU: today's price, the day before's, each source, the daily history, the open months | | `getMarket(gpu)` | one GPU, the same shape | | `book(gpu, month)` | the month's Kuru order book: bids and asks in dollars per GPU-hour and GPU-hours | | `recentFills(gpu, month, n)` | recent trades, newest first, with transaction hashes | | `candles(gpu, month)` | hourly candles from the month's first trade | | `ticker()` | each GPU's change and each month's change over 24 hours | | `getWallet(address)` | test dollars, every position (Long, Short, pay me daily), what is claimable, what rests at Kuru | | `openOrders(address)` | the account's resting limit orders | | `checkDay({ gpu, date })` | one day's index price recomputed from the chain alone, beside the stored one, with each source's inputs (below) | All shapes are in `types.ts` (`Market`, `Series`, `IndexDay`, `Book`, `Fill`, `Candle`, `Position`, `Wallet`, ...). ### Check any day ```ts const day = await agate.checkDay({ gpu: "H100", date: "2026-10-09" }); console.log(day.stored, day.recomputed, day.match); // 3.99 3.99 true ``` `checkDay` reads the day's stored readings and replays the index's rules on them, from the GPU's first day, then compares the result with the stored record, digest included (`DayCheck` in `types.ts`; the method: [Check any day yourself](https://agate.elpabl0.xyz/docs/the-price#check-any-day-yourself)). In `client/`, `bun run check-day H100 2026-10-09` prints the same as a short report. It is not in the npm release yet: `@s0nderlabs/agate` gets it in its next version. ## Trade, two ways Every action exists as a **write**, which sends it with a viem `WalletClient`, and as a **plan**, which returns the exact call batch for a smart account or a server to send as one user operation. Both run the same checks first (the band, a thin book, a price that moved, the balance, slippage) and put the bound onchain inside the router call. | Action | Write | Plan | |---|---|---| | test dollars | `drip` | `planDrip` | | Long | `buyLong` | `planBuyLong` | | close a Long | `sellLong` | `planSellLong` | | Long, paid daily | `openLongDaily` | `planOpenLongDaily` | | close a daily Long | `closeLongDaily` | `planCloseLongDaily` (`upFront: "paid"` puts back only what it was paid) | | Short (with or without pay me daily) | `openShort` | `planOpenShort` | | close a Short | `closeShort` | `planCloseShort` | | roll a Long into the next month | | `planRollLong` | | claim daily payouts | `claim`, `claimDaily` | `planClaim`, `planClaimAll` | | settle after the month | `settle` | `planSettle` | | limit order | `placeLimit` | `planPlaceLimit` | | cancel limit orders | `cancelLimit` | `planCancelLimit` | | take funds back from Kuru | `withdrawMargin` | `planWithdrawMargin` | | mint or redeem pairs | `mintPairs`, `redeem` | `planRedeem` | ```ts import { buyLong, planBuyLong, readResult } from "@s0nderlabs/agate"; await buyLong(agate, walletClient, { gpu: "H100", month: "2026-11", dollars: "100", maxPrice: "4.10" }); const plan = await planBuyLong(agate, account, { gpu: "H100", month: "2026-11", dollars: "100", maxPrice: "4.10" }); // send plan.calls as one user operation, then read what it did from the receipt's logs: const done = readResult(agate, plan.summary.action, receipt.logs); ``` Amounts are decimal strings (`"100"`, `"4.10"`) and never floats; prices are on the $0.01 grid, sizes in whole lots of 0.0001 GPU-hour. ## Errors Every failure is a `WriteError` with a `stage`, a `reason`, a sentence a person can read (`message`), and, once sent, the transaction `hash`. Errors are matched by name, not by `instanceof`, so a second copy of viem in an app does not break them. A write can be several transactions (an approval, then the trade; a claim across months): the `stage` names the step that failed, and `WriteError.txs` lists the ones already sent. Every stage and reason, what each means and what to do: [Errors](https://agate.elpabl0.xyz/docs/errors#sdk-errors). A bad amount (a float, too many decimals, off the lot grid) throws `AmountError` before any read. # MCP tools Source: https://agate.elpabl0.xyz/docs/mcp-tools # Seventeen tools: read, trade inside the limits, ask when above them. Connected through [Connect an AI](https://agate.elpabl0.xyz/docs/connect-an-ai), an AI app sees these tools. This page lists every one, its parameters and defaults, what it returns, and every refusal it can give. Reads always work; trades work only while the connection is live, from the pocket, inside its limits ([AI pockets and limits](https://agate.elpabl0.xyz/docs/ai-pockets)). Past the end date, a connector URL still answers the reads with its trade tools not listed; an OAuth connection stops answering within the hour (its token is not refreshed), so the person connects it again. Common types: `gpu` is one of `H100`, `H200`, `B200`, `B300`, `A100`, `L40S`; `month` is `YYYY-MM` (for example `2026-11`); dollars and GPU-hours are plain numbers (`100`, `24.5`); `idempotency_key` is any string of 8 to 100 characters. ## What the server tells the AI first Every connection starts with these instructions, word for word (`server/src/mcp/server.ts`): > agate makes the price of GPU compute tradable: a daily index of GPU-hour rental prices (H100, H200, B200 and more) > and monthly tokens that pay that month's average price. Long gains when GPU rent rises (a hedge for renters), Short > gains when it falls. Everything is on Monad testnet with test dollars. > > This connection is one person's AI connection. Trades run from their AI pocket (a separate account holding only the > budget they gave you), within a per-trade cap, a daily trade count and an end date; daily payouts always go to their > main account (what is already sure at opening comes back into the pocket at once). `my_limits` shows what is left; > check it before trading. followed by a paragraph listing the tools, and one with its rules: > Refusals name the rule (over_per_trade_cap, budget_left, daily_limit, grant_expired, price_moved, ...): read them > before retrying. Report only transaction hashes a tool returned. Give every money tool an idempotency_key so a retry > never trades twice. ## Which tool, when | The person asks | Call | |---|---| | "What's the H100 price, and where does it come from?" | `get_prices` with `gpu` | | "What would $50 of H100 November get me?" | `quote` | | "I rent 8 GPUs for 30 days: how big is the hedge?" | `size_for`, then `quote` | | "Lock in what I pay for H100 in November." | `my_limits`, `quote`, then `open_long` | | "Protect what my GPUs earn in November." | `my_limits`, `quote`, then `open_short` | | "Pay me as the month goes." | `open_long` or `open_short` with `pay_me_daily: true` | | "Close it." | `get_portfolio`, then `close_long`, `close_long_daily` or `close_short` | | "Keep my hedge going into next month." | `keep_hedge_going`, or `roll_long` once | | "Do it, even though it's above your cap." | `request_approval`, hand over the link, then `approval_status` | | "What did you do?" | `activity` | ## Read ### `get_prices` Today's index price per GPU and the tradable months with their best bid and ask and their range. | Parameter | Type | Default | Meaning | |---|---|---|---| | `gpu` | gpu | every GPU | one GPU only | Returns a list, one entry per GPU: `gpu`, `price` (`null` before the first final day), `priceDate`, `change` (from the day before), `clouds` (`"5 of 6"`: sources counted of the panel), `sources` (each cloud as `company`, with its own `price` that day, `counted` and `reserve`, the same rows as the developer API), `tradable`, and `months`, each with `month`, `symbol`, `phase`, `quote` (bid, ask, last), `floor`, `cap` (the ceiling), `openInterest` and `closesAt`. ### `quote` What a trade would do now, without trading. | Parameter | Type | Default | Meaning | |---|---|---|---| | `gpu` | gpu | required | | | `month` | month | required | | | `side` | `"long"` or `"short"` | required | | | `dollars` | number | required for a Long | what the Long spends | | `gpu_hours` | number | required for a Short | what the Short sells | A Long returns `gpuHours`, `avgPrice`, `mostYouCanLose`, `mostYouCanWin` and `band` (`lo`, `hi`). A Short returns `saleProceeds`, `collateral` (GPU-hours times the ceiling), `netCost`, `mostYouCanLose`, `mostYouCanWin` and `band`. Refuses `no_market` for a month with no book, `bad_input` without the amount its side needs. ### `size_for` GPU-hours for a rental: `gpus` (whole number) times `days` (whole number) times 24. Returns `{ gpus, days, gpuHours }`. ### `get_portfolio` No parameters. Returns `main` and `pocket`, each with `address`, `dollars` and `positions`. ### `my_limits` No parameters. Returns the connection (`id`, `label`, `status`, `pocket`, `mainAccount`, `budget` and `perTradeCap` in millionths of a dollar, `tradesPerDay`, `expiresAt`), `live`, `pocketDollars`, `perTradeCapDollars`, `tradesLeftToday`, the `autopilot` orders on, and `allowed`: what the pocket may call, contract by contract. ### `activity` | Parameter | Type | Default | Meaning | |---|---|---|---| | `limit` | whole number, 1 to 100 | 30 | how many entries | Newest first: each entry has `at`, `what` (for example `pocket.trade`, `pocket.refused`, `approval.requested`, `autopilot.started`) and its details, trades with their transaction hashes. ### `approval_status` | Parameter | Type | Meaning | |---|---|---| | `request_id` | UUID | from `request_approval` or a `needs_approval` answer | Returns `request_id`, `status` (`pending`, `approved`, `denied`, `done`, `failed` or `expired`), `summary`, `result` (with the transaction hash once `done`) and `expiresAt`. Refuses `not_found` for a request of another connection. ## Trade (from the pocket) Every trade tool answers with one of these: | `status` | Meaning | Fields | |---|---|---| | `done` | landed and succeeded | `action`, `summary`, `tx_hash`, `user_op_hash`, `explorer`, `seconds` | | `reverted` | landed, and the chain refused it | the same | | `sent` | sent, not seen landing yet | `user_op_hash`, `detail`: check `activity` before trying again | | `needs_approval` | above the cap: nothing was sent | `request_id`, `approve_url`, `summary`, `note` | | `refused` | a rule stopped it before anything was signed | `rule`, `detail` (and `quote` for a price refusal) | | `error` | anything else | `message` | A second call with an `idempotency_key` already used returns the first answer, marked `idempotent_replay: true`. One connection runs one trade at a time. Every trade carries a bound inside the router call, so the chain refuses a worse fill. Without `max_price` or `min_price` the bound is the fresh quote less 1% slippage, and a buy that would average above the ceiling or a sale below the floor is refused before sending (`above_band`, `below_band`): a sure loss at the month's end. ### `open_long` Buy a month's GPU-hours for dollars. Above the cap it becomes `needs_approval`. | Parameter | Type | Default | Meaning | |---|---|---|---| | `gpu`, `month` | | required | | | `dollars` | number | required | what it spends, at most the cap | | `pay_me_daily` | boolean | `false` | pay each day as it becomes final, to the main account; the floor for the days left comes back to the pocket at once | | `max_price` | number | none | the most per GPU-hour on average | | `idempotency_key` | string | none | | ### `open_short` Sell a month's GPU-hours. The pocket puts up the ceiling for each GPU-hour; the sale's proceeds come back to it at once. Collateral above the cap, or more GPU-hours than the connection's per-short limit, becomes `needs_approval`. | Parameter | Type | Default | Meaning | |---|---|---|---| | `gpu`, `month` | | required | | | `gpu_hours` | number | required | what it sells | | `pay_me_daily` | boolean | `true` | paid daily to the main account; `false` pays at the month's end | | `min_price` | number | none | the least per GPU-hour on average | | `idempotency_key` | string | none | | ### `close_long` Sell GPU-hours the pocket holds: `gpu`, `month`, `gpu_hours` (required), `min_price`, `idempotency_key`. ### `close_long_daily` End pay-me-daily Long positions early: `gpu`, `month`, `position_ids` (1 to 20, from `get_portfolio`), `min_price`, `idempotency_key`. ### `close_short` Buy Short positions back: `gpu`, `month`, `position_ids` (1 to 20), `max_dollars` (the most it may spend), `idempotency_key`. Spending above the cap becomes `needs_approval`, checked again once the buy-back is priced. ### `roll_long` Sell a held month and buy a later month of the same GPU with the proceeds, in one transaction (both or neither). | Parameter | Type | Default | Meaning | |---|---|---|---| | `gpu` | gpu | required | | | `from_month`, `to_month` | month | required | | | `gpu_hours` | number | all held | | | `min_price` | number | none | guards the sale | | `max_price` | number | none | guards the buy | | `idempotency_key` | string | none | | Proceeds above the cap are refused (`over_per_trade_cap`): roll in parts. ### `get_test_dollars` Take the pocket's test dollars from the faucet (once every 24 hours): `idempotency_key`. ### `request_approval` Ask the person to approve a trade the AI may not make alone. | Parameter | Type | Meaning | |---|---|---| | `action` | `"open_long"`, `"open_short"` or `"close_short"` | the trade | | `args` | object | that tool's parameters | | `note` | string, at most 500 characters | why, shown to the person | Returns `needs_approval` with `approve_url` (`https://agate.elpabl0.xyz/app/approve?request=`). The request lives 15 minutes. Once approved it runs from the person's main account (a Short's close from the pocket, signed by the main wallet). ### `keep_hedge_going` Autopilot: roll the pocket's Long of a GPU into the next listed month before the held month closes, in parts under the cap. Each roll is a trade and counts against the day. | Parameter | Type | Default | Meaning | |---|---|---|---| | `gpu` | gpu | required | | | `lead_minutes` | whole number, 10 to 10,080 | 60 | how long before the close it rolls | One order per GPU: asking again returns the existing one (`already_on: true`). Returns `order_id`, `gpu`, `lead_minutes`, `status`. ### `stop_keep_hedge_going` `order_id` (UUID, from `keep_hedge_going` or `my_limits`). Positions stay as they are. Refuses `not_found` for an order of another connection. ## Refusals A refusal is `{ "status": "refused", "rule": "", "detail": "" }`, with the MCP error flag set. Nothing was signed or sent. Every rule, what triggers it and what to do: [Errors](https://agate.elpabl0.xyz/docs/errors#mcp-refusals). ## Rules for agents The rules the server sends are quoted at the top of this page. The full guide for an agent, with what must go back to the person: [For agents](https://agate.elpabl0.xyz/docs/agents). When people ask what they are buying, tell them what backs a token ([The monthly market](https://agate.elpabl0.xyz/docs/the-market)): a cash-settled claim on the month's average price, fully paid for up front. # Contracts and addresses Source: https://agate.elpabl0.xyz/docs/contracts # Every contract, on Monad testnet (chain 10143). Solidity 0.8.30 with Foundry, in `contracts/`. Addresses are in `contracts/deployments/10143.json` (the market), `10143-indexes.json` (the index) and `10143-feeds.json` (the example feeds). Explorer: [testnet.monadexplorer.com](https://testnet.monadexplorer.com). **Verified on Sourcify.** All 20 live contracts (the index and its four libraries, the factory, the router, the test dollar, each November series and token, and the six feeds) are verified on Sourcify with both the runtime and the creation code matching: look any address up at [sourcify.dev](https://sourcify.dev/#/lookup/0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36). The list is `contracts/deployments/10143-sourcify.json`. The status is `match` rather than `exact_match` because the build leaves the metadata hash out of the bytecode (`bytecode_hash = "none"`), so Sourcify matches the code itself. ## The price | Contract | Address | What it does | |---|---|---| | `AgateIndex` | [`0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36`](https://testnet.monadexplorer.com/address/0x419394b0Edf3d03164a7C06ea525cC1ED0e5Da36) | stores each writer's hourly readings, computes each day's price, final after 6 h or a countersign; the guardian's veto; the 48 h queue for changes | | `AgatePriceFeed` (example) | H100 [`0xC686...3D98`](https://testnet.monadexplorer.com/address/0xC68687dd7d7b40281FB07E9006538aa45fAF3D98), others in [Onchain](https://agate.elpabl0.xyz/docs/onchain) | a Chainlink-style feed per GPU over the index | `AgateIndex` keeps its storage and cheap views; its logic runs in four linked libraries (`IndexReports`, `IndexDays`, `IndexViews`, `IndexAdmin`). The CRE writer reports through Chainlink's forwarder (in simulation, the CRE simulation forwarder). ## The market | Contract | Address | What it does | |---|---|---| | `AgateFactory` | [`0xEdBE3e696944443bBCe7eb3CD04E626e9396a0b5`](https://testnet.monadexplorer.com/address/0xEdBE3e696944443bBCe7eb3CD04E626e9396a0b5) | lists a series per GPU and month and records its Kuru market | | `AgateRouter` | [`0x4F4C14E7421dA83C398e04e4b5CeA2543f903c9c`](https://testnet.monadexplorer.com/address/0x4F4C14E7421dA83C398e04e4b5CeA2543f903c9c) | one-call flows: Long, Short, pay me daily, close, roll, with the bound inside the call | | `AgateDollar` (tUSD) | [`0x3A0513b2A19EE92eb3f73Dd06EefEe4D477CbF38`](https://testnet.monadexplorer.com/address/0x3A0513b2A19EE92eb3f73Dd06EefEe4D477CbF38) | the test dollar, 6 decimals, 10,000 per account every 24 hours from its faucet | Each month is an `AgateSeries` (mint, redeem, pay me daily positions, daily sync, claim, settle) with its `AgateToken`: | Month | Series | Token | Kuru market | Range | |---|---|---|---|---| | H100 Nov 2026 | [`0xbc28...c577`](https://testnet.monadexplorer.com/address/0xbc28e45ede13d0bd61d78f6f3d9f6341b78fc577) | `0x0fbf...ce28` | [`0xf245...3a9c`](https://testnet.monadexplorer.com/address/0xf2455ab8bbb5f8fa82d2a626a56bd5df7ef43a9c) | $1.95 to $8.00 | | H200 Nov 2026 | [`0x7b97...c9d4`](https://testnet.monadexplorer.com/address/0x7b97b60f8993de841ebf95cc0ed4d20e0abbc9d4) | `0x082a...1277` | [`0x3704...b70b`](https://testnet.monadexplorer.com/address/0x37049b0dbc6a623beb50d545799d138ac91bb70b) | $2.40 to $9.70 | | B200 Nov 2026 | [`0x5bf2...7a52`](https://testnet.monadexplorer.com/address/0x5bf2839ce16c6f0d106df46e637fe09187f97a52) | `0xfe7c...2c7c` | [`0x30df...fcd1`](https://testnet.monadexplorer.com/address/0x30df9a641d1936cefe6e93f9dbd4cb6a0659fcd1) | $3.50 to $14.15 | The live list, including months opened later: `GET https://agate.elpabl0.xyz/api/v1/markets`. A month's terms onchain, H100 November's range in millionths of a dollar: ```sh cast call 0xbc28e45ede13d0bd61d78f6f3d9f6341b78fc577 \ "terms()((address,address,address,address,bytes32,bytes32,uint32,uint32,uint8,uint64,uint32,uint64,uint32,uint32,uint32,uint8,uint8,uint8,bool))" \ --rpc-url https://testnet-rpc.monad.xyz ``` Its 13th to 16th fields read `1950000`, `8000000`, `3990000` and `2`: the floor ($1.95), the ceiling ($8.00), the fallback start value ($3.99) and the band grade (`2`, SEEDED). The rule: [The monthly market](https://agate.elpabl0.xyz/docs/the-market#the-floor-and-the-ceiling). ## Kuru (the order book) Agate trades on Kuru V1 on Monad testnet (Agate's market maker can also quote Kuru Spot V2 books, and will once Kuru lists the November H100 token there): Router `0x7EFbE105Ca7415dE98F96622173458ac1c054630`, MarginAccount `0xd029C2D98ff85D8F64799017fE00a59B1159CE02`. Books use a price precision of 10^6 with a $0.01 tick, and sizes in lots of 0.0001 GPU-hour (10^4 per token) with a 1 GPU-hour minimum order (`contracts/src/market/MarketTypes.sol`). Agate calls Kuru through interfaces that declare only the functions it uses. ## Endpoints Every address Agate serves, in one place: | What | Address | |---|---| | The site | https://agate.elpabl0.xyz | | The app | https://agate.elpabl0.xyz/app | | These docs | https://agate.elpabl0.xyz/docs, as markdown at `/docs/raw/.md`, for agents at `/llms.txt` and `/llms-full.txt` | | Developer API | `https://agate.elpabl0.xyz/api/v1` (also `https://agate-1.tailf06dd7.ts.net/v1`) | | OpenAPI | https://agate.elpabl0.xyz/api/v1/openapi.json | | MCP server | `https://agate-1.tailf06dd7.ts.net/mcp` | | OAuth discovery | `https://agate-1.tailf06dd7.ts.net/.well-known/oauth-protected-resource/mcp`, `/.well-known/oauth-authorization-server` | | Passkey sign-in key (JWKS) | `https://agate-1.tailf06dd7.ts.net/.well-known/agate-jwks.json` | | Indexer (GraphQL, public, read-only, POST) | `https://agate-1.tailf06dd7.ts.net:8443/v1/graphql` (fixed), and the hosted copy the app asks first, `https://indexer.dev.hyperindex.xyz//v1/graphql` (its id changes on each redeploy: [Built on](https://agate.elpabl0.xyz/docs/built-on#envio-the-indexer)) | | Monad testnet RPC | `https://testnet-rpc.monad.xyz` (chain 10143) | `agate-1.tailf06dd7.ts.net` is Agate's own server, published through Tailscale Funnel. The app does not proxy MCP or OAuth, so AI apps use that address. ## Build and test ```sh cd contracts forge install --no-git foundry-rs/forge-std@v1.17.0 forge install --no-git OpenZeppelin/openzeppelin-contracts@v5.4.0 forge test # fork tests skip without MONAD_FORK_URL ``` Monad allows 128 KB of runtime code; local chains and tests match it (`code_size_limit = 131072`). # Errors and fixes Source: https://agate.elpabl0.xyz/docs/errors # Every error, its exact words, and what to do. This page lists every error Agate gives: the app's messages, the developer API's answers, the MCP refusals, the SDK's `WriteError`s and the contracts' reverts. One rule holds everywhere: a refusal **before sending** means nothing was sent and no money moved. An error after sending (an SDK `receipt` stage, an MCP `sent` or `reverted`), or an SDK error whose `txs` is not empty, needs a look at the chain before trying again. ## In the app The app words its own messages (`app/src/lib/account/errors.ts`); the sentences below are what it shows. | What you see | Why | What to do | |---|---|---| | no sign-in code arrives | the email is still on its way, or in spam | wait a minute, check spam, or use Google | | `That code doesn't match. Check the newest email from Agate and try again.` | a mistyped or older code | use the newest email's code | | `Your next 10,000 test dollars arrive .` | test dollars come once every 24 hours per account | wait until then | | `Agate couldn't pay the network fee this time. Nothing was sent. Try again in a minute.` | the sponsored-fee policy refused (2 MON a user operation, 1,000 a day) | try again in a minute | | a code or passkey prompt | connecting an AI or delegating the Assistant asks you to confirm again | confirm ([Accounts and gas](https://agate.elpabl0.xyz/docs/accounts#step-up)) | | `No passkey was made.` | the passkey dialog was closed before a passkey was made | **Try again**, **I already have a passkey**, or **Use your email instead** | | `No passkey signed you in.` | the dialog was closed, or the browser found no Agate passkey (it cannot tell which) | **Try again or use my phone**, **Make a new passkey**, or **Use your email instead** | | `This device already has a passkey for Agate. Sign in with it.` | this device already holds an Agate passkey | **Sign in with it** | | `This passkey is from the older sign-in, where a passkey was added to an email or Google account.` | this passkey belongs to an email or Google account | **Continue**: it signs that account in | | `That took too long. Try again.` | a passkey request lasts 5 minutes | try again | | `Too many tries from this network. Wait a minute, then try again.` | too many passkey requests from one network in a minute | wait a minute, or use Google or your email | | `Too many new accounts from this network. Try again in an hour.` | 5 new passkey accounts were made from this network in the last hour | **Use your email instead**, or try again in an hour | | `New passkey accounts are paused for today. Use Google or your email instead.` | the day's cap on new passkey accounts (150) is reached, or Dynamic's test environment is full (then Google and email fail too) | use Google or your email, or try tomorrow | | `Agate couldn't accept that passkey. Try again.` | Agate's server could not verify the passkey's answer | try again | | `Your passkey worked, but sign-in didn't finish. Try again.` | Dynamic did not finish the sign-in | **Try again**: the account now exists, so it signs in | | `That code doesn't work. Check it, or try another of your backup codes.` | the backup code is wrong, used, or replaced by a newer set | type it again, or use another of your codes | | `That isn't a backup code. They look like K7QD-9XMP: 8 letters and numbers.` | what was typed has the wrong shape | type the code as saved; case, spaces and the dash do not matter | | `No new passkey was made, so your code still works.` | the passkey dialog was closed while using a backup code | try again: the code was not used up | | `Agate can't be reached right now. Try again in a moment.` | Agate's server did not answer | try again in a moment | | `This browser can't use passkeys. Use Google or your email instead.` | the browser has no passkey support | use Google or your email, or another browser | | `Your passkey didn't confirm it. Try again, or Cancel.` | confirming again with a passkey did not go through | try again | | `Your passkey worked, but it didn't finish. Try again.` | confirming again: Dynamic did not finish | try again | | `It now fills GPU-hours at $

on average for $.` | the book moved between the quote and the send | look at the new numbers and confirm again | | `At prices can still pay, the book holds $ ( GPU-hours). The rest would buy above that.` | the book is thinner than your order | buy at most that, or wait for the maker to requote | | `At these prices this trade can only lose: the asks are above what can pay. Nothing was sent.` | buying above the ceiling can only lose | wait for a lower ask | | `At these prices this trade can only lose: the bids are below the least will pay. Nothing was sent.` | selling below the floor can only lose | wait for a higher bid, or hold to the end | | `This trade needs more test dollars than your account holds. Nothing was sent.` | not enough test dollars | trade less, or take the day's test dollars | | ` settles once every day is final. Nothing was sent.` | settle opens only after the month's last day is final | wait until about 07:00 UTC on the 1st | ## Developer API Every error, a path the API does not have included, is `{ "error": "" }` with `400`, `404`, `429` or `503`, and `429` and `503` carry a `retry-after`. The full table, sentence by sentence: [Developer API](https://agate.elpabl0.xyz/docs/api#errors). ## MCP connection What the server answers before any tool runs (`server/src/mcp/routes.ts`): | Status | `error` | Why | What to do | |---|---|---|---| | `401` | `missing credential` | no token and no connector URL | sign in (OAuth) or use the connector URL | | `401` | `invalid or expired access token` | the OAuth token ended or the connection passed its end date | sign in again (`/mcp` in Claude Code, `codex mcp login agate`) | | `401` | `unknown connection` | the connector URL is wrong | the person checks the URL they saved; a URL shows only once, so for a new one they connect the AI again from **Connected AIs** | | `401` | `this AI connection was disconnected: connect it again from Agate` | the person disconnected this connection (its URL is replaced and its OAuth tokens revoked); a tool call on it gets this sentence as the `grant_revoked` refusal instead (status `200`), since AI apps show a `401` as a connection error | the person connects the AI again from Agate | | `405` | `method not allowed` | a GET on the MCP address | MCP clients POST; this is not a page to open | | `413` | `payload too large` | a request body over the limit | send less in one call | | `429` | `rate limit exceeded for this connection` | more than 240 requests a minute on one connection | slow down | | `429` | `too many requests` | more than 30 wrong connector URLs a minute from one address | stop guessing | ## MCP refusals A tool refusal is `{ "status": "refused", "rule": "", "detail": "" }` with the MCP error flag set. Nothing was signed. | `rule` | Why | What to do | |---|---|---| | `over_per_trade_cap` | the trade, or a Short's collateral, is above the cap per trade; or a roll's proceeds are | trade less, roll in parts, or `request_approval` | | `budget_left` | the pocket does not hold enough dollars | trade less; only the person can add to the budget | | `daily_limit` | the connection used its trades of the last 24 hours (` of trades used in the last 24 hours`) | wait; `my_limits` shows what is left | | `grant_expired` | the connection is past its end date | the person connects it again | | `grant_revoked` | the person disconnected it | stop; nothing more can be done from it | | `above_band` | the buy would average above the ceiling, a sure loss | wait for a lower ask | | `below_band` | the sale would average below the floor, a sure loss | wait for a higher bid | | `price_moved` | the book moved between the quote and the send | `quote` again, then trade | | `thin_book` | the book holds less than the order within the band | trade the amount `detail` names, or wait | | `empty_book` | no asks at all | wait for the maker to quote | | `not_enough_tokens` | the pocket holds fewer GPU-hours than asked to sell or roll | `get_portfolio`, then a smaller size | | `drip_too_soon` | the pocket's test dollars were taken less than 24 hours ago | wait until the time in `detail` | | `sponsor_limit` | the network fee could not be sponsored right now | try later | | `bad_amount` | an amount with too many decimals, off the 0.0001 GPU-hour lot or the $0.01 price grid | round it | | `bad_input` | a `quote` without the amount its side needs | pass `dollars` for a Long, `gpu_hours` for a Short | | `no_market` | the month has no order book yet (a trade says ` has no Kuru market yet`) | `get_prices` lists the tradable months | | `parts_too_small` | a pay-me-daily Long too small for that many daily parts (`the size is too small for that many parts`) | buy more | | `refused` | a check with no rule of its own | read `detail` | | `not_found` | an approval or autopilot order of another connection, or none | use an id this connection got | | `not_allowed_contract`, `not_allowed_function` | a call the pocket may never make | only the trade tools trade | | `payee_must_be_you`, `approve_router_only`, `no_native_value` | a call that would pay someone else, approve another spender, or send MON | never; these protect the person | A month that is not listed at all, or a GPU with a price and no market, answers `status: "error"` with a `message` (` is not listed`, ` is price only: ...`), not a refusal. `status: "sent"` is not a refusal: the trade was sent and has not been seen landing yet. Check `activity` before trying again; the same `idempotency_key` returns the first answer. ## The Allow page When the person connects an AI, Agate's server refuses a connection that breaks a limit: | `error` | What to do | |---|---| | `the per-trade cap must be above 0 and at most the budget` | lower the cap or raise the budget | | `trades per day: 1 to 50` | choose 1 to 50 | | `the end date must be within 90 days` | choose an earlier end date | | `the Assistant is not delegated to agate yet (try again in a few seconds)` | wait a few seconds and allow again | | `pocket_in_use: this pocket already serves "