Deribit Worker API

Deribit Options Data Proxy with Tolerance Filtering

Overview

Purpose

Proxies and filters Deribit options data with tolerance-based filtering to ensure data quality and relevance.

Currencies

ETH and BTC options with real-time market data from Deribit API

Features

Data filtering, tolerance checks, caching, and multiple endpoint variations for different use cases.

Cache

10-second in-memory cache with automatic refresh and retry logic

API Endpoints

GET / Get filtered Deribit options data (tolerance check applied)
Query Parameters
Parameter Type Required Description
keys string Optional Comma-separated list of fields to include (default: bid_price,ask_price,mark_price,underlying_price,strike)
Response
{ "data": { "ETH": { "ETH-2500C-20240115": { "bid_price": 0.05, "ask_price": 0.06, "mark_price": 0.055, "underlying_price": 2500.00, "strike": 2500 } }, "BTC": { "BTC-45000C-20240115": { "bid_price": 0.02, "ask_price": 0.025, "mark_price": 0.0225, "underlying_price": 45000.00, "strike": 45000 } } }, "metadata": { "last_fetched": 1704067200000, "cache_ttl": 10000, "cache_expires_in": 5000, "response_generated": 1704067200000, "tolerance_check": true, "endpoint": "default" } }
200 OK 500 Internal Error
GET /all Get all Deribit options data (no tolerance filtering)
Query Parameters
Parameter Type Required Description
keys string Optional Comma-separated list of fields to include (default: bid_price,ask_price,mark_price,underlying_price,strike)
Response
{ "data": { "ETH": { "ETH-2500C-20240115": { "bid_price": 0.05, "ask_price": 0.06, "mark_price": 0.055, "underlying_price": 2500.00, "strike": 2500, "passesToleranceCheck": true }, "ETH-2400C-20240115": { "bid_price": 0.15, "ask_price": 0.16, "mark_price": 0.155, "underlying_price": 2500.00, "strike": 2400, "passesToleranceCheck": false } } }, "metadata": { "last_fetched": 1704067200000, "cache_ttl": 10000, "cache_expires_in": 5000, "response_generated": 1704067200000, "tolerance_check": false, "endpoint": "/all" } }
200 OK 500 Internal Error
GET /raw Get raw Deribit API responses
Response
{ "data": { "instruments": { "result": [ { "instrument_name": "ETH-2500C-20240115", "quote_currency": "ETH", "base_currency": "ETH", "expiration_timestamp": 1704067200000, "tick_size": 0.001, "tick_size_steps": [ { "above_price": 0, "tick_size": 0.001 } ] } ] }, "bookSummaries": { "ETH": { "result": [ { "instrument_name": "ETH-2500C-20240115", "bid_price": 0.05, "ask_price": 0.06, "mark_price": 0.055, "underlying_price": 2500.00 } ] } } }, "metadata": { "last_fetched": 1704067200000, "cache_ttl": 10000, "cache_expires_in": 5000, "response_generated": 1704067200000 } }
200 OK 500 Internal Error

CORS Configuration

The following origins are whitelisted for CORS access:

Tolerance Filtering

Purpose

Filters out options with bid/ask spreads that are too wide relative to the mark price

Duration Tiers

≤2 weeks: 1 tick, ≤1 month: 2 ticks, ≤3 months: 3 ticks, ≤6 months: 5 ticks, >6 months: 10 ticks

Calculation

Uses tick size and duration-based tolerance to determine valid bid/ask ranges

Default Behavior

Main endpoint applies filtering, /all endpoint includes tolerance flags but doesn't filter

Data Sources

API Base

https://www.deribit.com/api/v2/public

Endpoints

get_instruments, get_book_summary_by_currency for ETH and BTC

Retry Logic

3 retries with exponential backoff for failed requests

Cache Strategy

10-second TTL with separate storage for raw data, all data, and filtered data