# Greek Options API

> Non-custodial HTTP API for listing Greek.fi option markets on Ethereum mainnet, reading indicative prices, preparing wallet approvals, and requesting firm executable RFQ quotes settled through Bebop.

- Base URL: https://api00.greek.fi
- Chain: Ethereum mainnet (chainId: 1)
- Auth: None required to start. Optional `X-Api-Key: gk_live_...` header for server-to-server integrators.
- Settlement contract (`tx.to` & factory operator): `0xbbbbbBB520d69a9775E85b458C58c648259FAD5F`

## Documentation Files

- [Complete API Documentation (Markdown)](https://apidocs.greek.fi/llms-full.txt): Full guide, quickstart code, rate limits, contracts, endpoints, and error codes.
- [API Reference Alias (Markdown)](https://apidocs.greek.fi/reference.md): Identical full Markdown document at `/reference.md`.
- [OpenAPI 3.1 Schema (JSON)](https://apidocs.greek.fi/openapi.json): Machine-readable OpenAPI 3.1.0 spec for all endpoints and schemas.
- [Protocol Smart Contract Docs](https://docs.greek.fi): Core Greek Option/Receipt ERC20 and Factory contract documentation.

## Integration Rules

1. Use `GET /options/ethereum/v1/instruments` (60s cache) and `GET /options/ethereum/v1/assets/{underlying}/summary` (3s cache) for browsing and indicative pricing. Never poll `/quote` for indicative prices.
2. Call `GET /greek/v1/readiness` before quoting and broadcast every returned unsigned transaction in `steps` (`wrap`, `approve`, `addPermissions` with mask `3` for open, `4` for close, `7` for roll).
3. Open quotes require `collateralBalance >= amount` (wrapped token, not raw ETH) and zero existing option token balance on-chain. Close and roll quotes require `receiptBalance > 0`.
4. Quotes are firm for at most 60 seconds and bound on-chain to `taker_address`. Broadcast `tx` directly from `taker_address` before `expiry`.
5. Never call unfiltered `GET /options/ethereum/v1/positions` (returns 400). Use `GET /greek/v1/wallets/{wallet}/positions`.

## Endpoints

- `GET /options/ethereum/v1/instruments` - List option instruments (60s edge cache)
- `GET /options/ethereum/v1/assets/{underlying}/summary` - Indicative pricing and Greeks (3s edge cache)
- `GET /options/ethereum/v1/status` - Upstream venue availability (10s edge cache)
- `GET /options/ethereum/v1/quote` - Firm sell-to-open quote + unsigned `tx` (no-store)
- `GET /options/ethereum/v1/positions/{positionId}/quote` - Firm buy-to-close quote + unsigned `tx` (no-store)
- `GET /options/ethereum/v1/positions/{positionId}/roll` - Firm atomic roll quote + unsigned `tx` (no-store)
- `GET /options/ethereum/v1/positions/{positionId}` - Single position details
- `GET /options/ethereum/v1/positions/{positionId}/transactions` - Position fill history
- `GET /greek/v1/wallets/{wallet}/positions` - Wallet-scoped positions list
- `GET /greek/v1/readiness` - On-chain readiness check + unsigned setup transactions
- `GET /health` - Proxy health and circuit breaker status
