Greek Options API
HTTP API for listing Greek.fi option markets on Ethereum mainnet, reading indicative prices, preparing wallet approvals, and requesting firm executable RFQ quotes backed by Bebop settlement.
Using an AI coding agent? Point your agent directly at the plain-text and machine-readable files served from this site: llms.txt (index), llms-full.txt (complete guide in Markdown), reference.md (Markdown alias), and openapi.json (OpenAPI 3.1 schema).
- Base URL:
https://api00.greek.fi - Chain: Ethereum mainnet (
chainId: 1) - Auth: None required to start. Optional
X-Api-Keyheader for server-to-server integrators. - Custody: Non-custodial. Every executable endpoint returns an unsigned transaction (
tx: { to, data, value }) that the taker wallet signs and broadcasts directly.
Paths under /options/ethereum/v1/... mirror the Bebop Options API 1:1. Paths under /greek/v1/... add wallet-scoped positions and on-chain readiness checks with unsigned setup transactions.
Quickstart
Every trade follows the same sequence: browse markets and indicative prices from cached public endpoints, run /greek/v1/readiness to send any missing wrap/approval/permission transactions, request a firm /quote, and broadcast the returned tx before expiry (at most 60 seconds).
1. Discover markets and indicative prices (no wallet required)
Fetch active instruments and indicative quotes without connecting a wallet or spending quote budget:
curl "https://api00.greek.fi/options/ethereum/v1/instruments?option_type=call&limit=10"
curl "https://api00.greek.fi/options/ethereum/v1/assets/ETH/summary"
Use /assets/{underlying}/summary (edge-cached 3 seconds) for UI pricing, APRs, implied volatility, and polling. Only call /quote when a funded wallet is ready to execute.
2. Prepare and execute a sell-to-open trade (TypeScript + viem)
import { createPublicClient, createWalletClient, http, type Address, type Hex } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { mainnet } from "viem/chains";
const API = "https://api00.greek.fi";
const HEADERS: Record<string, string> = {
// Optional: add your integrator key for server-side backends.
// "X-Api-Key": process.env.GREEK_API_KEY!,
};
const account = privateKeyToAccount(process.env.TAKER_PRIVATE_KEY as Hex);
const publicClient = createPublicClient({ chain: mainnet, transport: http(process.env.RPC_URL) });
const walletClient = createWalletClient({ account, chain: mainnet, transport: http(process.env.RPC_URL) });
async function getJson<T>(path: string): Promise<T> {
const res = await fetch(`${API}${path}`, { headers: HEADERS });
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body?.error?.code}: ${body?.error?.message}`);
return body as T;
}
async function openShortCall(instrument: Address, amountWei: string) {
// 1. Check collateral, allowance, factory permissions, and existing option balance.
const readiness = await getJson<{
ready: boolean;
issues: string[];
steps: { kind: string; description: string; tx: { to: Address; data: Hex; value: string } }[];
}>(`/greek/v1/readiness?trade=open&wallet=${account.address}&instrument=${instrument}&amount=${amountWei}`);
// 2. Execute any required wrap, ERC20 approve, or Factory.addPermissions transactions.
for (const step of readiness.steps) {
const hash = await walletClient.sendTransaction({
to: step.tx.to,
data: step.tx.data,
value: BigInt(step.tx.value),
});
await publicClient.waitForTransactionReceipt({ hash });
}
// 3. Request a firm quote (requires collateral token balance >= amountWei on-chain).
const quote = await getJson<{
quoteId: string;
positionId: string;
premium: string;
expiry: number;
tx: { to: Address; data: Hex; value: string };
}>(`/options/ethereum/v1/quote?instrument=${instrument}&amount=${amountWei}&taker_address=${account.address}`);
// 4. Broadcast the settlement transaction directly from taker_address before quote.expiry.
const fillHash = await walletClient.sendTransaction({
to: quote.tx.to,
data: quote.tx.data,
value: BigInt(quote.tx.value),
});
await publicClient.waitForTransactionReceipt({ hash: fillHash });
return { quoteId: quote.quoteId, positionId: quote.positionId, fillHash };
}
3. List, close, or roll a position
- Fetch the wallet's open positions via
GET /greek/v1/wallets/{wallet}/positions. - Call
GET /greek/v1/readiness?trade=close&wallet={wallet}&position_id={positionId}(ortrade=roll&instrument={newInstrument}) and send any returnedsteps(USDC approval to settlement,BURNorROLLfactory permission). - Request
GET /options/ethereum/v1/positions/{positionId}/quote(buy to close) orGET /options/ethereum/v1/positions/{positionId}/roll(atomic close + open) and broadcasttxfrom the position's wallet beforeexpiry.
Conventions and access
- Units: Token amounts are raw integer units encoded as decimal strings (e.g.
10000000000000000for0.01 WETH,1000000for1 USDC). Timestamps are Unix seconds. - Parameters: Query parameters use
snake_case, except Bebop'sincludeExpiredandincludeRetiredFactories. JSON response fields usecamelCase. - Addresses: Accepted in any case; returned lowercased or as provided by Bebop.
- Response headers: Every response includes
X-Request-Id(gk-<uuid>) andCache-Control(no-storeon quotes and positions;public, max-age=..., s-maxage=..., stale-while-revalidate=...on public catalogue endpoints).429and503responses includeRetry-Afterin seconds. - Client
Authorizationheader: Ignored and never forwarded upstream.
Authentication tiers
| Tier | Header | Intended caller | Rate limit scope |
|---|---|---|---|
| Anonymous | None | Browsers (greek.fi), quick tests, single-wallet scripts | Per IP + per taker wallet |
| Integrator | X-Api-Key: gk_live_... | Backend aggregators, vaults, trading bots | Per integrator RPM (quote_rpm, close_rpm, read_rpm) + per taker wallet (bypasses per-IP caps) |
Contact the Greek team to request an X-Api-Key with custom per-minute quotas.
Asset-aware gating and rate limits
Firm quote endpoints enforce on-chain readiness and abuse controls before spending upstream maker capacity:
- Geo-blocking (
451 GeoBlocked): Applied on firm quote endpoints (/quote, close, roll) for restricted jurisdictions (US, CA, SG, CN, CU, IR, KP, SY, T1). Public catalogue, summary, status, readiness, and position read endpoints are not geo-blocked. - Sanctions check (
403 Sanctioned): Checked against the Chainalysis sanctions oracle on Ethereum mainnet (0x40C57923924B5c5c5455c48D93317139ADDaC8fb). - Asset check (
409 NotReady): Open quotes requirecollateralBalance >= amount(andoptionBalance == 0so Bebop does not reject withExistingOptionBalance). Close and roll quotes requirereceiptBalance > 0. Unwrapped ETH does not satisfy a WETH collateral check; wrap first via/greek/v1/readiness. - Funded vs. unfunded limits:
- Public cached data (
/instruments,/summary,/status):240/minper IP (or per integrator). - Funded open quotes:
120/minper taker,120/minand30/10sburst per anonymous IP (no IP cap withX-Api-Key), bounded by the shared upstream pool (45 / 3s). - Funded close/roll quotes:
30/minper taker, bounded by the shared close pool (8 / 10s). - Position reads and readiness:
60/minper anonymous IP (or integratorread_rpm). - Unfunded throttle: Wallets that fail the asset check repeatedly are throttled with
429 RateLimitedbefore calling RPC. Funding the wallet clears the throttle on the next successful check. - Duplicate quote dedupe: Repeating the exact same
(taker, instrument, amount)within5sreturns429 RateLimited. - Zero-fill guardrail: Takers with more than
30resolved open quotes in 24 hours and0on-chain fills drop to1 quote/minuntil fills resume.
- Public cached data (
Contracts and permissions
| Contract | Mainnet address | Role |
|---|---|---|
BebopSettlement | 0xbbbbbBB520d69a9775E85b458C58c648259FAD5F | tx.to target for all executable quotes; operator for factory permissions and USDC close-premium allowance |
WETH | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | Call collateral (18 decimals) |
USDC | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 | Put collateral and option premium token (6 decimals) |
| Greek Factory | Returned per instrument in factory | Spender for open collateral allowance (approve(factory, amount)) and target for addPermissions(BebopSettlement, mask) |
Factory permission bitmasks (always pass to addPermissions, never setPermissions, to avoid overwriting existing bits):
| Trade | Required bits | Decimal mask |
|---|---|---|
| Open (sell to open) | TRANSFER (1) | MINT (2) | 3 |
| Close (buy to close) | BURN (4) | 4 |
| Roll (close + open) | TRANSFER (1) | MINT (2) | BURN (4) | 7 |
Public data endpoints
GET /options/ethereum/v1/instruments
Lists Greek option instruments. Edge-cached for 60 seconds (stale-while-revalidate=60).
| Param | Type | Required | Notes |
|---|---|---|---|
instrument | address | no | Filter by option token address |
underlying | address | no | Filter by underlying token address |
quote | address | no | Filter by quote token address |
option_type | call | put | no | Filter by option type |
expiration_from | integer | no | Minimum expiration (Unix seconds) |
expiration_to | integer | no | Maximum expiration (Unix seconds) |
includeExpired | boolean | no | Default false |
includeRetiredFactories | boolean | no | Default false |
limit | integer | no | 1 to 200, default 50 |
cursor | string | no | Opaque nextCursor from previous page |
{
"instruments": [
{
"instrument": "0xf4ef7ba1eb4a8781f2137c732630969e9eebbb22",
"receipt": "0x16870687ae254ca4f326c9a77929072b68dcc1e2",
"name": "OPTE-C-WETH-USDC-1700-2026-11-27",
"symbol": "OPTE-C-WETH-USDC-1700-2026-11-27",
"receiptSymbol": "RCTE-C-WETH-USDC-1700-2026-11-27",
"underlying": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"collateral": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"settlement": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"collateralSymbol": "WETH",
"settlementSymbol": "USDC",
"decimals": 18,
"collateralDecimals": 18,
"settlementDecimals": 6,
"optionType": "call",
"exerciseStyle": "european",
"strike": "1700",
"strikeRaw": "1700000000000000000000",
"expiration": 1795766400,
"exerciseDeadline": 1795770000,
"exerciseWindowSeconds": 3600,
"canSell": true,
"canBuy": true,
"factory": "0x9999999999906a9a5b3cfb1151ac6812b3042191",
"exercisedTotal": "0",
"maxUnderlyingAmount": "350000000000000000000",
"lastExerciseAt": null
}
],
"nextCursor": null
}
GET /options/ethereum/v1/assets/{underlying}/summary
Returns indicative pricing, Greeks, and open interest across all active expiries for an underlying. Edge-cached for 3 seconds (stale-while-revalidate=10). Indicative only, never executable.
| Param | Type | Required | Notes |
|---|---|---|---|
underlying | path | yes | Symbol (ETH, cbBTC) or underlying token address |
{
"asset": "ETH",
"underlying": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"schemaVersion": 5,
"indicativeOnly": true,
"sequence": 1234,
"spot": 1697.07,
"computedAt": 1795493810,
"expiries": [
{
"expiration": 1795766400,
"forward": 1697.14,
"atmIv": 0.6449,
"timeToExpiry": 0.0087,
"instruments": [
{
"instrument": "0xa48ad6a262774f2b217215b1933d4975d4ae29d1",
"strike": "1400",
"optionType": "put",
"canSell": true,
"canBuy": true,
"pricingStatus": "available",
"pricing": {
"markIv": 1.1627,
"bidPremiumUsd": 2.2543,
"markPremiumUsd": 2.4951,
"askPremiumUsd": 2.7502,
"netPremiumUsd": 2.0852,
"sellToOpenApr": 0.1701,
"forwardDelta": -0.0333,
"impliedItmProbability": 0.03,
"vegaPerVolPoint": 0.05
},
"statistics": { "openInterest": {}, "lastTrade": null }
}
]
}
]
}
GET /options/ethereum/v1/status
Returns upstream venue availability ({ "status": "available" } or "unavailable"). Edge-cached for 10 seconds.
Firm quote endpoints
Firm quotes are never cached (Cache-Control: no-store). Only the specified taker wallet can execute the returned tx.
GET /options/ethereum/v1/quote
Requests a firm sell-to-open quote and unsigned settlement transaction.
| Param | Type | Required | Notes |
|---|---|---|---|
instrument | address | yes | Option token address from /instruments |
amount | string | yes | Raw collateral units (>= 0.001 WETH for WETH calls, >= 0.00003 cbBTC for cbBTC calls, >= 1 USDC for puts) |
taker_address | address | yes | Wallet that will sign and broadcast tx |
validate | boolean | no | Handled locally from the proxy's on-chain check; populates issues without burning Bebop's strict validation limit |
{
"requestId": "0e5ad13e-3cd4-44de-ae40-8f4107096fd9",
"quoteId": "opt-89460930558919916945084727734426678678",
"positionId": "pos-1-0x8bba85212763d59038b1e717db7a67e4b727f70e-0xf4ef7ba1eb4a8781f2137c732630969e9eebbb22",
"chainId": 1,
"instrument": "0xf4ef7ba1eb4a8781f2137c732630969e9eebbb22",
"side": "sell",
"amount": "10000000000000000",
"premium": "485203",
"fee": "39340",
"expiry": 1795438930,
"issues": null,
"tx": {
"to": "0xbbbbbBB520d69a9775E85b458C58c648259FAD5F",
"data": "0x4dcebcba...",
"value": "0"
},
"iv": 0.623,
"delta": 0.5884,
"spotPrice": 1721.04,
"display": {
"isItm": true,
"intrinsicUsd": 20.24,
"grossTimeValueUsd": 32.21,
"feeUsd": 3.93,
"netTimeValueUsd": 28.28,
"yieldApr": 1.565,
"collateralUsd": 1720.42,
"riskLevel": "caution",
"impliedItmProbability": 0.561
}
}
premium is the net amount the taker receives after fee. Broadcast tx before expiry (at most 60 seconds).
GET /options/ethereum/v1/positions/{positionId}/quote
Requests a firm buy-to-close quote for an open position.
| Param | Type | Required | Notes |
|---|---|---|---|
positionId | path | yes | Format pos-1-<wallet>-<instrument> |
amount | string | no | Raw receipt/option units for a partial close; omit for full close |
validate | boolean | no | Populates issues locally using the returned premium (USDC balance, USDC allowance to settlement, BURN permission) |
Response matches /quote with side: "buy". premium is the amount the taker pays, including fee.
GET /options/ethereum/v1/positions/{positionId}/roll
Requests an atomic roll quote closing positionId and opening instrument in a single transaction.
| Param | Type | Required | Notes |
|---|---|---|---|
positionId | path | yes | Existing position (pos-1-<wallet>-<instrument>) |
instrument | address | yes | Target option token (same underlying, option type, collateral, quote token, and factory) |
validate | boolean | no | Populates issues locally (close premium + roll collateral allowance + mask 7) |
{
"requestId": "...",
"rollId": "...",
"chainId": 1,
"close": { "quoteId": "...", "positionId": "...", "instrument": "0xOLD", "side": "buy", "amount": "...", "premium": "...", "fee": "0", "iv": 0.6 },
"open": { "quoteId": "...", "positionId": "...", "instrument": "0xNEW", "side": "sell", "amount": "...", "premium": "...", "fee": "3000", "iv": 0.6 },
"netPremium": "...",
"collateralDelta": "...",
"fee": "3000",
"expiry": 1795438930,
"issues": null,
"tx": { "to": "0xbbbbbBB520d69a9775E85b458C58c648259FAD5F", "data": "0x...", "value": "0" },
"display": {},
"assignmentRisk": { "old": 0.56, "new": 0.31 }
}
netPremium equals open premium minus close premium (negative when the taker pays net USDC).
Position endpoints
GET /greek/v1/wallets/{wallet}/positions
Returns positions opened through this API filtered to a single wallet, newest first. Calling unfiltered GET /options/ethereum/v1/positions returns 400 InvalidRequest pointing here.
| Param | Type | Required | Notes |
|---|---|---|---|
wallet | path | yes | Taker wallet address |
limit | integer | no | 1 to 50, default 20 |
cursor | string | no | Opaque cursor from previous page |
Response: { "positions": [ ... ], "nextCursor": null }.
GET /options/ethereum/v1/positions/{positionId}
Returns a single position by ID. Bebop indexes mined fills after roughly 30 seconds (404 NotFound until indexed).
{
"positionId": "pos-1-0xwallet-0xinstrument",
"openingQuoteId": "opt-...",
"chainId": 1,
"instrument": "0x...",
"takerAddress": "0xwallet",
"openedAmount": "10000000000000000",
"closedAmount": "0",
"remainingAmount": "10000000000000000",
"premiumReceived": "485203",
"premiumPaid": "0",
"status": "open",
"openingTransactionHash": "0x...",
"openedAt": 1795438900,
"updatedAt": 1795438930,
"rtBalance": "10000000000000000",
"phase": "...",
"redeemable": null,
"pnl": { "currency": "USDC", "realized": null, "unrealized": "...", "total": "..." },
"yield": {}
}
status values: open, closed, expired_pending_exercise, exercised, expired_unexercised, redeemed.
GET /options/ethereum/v1/positions/{positionId}/transactions
Returns fill history for a position (type: sell_to_open or buy_to_close).
{
"positionId": "pos-1-0xwallet-0xinstrument",
"transactions": [
{
"type": "sell_to_open",
"amount": "10000000000000000",
"premium": "485203",
"txHash": "0x...",
"timestamp": 1795438900,
"rollId": null
}
]
}
Readiness and health
GET /greek/v1/readiness
Inspects on-chain wallet state in a single multicall and returns exact unsigned setup transactions (steps) needed before quoting. Reads Ethereum mainnet directly and never calls Bebop.
| Param | Type | Required | Notes |
|---|---|---|---|
wallet | address | yes | Taker wallet address |
trade | open | close | roll | yes | Trade flow to evaluate |
instrument | address | for open and roll | Target option token address |
amount | string | for open | Raw collateral units |
position_id | string | for close and roll | Must belong to wallet |
premium | string | no | Expected close premium in raw USDC; omit to check permissions only |
{
"wallet": "0x8bba85212763d59038b1e717db7a67e4b727f70e",
"trade": "open",
"instrument": "0xf4ef7ba1eb4a8781f2137c732630969e9eebbb22",
"amount": "10000000000000000",
"ready": false,
"canSell": true,
"issues": ["insufficient_collateral_allowance", "missing_factory_permissions"],
"checks": {
"sanctioned": false,
"collateral": {
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"balance": "50000000000000000",
"required": "10000000000000000",
"ethBalance": "1000000000000000000"
},
"allowance": {
"spender": "0x9999999999906a9a5b3cfb1151ac6812b3042191",
"current": "0",
"required": "10000000000000000"
},
"permissions": {
"operator": "0xbbbbbBB520d69a9775E85b458C58c648259FAD5F",
"current": 0,
"required": 3
},
"existingOptionBalance": "0"
},
"steps": [
{
"kind": "approve",
"description": "Allow the Greek Factory to pull 0.01 WETH",
"tx": { "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "data": "0x095ea7b3...", "value": "0" }
},
{
"kind": "addPermissions",
"description": "Let Bebop settlement transfer and mint option tokens (mask 3)",
"tx": { "to": "0x9999999999906a9a5b3cfb1151ac6812b3042191", "data": "0x...", "value": "0" }
}
],
"blockNumber": 23812345
}
Possible steps[].kind values:
wrap: Included when WETH collateral is short and the wallet's native ETH covers the shortfall (WETH.deposit()withvalueset to the exact shortfall).approve: Exact ERC20approve(spender, amount).addPermissions: CallsFactory.addPermissions(BebopSettlement, missingBits)with only the missing bits.
Possible issues values: missing_factory_permissions, insufficient_collateral_balance, insufficient_collateral_allowance, insufficient_premium_balance, insufficient_premium_allowance.
GET /health
Returns proxy health, version, circuit-breaker state, and count of currently throttled zero-fill takers:
{
"ok": true,
"version": "0.1.0",
"upstream": {
"lastStatus": 200,
"lastSuccessAt": 1795493810,
"breaker": "closed",
"throttledTakers": 0
}
}
Errors
All errors share one JSON shape:
{
"requestId": "gk-3f1c2a8e-...",
"error": {
"code": "NotReady",
"message": "wallet holds less WETH than amount; see /greek/v1/readiness"
},
"upstreamRequestId": null
}
When an error originates from Bebop, upstreamRequestId carries Bebop's requestId for support tracing.
| HTTP | Code | Meaning |
|---|---|---|
400 | InvalidRequest, InvalidAddress, InvalidAmount | Missing or malformed parameter |
400 | InstrumentNotSellable | Instrument has canSell: false |
400 | MinNotional, MaxSize, InstrumentExpired, InvalidRoll, TakerIsMaker | Trade violates instrument or venue bounds |
401 | InvalidApiKey | X-Api-Key header is malformed or unknown |
403 | ApiKeyRevoked | X-Api-Key has been revoked |
403 | Sanctioned | Taker wallet is flagged by the Chainalysis sanctions oracle |
404 | UnknownInstrument, NotFound, PositionNotFound | Instrument or position not found |
409 | NotReady | Wallet lacks collateral for open or receipt balance for close/roll |
409 | ExistingOptionBalance | Wallet already holds option tokens of the instrument |
429 | RateLimited | Caller exceeded IP, taker, integrator, unfunded, or 5s dedupe limit; check Retry-After |
451 | GeoBlocked | Request originated from a restricted jurisdiction |
502 | ChainUnavailable, UpstreamUnavailable, UpstreamError | RPC or upstream venue failure |
503 | NoValidMakerQuote | No maker returned a valid quote for this instrument and size |
503 | UpstreamBusy | Shared upstream budget exhausted or circuit breaker open; check Retry-After |