Skip to content

Commit

Permalink
adding utility realitime option book
Browse files Browse the repository at this point in the history
  • Loading branch information
phatdoyle committed Feb 10, 2022
1 parent 9a14424 commit e8b89e7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Denys Halenok"

# The full version, including alpha/beta/rc tags
release = "0.2.21"
release = "0.2.22"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gvol/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__all__ = ("__version__", "GVol")
__version__ = "0.2.21"
__version__ = "0.2.22"

from gvol.client import GVol
24 changes: 23 additions & 1 deletion gvol/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ def HifiVolSurfaceStrikesGreeksMinute(
) -> Dict:
"""This endpoint returns a volatility surface represented by option strike prices.
This is a "model-free" volatility surface, meaning no interpolation or fitting of any kind is present.
This is a "model-free" volatility surface, meaning no interpolation or fitting of any kind is present.
Currently supports: Deribit
Expand Down Expand Up @@ -1894,3 +1894,25 @@ def dVolVariancePremium(
"symbol": symbol,
},
)

def UtilityRealtimeOptionbook(
self,
symbol: types.SymbolEnumType,
) -> Dict:
"""
This endpoint will return the option orderbook, index prices, underlying prices and open interest for the entire exchange.
All crypto options, regardless of underlying coin, are returned.
This endpoint is real-time and will return live prices when requested.
Supported exchanges are |Deribit|Bitcom|Okex|Delta|
Args:
exchange: (types.ExchangeEnumType)
Returns:
dict
"""
return self._client.execute(
gql(queries.UtilityRealtimeOptionbook),
variable_values={
"exchange": symbol,
},
)
27 changes: 27 additions & 0 deletions gvol/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,3 +1208,30 @@
}
}
"""


UtilityRealtimeOptionbook = """
query UtilityRealtimeOptionbook(
$exchange: ExchangeEnumType
) {
UtilityRealtimeOptionbook: genericUtilityRealtimeOptionbook(
exchange: $exchange
) {
date
instrumentName
currency
expiration
strike
putCall
isAtm
oi
bestBidPrice
usdBid
bidIV
markIv
askIv
indexPrice
underlyingPrice
}
}
"""
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gvol"
version = "0.2.21"
version = "0.2.22"
description = "GVol is a Python library to access the GVol API"
authors = ["Denys Halenok <[email protected]>"]

Expand Down

0 comments on commit e8b89e7

Please sign in to comment.