endline

Architecture

One contract inside NEAR Intents, plus a relay, a market maker and an oracle program.

Source: coming soon. Internal design notes are in docs/ in the repo.

Users fund a USDC balance in intents.near from any chain, buy with one signature, and are paid into the same balance after expiry and the dispute window. They can withdraw to any chain.

Components

ComponentCodeWhat it doesRun by
Options contractcontracts/options (Rust)The rules and the money: holds collateral, mints option tokens, settles, pays outNEAR, deployed once
intents.nearnear/intentsHolds every balance, settles trades atomically, cross-chain deposits and withdrawalsNEAR Intents team
Relayapps/relay (TypeScript)RFQ auction, submits matched trades, relays gasless collectsUs
Market makerapps/mm (TypeScript)Writes options, quotes, takes the other side, hedgesUs. Anyone can run another
Oracle WASMoracle/ (Rust, wasm32-wasip2)Median of 7 exchanges' 30-min averages, checked against DeribitOutLayer TEE (mainnet), our proposer (testnet)
Market listerapps/mm listKeeps the next 4 daily expiries (plus a 4-hourly one on testnet) listed with BTC/ETH calls and puts around spot, each capped two strike steps out, writes inventory, burns unsold pairs after the write cutoff and redeems shorts once finalUs, with the market maker's key
Testnet proposerapps/mm proposeRuns the pinned oracle WASM in wasmtime and proposes its price as the manual oracleUs, testnet only
Mainnet settlerapps/mm settleFrom 5 min after expiry, calls request_settlement every 10 min until a price is proposed or the oracle window closesUs, with the relayer's key, mainnet only
Settlement monitorapps/mm monitorChecks every proposed price against Deribit, flags missing prices, watches the contract's NEAR reserve and pending oracle and owner changesUs, read-only
Web appapps/web (React)Up/Down buying, positions, collect, depositsUs
SDKpackages/sdk (TypeScript)Series ids, payout math, fee-exact trade legs, intent payloads, signing, wire schemasLibrary

How they talk

web ──HTTP──▶ relay ◀──WebSocket── market maker ──▶ Deribit (prices), Hyperliquid (hedge)
 │              │
 │ sign         └─ execute_intents([mm half, user half]) ──▶ intents.near ◀──▶ options contract
 └──────────────────────────────────────────────────────────▶ (user deposits, balances)

options contract ── request_settlement ──▶ OutLayer TEE ── runs oracle WASM ──▶ 7 exchanges (+ Deribit check)

Flows

FlowSteps
Fund1Click deposit from any chain (the quote goes through the relay's POST /deposit-quote, which adds our partner key), or ft_transfer_call into intents → USDC in the user's intents balance
Write (market maker)Signs an intents transfer of USDC collateral (the most the options can pay) to the contract with {"action":"write"} → the contract mints long + short into its intents balance
Buy or sell to closeWeb asks the relay for a quote → market makers bid → user signs their half → relay submits both halves in one execute_intents → USDC and option swap atomically
SettleFrom 5 min after expiry our settler (mainnet) or anyone calls request_settlement → OutLayer runs the oracle → price proposed → final after the dispute window
CollectHolder sends longs back with {"action":"exercise"}, pre-signed at buy time (auto-collect) or via the Collect button. The relay submits it; the contract pays from locked collateral into the holder's intents balance

Money never leaves intents.near. User USDC and option tokens are intents balances, collateral is the contract's own intents balance, and payouts are intents ledger moves. There are no bridges, and we hold nothing.

Why our own relay

The official NEAR Intents quote bus needs a partner key and KYC for market makers, and doesn't list NEP-245 option tokens. Our relay does the same job for options and pays gas, so users never need NEAR.

Environments

MainnetTestnet (live)
Intentsintents.nearintents.near-options-dev.testnet, a copy of the exact mainnet wasm
Options contractNot deployedopt3.near-options-dev.testnet
CollateralNative USDCMock USDC (6 decimals)
ExpiriesDaily 08:00 UTC (Deribit's grid)Every minute
Write and sell-back cutoff30 min before the end60 s before
Dispute window1 h2 min
Funding1Click from any chain100 test USDC a day from Add funds (relay POST /faucet)
Oracleoutlayer.nearoutlayer.testnet. Manual oracle: near-options-dev.testnet, driven by the proposer

Testnet ids are in deploy/testnet.json. RPC: https://rpc.testnet.fastnear.com.

Adding an asset

WhereChange
ContractThe owner calls add_underlying(symbol, {index, decimals, min_write}). index is the Deribit index name, e.g. sol_usdc
Oracle WASMAdd one row to MARKETS in oracle/src/sources.rs, rebuild, host, set_oracle_wasm
Market maker, relay, webNothing. They read assets and series from the contract

Deribit must list options on the asset, since the market maker prices from Deribit's volatility, and at least 3 of the oracle's 7 exchanges must list a spot pair.

On this page