Skip to content
Velo

Fetch Futures Basis

3m_basis_ann is a special case available for BTC and ETH. To request this data, do not specify products, exchanges, or any additional columns.

from velodata import lib as velo
 
day_in_ms = 1000 * 60 * 60 * 24
 
# new velo client
client = velo.client('api_key')
 
# from 5 days ago in 1 hour resolution
params = {
    'type': 'futures',
    'columns': ['3m_basis_ann'],
    'coins': ['BTC', 'ETH'],
    'begin': client.timestamp() - day_in_ms * 5,
    'end': client.timestamp(),
    'resolution': '1h'
}
 
# returns dataframe
print(client.get_rows(params))