Skip to content

Instantly share code, notes, and snippets.

@databento-bot
Created January 3, 2024 22:44
Show Gist options
  • Save databento-bot/54009c0b0990aca585971227f8da8c93 to your computer and use it in GitHub Desktop.
Save databento-bot/54009c0b0990aca585971227f8da8c93 to your computer and use it in GitHub Desktop.
import databento as db
client = db.Historical()
data = client.timeseries.get_range(
dataset='GLBX.MDP3',
schema='definition',
symbols='ALL_SYMBOLS',
start='2023-12-27',
end='2023-12-27',
)
df = data.to_df()
is_rates = df.underlying_product == 14 # only interest rate products
is_fut = df.security_type == 'FUT' # futures outrights, no options
is_sofr = df.asset == 'SR3' # SOFR futures
sr3_symbols = df[is_rates & is_fut & is_sofr].raw_symbol
print(sr3_symbols)
data = client.timeseries.get_range(
dataset='GLBX.MDP3',
schema='statistics',
stype_in='raw_symbol',
symbols=sr3_symbols.tolist(),
start='2023-12-27',
end='2023-12-27',
)
df = data.to_df()
print(df[df.stat_type == 9].symbol.unique()) # only symbols with nonzero OI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment