curl --request GET \
--url https://test.deribit.com/api/v2/public/get_order_book \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 8772,
"method": "public/get_order_book",
"params": {
"instrument_name": "BTC-PERPETUAL",
"depth": 5
}
}
'{
"jsonrpc": "2.0",
"id": 8772,
"result": {
"timestamp": 1550757626706,
"stats": {
"volume": 93.35589552,
"price_change": 0.6913,
"low": 3940.75,
"high": 3976.25
},
"state": "open",
"settlement_price": 3925.85,
"open_interest": 45.27600333464605,
"min_price": 3932.22,
"max_price": 3971.74,
"mark_price": 3931.97,
"last_price": 3955.75,
"instrument_name": "BTC-PERPETUAL",
"index_price": 3910.46,
"funding_8h": 0.00455263,
"current_funding": 0.00500063,
"change_id": 474988,
"bids": [
[
3955.75,
30
],
[
3940.75,
102020
],
[
3423,
42840
]
],
"best_bid_price": 3955.75,
"best_bid_amount": 30,
"best_ask_price": 0,
"best_ask_amount": 0,
"asks": []
}
}Retrieves the order book (bids and asks) for a given instrument, along with other market values such as best bid/ask prices, last trade price, mark price, and index price.
The order book depth can be controlled using the depth parameter, which accepts values from 1 to 10000. The response includes price levels sorted by price (bids descending, asks ascending).
curl --request GET \
--url https://test.deribit.com/api/v2/public/get_order_book \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 8772,
"method": "public/get_order_book",
"params": {
"instrument_name": "BTC-PERPETUAL",
"depth": 5
}
}
'{
"jsonrpc": "2.0",
"id": 8772,
"result": {
"timestamp": 1550757626706,
"stats": {
"volume": 93.35589552,
"price_change": 0.6913,
"low": 3940.75,
"high": 3976.25
},
"state": "open",
"settlement_price": 3925.85,
"open_interest": 45.27600333464605,
"min_price": 3932.22,
"max_price": 3971.74,
"mark_price": 3931.97,
"last_price": 3955.75,
"instrument_name": "BTC-PERPETUAL",
"index_price": 3910.46,
"funding_8h": 0.00455263,
"current_funding": 0.00500063,
"change_id": 474988,
"bids": [
[
3955.75,
30
],
[
3940.75,
102020
],
[
3423,
42840
]
],
"best_bid_price": 3955.75,
"best_bid_amount": 30,
"best_ask_price": 0,
"best_ask_amount": 0,
"asks": []
}
}The instrument name for which to retrieve the order book, see public/get_instruments to obtain instrument names.
"BTC-PERPETUAL"
The number of entries to return for bids and asks, maximum - 10000.
1, 5, 10, 20, 50, 100, 1000, 10000 5
Success response
The JSON-RPC version (2.0)
2.0 Hide child attributes
Unique instrument identifier
"BTC-PERPETUAL"
The timestamp (milliseconds since the Unix epoch)
1536569522277
The state of the order book. Represents the current lifecycle stage of the instrument.
State Lifecycle and Meanings:
open: Default state for running books. In this state book is accepting new orders, edits, cancels; prices should be updated, trading is live.settlement: Books enters to this state during settlement/delivery. New orders, edits, cancels are not accepted. After this state normally next state should be open if it was settlement, or delivered if it was delivery. On enter to this state good till day orders in book are canceled.delivered: Final state of book that has been delivered. New orders, edits, cancels are not accepted. After some time book process will be terminated and, instrument moved to expired_instruments and its instrument_state will become archivized. On enter to this all open orders in book are canceled.inactive: After a book is deactivated, this state is set on book. New orders, edits, cancels are not accepted. On enter to this all open orders in book are canceled. Book in this state is not considered as open. This can be also final state for book.locked: New orders, edits, are not accepted, only cancels ARE accepted. In some cases when configured books can start as locked or it may become locked on admin request. Settlement is possible on locked books.halted: The state that books enter as a result of an error. Settlement is not possible when there is at least one book in this state.archivized: Set when instrument is moved to expired_instruments table, final state.open, settlement, delivered, inactive, locked, halted, archivized Hide child attributes
Volume during last 24h in base currency
Lowest price during 24h
Highest price during 24h
24-hour price change expressed as a percentage, null if there weren't any trades
10.23
Volume in usd (futures only)
The total amount of outstanding contracts in the corresponding amount units. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin.
The current best bid price, null if there aren't any bids
It represents the requested order size of all best bids
The current best ask price, null if there aren't any asks
It represents the requested order size of all best asks
Current index price
8247.27
The minimum price for the future. Any sell orders you submit lower than this price will be clamped to this minimum.
The maximum price for the future. Any buy orders you submit higher than this price, will be clamped to this maximum.
The mark price for the instrument
The price for the last trade
List of bids (price-amount pairs)
2 elementsList of asks (price-amount pairs)
2 elementsUnderlying price for implied volatility calculations (options only)
Name of the underlying future, or index_price (options only)
Interest rate used in implied volatility calculations (options only)
(Only for option) implied volatility for best bid
(Only for option) implied volatility for best ask
(Only for option) implied volatility for mark price
Only for options. Greeks are risk measures that describe how the option's price changes with respect to various factors.
Delta (Δ)
Deribit uses two different Deltas:
In the settings section you can toggle Net Transaction Delta instead.
What is DeltaTotal in the account summary?
DeltaTotal = Net Transaction Delta of options + BTC Position of Futures
What is Net Transaction Delta?
Net Transaction Delta = Black Scholes Delta - Mark Price of Options
Why do we use a Net Transaction Delta? The Delta Total uses the Net Transaction Delta (or price adjusted Delta) of the options. This is because, from a risk perspective, we are interested in the change in Bitcoin price as the underlying changes.
You should actually treat your delta as Equity + Delta Total if you want to have less risk for your USD PnL.
Example: Consider a call option with strike 0, which has a Black Scholes Delta of 1 and Net Transaction Delta = 0.
Imagine you have 2 BTC equity and no positions and BTC price is at USD 60k. In that case you would short 2 Futures contracts to hedge your USD exposure to BTC.
Now let's say you buy one call with strike 0. The question is if you should sell another future?
The call will always have a price of 1 BTC. So you buy it at 1 BTC which equates to USD 60k. Let's say the price increases to USD 70k. The value of the call is still 1 BTC. At settlement you receive 1 BTC for the call. So you paid 1 BTC and then receive 1 BTC which means your USD PnL on buying the call is 0. If you sold a future on it, then you would actually lose on the future.
⚠️ During the 30 minute settlement period we decay your Delta. See Delta decay during settlement for more details.
Theta (Θ)
The Theta that Deribit uses is the minimum of (1 day Theta, lifetime theta of the option). So if you take an option with 1 hour to expire for example, generally Black Scholes Theta will give you the equivalent 1 day Theta. Whereas we show the 1 hour Theta, so our Theta would differ from Black Scholes Theta when time to expiry is less than 1 day.
Vega, Gamma, and Rho
Vega (not actually a Greek symbol), Gamma, Theta and Rho values shown on Deribit are calculated using standard Black Scholes without adjustments.
Hide child attributes
(Only for option) The delta value for the option. This is the Black Scholes Delta for individual option expiries.
Note that DeltaTotal in account summary uses Net Transaction Delta instead. See the greeks object description for more details.
(Only for option) The gamma value for the option. Calculated using standard Black Scholes without adjustments.
Gamma measures the rate of change of delta with respect to changes in the underlying asset price.
(Only for option) The rho value for the option. Calculated using standard Black Scholes without adjustments.
Rho measures the sensitivity of the option price to changes in the risk-free interest rate.
(Only for option) The theta value for the option. Deribit uses the minimum of (1 day Theta, lifetime theta of the option).
So if you take an option with 1 hour to expire for example, generally Black Scholes Theta will give you the equivalent 1 day Theta. Whereas we show the 1 hour Theta, so our Theta would differ from Black Scholes Theta when time to expiry is less than 1 day.
Theta measures the rate of change of the option price with respect to time decay.
(Only for option) The vega value for the option. Calculated using standard Black Scholes without adjustments.
Vega (not actually a Greek symbol) measures the sensitivity of the option price to changes in implied volatility.
Funding 8h (perpetual only)
Current funding (perpetual only)
The settlement price for the instrument. Only when state = closed
Optional (not added for spot). The settlement price for the instrument. Only when state = open
The id that was sent in the request
Was this page helpful?