fromdatetime importdatefromaperiodic importget_metrics# S&P 500 (SP500), `basis`, hourly, on 2 venuesforexchange, symbol in [ ("hyperliquid-perps", "perpetual-XYZ:SP500-USDC:USDC"), ("okx-perps", "perpetual-US500-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 S&P 500 (SP500) perps on Hyperliquid and OKX over the last 30 days: how does the premium over the index (`basis`, `funding`) behave while the cash market is shut?