fromdatetime importdatefromaperiodic importget_metrics# Apple (AAPL), `basis`, hourly, on 3 venuesforexchange, symbol in [ ("binance-futures", "perpetual-AAPL-USDT:USDT"), ("hyperliquid-perps", "perpetual-XYZ:AAPL-USDC:USDC"), ("okx-perps", "perpetual-AAPL-USDT:USDT"),]:df = get_metrics(api_key="YOUR_API_KEY",metric="basis",exchange=exchange,symbol=symbol,interval="1h",timestamp="exchange",start_date=date(2026, 10, 24),end_date=date(2026, 11, 23), )print(exchange, df.head())
供AI智能体使用的提示词
Read https://aperiodic.io/start.md and follow it. Then, for the Apple (AAPL) perps on Binance, Hyperliquid and OKX over the last 30 days: how does the premium over the stock (`basis`, `funding`) behave overnight and at weekends, while its market is shut?