Skip to content

Commit

Permalink
new endpoints 3
Browse files Browse the repository at this point in the history
  • Loading branch information
GravitySucks committed Jan 19, 2023
1 parent 469bab9 commit 502534f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
37 changes: 37 additions & 0 deletions gvol/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,4 +1440,41 @@ def options_atm_skew_spot(
return self._client.execute(
gql(queries.options_atm_skew_spot),
variable_values={"symbol":symbol, "dateStart":dateStart, "dateEnd":dateEnd},
)

def options_deribit_volume_detailed_daily(
self, exchange: types.ExchangeEnumType, dateStart: types.String, dateEnd: types.String,
) -> Dict:
"""This query will return the Deribit daily volumes detailed and open interest with putcall ratio.
Args:
{
"exchange": "deribit",
"dateStart": "2016-01-01",
"dateEnd": "2023-01-19"
}
Returns:
{
"date": "1673395200000",
"year": "2023",
"month": "1",
"blockTrade": "Block",
"currency": "BTC",
"typeOfTrade": "trade",
"putCall": "C",
"volume": 8670,
"premium": 223,
"notional": 151547850,
"premiumDollar": 3902913,
"avgIv": 48.3,
"avgIndexPrice": 17480.4,
"countTrades": 117,
"oiNotional": 3404269477,
"oiPcRatio": 0.47
}
"""
return self._client.execute(
gql(queries.options_deribit_volume_detailed_daily),
variable_values={"exchange":exchange, "dateStart":dateStart, "dateEnd":dateEnd},
)
28 changes: 26 additions & 2 deletions gvol/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@


options_atm_skew_spot = """
query HourlyFixedDeltaSurface($symbol: SymbolEnumType, $dateStart: String, $dateEnd: String) {
HourlyFixedDeltaSurface: HourlyFixedDeltaSurface(symbol: $symbol, dateStart:$dateStart,dateEnd:$dateEnd) {
query HourlyFixedDeltaSurface($symbol: SymbolEnumType, $dateStart: String, $dateEnd: String) {
HourlyFixedDeltaSurface: HourlyFixedDeltaSurface(symbol: $symbol, dateStart:$dateStart,dateEnd:$dateEnd) {
ts
currency
indexPrice
Expand Down Expand Up @@ -1340,4 +1340,28 @@
FiveDelta180Call
}
}
"""


options_deribit_volume_detailed_daily = """
query DeribitDetailedDaily($exchange: ExchangeEnumType, $dateStart: String,$dateEnd: String) {
DeribitDetailedDaily: DeribitDetailedDaily(exchange: $exchange, dateStart: $dateStart, dateEnd: $dateEnd) {
date
year
month
blockTrade
currency
typeOfTrade
putCall
volume
premium
notional
premiumDollar
avgIv
avgIndexPrice
countTrades
oiNotional
oiPcRatio
}
}
"""

0 comments on commit 502534f

Please sign in to comment.