# Velo Documentation for the Velo market data and trading APIs # Velo \[Learn about Velo's Web App and API] Velo provides market insights through a web application and through an API, unifying news, trading and data. To get started, please visit the [web application](https://velo.xyz/) or read the [API docs](/api). ## Web Features On the [web application](https://velo.xyz/), you can explore: * **Charting for more than 3400+ symbols**: we support symbols from a wide variety of exchanges, including Binance, ByBit, Coinbase, Hyperliquid, Trade.xyz and more. * **[Indicators](/features/chart/indicators)**: Open Interest, Funding Rates. * **[Heatmap](/features/chart/heatmap)**: Orderbook heatmaps, and Hyperliquid TP/SL/Liquidation heatmaps. * **[Alerts](/features/chart/alerts)**: Set alerts for price, Open Interest, Volume or Liquidations. Velo supports trading for ByBit and Hyperliquid. Start trading on Velo today. ## SDK & API :::tip Want to access Velo's data directly? Start from the [SDK docs](/sdks/typescript/getting-started) and make your first request. ::: The [Velo TypeScript SDK](/sdks/typescript/getting-started) simplifies the process of fetching market data. It provides everything from price OHLC candles to data such as historical open interest for various symbols. The [Velo API](/api) exposes HTTP endpoints for the case where SDKs are not preferred. ## Next steps * [Chart](/features/chart/overview) - read about Velo's charting product * [SDKs](/sdks) - explore the SDKs for the API * [API](/api) - make your first request # Chart \[A rundown of how charting on Velo works] Velo uses [TradingView's](https://www.tradingview.com/) library to support seamless switching of coins and timeframes. Data updates live up to 10x per second and users may save up to 4 layouts that will persist across browser sessions. The chart can be taken into full screen, changed to line style, and broken into up to 16 panes. *The charting technology is provided by TradingView, a platform for traders and investors. It offers advanced charting tools where people driven by markets can track major upcoming events in the [Economic calendar](https://www.tradingview.com/economic-calendar/), chart, and prepare for trades.* ## See also :::tip Explore the main features of Velo's charting product! ::: * [Heatmaps](/features/chart/heatmap) - configure the SDK and make your first request * [Alerts](/features/chart/alerts) - choose between the fluent and object-based query styles * [Indicators](/features/chart/indicators) - explore the SDK's namespaces and methods * [Table](/features/chart/table) - explore the SDK's namespaces and methods # Indicators \[Insight into Velo's custom indicators] Indicators may have additional functionality unlocked (including the ability to filter aggregated data by exchange) by mousing over their names and clicking the settings icon. Indicators not prefixed by `` are preset TradingView indicators and their definitions may be seen [here](https://www.tradingview.com/support/categories/indicators/). | Indicator | Description | | --- | --- | | `` **Open Interest** | Viewable in dollar or coin terms, and in the form of candlesticks or bar-to-bar changes (absolute and percentage). | | `` **Liquidations** | Viewable in dollar or coin terms, and in the form of long and short, total count, long only, or short only.

Users may also enable a hitmarker sound to play on each liquidation. | | `` **Funding** | Viewable standardized to per 1 hour, 8 hours, 24 hours, or 1 year, and in the form of rate (%), total coin spend, or total dollar spend.

Funding spends are calculated as funding rate times open interest.

The view input of this indicator controls whether the average or the last value is returned for each individual bar.

*By default Velo shows funding rates as they update, rather than as they were at their last payment interval. This may sometimes be referred to elsewhere as a "predicted funding rate."* | | `` **Premium** | Mark price vs. index price as reported by each exchange. Viewable in terms of dollars or percent.

The view input of this indicator controls whether the average or the last value is returned for each individual bar. The moving average input controls if and how an average is returned for a period of multiple bars.

*See how Binance defines mark prices and index prices [here](https://www.binance.com/en/support/faq/what-are-mark-price-and-price-index-in-usd%E2%93%A2-margined-futures-360033525071). Most exchanges follow similar definitions.* | | `` **Volume** | Viewable in dollar or coin terms, as well as in the form of volume delta or cumulative volume delta.

The volume delta of a period is the value of market buys minus the value of market sells during that period. Cumulative volume delta is the cumulative sum of the volume deltas of multiple periods. | | `` **Tape** | Viewable in total trade count or tape speed (trades per minute) terms, as well as in the form of trade delta or cumulative trade delta.

The trade delta of a period is the number of market buys minus the number of market sells during that period. Cumulative trade delta is the cumulative sum of the trade deltas of multiple periods. | | `` **Moving Average** | In addition to two standard [moving averages](https://www.tradingview.com/support/solutions/43000502589-moving-averages/), volume weighted average price (VWAP) and open interest weighted average price (OIWAP) are viewable.

• VWAP is the total dollar value of all trades in a period divided by the total number of contracts traded in a period.
• OIWAP is the total dollar value of all open positions in a period divided by the total coin value of all open contracts in a period.

*Because of the less volatile nature of open interest, an OIWAP may at times appear similar to a standard moving average. This indicator may be reworked in the future.* | | `` **Returns** | Returns (bar to bar close) are viewable in absolute or percentage terms and over one or multiple periods. | | `` **Realized Vol** | The annualized standard deviation of percent returns over a given period. | | `` **Total Return** | The estimated value of a long position held in a perpetual future after funding rate payments are considered. Payments are not assumed to be compounded into the position and this value may vary slightly from true actualized returns. | | `` **Coinbase Premium** | The closing price for the selected symbol vs. the closing price of the matching Coinbase-USD pair, when one exists. | # Table \[A list of aggregated coin symbols] The table is sortable and will auto sort on new data. The data updates live between twice per second and once per minute where applicable. Clicking a coin in the table will select its Binance USDT perpetual on the chart by default, or its Bybit USDT perpetual if applicable. Users can favorite and unfavorite coins in the table, filter the display by coins and columns, and make watchlists. Watchlists can also be used on the [Market](/features/reference/market) page. These configurations are saved across browser sessions and devices. ## Columns | Column | Description | | --- | --- | | **Price** | The last traded price of the coin's Binance USDT perpetual. | | **Chg** | The 24 hour, 1 hour, 10 minute, or 7 day price change of the coin in percentage terms. The column with no duration specified shows change since daily open (UTC midnight). | | **Price/7d High or Low** | The coin's last traded price vs. its highest or lowest traded price over the last 7 days. | | **Volume** | The total dollar value of trades on the coin in the last 24 hours, 1 hour, or 10 minutes across all supported exchanges. | | **Volume Delta** | The total volume delta (dollar value of market buys minus market sells) of the coin in the last 24 hours, 1 hour, or 10 minutes across all supported exchanges. | | **Open Interest** | The coin's open interest in dollars across all supported exchanges. | | **OI Chg** | The percent change between a coin's total dollar value open interest now and 24 hours ago. | | **Funding** | **24h Funding:** The open-interest weighted 24 hour average funding rate of the coin across all supported exchanges.

**24h Funding (APR):** The above standardized per annum.

**Funding:** The most recent open-interest weighted funding rate of the coin across all supported exchanges. | | **24h Liquidations** | The total number of liquidations on the coin in the last 24 hours across all supported exchanges. | | **Trades** | The total number of trades on the coin in the last 24 hours, 1 hour, or 10 minutes across all supported exchanges. | | **Mkt Cap, FDV, and Float** | The circulating market cap or fully diluted market cap of a coin. Calculated by supply × price. Viewable also as Open Interest / circulating market cap, Open Interest / FDV, 24h Volume / circulating market cap, 24h Volume / FDV, or as Float (circulating divided by FDV). | | **24h Perp / Spot Volume Ratio** | The ratio of 24 hour Binance USDT perpetual volume to 24 hour Binance spot USDT volume for the coin. Returns 0 if no spot pair is available. | # Heatmap \[Show heatmaps in your Velo chart] In this guide, we will go through: 1. Turning on heatmaps 2. Configuring heatmaps with different options 3. Turning on Hyperliquid-specific heatmaps ## Turning on heatmaps To turn on heatmaps in Velo, press the button `Toggle Heatmap` in the TradingView toolbar.
A BTC-USDC chart with the orderbook heatmap displayed behind the candlesticks
## Configuring heatmaps If you press on the small `⌄` shaped symbol to the right of the heatmap range slider, you can open the settings menu for the heatmap (see Figure 2).
The Show heatmap settings button beside the heatmap range slider
Figure 2: Look for the `⌄` icon to open the settings.
Heatmap settings for selecting the heatmap type, display options, theme, and scale
Figure 3: All the options that are available for heatmap.
## Turning on Hyperliquid-specific heatmaps For a few Hyperliquid charts on Velo, we support heatmaps for all of `Orderbook`, `Liquidation`, `TP` and `SL`. You can switch between them using the tab group at the top of the heatmap settings popup.
Heatmap type tabs for Orderbook, Liquidation, TP, and SL with Liquidation selected
Figure 4: Switch between Hyperliquid heatmap types using the tabs.
BTC-USDC candlestick chart with the Hyperliquid orderbook heatmap
Figure 5: Orderbook heatmap.
BTC-USDC candlestick chart with the Hyperliquid liquidation heatmap
Figure 6: Liquidation heatmap.
BTC-USDC candlestick chart with the Hyperliquid take-profit heatmap
Figure 7: Take-profit heatmap.
BTC-USDC candlestick chart with the Hyperliquid stop-loss heatmap
Figure 8: Stop-loss heatmap.
# Alerts \[Set alerts to get notified in the Web App or on Telegram] On Velo, it is possible to create alerts for any of the combinations below. | Indicator | Direction | Unit | Timeframe | Crossing | | ---------------------- | ------------------ | --------------- | ---------------------------- | --------------- | | Price | Close | - | - | Up / Down / Any | | ` Volume` | Total / Buy / Sell | Dollars / Coins | 1m / 5m / 15m / 1h / 4h / 1d | Up | | ` Liquidations` | Total / Buy / Sell | Dollars / Coins | 1m / 5m / 15m / 1h / 4h / 1d | Up | | ` Open Interest` | Close | Dollars / Coins | - | Up / Down / Any | ## Notifications It is possible to get an alert notification through two different channels, either through the Velo web app or through Telegram. You can choose the notification channel when creating an alert. ### Web notification A web notification looks as follows and will trigger a sound effect as well. Upon clicking on the notification, you will be navigated to the symbol and timeframe. A Velo web notification for a triggered alert ### Telegram notification To enable Telegram notifications, you will need to connect your Velo account to the `Velo Alerts` bot. Connecting to the Velo Alerts Telegram bot After adding the bot through the deep link or the QR code, you should see the message: ``` Successfully linked chat to: ``` Alerts that are created with the Telegram option will now send a notification on the Telegram app instead of the web app when triggered. ## Tips for managing alerts ### Create alerts with plus-menu For a quicker way to create alerts, you can use TradingView's native plus-menu. Creating an alert from TradingView's plus-menu ### Drag-edit alerts If you hold and drag an alert, you can quickly adjust the value at which it should trigger. Dragging an alert line to adjust its trigger value # News To get Velo News, there are 4 approaches: 1. The toasts on [Chart](https://velo.xyz/chart) page 2. The [News](https://velo.xyz/news) page 3. The [Telegram channel](https://t.me/ZoomerfiedNews) 4. The [Velo API](/api/news) ## News toasts on chart page When you have Velo's [Chart](https://velo.xyz/chart) page open, new stories appear as toast notifications in the lower-right corner of the screen. Prioritized news stories have a yellow/golden border around them, while normal news stories are grey.
A priority news toast announcing a Strategy stock buyback on the chart page
Figure 1: A priority news toast displayed on the chart page.
# Manual Connection \[Setup an API wallet for manual connection] To add a Hyperliquid account manually on Velo, navigate to the [API page](https://app.hyperliquid.xyz/API) on Hyperliquid. You will create an API wallet on Hyperliquid which will then be used to trade on Velo. :::info An API wallet will never have access to the main wallet funds and will only have access to trading actions on Hyperliquid. ::: :::steps ### Create an API wallet on Hyperliquid * Enter a name for the API wallet (e.g. velo.xyz) * Generate a new wallet * Press the button "Authorize API Wallet" which will open up a popup Create an API wallet on Hyperliquid ### In the authorization popup * Enter any preferred expiration date on the API wallet (max 180 days) * Save the API wallet private key * Authorize the API wallet (this should prompt e.g. MetaMask for a signature to approve the API wallet) Authorize the API wallet in the popup ### Add the API wallet to Velo After the API wallet has been authorized, you'll need two values to enter into Velo: * The master account address (NOTE: not the API wallet address, this is the master account address found at the top-right of the Hyperliquid UI) * The API wallet private key that was previously saved Master account address in the Hyperliquid UI Then: * Accept the terms * Press "Connect" Add the API wallet to Velo ::: # Borrow & Lend \[Learn about the integration with HyperEVM lending protocols] To borrow stablecoins with HYPE as collateral, you will need to first add a Hyperliquid account to Velo. After a Hyperliquid account is added, the user's wallet can be connected and borrowing will be available to use. Velo currently supports three lending protocols on the HyperEVM network: * Felix * Hyperlend * Hyperdrive The borrow UI in the Velo terminal is an interface for each protocol where the user directly interacts with the protocol's onchain contracts. :::steps ### Add a Hyperliquid account Create or add your Hyperliquid account in Velo so the account is available for borrowing actions. ### Connect your wallet After the Hyperliquid account is added, connect the user's wallet to enable borrowing through the Velo terminal. ::: ## Felix The Felix lending market integrated with Velo is the [Felix Vanilla Markets](https://usefelix.gitbook.io/felix-docs/money-market-products/publish-your-docs), which is a deployment of the [Morpho Blue](https://docs.morpho.org/overview/concepts/market/) protocol. On Morpho Blue (and hence on Felix Vanilla Markets as well), the positions are all isolated from each other. The collateral does not earn yield due to the isolated model used, and borrow rates apply when borrowing assets. ### Health Factor To avoid liquidation on your Felix Vanilla Market position, the health factor needs to be above `1.0`. Any health factor below `1.0` becomes eligible for liquidation. More details can be found in the [Morpho documentation](https://docs.morpho.org/overview/concepts/liquidation/#health-factor). :::info A position is healthy when the Health Factor is greater than 1.0. When it falls below 1.0, the position becomes eligible for liquidation. *Source: [Morpho documentation](https://docs.morpho.org/overview/concepts/liquidation/#health-factor)* ::: ## Hyperlend Hyperlend is a fork of the [Aave V3](https://aave.com/docs/developers/aave-v3) contracts. This means that positions on Hyperlend share collaterals and borrows for all positions, and the collateral will earn supply yield and borrows have borrow rates that apply. ### Health Factor While the UI only allows supplying and borrowing of singular assets, the health factor represents the aggregated health factor that will reflect the same value as the one in Hyperlend's website/contract. To avoid liquidation on Hyperlend the health factor needs to be above `1.0`. Any health factor below `1.0` becomes eligible for liquidation. More details can be found in the [Hyperlend documentation](https://docs.hyperlend.finance/hyperlend-1/liquidations). :::info Liquidation occurs when a borrower's health factor falls below 1, indicating that their collateral value no longer sufficiently covers their loan/debt value. This situation can arise if the collateral decreases in value or the borrowed debt increases in value relative to each other. During a liquidation, a portion of the borrower's debt is repaid, and this amount plus a liquidation fee is deducted from the available collateral. Consequently, the liquidated debt portion is repaid. *Source: [Hyperlend documentation](https://docs.hyperlend.finance/hyperlend-1/liquidations)* ::: ## Hyperdrive Hyperdrive's contracts are isolated borrowing markets, where collateral does not earn yield and where a borrow rate applies to borrows. The contracts are not open-source at the point of writing, and contracts have been audited. ### Health Factor To avoid liquidation on Hyperdrive the health factor needs to be above `100.0`. Any health factor below `100.0` becomes eligible for liquidation. More details can be found in the [Hyperdrive documentation](https://hyperdrive-2.gitbook.io/hyperdrive/borrowing/liquidations). For Hyperdrive, there is a max health factor of `1000.0`. :::info When your Health Score drops below 100 you are then exposed to the risk of being liquidated. It is therefore vital that you pay attention to your Health Score and when it gets too low, start to repay your liabilities or add more collateral to the market. *Source: [Hyperdrive documentation](https://hyperdrive-2.gitbook.io/hyperdrive/borrowing/liquidations#health-score-1)* ::: # Futures \[Learn about the definitions] | Metric | Description | | --- | --- | | **24h Volume** | The total dollar value of trades on the coin in the last 24 hours, broken down into supported exchanges. | | **Open Interest Snapshot** | The coin's open interest in dollars broken down into supported exchanges. | | **Funding** | The coin's historical funding rate, per 8 hours or per annum and broken down into supported exchanges. | | **Open Interest** | The coin's historical open interest in dollars broken down into supported exchanges. | | **Price** | The last traded price of the coin's Binance USDT perpetual. | | **Basis** | The annualized basis of the coin's rolling dated future expiring closest to three months in the future, broken down by exchange.

*BTC and ETH coin-margined futures only.* | | **Liquidations** | The coin's historical liquidations in dollars broken down into supported exchanges. Short liquidations are shown above the x-axis and long liquidations are shown below. | | **Volume** | The coin's historical dollar volume by period, broken down into supported exchanges. | | **CVD** | The coin's cumulative volume delta broken down into supported exchanges. Viewable in dollar terms or standardized by the open interest for that coin on each exchange.

*Cumulative volume delta is the cumulative sum of (market buys minus market sells) for a coin over a given period.* | | **Average Return By Hour** | The coin's average price change by hour of the day, shown in UTC time. | | **Average Return By Day** | The coin's average price change by day of the week, with days defined in UTC time. | | **Cumulative Return By Session** | The coin's cumulative open to close return by market session.

Sessions are defined as the following:

**US** - 8:00am to 6:00pm New York time
**EU** - 8:00am to 6:00pm Brussels time
**APAC** - 8:00am to 6:00pm Seoul time

Some overlap exists between sessions. Through volume analysis and consideration of local stock exchange hours, these windows were determined to be the best way to standardize 24 hours into equal length US, EU, and APAC trading sessions. | # Options \[Learn about the definitions] Velo uses [TradingView's](https://www.tradingview.com/) library to support seamless switching of coins and timeframes. Data updates live up to 5x per second and users may save up to 4 layouts that will persist across browser sessions, as well as display the chart in full screen. *The charting technology is provided by TradingView, a platform for traders and investors. It offers advanced charting tools where people driven by markets can track major upcoming events in the [Economic calendar,](https://www.tradingview.com/economic-calendar/) chat, chart, and prepare for trades.* | Metric | Description | | --- | --- | | **DVOL** | DVOL is Deribit's [implied volatility index](https://insights.deribit.com/exchange-updates/dvol-deribit-implied-volatility-index/). Velo displays the mark price of the index itself. | | **Price Overlay** | Price overlay shows the mark price of the selected coin's perpetual future on Deribit. | | **Volume** | Viewable in contracts, notional, or premium terms, and in the form of call and put, call minus put, or total.

Contract volume is the actual number of contracts traded. Notional volume is the number of contracts traded times the price of each contract's underlying future. Premium is the dollar price of the option times the number of contracts traded. | | **Greeks** | Calculated using the Black Scholes formula. Velo may price each option with a perpetual, dated, or interpolated underlying future.

Traded amounts of **delta** are viewable in terms of coins or dollars, and in the form of call and put, call minus put, or total.
Traded amounts of **gamma** are viewable in terms of coins or dollars.
Traded amounts of **vega** are viewable in terms of coins or dollars. | | **RV** | The realized volatility for the selected underlying (BTC or ETH), shown by default as 30 day realized volatility and with a spread to the DVOL index. The spread to DVOL is best viewed only when RV is kept as the default 30 day measure. | ## Panels The 6 charts beside the large TradingView chart on our Options page. | Panel | Description | | --- | --- | | **ATM Implied Volatility** | Implied volatility is viewable standardized for options expiring in 1 week (7 days), 1 month (30 days), 3 months (90 days), or 6 months (180 days).

At the money implied volatility for each listed expiration is interpolated between the options with strike prices surrounding the price of the underlying future.

At the money implied volatility for each standardized expiration is interpolated between the values for expirations surrounding the target date.

*Saved and shown as a ~240 second moving average.* | | **25 Delta Skew** | 25 delta skew is viewable standardized for options expiring in 1 week (7 days), 1 month (30 days), 3 months (90 days), or 6 months (180 days).

25 delta put implied volatility for each listed expiration is interpolated between the options with deltas surrounding -0.25.

25 delta call implied volatility for each listed expiration is interpolated between the options with deltas surrounding 0.25.

25 delta skew for each listed expiration is calculated as (25 delta put implied volatility − 25 delta call implied volatility) / at the money implied volatility.

25 delta skew for each standardized expiration is interpolated between the values for expirations surrounding the target date.

*Saved and shown as a ~240 second moving average.* | | **Active Options** | The 6 options contracts for the selected coin with the highest volume in the last 24 hours. | | **Put/Call** | **Volume:** The trailing 24 hour options volume in contracts, broken down by put or call.
**OI:** The latest open interest in contracts for all options, broken down by put or call.
**OI (Premium):** The latest open interest in premium (OI × option price in dollars) for all options, broken down by put or call. | | **Term Structure** | The term structure with at the money and forward at the money implied volatility for each expiration on the selected coin. | | **Spot-Vol Correlation** | The trailing correlation between changes in the DVOL index and changes in the underlying price for the selected coin. | | **Term Structure Slope** | The spread between the 1 month at the money implied volatility and 6 month at the money implied volatility for the selected coin. | # Market \[Learn about the definitions] Users can filter most charts on this page to show only the coins on a selected watchlist. Custom watchlists can be made in the table on the [Chart](/features/chart/overview) page. | Metric | Description | | --- | --- | | **Price Changes** | Cumulative coin price changes, shown in percentages. | | **OI-Normalized CVD** | Cumulative dollar volume delta across all supported exchanges for each coin, normalized by the aggregated open interest for that coin.

*Cumulative volume delta is the cumulative sum of (market buys minus market sells) for a coin over a given period.* | | **Funding Heatmap** | The funding rates heatmap chart shows the evolution of coin funding rates over time. The rate shown for each period is an open-interest weighted average of a coin's funding rate (per 8 hours or per annum) for that period, across all supported exchanges. | | **Liquidations Heatmap** | The liquidations heatmap chart shows historical coin liquidations. The value shown for each period is the total number of liquidations on a coin for that period, across all supported exchanges. | | **Open Interest Changes** | Cumulative aggregated open interest (in coin terms) changes, shown in percentages. | | **Return Buckets** | The return buckets chart breaks coins down to their percentage return over a selected time period. Each column shows the number of coins to fall into that bucket, and may list them on mouseover. | | **Market Volume** | The total futures market dollar volume for all selected coins, grouped by exchange. | | **Total Open Interest** | The total dollar open interest for all selected coins, grouped by exchange. | # TradFi \[Learn about the definitions] CME data will typically update as we receive it each day around 10:30pm ET. *Coin values shown may differ from raw contract values. For example, one CME Bitcoin futures contract is equal to five Bitcoin.* | Metric | Description | | --- | --- | | **Open Interest** | **Futures:** The summed open interest in coin or dollar terms across all CME Bitcoin futures contracts.
**Options:** The summed open interest in coin or dollar terms across all CME Bitcoin options contracts. | | **Volume** | **Futures:** The summed volume in coin or dollar terms across all CME Bitcoin futures contracts.
**Options:** The summed volume in coin or dollar terms across all CME Bitcoin options contracts. | | **Basis** | The annualized basis of the next-month CME futures contract for the selected coin.

*Calculated from daily settlement prices against Coinbase spot prices.* | | **GBTC/ETHE Premium** | The premium or discount between the market price and NAV of the [Grayscale trust](https://www.grayscale.com/crypto-products) for the selected coin.

Implied price is also shown, calculated as (trust premium × Coinbase spot price).

*Typically updates next-morning ET.* | # Model Context Protocol (MCP) \[Interact with the Velo API using AI agents] By using Velo's Model Context Protocol (MCP) server, you can have AI agents interact with the Velo API. To access the MCP, you will need an API key. ## Install Connect your AI agent to Velo MCP by running any of the commands below. :::code-group ```bash [Codex] codex mcp add velo --url https://velo.xyz/api/mcp --bearer-token-env-var VELO_API_KEY export VELO_API_KEY= ``` ```bash [Claude] claude mcp add velo --scope user --transport http https://velo.xyz/api/mcp --header 'Authorization: Bearer ' ```
```bash opencode mcp add MCP server name: velo MCP server type: remote MCP server url: https://velo.xyz/api/mcp Require oauth? No ``` For `opencode`, you also need to open `opencode.jsonc` and add the `Authorization` header to authenticate. ``` "velo": { "type": "remote", "url": "https://velo.xyz/api/mcp", "headers": { "Authorization": "Bearer " } } ```
::: ## Tools The Velo MCP server exposes the following read-only tools: | Resource | Tool | Description | | --- | --- | --- | | **Market data** | `market_data` | Get current or historical [spot, futures, and options market data](/api/data). Includes OHLCV, trades, open interest, funding rates, liquidations, basis, and options metrics. | | **Products** | `market_data_products` | Search the [products/symbols available](/sdks/typescript/guides/discover-products). | | **Orderbook** | `orderbook` | Get [historical futures orderbook depth](/sdks/typescript/guides/fetch-orderbook-data) for an exchange product or a Velo-aggregated coin. | | **Orderbook products** | `orderbook_products` | Search the futures products available for orderbook data. | | **Market caps** | `market_caps` | Get [market cap data](/api/data#getcaps) for Velo-aggregated coins. Includes current circulating supply, market capitalization, fully diluted supply, and fully diluted valuation. | | **News** | `news` | Get [news headlines](/api/news#getnews). | To see a list of the supported API endpoints, please visit the [API section](/api). ## Examples ### Screen top performing Trade.xyz assets in last 24 hours :::terminal ```bash # Prompt > show me the top 10 trade.xyz assets that went up the most in last 24h using velo mcp ``` ```ansi # Response • Called └ velo.market_data_products({"category":"futures","exchange":"hyperliquid"}) • Called └ velo.market_data({ • ... • Top 10 trade.xyz assets by exact 24-hour price gain, using Velo MCP’s one- minute Hyperliquid data: # Asset Market 24h ago Latest Change ━━━━━ ━━━━━━━━━ ━━━━━━━━━━━━ ━━━━━━━━━━ ━━━━━━━━━━ ━━━━━━━━━ 1 PLTR xyz:PLTR 139.56 160.42 +14.95% ───── ───────── ──────────── ────────── ────────── ───────── 2 ARM xyz:ARM 239.27 271.97 +13.67% ───── ───────── ──────────── ────────── ────────── ───────── 3 MRVL xyz:MRVL 195.16 215.83 +10.59% ───── ───────── ──────────── ────────── ────────── ───────── 4 KIOXIA xyz:KIOXIA 320.62 349.43 +8.99% ───── ───────── ──────────── ────────── ────────── ───────── 5 SNDK xyz:SNDK 1,296.60 1,404.70 +8.34% ───── ───────── ──────────── ────────── ────────── ───────── 6 INTC xyz:INTC 90.972 98.12 +7.86% ───── ───────── ──────────── ────────── ────────── ───────── 7 LITE xyz:LITE 782.91 842.36 +7.59% ───── ───────── ──────────── ────────── ────────── ───────── 8 MU xyz:MU 829.60 882.72 +6.40% ───── ───────── ──────────── ────────── ────────── ───────── 9 SAMSUNG xyz:SMSN 168.21 178.36 +6.03% ───── ───────── ──────────── ────────── ────────── ───────── 10 AVGO xyz:AVGO 392.34 415.58 +5.92% Snapshot: August 4, 2026 at 21:17 UTC, compared with the same minute 24 hours earlier. Universe: all 51 xyz: markets available through Velo’s Hyperliquid futures catalog. ``` ::: ### HYPE/BTC performance in the last 7 days :::terminal ```bash # Prompt > show me how hype/btc trade have performed in the last 7 days on hyperliquid using velo mpc ``` ```ansi # Response • Called └ velo.market_data({"category":"futures","exchanges": ["hyperliquid"],"products":["HYPE-USD","BTC-USD"],"columns": ["close_price"],"resolution":{"unit":"minutes","value":1},"begin":"2026- 08-04T21:14:00.000Z","end":"2026-08-04T21:30:00.000Z"}) • ... • A long-HYPE / short-BTC trade lost approximately 0.72% over the last seven days, before funding and fees. HYPE underperformed BTC. Metric Jul 28, 21:28 UTC Aug 4, 21:28 UTC Return ━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━ ━━━━━━━━ HYPE $55.334 $55.229 −0.19% ────────── ─────────────────── ────────────────── ──────── BTC $63,892 $64,231 +0.53% ────────── ─────────────────── ────────────────── ──────── HYPE/BTC 0.00086606 0.00085985 −0.72% Daily HYPE/BTC performance: Date HYPE/BTC Cumulative ━━━━━━━━ ━━━━━━━━━━━━ ━━━━━━━━━━━━ Jul 28 0.00086606 — ──────── ──────────── ──────────── Jul 29 0.00083918 −3.10% ──────── ──────────── ──────────── Jul 30 0.00085637 −1.12% ──────── ──────────── ──────────── Jul 31 0.00083497 −3.59% ──────── ──────────── ──────────── Aug 1 0.00082955 −4.22% ──────── ──────────── ──────────── Aug 2 0.00083048 −4.11% ──────── ──────────── ──────────── Aug 3 0.00085029 −1.82% ──────── ──────────── ──────────── Aug 4 0.00085985 −0.72% The trade bottomed around −4.22% at the daily observation on August 1, then recovered most of the loss. Conversely, short HYPE / long BTC returned roughly +0.72%. Source: Velo MCP, synchronized one-minute closes for Hyperliquid HYPE-USD and BTC-USD. Returns exclude funding, trading fees and slippage. ``` ::: # Terms of Service **By connecting to Velo Trading, you accept that neither Velo nor the exchange are responsible for possible losses, our web app saves your API keys on your device only, and Hyperliquid trades carry a builder fee of 0.01% (1 basis point). Please trade responsibly.** By using Velo Data, you agree that: * Your account and account information is for your own use only * Your API key + data, derived data, and news from your API key are for your own use only * If more than three IPs try to use the same account or API key within 5 minutes, only one may be allowed access * API rate limit: 120 requests per 30 seconds * Single requests return a max of [22.5k values](https://github.com/velodataorg/velo-node/blob/f5b00a589853e96b0f156ee23d1808721165ca20/lib/client.js#L87) * Python and NodeJS libraries handle limiting/batching automatically Please contact [support@velo.xyz](mailto\:support@velo.xyz) if you are interested in getting accounts or API keys for multiple people at your organization, or if you are interested in using our data or news for non-internal purposes. # Web App Changelog Changelog for the [Velo Web Application](https://velo.xyz/). Breaking changes, new features and bug fixes. ## 2.2.19 **Improvements** * More consistent order sizing and slider behavior across order types. ## 2.2.17 **Improvements** * Add support for bars, candlesticks, hollow candles, volume candles, line, area, and baseline charts through a dedicated chart type menu. **Fixed** * Fix heatmap synchronization and chart background colors. ## 2.2.16 **Fixed** * Correct the next billing date shown for renewing subscriptions. ## 2.2.15 **Added** * Add `BTDR`, `CGNX`, `FORMSTOCK`, `HORIZON`, `MEITU`, `SENSETIME`, `EURUSD`, `GBPUSD`, and `USDJPY` to the TradFi market list. **Improvements** * Fit the chat panel to narrow screens. **Fixed** * Fix message sending and scrolling issues in chat. ## 2.2.14 **Added** * Add `BYD`, `HK0992`, `HUAHONG`, and `LENOVO` to the TradFi market list. **Fixed** * Display the correct logo for `哈基米`. # TypeScript SDK Changelog Changelog for the Velo TypeScript SDK. Breaking changes, new features and bug fixes. ## 0.2.0 **Added** * [Subscribe to live market data](/sdks/typescript/guides/subscribe-to-live-market-data) with `velo.watch(velo.channels.feed(...))`. ## 0.1.0 **Added** * Query futures, options, and spot market data with a typed, fluent API. * Discover available exchanges and products. * Access historical orderbooks, market caps, and news. * Stream large query results and subscribe to live news. * Built-in authentication, rate limiting, and retries. # Introduction to SDKs Use Velo's SDKs to simplfy the authentication, querying of market data, handling of rate limits and batching in your application. The SDK allows you to: * Query futures, options, and spot market data * Discover supported exchanges, coins, and products * Retrieve market cap data * Fetch historical news or subscribe to live news * Build candles and other timeseries datasets ## Next steps * [Getting Started](/sdks/typescript/getting-started) - make your first request * [Builder and Query](/sdks/typescript/concepts/builder-and-query) - learn how to construct market data queries * [Data Shapes](/sdks/typescript/concepts/data-shapes) - work with the data returned by the SDK * [Discover Products](/sdks/typescript/guides/discover-products) - find supported exchanges, coins, and products * [API Reference](/sdks/typescript/api/futures) - explore the SDK's namespaces and methods # TypeScript SDK \[Build applications with Velo's typed client] The Velo TypeScript SDK provides a typed interface for querying historical market data, subscribing to live market data, discovering products, and consuming news from the Velo API. It handles authentication, request splitting, response parsing, data transformation and more. ## Next steps :::tip Ready to make your first request? Follow the [Getting Started](/sdks/typescript/getting-started) guide. ::: * [Getting Started](/sdks/typescript/getting-started) - configure the SDK and make your first request * [Builder and Query](/sdks/typescript/concepts/builder-and-query) - learn about the builder * [Channels](/sdks/typescript/concepts/channels) - understand live subscriptions * [Data Shapes](/sdks/typescript/concepts/data-shapes) - transform the data to the correct format * [Subscribe to Live Market Data](/sdks/typescript/guides/subscribe-to-live-market-data) - subscribe to prices, open interest, and other live channels # Getting Started ### 1. Install Install Velo's TypeScript SDK :::code-group ```bash [npm] npm install velo-sdk ``` ```bash [bun] bun add velo-sdk ``` ```bash [pnpm] pnpm add velo-sdk ``` ```bash [yarn] yarn add velo-sdk ``` ::: ### 2. API Key Before you can make a request, you need a Velo API key. Here are details on getting an API key: * Velo API keys are available at $199/mo. * Subscriptions are payable *monthly* (3 month history) or *yearly* (full data history). * **Please see the [pricing page](https://velo.xyz/pricing) in the web app to get a key or send us an email to support@velo.xyz to request a trial.** ### 3. Making a request Describe the request with the fluent builder or as a typed request object, then execute it with [`velo.query()`](/sdks/typescript/api/query). :::code-group ```ts [Builder] import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .price() .volume(['total']) .for({ exchanges: ['binance-futures', 'bybit'], coins: ['BTC'], }) .over({ last: '1h', resolution: '1m', }), ); console.log(data.columns()); ``` ```ts [Request object] import { Velo } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query({ kind: 'futures.rows', params: { exchanges: ['binance-futures', 'bybit'], coins: ['BTC'], columns: [ 'open_price', 'high_price', 'low_price', 'close_price', 'dollar_volume', ], begin: Date.now() - 60 * 60 * 1_000, end: Date.now(), resolution: '1m', }, }); console.log(data.columns()); ``` ::: To receive rows one at a time instead of collecting them, use [`velo.stream()`](/sdks/typescript/api/stream) with the same request: ```ts for await (const row of velo.stream(request)) { console.log(row.close_price); } ``` # Builder and Query Requesting market data is two steps: 1. **Describe the request**: with the fluent builder on the `futures`, `options`, and `spot` namespaces, or as a typed request object. 2. **Execute it**: with [`velo.query()`](/sdks/typescript/api/query) to collect all the data, [`velo.stream()`](/sdks/typescript/api/stream) to receive rows one at a time, or [`velo.watch()`](/sdks/typescript/api/watch) to subscribe to a live feed. A request sends nothing on its own, so it can be built once, reused, and passed around. Both ways of describing a request go through the same validation, request-splitting, and decoding pipeline, and return the same typed [`Data` object](/sdks/typescript/concepts/data-shapes). ## Example These two examples request the same futures columns over the same time range: :::code-group ```ts [Builder] const end = Date.now(); const begin = end - 60 * 60 * 1_000; const data = await velo.query( futures .price(['close']) .openInterest(['close']) .volume(['total']) .for({ exchanges: ['binance-futures', 'bybit'], coins: ['BTC'], }) .over({ between: [begin, end], resolution: '1m', }), ); ``` ```ts [Request object] const end = Date.now(); const begin = end - 60 * 60 * 1_000; const data = await velo.query({ kind: 'futures.rows', params: { exchanges: ['binance-futures', 'bybit'], coins: ['BTC'], columns: [ 'close_price', 'dollar_open_interest_close', 'dollar_volume', ], begin, end, resolution: '1m', }, }); ``` ::: The builder translates semantic selectors into raw API columns. For example, `openInterest(['close'])` selects `dollar_open_interest_close` when sending the HTTP request. ## Describing a request A builder is made of three kinds of step, and `for()` and `over()` may be called in either order: | Category | Step | Purpose | | --- | --- | --- | | Data selectors | `price()`, `volume()`, `fundingRate()`, … | Choose the columns. Call as many as needed; they accumulate | | Market scope | `for(scope)` | Choose the markets: `exchanges` plus exactly one of `coins` or `products` | | Time scope | `over(scope)` | Choose the time window: exactly one of `between` or `last`, plus a `resolution` | Both `for()` and `over()` are required. Attempting to execute the request before calling both results in a compile-time error that identifies the missing method. Because a request is a value, you can share it before it is fully configured: ```ts const btc = futures .price(['close']) .volume(['total']) .for({ exchanges: ['bybit'], coins: ['BTC'] }); const hourly = await velo.query(btc.over({ last: '7D', resolution: '1h' })); const daily = await velo.query(btc.over({ last: '90D', resolution: '1D' })); ``` :::warning Exactly one of `coins` and `products` may be used in `for()`, and exactly one of `between` and `last` in `over()`. ::: ## Executing a request | Call | Result | | --- | --- | | [`velo.query(request)`](/sdks/typescript/api/query) | Executes every request and resolves to `Data` | | [`velo.stream(request)`](/sdks/typescript/api/stream) | Executes and yields decoded rows one at a time | | [`velo.watch(request)`](/sdks/typescript/api/watch) | Opens a live subscription and returns a watcher | Use [`velo.query()`](/sdks/typescript/api/query) for the common case: ```ts const data = await velo.query( futures .price() .for({ products: ['BTCUSDT'] }) .over({ last: '1h', resolution: '1m' }), ); ``` Use [`velo.stream()`](/sdks/typescript/api/stream) to process rows without holding the whole result in memory: ```ts for await (const row of velo.stream(request)) { console.log(row.close_price); } ``` Each call executes the request once, so querying and streaming the same request sends its requests twice. Read more at [Stream Large Queries](/sdks/typescript/concepts/stream-large-queries). ## Time ranges `over()` accepts an explicit or a trailing range: :::code-group ```ts [between] const data = await velo.query( futures .price(['close']) .for({ exchanges: ['binance-futures'], coins: ['BTC'] }) .over({ between: [ new Date('2026-01-01T00:00:00Z'), new Date('2026-02-20T00:00:00Z'), ], resolution: '4h', }), ); ``` ```ts [last] const data = await velo.query( futures .price(['close']) .for({ exchanges: ['binance-futures'], coins: ['BTC'] }) .over({ last: '1h', resolution: '1m' }), ); ``` ::: * `between` describes a range `[begin, end)`, where `begin` is included and `end` is excluded. It accepts `Date` objects or millisecond timestamps. * `last` accepts a duration in minutes, hours, days, or weeks. For example: `30m`, `2h`, `3D`, and `1W`. It is anchored when the request is executed. ## Request validation A market-data request must include: * At least one data column. * A `for()` step with exactly one non-empty `coins` or `products` selection. Every exchange for the market is selected when `exchanges` is omitted. * An `over()` step with a valid time range and resolution. Most of this is enforced by the types, so an invalid request will not compile. Values that cannot be checked at compile time, such as symbol names, are validated when the request is built, before any HTTP request is sent. :::info Note that [`basis()`](/sdks/typescript/api/futures/basis) is a special case with its own validation rules. ::: # Data Shapes An executed query returns a `Data` object. It exposes several lazily computed data shapes over the same response, without making additional requests. | API | Returns | Missing values | | --- | --- | --- | | `.rows()` | A flat array of all rows | `null` | | `.series()` | Map of row arrays, keyed by `exchange:product` | `null` | | `.columns()` | Map of index-aligned `Float64Array`s, keyed by `exchange:product` | `NaN` | | `.candles()` | Map of OHLCV candle arrays, keyed by `exchange:product` | Skipped | :::code-group ```json [Rows] [ { "exchange": "binance", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "open_price": 65441.98, "high_price": 65441.99, "low_price": 65308.02, "close_price": 65347.87, "dollar_volume": 1258607.7729999353 }, { "exchange": "coinbase", "coin": "BTC", "product": "BTC-USD", "time": 1785160560000, "open_price": 65377.66, "high_price": 65379.99, "low_price": 65238.68, "close_price": 65288.9, "dollar_volume": 508561.6389999999 } ] ``` ```json [Series] { "binance:BTCUSDT": [ { "exchange": "binance", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "open_price": 65441.98, "high_price": 65441.99, "low_price": 65308.02, "close_price": 65347.87, "dollar_volume": 1258607.7729999353 }, { "exchange": "binance", "coin": "BTC", "product": "BTCUSDT", "time": 1785160620000, "open_price": 65347.87, "high_price": 65360, "low_price": 65220.83, "close_price": 65230.16, "dollar_volume": 2171446.9780000555 } ] } ``` ```json [Columns] { "binance:BTCUSDT": { "exchange": "binance", "coin": "BTC", "product": "BTCUSDT", "time": [ 1785160560000, 1785160620000 ], "values": { "open_price": [ 65441.98, 65347.87 ], "high_price": [ 65441.99, 65360 ], "low_price": [ 65308.02, 65220.83 ], "close_price": [ 65347.87, 65230.16 ], "dollar_volume": [ 1258607.7729999353, 2171446.9780000555 ] } } } ``` ```json [Candles] { "binance:BTCUSDT": [ { "time": 1785160560000, "open": 65441.98, "high": 65441.99, "low": 65308.02, "close": 65347.87, "volume": 1258607.7729999353 }, { "time": 1785160620000, "open": 65347.87, "high": 65360, "low": 65220.83, "close": 65230.16, "volume": 2171446.9780000555 } ] } ``` ::: # Stream Large Queries The SDK automatically splits large market-data queries into multiple HTTP requests. Use [`velo.stream()`](/sdks/typescript/api/stream) to process their rows incrementally instead of waiting for every request to finish and keeping the entire result in memory. | Call | Behavior | | ---------------------- | ---------------------------------------------------------------- | | [`velo.query(request)`](/sdks/typescript/api/query) | Collects every row and resolves to a `Data` object | | [`velo.stream(request)`](/sdks/typescript/api/stream) | Returns an async generator that yields one decoded row at a time | Both take the same request, so switching between them changes one line. :::note Every market-data endpoint can be streamed. `news.stories()` is the exception as it is served as a single JSON document. ::: ## Stream rows A request sends nothing until it is executed. No HTTP request is made until the iterator returned by [`velo.stream()`](/sdks/typescript/api/stream) is advanced. ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const end = Date.now(); const begin = end - 30 * 24 * 60 * 60 * 1_000; const request = futures .price(["close"]) .volume(["total"]) .for({ exchanges: ["binance-futures", "bybit"], coins: ["BTC", "ETH"], }) .over({ between: [begin, end], resolution: "1m", }); for await (const row of velo.stream(request)) { console.log(row); } ``` A typed request object streams the same way: ```ts for await (const row of velo.stream({ kind: "futures.rows", params: { exchanges: ["binance-futures", "bybit"], coins: ["BTC", "ETH"], columns: ["close_price", "dollar_volume"], begin, end, resolution: "1m", }, })) { console.log(row); } ``` :::warning Each call executes the request once. Passing the same request to both [`velo.query()`](/sdks/typescript/api/query) and [`velo.stream()`](/sdks/typescript/api/stream) sends its HTTP requests twice. ::: Ending the loop early with `break` or `return` aborts any request still in flight. ## Rebuild a `Data` object Streaming is useful when rows can be processed and discarded. If you later need the SDK's `.rows()`, `.series()`, `.columns()`, or `.candles()` views, accumulate the rows and pass them to `Data.from()`. ```ts const rows = []; for await (const row of velo.stream(request)) { rows.push(row); } const data = Data.from(rows); console.log(data.rows()); console.log(data.series()); console.log(data.columns()); ``` Accumulating every row uses similar memory to [`velo.query()`](/sdks/typescript/api/query). See [Data Shapes](/sdks/typescript/concepts/data-shapes) for the available views. # Channels Live market data arrives through channels. Choose an indicator and a target, attach listeners, and open a feed with [`velo.watch()`](/sdks/typescript/api/watch). | Part | Purpose | | --- | --- | | Channel | Describes the indicator, target, and listeners for its updates. | | Feed | Groups channels into one subscription request. | | Watcher | Manages the connections and the channels being subscribed to. | Building channels and feeds sends nothing. `velo.watch()` starts the connections and resolves to a watcher, while data arrives through each channel's listeners. ```ts import { Velo } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const price = velo.channels.price(product).on({ data: (row) => console.log(row.time, row.close_price), error: ({ reason }) => console.error('Price channel error:', reason), }); const openInterest = velo.channels.openInterest({ coin: product.coin }, { metric: 'coins' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Open interest channel error:', reason), }); const feed = velo.channels.feed([price, openInterest]); const watcher = await velo.watch(feed, { on: { error: (error) => console.error('Connection error:', error) }, }); ``` ## Scope A channel's target determines its scope: | Scope | Target | Description | | --- | --- | --- | | Single | `{ exchange, coin, product }` | Subscribes to one product on one exchange (e.g. `BTCUSDT` on Binance Futures). | | Aggregated | `{ coin }` | Subscribes to a coin across exchanges, returning one entry per exchange (e.g. `BTC` on Binance Futures and Hyperliquid). | Use the [catalog](/sdks/typescript/guides/discover-products) to find products. See the [Channels reference](/sdks/typescript/api/channels) for supported scopes and markets. ## Listeners Attach listeners with `.on({ data, error })`. A `data` listener is required before adding a channel to a feed; `error` is optional. The data is typed to the channel's indicator, target, and options. Each indicator field is a `number`, or `null` when the server sends no value for it. Check for `null` before doing arithmetic with a field. `.on()` returns a new channel with the listeners attached. Keep that returned value to unsubscribe it later. ### Message metadata The `data` listener receives `(data, message)`: decoded data and a `ChannelMessage` with these fields: | Field | Description | | --- | --- | | `kind` | Identifies the channel's decoder, such as `price` | | `channel` | The wire name used for the subscription | | `timestamp` | The server's tick timestamp in Unix milliseconds, when present | | `data` | The same decoded data as the first argument | | `frame` | The complete, unmodified server frame | ### Error handling Subscription and decoding failures go to the channel's `error` listener. Connection failures go to the watcher's `error` listener. A channel error does not disconnect other channels. Channel errors include the channel's wire name and a `reason`: | Reason | Meaning | | --- | --- | | `rejected` | The server does not recognize the channel name. The channel receives no data until the next connection, which subscribes to it again. | | `decode` | A frame could not be decoded and was skipped. The event also includes the decoder's `error` and the `frame`. | | `failing` | Three frames in a row could not be decoded. Further failures are not reported until a frame decodes again. The subscription stays open, and `data` resumes with the next frame that decodes. | ## Managing subscriptions Use `watcher.subscribe(channel)` and `watcher.unsubscribe(channel)` to change channels while the feed is running. Keep the channel returned by `.on()` to unsubscribe it later: ```ts const volume = velo.channels.volume(product).on({ data: (row) => console.log(row.buy_dollar_volume, row.sell_dollar_volume), error: ({ reason }) => console.error('Volume channel error:', reason), }); watcher.subscribe(volume); // Later: watcher.unsubscribe(volume); watcher.close(); ``` `unsubscribe()` requires the same channel object passed to the feed or `subscribe()`. A watcher must keep at least one channel; use `close()` to stop the last one. Connections retry automatically by default. Reconnecting restores the current subscriptions but does not replay missed updates. See [`velo.watch()`](/sdks/typescript/api/watch) for connection options. ## Understanding update timing For built-in single channels, `time` is the start of the current minute in Unix milliseconds. Updates for the same product and minute share the same `time`. Volume, trade counts, and liquidation counts and volumes accumulate within the minute and reset for the next one. Replace stored values with each update to avoid double-counting them. Aggregated entries contain each exchange's latest values, without `time` or `product`. Exchanges can roll into a new minute at different times, so a message can contain values from different minutes. Use single channels when you need rows aligned by minute. # Discover Products Most market-data requests take a `coins`, `products`, or `exchanges` parameter. Use the catalog endpoints to find the values these accept. Filter a catalog by `coin`, `product`, and `exchange`. A coin is Velo's aggregated and normalized symbol, such as `BTC`. A product is the symbol used by an exchange, such as `BTCUSDT`. :::info Use at most one of `coin` and `product`. Both can be omitted, and either can be combined with `exchange`. ::: ```ts // All futures products const allProducts = await velo.query(catalog.futures()); // All BTC futures products const btcFutures = await velo.query( catalog.futures({ coin: 'BTC', }), ); // All BTC futures products on `binance-futures` const btcBinanceFutures = await velo.query( catalog.futures({ coin: 'BTC', exchange: 'binance-futures', }), ); // One exchange product from `binance-futures` const binanceBtc = await velo.query( catalog.futures({ product: 'BTCUSDT', exchange: 'binance-futures', }), ); ``` Filters are exact and case-insensitive. A search that has no match returns an empty array. ## Product Every entry includes its `exchange`, `coin`, and `product`, along with the beginning of its available history: ```ts import type { FutureProduct } from 'velo-sdk'; const product: FutureProduct = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', begin: 1609459200000, depth: true, }; ``` | Field | Markets | Description | | --- | --- | --- | | `exchange` | All | The exchange and market type that the product belongs to | | `coin` | All | Velo's aggregated and normalized symbol | | `product` | All | The product symbol, the symbol used at an exchange | | `begin` | All | First available timestamp, in Unix milliseconds | | `depth` | Futures | Whether orderbook depth data is available for the futures product | | `end` | Delisted futures and spot | Last available timestamp, in Unix milliseconds | ## Example ```ts const [product] = await velo.query( catalog.futures({ product: 'BTCUSDT', exchange: 'binance-futures', }), ); if (!product) { throw new Error('Failed to find a product'); } const data = await velo.query( futures .price() .for({ products: [product.product], exchanges: [product.exchange], }) .over({ last: '1h', resolution: '1m', }), ); console.log(data.rows()); ``` # Fetch Market Caps Use the `marketCaps` namespace to fetch market caps for coins. ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const caps = await velo.query( marketCaps.history({ coins: ['BTC', 'ETH'] }), ); for (const marketCap of caps) { console.log(marketCap.coin, marketCap.circ_dollars); } ``` `coins` must be a non-empty array. ## Result type [`velo.query()`](/sdks/typescript/api/query) resolves to a `MarketCap[]`. For example: ```json [ { "coin": "BTC", "time": 1783513513252, "circ": 20053612, "circ_dollars": 1248112746545.6, "fdv": 20053612, "fdv_dollars": 1248112746545.6 } ] ``` Each item uses the exported `MarketCap` type: ```ts interface MarketCap { coin: string; time: number; circ: number | null; circ_dollars: number | null; fdv: number | null; fdv_dollars: number | null; } ``` | Field | Description | | --- | --- | | `coin` | Velo's normalized coin symbol | | `time` | Snapshot time, as a Unix timestamp in milliseconds | | `circ` | Circulating supply | | `circ_dollars` | Circulating market capitalization in dollars | | `fdv` | Fully diluted supply | | `fdv_dollars` | Fully diluted valuation in dollars | Supply and valuation fields may be `null` when a value is unavailable. # Fetch News ## Fetch historical news Call `news.stories()` with a millisecond timestamp to describe a request for stories published after that time, then pass it to [`velo.query()`](/sdks/typescript/api/query) to execute it. ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const begin = Date.now() - 24 * 60 * 60 * 1_000; const stories = await velo.query(news.stories({ begin })); for (const story of stories) { console.log(story.headline); } ``` Omit `begin` to fetch every available story: ```ts const stories = await velo.query(news.stories()); ``` ## Watch news in real-time Describe the subscription with `news.feed()` and execute it with [`velo.watch()`](/sdks/typescript/api/watch), which opens the WebSocket and resolves once the subscription is live. ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const watcher = await velo.watch(news.feed(), { on: { story: (story) => { console.log('New story:', story.headline); }, edit: (story) => { console.log('Edited story:', story.headline); }, delete: ({ id }) => { console.log('Deleted story:', id); }, error: (error) => { console.error('News watcher error:', error); }, close: ({ code, reason, wasClean }) => { console.log('News watcher closed:', { code, reason, wasClean }); }, }, }); ``` To handle every event in one place, pass a single function instead of a map and switch on `type`: ```ts const watcher = await velo.watch(news.feed(), { on: (event) => { switch (event.type) { case 'story': case 'edit': console.log(event.type, event.event.headline); break; case 'delete': console.log('Deleted story:', event.event.id); break; } }, }); ``` ## Result types Both `stories()` results and the watcher's `story` and `edit` events use the same story shape. An example of a story: ```json { "id": 1646, "time": 1765554594943, "effectiveTime": 1765554594943, "effectivePrice": 29.058, "headline": "Hyperliquid To Introduce Portfolio Margin", "source": "Team", "priority": 2, "coins": ["HYPE"], "summary": "Portfolio margin is coming.", "link": "https://t.me/hyperliquid_announcements" } ``` The type of the story objects is the `NewsStory` type: ```ts interface NewsStory { id: number; time: number; effectiveTime: number; effectivePrice: number | null; headline: string; source: string | null; priority: number; coins: string[]; summary: string | null; link: string | null; } ``` where `time` and `effectiveTime` are Unix timestamps in milliseconds. The other watcher events have these payloads: | Event | Payload | | --- | --- | | `delete` | `{ id: number }` | | `error` | `VeloError` | | `close` | `{ code: number; reason: string; wasClean: boolean }` | # Fetch Orderbook Data Use the `orderbook` namespace to fetch historical futures orderbook depth for one exchange product or a Velo-aggregated coin. :::warning Not all products support orderbooks, and orderbook history may not match candle history. Use [`catalog.futures`](/sdks/typescript/api/catalog/futures) and select records whose `depth` field is true. ::: :::details[List of symbols that support orderbooks] ``` // Supported products for orderbooks ┌────┬─────────────────┬──────────┬───────────────┬───────────────────────┐ │ │ exchange │ coin │ product │ orderbook start (UTC) │ ├────┼─────────────────┼──────────┼───────────────┼───────────────────────┤ │ 0 │ hyperliquid │ BRENTOIL │ xyz:BRENTOIL │ 2026-05-07 12:00 │ │ 1 │ binance-futures │ BTC │ BTCUSDT │ 2025-03-01 00:00 │ │ 2 │ hyperliquid │ BTC │ BTC-USD │ 2025-03-01 00:00 │ │ 3 │ bybit │ BTC │ BTCUSDT │ 2025-03-01 00:00 │ │ 4 │ okex-swap │ BTC │ BTC-USDT-SWAP │ 2025-03-01 00:00 │ │ 5 │ binance-futures │ CL │ CLUSDT │ 2026-04-01 09:00 │ │ 6 │ hyperliquid │ CL │ xyz:CL │ 2026-05-07 14:00 │ │ 7 │ bybit │ CL │ CLUSDT │ 2026-04-01 01:00 │ │ 8 │ hyperliquid │ ETH │ ETH-USD │ 2025-03-01 00:00 │ │ 9 │ bybit │ ETH │ ETHUSDT │ 2025-03-01 00:00 │ │ 10 │ okex-swap │ ETH │ ETH-USDT-SWAP │ 2025-03-01 00:00 │ │ 11 │ binance-futures │ ETH │ ETHUSDT │ 2025-03-01 00:00 │ │ 12 │ hyperliquid │ HYPE │ HYPE-USD │ 2025-03-01 00:00 │ │ 13 │ bybit │ HYPE │ HYPEUSDT │ 2025-03-01 00:00 │ │ 14 │ binance-futures │ HYPE │ HYPEUSDT │ 2025-05-30 10:30 │ │ 15 │ okex-swap │ SOL │ SOL-USDT-SWAP │ 2025-03-01 00:00 │ │ 16 │ binance-futures │ SOL │ SOLUSDT │ 2025-03-01 00:00 │ │ 17 │ hyperliquid │ SOL │ SOL-USD │ 2025-03-01 00:00 │ │ 18 │ bybit │ SOL │ SOLUSDT │ 2025-03-01 00:00 │ │ 19 │ hyperliquid │ SP500 │ xyz:SP500 │ 2026-04-20 01:00 │ │ 20 │ hyperliquid │ SPCX │ xyz:SPCX │ 2026-06-11 01:00 │ │ 21 │ bybit │ XAG │ XAGUSDT │ 2026-04-01 01:00 │ │ 22 │ hyperliquid │ XAG │ xyz:SILVER │ 2026-05-07 14:00 │ │ 23 │ binance-futures │ XAG │ XAGUSDT │ 2026-04-01 01:00 │ │ 24 │ hyperliquid │ XAU │ xyz:GOLD │ 2026-05-07 14:00 │ │ 25 │ bybit │ XAU │ XAUUSDT │ 2026-04-01 01:00 │ │ 26 │ binance-futures │ XAU │ XAUUSDT │ 2026-04-01 01:00 │ │ 27 │ hyperliquid │ XRP │ XRP-USD │ 2025-03-01 00:00 │ │ 28 │ binance-futures │ XRP │ XRPUSDT │ 2025-03-01 00:00 │ │ 29 │ bybit │ XRP │ XRPUSDT │ 2025-03-01 00:00 │ │ 30 │ okex-swap │ XRP │ XRP-USDT-SWAP │ 2025-03-01 00:00 │ │ 31 │ hyperliquid │ XYZ100 │ xyz:XYZ100 │ 2026-05-07 12:00 │ └────┴─────────────────┴──────────┴───────────────┴───────────────────────┘ ``` ::: ## Fetch historical orderbook data Pass either `exchange` and `product` together, or `coin` on its own. A `coin` query aggregates depth across every tracked futures exchange. Use [`catalog.futures()`](/sdks/typescript/api/catalog/futures) to find products with `depth: true`. :::code-group ```ts [Exchange and product] const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( orderbook.levels({ exchange: 'binance-futures', product: 'BTCUSDT', last: '1h', resolution: '1m', }), ); const latest = data.snapshotAt(-1); if (latest) { console.log('Best bid:', latest.bids[0]); console.log('Best ask:', latest.asks[0]); } ``` ```ts [Coin] const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( orderbook.levels({ coin: 'BTC', last: '1h', resolution: '1m', }), ); const latest = data.snapshotAt(-1); if (latest) { console.log('Best bid:', latest.bids[0]); console.log('Best ask:', latest.asks[0]); } ``` ::: ## Result types [`velo.query()`](/sdks/typescript/api/query) resolves to `OrderbookData`. Call `snapshots()` or `snapshotAt(index)` to view the data as two-sided orderbooks with the best levels first. The `depth` column ranks price levels within each side of the book. Depth 1 is the best bid or ask, while depth 216 is the deepest level shown in this snapshot. ``` // Example snapshot for coin `BTC` asks bids ┌───────┬───────┬────────────┐┌───────┬───────┬────────────┐ │ depth │ price │ size ││ depth │ price │ size │ ├───────┼───────┼────────────┤├───────┼───────┼────────────┤ │ 1 │ 64710 │ 5771.51513 ││ 1 │ 64695 │ 4523.11767 │ │ 2 │ 64725 │ 5275.07568 ││ 2 │ 64680 │ 6011.80615 │ │ 3 │ 64740 │ 5563.13037 ││ 3 │ 64665 │ 4952.93603 │ │ 4 │ 64755 │ 447.168518 ││ 4 │ 64650 │ 4475.40917 │ │ 5 │ 64770 │ 195.603027 ││ 5 │ 64635 │ 2156.96655 │ │ 6 │ 64785 │ 208.961578 ││ 6 │ 64620 │ 197.118194 │ │ ... │ ... │ ... ││ ... │ ... │ ... │ │ 214 │ 67905 │ 5.78559017 ││ 214 │ 61500 │ 595.669799 │ │ 215 │ 67920 │ 7.74172019 ││ 215 │ 61485 │ 2.72295999 │ │ 216 │ 67935 │ 59.1259193 ││ 216 │ 61470 │ 2.05807995 │ └───────┴───────┴────────────┘└───────┴───────┴────────────┘ ``` :::code-group ```ts [Snapshot] interface OrderbookSnapshot { time: number; mid: number; bids: readonly OrderbookLevel[]; asks: readonly OrderbookLevel[]; } interface OrderbookLevel { price: number; size: number; } ``` ```ts [Row] interface OrderbookRow { time: number; mid: number; step: number; prices: Float64Array; sizes: Float64Array; } ``` ::: | Field | Description | | --- | --- | | `time` | Bucket timestamp in Unix milliseconds | | `mid` | Mid price for the bucket | | `bids` | Levels below `mid`, ordered from highest to lowest price | | `asks` | Levels at or above `mid`, ordered from lowest to highest price | | `price` | Level price | | `size` | Resting base-asset size at the level | # Subscribe to Live Market Data Use the `velo.channels` namespace to subscribe to live market data. Build a channel, attach its listeners with `.on()`, and pass it to `velo.channels.feed()`. Execute the feed with [`velo.watch()`](/sdks/typescript/api/watch) to start receiving updates. ## Example Use the [catalog](/sdks/typescript/guides/discover-products) to find its `exchange`, `coin`, and `product`. Each channel needs a `data` listener before it can be added to a feed. Building the channel and feed sends nothing, `velo.watch()` opens the connection and resolves to a watcher. Updates arrive through the channel's listener. ```ts import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY!, }); const [product] = await velo.query( catalog.futures({ exchange: 'binance-futures', product: 'BTCUSDT', }), ); if (!product) { throw new Error('Failed to find a product'); } const price = velo.channels.price(product).on({ data: (row) => console.log(row.time, row.close_price), error: ({ reason }) => console.error('Price channel error:', reason), }); const openInterest = velo.channels.openInterest({ coin: product.coin }, { metric: 'coins' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Open interest channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([price, openInterest]), { on: { error: (error) => console.error('Connection error:', error), }, }); ``` See the [Channels reference](/sdks/typescript/api/channels) for available channels, scopes, and markets. ## Manage the subscription Keep the channel value returned by `.on()` to stop following it later: ```ts watcher.unsubscribe(openInterest); ``` Adding or removing a channel keeps the other subscriptions running. To stop the last channel, close the watcher: ```ts watcher.close(); ``` Connection failures retry automatically by default. Reconnecting subscribes to the channels the watcher currently follows, but does not replay updates missed during the gap. Refresh historical data if your application needs to fill those gaps. See [`velo.watch()`](/sdks/typescript/api/watch) for reconnection options, timeouts, and cancellation. Errors on one channel go to its own `error` listener while the other channels continue. Connection errors go to the watcher's `error` listener. # Python SDK \[Build applications with Velo's Python client] The Velo Python SDK provides an interface for querying market data, discovering products, and consuming news from the Velo API. It handles authentication, request splitting, response parsing, data transformation and more. ## Next steps :::tip Ready to make your first request? Follow the [Getting Started](/sdks/python/getting-started) guide. ::: * [Getting Started](/sdks/python/getting-started) - configure the SDK and make your first request * [Large Requests](/sdks/python/concepts/large-requests) - handle queries that exceed a single request * [Fetch Aggregated Spot CVD](//sdks/python/guides/fetch-aggregated-spot-cvd) - see an example for fetching data # Getting Started ### 1. Install Install Velo's Python SDK ```bash pip install velodata ``` ### 2. API Key Before you can make a request, you need a Velo API key. Here are details on getting an API key: * Velo API keys are available at $199/mo. * Subscriptions are payable *monthly* (3 month history) or *yearly* (full data history). * **Please see the [pricing page](https://velo.xyz/pricing) in the web app to get a key or send us an email to support@velo.xyz to request a trial.** ### 3. Making a request Create a client, select a futures product and columns, then request the rows as a dataframe. ```python from velodata import lib as velo # new velo client client = velo.client('api_key') # get futures and pick one future = client.get_futures()[0] # get futures columns and pick two columns = client.get_futures_columns()[:2] # last 10 minutes in 1 minute resolution params = { 'type': 'futures', 'columns': columns, 'exchanges': [future['exchange']], 'products': [future['product']], 'begin': client.timestamp() - 1000 * 60 * 11, 'end': client.timestamp(), 'resolution': '1m' } # returns dataframe print(client.get_rows(params)) ``` # Large Requests Both `get_rows` and `stream_rows` handle batching of large requests automatically, but if you wish to receive batch responses individually rather than in one final DataFrame, you should use `stream_rows`. ```python 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 minute resolution # 2 columns * 4 products * 1 exchange * 7200 rows = 57600 values params = { 'type': 'futures', 'columns': ['open_price', 'close_price'], 'exchanges': ['binance-futures'], 'products': ['LTCUSDT', 'ETCUSDT', 'BCHUSDT', 'SOLUSDT'], 'begin': client.timestamp() - day_in_ms * 5, 'end': client.timestamp(), 'resolution': '1m' } # creates 3 batches (57600 values / 22500 limit) batches = client.batch_rows(params) # prints each batch as it finishes for df in client.stream_rows(batches): print(df) ``` # Fetch Aggregated Spot CVD ```python from velodata import lib as velo day_in_ms = 1000 * 60 * 60 * 24 # new velo client client = velo.client('api_key') # from one day ago in 10 minute resolution params = { 'type': 'spot', 'columns': ['buy_dollar_volume', 'sell_dollar_volume'], 'exchanges': ['coinbase', 'binance', 'bybit-spot'], 'products': ['ETHUSDT', 'ETH-USD'], 'begin': client.timestamp() - day_in_ms, 'end': client.timestamp(), 'resolution': '10m' } # returns dataframe df = client.get_rows(params) # aggregate all exchanges df = df.groupby(df['time']).sum(numeric_only=True) # compute volume delta df['delta'] = df['buy_dollar_volume'] - df['sell_dollar_volume'] # cumulative print(df['delta'].cumsum()) ``` # Fetch OI-Weighted Funding Rate ```python from velodata import lib as velo hour_in_ms = 1000 * 60 * 60 # new velo client client = velo.client('api_key') # from one hour ago in 1 minute resolution params = { 'type': 'futures', 'columns': ['funding_rate', 'coin_open_interest_close'], 'exchanges': ['binance-futures', 'bybit', 'okex-swap'], 'coins': ['SOL'], 'begin': client.timestamp() - hour_in_ms, 'end': client.timestamp(), 'resolution': '1m' } # returns dataframe df = client.get_rows(params) # oi-weighted funding = SUM(funding*OI) / SUM(OI) df['funding_rate'] = df['funding_rate'] * df['coin_open_interest_close'] df = df.groupby(df['time']).sum(numeric_only=True) df['funding_rate'] = df['funding_rate'] / df['coin_open_interest_close'] print(df['funding_rate']) ``` # Fetch Spot-Vol Correlation ```python 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': 'options', 'columns': ['dvol_close', 'index_price'], 'exchanges': ['deribit'], 'products': ['BTC'], 'begin': client.timestamp() - day_in_ms * 5, 'end': client.timestamp(), 'resolution': '1h' } # returns dataframe df = client.get_rows(params) # simple rolling 24 hour correlation print( df['dvol_close'].pct_change().rolling(24).corr( df['index_price'].pct_change() ) ) ``` # 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. ```python 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)) ``` # Fetch Orderbook Data The `depth` function returns orderbook depth data in snapshots with the specified resolution over the specified time period. ```python from velodata import lib as velo day_in_ms = 1000 * 60 * 60 * 24 # new velo client client = velo.client('api_key') # pick a supported future futures = client.get_futures() futures_with_orderbook_data = [f for f in futures if f['depth']] future = futures_with_orderbook_data[0] # last 24 hours in 5 minute resolution params = { 'exchange': future['exchange'], 'product': future['product'], 'begin': client.timestamp() - day_in_ms, 'end': client.timestamp(), 'resolution': '5m' } # prints orderbook at each timestamp as it finishes for df in client.depth(params): print(df) ``` # Node.js SDK \[Build applications with Velo's Node.js client] The Velo Node.js SDK provides an interface for querying market data, discovering products, and consuming news from the Velo API. It handles authentication, request batching, rate limiting, and response parsing. :::info We recommend developers using the [TypeScript SDK](/sdks/typescript/introduction) over the Node.js SDK. ::: ## Next steps * [Getting Started](/sdks/nodejs/getting-started) - configure the SDK and make your first request # Getting Started :::info We recommend developers using the [TypeScript SDK](/sdks/typescript/getting-started) over the Node.js SDK. ::: ### 1. Install Install Velo's Node.js SDK: ```bash npm install velo-node ``` ### 2. API Key Before you can make a request, you need a Velo API key. Here are details on getting an API key: * Velo API keys are available at $199/mo. * Subscriptions are payable *monthly* (3 month history) or *yearly* (full data history). * **Please see the [pricing page](https://velo.xyz/pricing) in the web app to get a key or send us an email to support@velo.xyz to request a trial.** ### 3. Making a request Create a client, select a futures product and columns, then stream the requested rows. ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const futures = await client.futures() const future = futures[0] const columns = client.futuresColumns() const twoColumns = columns.slice(0, 2) const params = { type: 'futures', columns: twoColumns, exchanges: [future.exchange], products: [future.product], begin: Date.now() - 1000 * 60 * 11, // 10 minutes end: Date.now(), resolution: '1m' // 1 minute } const rows = client.rows(params) for await (const row of rows) { console.log(row) } } main() ``` # Fetch Orderbook Data ```js const velo = require('velo-node') async function main() { const futures = await client.futures() const future = futures.filter((f) => f.depth)[0] const dayInMs = 1000 * 60 * 60 * 24 const params = { exchange: future.exchange, product: future.product, begin: Date.now() - dayInMs, end: Date.now(), resolution: '5m' } const iter = client.depth(params) for await (const depth of iter) { console.log(depth) } } const client = new velo.Client('api_key') main() ``` # velo.query Executes a completed query request and collects every decoded item into the endpoint's result type. Use [`velo.stream()`](/sdks/typescript/api/stream) instead when you want to process supported responses incrementally. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .price(['close']) .volume(['total']) .for({ exchanges: ['binance-futures'], coins: ['BTC'] }) .over({ last: '24h', resolution: '1h' }), ); for (const row of data.rows()) { console.log(row); } ``` `query()` also accepts a typed request object: ```ts const stories = await velo.query({ kind: 'news.stories', params: { begin: Date.now() - 60 * 60 * 1_000 }, }); ``` ## Definition ```ts function query>( input: QueryInput, options?: HttpRequestOptions, ): Promise>; ``` ## Parameters ### input * **Type:** `QueryInput` A direct endpoint request or a completed request builder. The request kind determines the resolved type, and incomplete fluent builders are rejected by TypeScript. Common results include: | Input | Resolved value | | --- | --- | | Futures, options, or spot rows | A typed [`Data`](/sdks/typescript/concepts/data-shapes) object | | `futures.basis()` | A typed `Data` object | | `orderbook.levels()` | `OrderbookData` | | `options.terms()` | `TermPoint[]` | | `catalog.futures()`, `.options()`, or `.spot()` | The corresponding product array | | `marketCaps.history()` | `MarketCap[]` | | `news.stories()` | `NewsStory[]` | Subscription requests such as `news.feed()` cannot be passed to `query()`. Execute them with [`velo.watch()`](/sdks/typescript/api/watch). ### options * **Type:** `HttpRequestOptions` * **Optional** Overrides the client's HTTP settings for every HTTP request generated by this execution. | Property | Type | Description | | --- | --- | --- | | `signal` | `AbortSignal` | Aborts in-flight requests and pending retry waits. | | `timeout` | `number` | Per-attempt timeout in milliseconds. Defaults to the client setting, initially `60_000`. | | `retry` | `Partial` | Overrides the retry count and backoff for this execution. | `RetryOptions` has the following properties: | Property | Type | Default | Description | | --- | --- | --- | --- | | `retries` | `number` | `5` | Maximum retry attempts after the initial request. | | `baseDelayMs` | `number` | `500` | Initial backoff delay, which doubles after each failure. | | `maxDelayMs` | `number` | `10_000` | Maximum backoff delay. | Connection failures, timeouts, HTTP `408`, `429`, and transient `5xx` responses are retried. Server-provided `Retry-After` values are respected when they request a longer delay. ## Return Type * **Type:** `Promise>` Returns a promise whose resolved type is inferred from the request kind and parameters. Market-row requests also preserve the selected exchange and column types. Large requests may be split into multiple HTTP requests. The SDK overlaps up to four of them while preserving request order, then collects all decoded items before resolving. Calling `query()` again with the same input executes it again. ## Errors Invalid request objects and incomplete or unsupported requests fail before an HTTP request is sent. Request failures reject with a `VeloError` subclass after the configured retry budget is exhausted. Aborting `options.signal` rejects with the signal's abort reason. # velo.stream Returns an async generator that executes a supported query and yields decoded items in request order. Streaming avoids collecting the complete result in memory and can surface rows while a line-oriented response is still arriving. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const request = futures .price(['close']) .volume(['total']) .for({ exchanges: ['binance-futures'], coins: ['BTC', 'ETH'] }) .over({ last: '30D', resolution: '1m' }); for await (const row of velo.stream(request)) { console.log(row.time, row.close_price); } ``` No HTTP request is sent until iteration starts. Leaving the loop early aborts requests that are still in flight: ```ts for await (const row of velo.stream(request)) { console.log(row); break; } ``` ## Definition ```ts function stream>( input: QueryInput, options?: HttpRequestOptions, ): AsyncGenerator, void, undefined>; ``` ## Parameters ### input * **Type:** `QueryInput` where `K extends StreamableKind` A direct endpoint request or completed request builder for a streamable query kind. | Input | Yielded item | | --- | --- | | Futures, options, or spot rows | A typed market-data `Row` | | `futures.basis()` | A futures basis row | | `orderbook.levels()` | `OrderbookRow` | | `options.terms()` | `TermPoint` | | `catalog.futures()`, `.options()`, or `.spot()` | The corresponding product type | | `marketCaps.history()` | `MarketCap` | `news.stories()` is not streamable because its response is handled as one JSON document. Use [`velo.query()`](/sdks/typescript/api/query) to fetch it. Subscription requests such as `news.feed()` must be passed to [`velo.watch()`](/sdks/typescript/api/watch). ### options * **Type:** `HttpRequestOptions` * **Optional** Overrides the client's HTTP settings for every HTTP request generated by this execution. | Property | Type | Description | | --- | --- | --- | | `signal` | `AbortSignal` | Aborts iteration, in-flight requests, and pending retry waits. | | `timeout` | `number` | Per-attempt timeout in milliseconds. Defaults to the client setting, initially `60_000`. | | `retry` | `Partial` | Overrides `retries`, `baseDelayMs`, or `maxDelayMs` for this execution. | HTTP retry defaults and retryable failures are described in [`velo.query()`](/sdks/typescript/api/query#options). ## Return Type * **Type:** `AsyncGenerator, void, undefined>` The yielded item type is inferred from the request kind and parameters. Market-row requests preserve the selected exchange and column types. Large queries may be split into multiple HTTP requests. Up to four requests overlap, but decoded items are yielded in request order. Whole-document endpoints that support the streaming interface may yield their items only after an individual response has been buffered and decoded. Each call creates a separate execution. Iterating two generators built from the same request sends the request twice, as does passing the same request to both `query()` and `stream()`. ## Errors Invalid request objects and unsupported query kinds fail when `stream()` creates the generator. HTTP and decoding failures are thrown during iteration as `VeloError` subclasses after retries are exhausted. Aborting `options.signal` throws the signal's abort reason from the iterator. For a longer workflow, see [Stream Large Queries](/sdks/typescript/concepts/stream-large-queries). # velo.watch Opens a live subscription from a completed subscription request. The connection starts immediately, and the returned promise resolves with a reusable watcher once the subscription is live. The subscription kind determines the returned watcher and its events: | Request | Watcher | Events | | --- | --- | --- | | [`velo.news.feed()`](/sdks/typescript/api/news/feed) | `NewsWatcher` | `story`, `edit`, `delete`, `error`, `close` | | [`velo.channels.feed(...)`](/sdks/typescript/api/channels/feed) | `ChannelsWatcher` | `error`, `close` | ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ### News feeds Pass listeners with the initial call so they are attached before the connection opens: ```ts import { Velo, news } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const watcher = await velo.watch(news.feed(), { on: { story: (story) => console.log('New:', story.headline), edit: (story) => console.log('Edited:', story.headline), delete: ({ id }) => console.log('Deleted:', id), error: (error) => console.error(error), }, }); // Permanently close the subscription when it is no longer needed. watcher.close(); ``` `on` can instead be one listener receiving every event as a discriminated union: ```ts const watcher = await velo.watch(news.feed(), { on: (event) => { if (event.type === 'story') { console.log(event.event.headline); } }, }); ``` ### Market-data feeds Attach data listeners to the channels before watching the feed. The watcher's `on` option receives connection events: ```ts const openInterest = velo.channels.openInterest({ coin: 'BTC' }, { metric: 'coins' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Channel error:', reason), }); const channelsWatcher = await velo.watch(velo.channels.feed([openInterest]), { on: { error: (error) => console.error('Connection error:', error), close: ({ code, reason }) => console.log('Connection closed:', code, reason), }, }); // Later: channelsWatcher.close(); ``` ## Definition ```ts function watch>( input: WatchInput, options?: WatchOptions, ): Promise>; ``` ## Parameters ### input * **Type:** `WatchInput` A direct subscription request or completed subscription builder. Query requests cannot be watched; pass them to [`velo.query()`](/sdks/typescript/api/query) or, when supported, [`velo.stream()`](/sdks/typescript/api/stream). ### options * **Type:** `WatchOptions` * **Optional** Both feed kinds share these connection settings. The available `on` events are inferred from the subscription kind: | Property | Type | Description | | --- | --- | --- | | `on` | listeners | A map of watcher-event listeners, or one function receiving every watcher event tagged with `type`. Channel data and channel errors use the channel's own `.on()` listeners. | | `reconnect` | `boolean \| Partial` | Controls retries for the initial connection and automatic reconnection after unexpected drops. Enabled by default. | | `signal` | `AbortSignal` | Permanently closes the watcher when aborted, including during an initial connection or backoff. | | `heartbeatTimeout` | `number` | Maximum time between heartbeat messages in milliseconds. Defaults to `300_000`. | | `connectTimeout` | `number` | Maximum time for each connection attempt in milliseconds. Defaults to `30_000`. | | `onListenerError` | `(error: unknown) => unknown` | Handles errors thrown or rejected by event listeners. | For channel feeds, `on` receives these connection events: | Event | Payload | Description | | --- | --- | --- | | `error` | `VeloError` | A connection failure, such as a heartbeat timeout or a malformed message that cannot be attributed to a channel. | | `close` | `WebSocketCloseEvent` | The connection's close `code`, `reason`, and `wasClean` status. | Listeners supplied through `on` are attached before connecting, so an event cannot arrive between opening the subscription and registering its initial listeners. Channel listeners can also receive data before the promise resolves. ### Reconnection Automatic reconnection uses jittered exponential backoff: | `reconnect` value | Behavior | | --- | --- | | Omitted or `true` | Retries the initial connection up to 5 times, then reconnects indefinitely after unexpected drops. | | `false` | Makes one initial attempt and does not reconnect after a drop. | | An options object | Overrides `retries`, `baseDelayMs`, or `maxDelayMs`. Omitting `retries` keeps the default limits: up to 5 initial retries, then unlimited reconnection attempts. | The default base delay is `500` milliseconds and the maximum delay is `30_000` milliseconds. The initial connection makes one immediate attempt followed by at most `retries` retries. After a drop, the watcher makes at most `retries` reconnection attempts, or unlimited attempts when `retries` is omitted. A connection that stays open for 5 seconds ends the outage, so the next drop starts again from the base delay with a fresh retry budget. A connection that drops sooner continues the current backoff and retry count. Retrying stops immediately when the server refuses the connection with a non-retryable HTTP error, such as `401` or `403` for an invalid API key. Network failures, timeouts (`408`), rate limits (`429`), and `500`, `502`, `503`, or `504` server errors are retried. Intentional endings do not reconnect: `disconnect()` leaves the watcher reusable, while `close()` and aborting `signal` close it permanently. Events missed while disconnected are not replayed. ## Return Type * **Type:** `Promise>` The promise resolves the first time the subscription becomes live. With the default reconnect policy, it remains pending while failed initial connections are retried. It rejects when reconnection is disabled, the initial retry budget is exhausted, the server refuses the connection with a non-retryable error, or the operation is aborted before connecting. For channels, resolution means all required sockets are open and subscription commands have been sent. It does not confirm that every channel is delivering data. A server rejection can arrive afterward at that channel's `error` listener. The resolved watcher exposes a read-only `state` and the following methods: | Member | Description | | --- | --- | | `state` | One of `idle`, `connecting`, `open`, `disconnected`, or `closed`. | | `.on(type, listener)` | Adds a watcher-event listener and returns the watcher. | | `.off(type, listener)` | Removes a watcher-event listener and returns the watcher. | | `.connect()` | Reopens an intentionally disconnected watcher. Returns `Promise`. Concurrent calls share one attempt. | | `.disconnect()` | Disconnects intentionally and leaves the watcher `idle`, preserving its subscriptions and listeners for reuse. | | `.close()` | Permanently closes the watcher and clears its listeners. Calling it repeatedly is safe. | `ChannelsWatcher` also provides these methods: | Method | Description | | --- | --- | | `.subscribe(channel)` | Adds a channel without reconnecting the existing subscriptions. Returns `void`. | | `.unsubscribe(channel)` | Removes a channel previously passed to the feed or `subscribe()`. Returns `void`. | See [Managing subscriptions](/sdks/typescript/concepts/channels#managing-subscriptions) for adding and removing channels, and [`news.feed()`](/sdks/typescript/api/news/feed) for news event payloads. ## Errors Invalid options throw synchronously. Connection failures during the initial sequence reject the promise only after reconnection is disabled, its retry budget is exhausted, or the server refuses the connection with a non-retryable error. Failures after the watcher has opened are delivered through its typed `error` event while automatic reconnection continues according to the selected policy. Failures attributable to one channel go to its own `error` listener while other channels continue. See [Error handling](/sdks/typescript/concepts/channels#error-handling) for server rejection and decoding errors. Errors from user listeners do not close the connection. They are passed to `onListenerError`, or reported through the runtime's default error reporting when no handler is supplied. # Channels API The `velo.channels` namespace provides typed subscriptions to live prices, volume, open interest, funding, and liquidations. ## APIs ### Feeds | API | Description | | --- | --- | | [`.feed()`](/sdks/typescript/api/channels/feed) | Groups channels into a live feed, executed with [`velo.watch()`](/sdks/typescript/api/watch). | ### Indicators | API | Description | Scope | Market | | --- | --- | --- | --- | | [`.price()`](/sdks/typescript/api/channels/price) | OHLC prices and volume. | Single | Futures / Spot | | [`.openInterest()`](/sdks/typescript/api/channels/open-interest) | Coin or dollar open interest. | Single / Aggregated | Futures | | [`.fundingRate()`](/sdks/typescript/api/channels/funding-rate) | Funding rates or funding spend rates. | Single / Aggregated | Futures | | [`.volume()`](/sdks/typescript/api/channels/volume) | Buy and sell volume. | Single / Aggregated | Futures | | [`.spotVolume()`](/sdks/typescript/api/channels/spot-volume) | Buy and sell volume. | Single / Aggregated | Spot | | [`.tape()`](/sdks/typescript/api/channels/tape) | Buy and sell trade counts. | Single / Aggregated | Futures | | [`.spotTape()`](/sdks/typescript/api/channels/spot-tape) | Buy and sell trade counts. | Single / Aggregated | Spot | | [`.premium()`](/sdks/typescript/api/channels/premium) | Premium and open price. | Single / Aggregated | Futures | | [`.liquidations()`](/sdks/typescript/api/channels/liquidations) | Buy and sell liquidation counts. | Single / Aggregated | Futures | | [`.liquidationVolume()`](/sdks/typescript/api/channels/liquidation-volume) | Coin or dollar liquidation volume. | Single / Aggregated | Futures | ### Raw and custom channels | API | Description | | --- | --- | | [`.raw()`](/sdks/typescript/api/channels/raw) | A wire-name channel with an untyped payload. | | [`.custom()`](/sdks/typescript/api/channels/custom) | A channel with a custom synchronous decoder. | See [Channels concepts](/sdks/typescript/concepts/channels) for scope and listener behavior. # channels.feed Describes a subscription to one or more [channels](/sdks/typescript/api/channels). Nothing connects until the feed is executed with [`velo.watch()`](/sdks/typescript/api/watch). ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example Attach listeners to each channel, then pass the channels to `velo.channels.feed()`: ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const price = velo.channels.price(product).on({ data: (row) => console.log(row.time, row.close_price), error: ({ reason }) => console.error('Price channel error:', reason), }); const openInterest = velo.channels.openInterest({ coin: product.coin }, { metric: 'coins' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Open interest channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([price, openInterest]), { on: { error: (error) => console.error('Connection error:', error), close: ({ code, reason }) => console.log('Connection closed:', code, reason), }, }); ``` ## Definition ```ts function feed(channels: readonly Channel[]): ChannelsFeedBuilder; ``` ## Parameters ### channels * **Type:** `readonly Channel[]` * **Required** A non-empty array of `velo.channels` channels, each with a `.on({ data })` listener. Indicators, products, coins, and markets can be mixed. Invalid entries, missing data listeners, or conflicting kinds for the same channel name throw a `VeloError`. ## Return Type * **Type:** `ChannelsFeedBuilder` Returns an immutable subscription builder for the selected channels. See [Managing subscriptions](/sdks/typescript/concepts/channels#managing-subscriptions) for adding and removing channels from a running feed. # channels.price Builds a channel for live futures or spot OHLC prices and volume. Accepts a product on one exchange. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.price(product).on({ data: (row) => console.log(row.time, row.close_price), error: ({ reason }) => console.error('Channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the product. ```ts function price(product: Product): Channel; ``` ## Parameters ### product * **Type:** `Product` * **Required** A futures or spot product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Price has no aggregated coin channel. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected product. | Field | Description | | --- | --- | | `open_price` | First price of the minute | | `high_price` / `low_price` | Highest and lowest prices so far in the minute | | `close_price` | Latest price | | `coin_volume` / `dollar_volume` | Total volume so far in the minute, in coins or dollars | ```json { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "open_price": 65000, "high_price": 65120, "low_price": 64980, "close_price": 65080, "coin_volume": 25, "dollar_volume": 1627000 } ``` # channels.openInterest Builds a channel for live futures open interest. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.openInterest(product, { metric: 'dollars' }).on({ data: (row) => console.log(row.time, row.dollar_open_interest_high), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.openInterest({ coin: product.coin }, { metric: 'dollars' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target and options. ```ts function openInterest( target: Target, options?: { readonly metric?: 'coins' | 'dollars' }, ): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. ### options | Property | Type | Default | Description | | --- | --- | --- | --- | | `metric` | `'coins' \| 'dollars'` | `'dollars'` | Units for the returned values. | Channel metrics use the plural `coins` and `dollars`; historical selectors use `coin` and `dollar`. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target and options. | Metric | Fields | | --- | --- | | `coins` | `coin_open_interest_high`, `coin_open_interest_low`, `coin_open_interest_close` | | `dollars` | `dollar_open_interest_high`, `dollar_open_interest_low`, `dollar_open_interest_close` | Dollar close uses the latest trade price, so it may fall outside the reported high/low range or differ from historical values. :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "dollar_open_interest_high": 65000000, "dollar_open_interest_low": 64000000, "dollar_open_interest_close": 64500000 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "dollar_open_interest_high": 65000000, "dollar_open_interest_low": 64000000, "dollar_open_interest_close": 64500000 } ] ``` ::: # channels.fundingRate Builds a channel for live futures funding rates and funding spend rates. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.fundingRate(product).on({ data: (row) => console.log(row.time, row.funding_rate), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.fundingRate({ coin: product.coin }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target and options. ```ts function fundingRate( target: Product, options?: { readonly measure?: 'rate' | 'coins' | 'dollars'; readonly weighted?: false }, ): Channel; function fundingRate( target: Coin, options?: | { readonly measure?: 'rate'; readonly weighted?: boolean } | { readonly measure: 'coins' | 'dollars'; readonly weighted?: false }, ): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. ### options | Property | Type | Default | Description | | --- | --- | --- | --- | | `measure` | `'rate' \| 'coins' \| 'dollars'` | `'rate'` | Funding rate or the rate multiplied by open interest in the selected units. | | `weighted` | `boolean` | `false` | Adds coin open-interest weights. Available only for a coin target with `measure: 'rate'`. | ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target and options. | Measure | Field | Description | | --- | --- | --- | | `rate` | `funding_rate` | Funding rate as a fraction: `0.0001` is `0.01%` | | `coins` | `coin_funding_spend_rate` | Rate multiplied by coin open interest | | `dollars` | `dollar_funding_spend_rate` | Rate multiplied by dollar open interest | :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "funding_rate": 0.0001 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "funding_rate": 0.0001 } ] ``` ::: ## Weighted funding rate With `weighted: true`, each exchange entry also includes `coin_open_interest_close`. The payload supplies the weights so you can calculate an average: sum each `funding_rate` multiplied by its open interest, then divide by the total open interest. ```ts const weighted = velo.channels.fundingRate({ coin: product.coin }, { weighted: true }).on({ data: (entries) => { let totalWeight = 0; let weightedSum = 0; for (const entry of entries) { const value = entry.funding_rate; const weight = entry.coin_open_interest_close; if (value === null || weight === null) continue; totalWeight += weight; weightedSum += value * weight; } console.log(totalWeight > 0 ? weightedSum / totalWeight : null); }, error: ({ reason }) => console.error('Weighted channel error:', reason), }); const weightedWatcher = await velo.watch(velo.channels.feed([weighted]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: weightedWatcher.close(); ``` # channels.volume Builds a channel for live futures buy and sell volume. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.volume(product, { metric: 'dollars' }).on({ data: (row) => console.log(row.time, row.buy_dollar_volume), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.volume({ coin: product.coin }, { metric: 'dollars' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target and options. ```ts function volume( target: Target, options?: { readonly metric?: 'coins' | 'dollars' }, ): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. ### options | Property | Type | Default | Description | | --- | --- | --- | --- | | `metric` | `'coins' \| 'dollars'` | `'dollars'` | Units for the returned values. | Channel metrics use the plural `coins` and `dollars`; historical selectors use `coin` and `dollar`. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target and options. | Metric | Fields | | --- | --- | | `coins` | `buy_coin_volume`, `sell_coin_volume` | | `dollars` | `buy_dollar_volume`, `sell_dollar_volume` | :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "buy_dollar_volume": 750000, "sell_dollar_volume": 500000 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "buy_dollar_volume": 750000, "sell_dollar_volume": 500000 } ] ``` ::: # channels.spotVolume Builds a channel for live spot buy and sell volume. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'coinbase', coin: 'BTC', product: 'BTC-USD', } as const; const single = velo.channels.spotVolume(product, { metric: 'dollars' }).on({ data: (row) => console.log(row.time, row.buy_dollar_volume), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.spotVolume({ coin: product.coin }, { metric: 'dollars' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target and options. ```ts function spotVolume( target: Target, options?: { readonly metric?: 'coins' | 'dollars' }, ): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A spot product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across spot exchanges. ### options | Property | Type | Default | Description | | --- | --- | --- | --- | | `metric` | `'coins' \| 'dollars'` | `'dollars'` | Units for the returned values. | Channel metrics use the plural `coins` and `dollars`; historical selectors use `coin` and `dollar`. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target and options. | Metric | Fields | | --- | --- | | `coins` | `buy_coin_volume`, `sell_coin_volume` | | `dollars` | `buy_dollar_volume`, `sell_dollar_volume` | :::code-group ```json [Single] { "exchange": "coinbase", "coin": "BTC", "product": "BTC-USD", "time": 1785160560000, "buy_dollar_volume": 420000, "sell_dollar_volume": 310000 } ``` ```json [Aggregated] [ { "exchange": "coinbase", "coin": "BTC", "buy_dollar_volume": 420000, "sell_dollar_volume": 310000 } ] ``` ::: # channels.tape Builds a channel for live futures buy and sell trade counts. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.tape(product).on({ data: (row) => console.log(row.time, row.buy_trades), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.tape({ coin: product.coin }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target. ```ts function tape(target: Target): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target. | Field | Description | | --- | --- | | `buy_trades` | Number of buy trades so far in the minute | | `sell_trades` | Number of sell trades so far in the minute | :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "buy_trades": 120, "sell_trades": 95 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "buy_trades": 120, "sell_trades": 95 } ] ``` ::: # channels.spotTape Builds a channel for live spot buy and sell trade counts. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'coinbase', coin: 'BTC', product: 'BTC-USD', } as const; const single = velo.channels.spotTape(product).on({ data: (row) => console.log(row.time, row.buy_trades), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.spotTape({ coin: product.coin }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target. ```ts function spotTape(target: Target): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A spot product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across spot exchanges. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target. | Field | Description | | --- | --- | | `buy_trades` | Number of buy trades so far in the minute | | `sell_trades` | Number of sell trades so far in the minute | :::code-group ```json [Single] { "exchange": "coinbase", "coin": "BTC", "product": "BTC-USD", "time": 1785160560000, "buy_trades": 80, "sell_trades": 65 } ``` ```json [Aggregated] [ { "exchange": "coinbase", "coin": "BTC", "buy_trades": 80, "sell_trades": 65 } ] ``` ::: # channels.premium Builds a channel for live futures premium and open price. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.premium(product).on({ data: (row) => console.log(row.time, row.premium), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.premium({ coin: product.coin }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target and options. ```ts function premium( target: Product, options?: { readonly weighted?: false }, ): Channel; function premium( target: Coin, options?: { readonly weighted?: boolean }, ): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. ### options | Property | Type | Default | Description | | --- | --- | --- | --- | | `weighted` | `boolean` | `false` | Adds coin open-interest weights. Available only for a coin target. | ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target and options. | Field | Description | | --- | --- | | `premium` | Mark price minus index price, in quote currency, averaged over the minute so far | | `open_price` | The minute's opening trade price | :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "premium": 12.5, "open_price": 65000 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "premium": 12.5, "open_price": 65000 } ] ``` ::: ## Weighted premium With `weighted: true`, each exchange entry also includes `coin_open_interest_close`. The payload supplies the weights so you can calculate an average: sum each `premium` multiplied by its open interest, then divide by the total open interest. ```ts const weighted = velo.channels.premium({ coin: product.coin }, { weighted: true }).on({ data: (entries) => { let totalWeight = 0; let weightedSum = 0; for (const entry of entries) { const value = entry.premium; const weight = entry.coin_open_interest_close; if (value === null || weight === null) continue; totalWeight += weight; weightedSum += value * weight; } console.log(totalWeight > 0 ? weightedSum / totalWeight : null); }, error: ({ reason }) => console.error('Weighted channel error:', reason), }); const weightedWatcher = await velo.watch(velo.channels.feed([weighted]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: weightedWatcher.close(); ``` # channels.liquidations Builds a channel for live futures buy and sell liquidation counts. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.liquidations(product).on({ data: (row) => console.log(row.time, row.buy_liquidations), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.liquidations({ coin: product.coin }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target. ```ts function liquidations(target: Target): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. :::info Live liquidations are published only for `binance-futures`, `bybit`, `deribit`, `hyperliquid`, and `okex-swap`. ::: ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target. | Field | Description | | --- | --- | | `buy_liquidations` | Forced buys that close short positions | | `sell_liquidations` | Forced sells that close long positions | :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "buy_liquidations": 3, "sell_liquidations": 5 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "buy_liquidations": 3, "sell_liquidations": 5 } ] ``` ::: # channels.liquidationVolume Builds a channel for live futures buy and sell liquidation volume. Accepts a product on one exchange or a coin across exchanges. Pass it to [velo.channels.feed()](/sdks/typescript/api/channels/feed) with a `data` listener to receive updates. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const product = { exchange: 'binance-futures', coin: 'BTC', product: 'BTCUSDT', } as const; const single = velo.channels.liquidationVolume(product, { metric: 'dollars' }).on({ data: (row) => console.log(row.time, row.buy_liquidations_dollar_volume), error: ({ reason }) => console.error('Channel error:', reason), }); const aggregated = velo.channels.liquidationVolume({ coin: product.coin }, { metric: 'dollars' }).on({ data: (entries) => console.table(entries), error: ({ reason }) => console.error('Aggregated channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([single, aggregated]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition Simplified signature. The SDK infers the returned channel's data type from the target and options. ```ts function liquidationVolume( target: Target, options?: { readonly metric?: 'coins' | 'dollars' }, ): Channel; ``` ## Parameters ### target * **Type:** `Target` * **Required** A futures product with `exchange`, `coin`, and `product`, as returned by the [catalog](/sdks/typescript/guides/discover-products). Pass `{ coin }` on its own for an aggregated channel across futures exchanges. :::info Live liquidations are published only for `binance-futures`, `bybit`, `deribit`, `hyperliquid`, and `okex-swap`. ::: ### options | Property | Type | Default | Description | | --- | --- | --- | --- | | `metric` | `'coins' \| 'dollars'` | `'dollars'` | Units for the returned values. | Channel metrics use the plural `coins` and `dollars`; historical selectors use `coin` and `dollar`. ## Return Type * **Type:** `Channel` Returns a channel typed with the selected target and options. | Metric | Fields | | --- | --- | | `coins` | `buy_liquidations_coin_volume`, `sell_liquidations_coin_volume` | | `dollars` | `buy_liquidations_dollar_volume`, `sell_liquidations_dollar_volume` | :::code-group ```json [Single] { "exchange": "binance-futures", "coin": "BTC", "product": "BTCUSDT", "time": 1785160560000, "buy_liquidations_dollar_volume": 150000, "sell_liquidations_dollar_volume": 250000 } ``` ```json [Aggregated] [ { "exchange": "binance-futures", "coin": "BTC", "buy_liquidations_dollar_volume": 150000, "sell_liquidations_dollar_volume": 250000 } ] ``` ::: # channels.raw Builds a channel from its wire name. The listener receives the server's payload as `unknown`, even when the name matches a built-in indicator. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const raw = velo.channels.raw('realtime_binance-futures:BTCUSDT').on({ data: (payload, message) => console.log(payload, message.frame), error: ({ reason }) => console.error('Raw channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([raw]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` Use [channels.price()](/sdks/typescript/api/channels/price) when you want this channel decoded into named price and volume fields. ## Definition ```ts function raw(name: string): RawChannel; ``` ## Parameters ### name * **Type:** `string` * **Required** The exact channel name sent to the server. It must be non-empty and contain no surrounding whitespace or control characters. Validating the name does not confirm that the server publishes it. A raw channel and a typed channel with the same wire name have different `kind` values and cannot share one watcher. ## Return Type * **Type:** `RawChannel` Returns a channel with payload data typed as `unknown`. The payload is the frame's `d` field, unchanged, or `undefined` when absent. Use `message.frame` to access the complete server frame. # channels.custom Builds a channel with a decoder of your own. The decoder's return type determines the data received by the channel's listener. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Example This decoder reads the close price from a product's raw price frame: ```ts const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const closePrice = velo.channels.custom({ kind: 'app.price-close', name: 'realtime_binance-futures:BTCUSDT', decode: (frame) => { const values = frame.d; if ( !Array.isArray(values) || values.length !== 6 || !values.every( (value) => value === null || (typeof value === 'number' && Number.isFinite(value)), ) || typeof frame.tt !== 'number' || !Number.isFinite(frame.tt) ) { throw new Error('Invalid price frame'); } return { closePrice: values[3] as number | null, tickTime: frame.tt }; }, }).on({ data: (data) => console.log(data.closePrice, data.tickTime), error: ({ reason }) => console.error('Custom channel error:', reason), }); const watcher = await velo.watch(velo.channels.feed([closePrice]), { on: { error: (error) => console.error('Connection error:', error) }, }); // Later: watcher.close(); ``` ## Definition ```ts function custom( definition: CustomChannel, ): Channel; ``` ## Parameters ### definition * **Type:** `CustomChannel` * **Required** | Property | Type | Description | | --- | --- | --- | | `kind` | `string` | A non-empty name identifying how the payload is decoded. Use a name distinct from the built-in kinds. | | `name` | `string` | The exact wire name. It must be non-empty with no surrounding whitespace or control characters. | | `decode` | `(frame: ChannelFrame) => Data` | Validates and decodes the frame synchronously. Throw when the frame cannot be decoded. | The decoder receives the complete frame, including `c`, optional `d` and `tt`, and any channel-specific fields. These payload fields are untrusted data that your decoder must validate. Payload values can be `null` when the server sends no value; accept them, or those frames are reported as `decode` errors. Async decoders and promise-like return values are not supported. Use a distinct `kind` for each decoder. ## Return Type * **Type:** `Channel` Returns a channel typed with the decoder's return value. # Futures API The `futures` namespace provides typed queries for historical futures prices, volume, open interest, funding, liquidations, and basis data. ## APIs | API | Description | | --- | --- | | [`.basis()`](/sdks/typescript/api/futures/basis) | Queries the annualized three-month futures basis. | | [`.price()`](/sdks/typescript/api/futures/price) | Selects OHLC price columns. | | [`.volume()`](/sdks/typescript/api/futures/volume) | Selects coin or dollar volume columns. | | [`.trades()`](/sdks/typescript/api/futures/trades) | Selects buy, sell, or total trade counts. | | [`.openInterest()`](/sdks/typescript/api/futures/open-interest) | Selects coin or dollar open-interest columns. | | [`.fundingRate()`](/sdks/typescript/api/futures/funding-rate) | Selects funding-rate and average-funding-rate columns. | | [`.premium()`](/sdks/typescript/api/futures/premium) | Selects the futures premium column. | | [`.liquidations()`](/sdks/typescript/api/futures/liquidations) | Selects long or short liquidation counts. | | [`.liquidationVolume()`](/sdks/typescript/api/futures/liquidation-volume) | Selects coin or dollar liquidation-volume columns. | | [`.for()`](/sdks/typescript/api/futures/for) | Selects the exchanges and the coins or products to query. | | [`.over()`](/sdks/typescript/api/futures/over) | Selects the time window and resolution. | ## Required scope | Step | Property | Description | | --- | --- | --- | | [`.for()`](/sdks/typescript/api/futures/for) | `exchanges` | Restricts the exchanges. Every exchange is selected when omitted. | | [`.for()`](/sdks/typescript/api/futures/for) | `coins` / `products` | Targets Velo-aggregated coins, or exchange-native products. | | [`.over()`](/sdks/typescript/api/futures/over) | `between` / `last` | An explicit `[begin, end)` range, or a trailing duration. | | [`.over()`](/sdks/typescript/api/futures/over) | `resolution` | Sets the returned bucket size. | Every request needs a `.for()` step with exactly one target (`coins` or `products`) and an `.over()` step with one time range (`between` or `last`) and a `resolution`. Pass the result to [`velo.query()`](/sdks/typescript/api/query). The `.basis()` builder instead supports `BTC` and `ETH` with a time range and resolution. # futures.basis Creates an immutable builder for the annualized basis of the rolling futures contract expiring closest to three months in the future. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .basis() .coins(['BTC']) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` The `.coins()` call is optional. When omitted, the query includes both BTC and ETH. ## Definition ```ts function basis(): FuturesBasisBuilder; ``` ## Parameters None. ## Return Type * **Type:** `FuturesBasisBuilder` Returns an immutable builder with the following methods: | Method | Description | | --- | --- | | `.coins(coins)` | Selects `BTC`, `ETH`, or both. Defaults to both coins. | | `.over(scope)` | Selects the time window and resolution. Required. | Pass the request to [`velo.query()`](/sdks/typescript/api/query) to resolve `Data`, or to [`velo.stream()`](/sdks/typescript/api/stream) to receive rows one at a time. Basis takes no `.for()` step: it selects coins directly, and the API always serves it across the exchanges used for the basis calculation. # futures.price Adds futures price columns to a query builder. Calling `.price()` without arguments selects all four OHLC columns. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .price(['close']) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function price(): FuturesBuilder; function price

( parts: readonly P[], ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesPricePart[]` * **Optional** * **Default:** `['open', 'high', 'low', 'close']` ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.volume Adds futures volume columns to an immutable query builder. Calling `.volume()` without arguments selects all dollar-volume columns. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .volume(['total'], { metric: 'coin' }) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function volume(): FuturesBuilder>; function volume( options: { readonly metric: M }, ): FuturesBuilder>; function volume

( parts: readonly P[], ): FuturesBuilder>; function volume< P extends FuturesVolumePart, M extends FuturesVolumeMetric, >( parts: readonly P[], options: { readonly metric: M }, ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesVolumePart[]` * **Optional** * **Default:** `['total', 'buy', 'sell']` | Part | `coin` column | `dollar` column | | --- | --- | --- | | `total` | `coin_volume` | `dollar_volume` | | `buy` | `buy_coin_volume` | `buy_dollar_volume` | | `sell` | `sell_coin_volume` | `sell_dollar_volume` | ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether volume is measured in coins or dollars. ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.trades Adds futures trade-count columns to an immutable query builder. Calling `.trades()` without arguments selects buy, sell, and total trade counts. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .trades(['buy', 'sell']) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function trades(): FuturesBuilder; function trades

( parts: readonly P[], ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesTradePart[]` * **Optional** * **Default:** `['buy', 'sell', 'total']` | Part | Selected column | | --- | --- | | `buy` | `buy_trades` | | `sell` | `sell_trades` | | `total` | `total_trades` | ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.openInterest Adds futures open-interest columns to an immutable query builder. Calling `.openInterest()` without arguments selects all dollar open-interest columns. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .openInterest(['close'], { metric: 'coin' }) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function openInterest( ): FuturesBuilder>; function openInterest( options: { readonly metric: M }, ): FuturesBuilder>; function openInterest

( parts: readonly P[], ): FuturesBuilder>; function openInterest< P extends FuturesOpenInterestPart, M extends FuturesOpenInterestMetric, >( parts: readonly P[], options: { readonly metric: M }, ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesOpenInterestPart[]` * **Optional** * **Default:** `['high', 'low', 'close']` | Part | `coin` column | `dollar` column | | --- | --- | --- | | `high` | `coin_open_interest_high` | `dollar_open_interest_high` | | `low` | `coin_open_interest_low` | `dollar_open_interest_low` | | `close` | `coin_open_interest_close` | `dollar_open_interest_close` | ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether open interest is measured in coins or dollars. ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.fundingRate Adds futures funding-rate columns to an immutable query builder. Calling `.fundingRate()` without arguments selects both the rate and average columns. Funding rates reflect rates as they update, rather than the rates at the last funding payment interval. These are sometimes called “predicted funding rates.” All funding rates are normalized to an eight-hour interval. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .fundingRate(['average']) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function fundingRate(): FuturesBuilder; function fundingRate

( parts: readonly P[], ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesFundingRatePart[]` * **Optional** * **Default:** `['rate', 'average']` | Part | Selected column | | --- | --- | | `rate` | `funding_rate` | | `average` | `funding_rate_avg` | ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.premium Adds the futures premium column to an immutable query builder. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .premium() .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function premium(): FuturesBuilder; ``` ## Parameters None. ## Return Type * **Type:** `FuturesBuilder` Returns a builder typed with the accumulated columns. # futures.liquidations Adds futures liquidation-count columns to an immutable query builder. Calling `.liquidations()` without arguments selects both buy and sell counts. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .liquidations(['sell']) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function liquidations(): FuturesBuilder; function liquidations

( parts: readonly P[], ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesLiquidationPart[]` * **Optional** * **Default:** `['buy', 'sell']` | Part | Selected column | | --- | --- | | `buy` | `buy_liquidations` | | `sell` | `sell_liquidations` | ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.liquidationVolume Adds futures liquidation-volume columns to an immutable query builder. Calling `.liquidationVolume()` without arguments selects all dollar-volume columns. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .liquidationVolume(['total'], { metric: 'coin' }) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function liquidationVolume( ): FuturesBuilder>; function liquidationVolume( options: { readonly metric: M }, ): FuturesBuilder>; function liquidationVolume

( parts: readonly P[], ): FuturesBuilder>; function liquidationVolume< P extends FuturesLiquidationVolumePart, M extends FuturesLiquidationVolumeMetric, >( parts: readonly P[], options: { readonly metric: M }, ): FuturesBuilder>; ``` ## Parameters ### parts * **Type:** `readonly FuturesLiquidationVolumePart[]` * **Optional** * **Default:** `['buy', 'sell', 'total']` | Part | `coin` column | `dollar` column | | --- | --- | --- | | `buy` | `buy_liquidations_coin_volume` | `buy_liquidations_dollar_volume` | | `sell` | `sell_liquidations_coin_volume` | `sell_liquidations_dollar_volume` | | `total` | `liquidations_coin_volume` | `liquidations_dollar_volume` | ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether liquidation volume is measured in coins or dollars. ## Return Type * **Type:** `FuturesBuilder>` Returns a builder typed with the accumulated columns. # futures.for Defines which markets to query. Choose exactly one of `coins` or `products`, and optionally select specific `exchanges` (omit for all exchanges). The `.for()` step is required before a request can be executed. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .price(['close']) .for({ exchanges: ['binance-futures', 'bybit'], coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); ``` Omitting `exchanges` selects every futures exchange: ```ts futures.price(['close']).for({ coins: ['BTC'] }); ``` ## Definition ```ts function for(scope: MarketScope): FuturesBuilder; ``` ## Parameters ### scope.coins / scope.products * **Type:** `readonly string[]` Provide exactly one of the two. Use `coins` for Velo-aggregated symbols, `products` for exchange-specific symbols. ### scope.exchanges * **Type:** `readonly FuturesExchange[]` * **Optional** * **Default:** every futures exchange When given, the returned row type narrows to exactly the exchanges selected. ## Return Type * **Type:** `FuturesBuilder` Returns a builder with the market scope recorded. Call [`.over()`](/sdks/typescript/api/futures/over) to add the time window. # futures.over Defines the time window to query. Choose exactly one of `between` or `last`, and select a `resolution`. The `.over()` step is required before a request can be executed. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples :::code-group ```ts [last] const data = await velo.query( futures .price(['close']) .for({ coins: ['BTC'] }) .over({ last: '1D', resolution: '1h', }), ); ``` ```ts [between] const data = await velo.query( futures .price(['close']) .for({ coins: ['BTC'] }) .over({ between: [ new Date('2026-01-01T00:00:00Z'), new Date('2026-02-01T00:00:00Z'), ], resolution: '4h', }), ); ``` ::: ## Definition ```ts function over(scope: WindowScope): FuturesBuilder; ``` ## Parameters ### scope.between / scope.last * **Type:** `readonly [number | Date, number | Date]` (`between`) or `LastDuration` (`last`) Provide exactly one of the two. * `between` is a `[begin, end)` pair of `Date` objects or millisecond timestamps * `last` is a trailing duration in minutes, hours, days, or weeks: `30m`, `2h`, `3D`, `1W`. It is anchored when the request is executed ### scope.resolution * **Type:** `Resolution` ## Return Type * **Type:** `FuturesBuilder` Returns a builder with the time window recorded. Pass it to [`velo.query()`](/sdks/typescript/api/query) or [`velo.stream()`](/sdks/typescript/api/stream). # Orderbook API The `orderbook` namespace queries historical futures orderbook depth for one exchange product or a Velo-aggregated coin. :::warning Not all products support orderbooks, and orderbook history may not match candle history. Use [`catalog.futures`](/sdks/typescript/api/catalog/futures) and select records whose `depth` field is true. ::: :::details[List of symbols that support orderbooks] ``` // Supported products for orderbooks ┌────┬─────────────────┬──────────┬───────────────┬───────────────────────┐ │ │ exchange │ coin │ product │ orderbook start (UTC) │ ├────┼─────────────────┼──────────┼───────────────┼───────────────────────┤ │ 0 │ hyperliquid │ BRENTOIL │ xyz:BRENTOIL │ 2026-05-07 12:00 │ │ 1 │ binance-futures │ BTC │ BTCUSDT │ 2025-03-01 00:00 │ │ 2 │ hyperliquid │ BTC │ BTC-USD │ 2025-03-01 00:00 │ │ 3 │ bybit │ BTC │ BTCUSDT │ 2025-03-01 00:00 │ │ 4 │ okex-swap │ BTC │ BTC-USDT-SWAP │ 2025-03-01 00:00 │ │ 5 │ binance-futures │ CL │ CLUSDT │ 2026-04-01 09:00 │ │ 6 │ hyperliquid │ CL │ xyz:CL │ 2026-05-07 14:00 │ │ 7 │ bybit │ CL │ CLUSDT │ 2026-04-01 01:00 │ │ 8 │ hyperliquid │ ETH │ ETH-USD │ 2025-03-01 00:00 │ │ 9 │ bybit │ ETH │ ETHUSDT │ 2025-03-01 00:00 │ │ 10 │ okex-swap │ ETH │ ETH-USDT-SWAP │ 2025-03-01 00:00 │ │ 11 │ binance-futures │ ETH │ ETHUSDT │ 2025-03-01 00:00 │ │ 12 │ hyperliquid │ HYPE │ HYPE-USD │ 2025-03-01 00:00 │ │ 13 │ bybit │ HYPE │ HYPEUSDT │ 2025-03-01 00:00 │ │ 14 │ binance-futures │ HYPE │ HYPEUSDT │ 2025-05-30 10:30 │ │ 15 │ okex-swap │ SOL │ SOL-USDT-SWAP │ 2025-03-01 00:00 │ │ 16 │ binance-futures │ SOL │ SOLUSDT │ 2025-03-01 00:00 │ │ 17 │ hyperliquid │ SOL │ SOL-USD │ 2025-03-01 00:00 │ │ 18 │ bybit │ SOL │ SOLUSDT │ 2025-03-01 00:00 │ │ 19 │ hyperliquid │ SP500 │ xyz:SP500 │ 2026-04-20 01:00 │ │ 20 │ hyperliquid │ SPCX │ xyz:SPCX │ 2026-06-11 01:00 │ │ 21 │ bybit │ XAG │ XAGUSDT │ 2026-04-01 01:00 │ │ 22 │ hyperliquid │ XAG │ xyz:SILVER │ 2026-05-07 14:00 │ │ 23 │ binance-futures │ XAG │ XAGUSDT │ 2026-04-01 01:00 │ │ 24 │ hyperliquid │ XAU │ xyz:GOLD │ 2026-05-07 14:00 │ │ 25 │ bybit │ XAU │ XAUUSDT │ 2026-04-01 01:00 │ │ 26 │ binance-futures │ XAU │ XAUUSDT │ 2026-04-01 01:00 │ │ 27 │ hyperliquid │ XRP │ XRP-USD │ 2025-03-01 00:00 │ │ 28 │ binance-futures │ XRP │ XRPUSDT │ 2025-03-01 00:00 │ │ 29 │ bybit │ XRP │ XRPUSDT │ 2025-03-01 00:00 │ │ 30 │ okex-swap │ XRP │ XRP-USDT-SWAP │ 2025-03-01 00:00 │ │ 31 │ hyperliquid │ XYZ100 │ xyz:XYZ100 │ 2026-05-07 12:00 │ └────┴─────────────────┴──────────┴───────────────┴───────────────────────┘ ``` ::: ## APIs | API | Description | | --- | --- | | [`.levels()`](/sdks/typescript/api/orderbook/levels) | Describes an orderbook depth request. | ## Required scope | Property | Description | | --- | --- | | `exchange` and `product` | Targets one exchange-native futures product. | | `coin` | Targets a Velo-aggregated orderbook across tracked futures exchanges. | | `between` | Uses an explicit beginning and end time. | | `last` | Uses a trailing duration ending at the current time. | | `resolution` | Sets the time interval for each returned orderbook. | Queries require exactly one target (either `exchange` and `product`, or `coin`), one time range (`between` or `last`), and a `resolution`. Use [`catalog.futures()`](/sdks/typescript/api/catalog/futures) to find products with `depth: true`. # orderbook.levels Describes an orderbook depth request. Takes the whole scope in one object: a target, a time window, and a resolution. Pass the result to [`velo.query()`](/sdks/typescript/api/query) or [`velo.stream()`](/sdks/typescript/api/stream). ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples :::code-group ```ts [Exchange and product] import { Velo, orderbook } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( orderbook.levels({ exchange: 'binance-futures', product: 'BTCUSDT', last: '1h', resolution: '1m', }), ); const latest = data.snapshotAt(-1); ``` ```ts [Coin] const data = await velo.query( orderbook.levels({ coin: 'BTC', last: '1h', resolution: '1m', }), ); ``` ```ts [Streaming] const request = orderbook.levels({ exchange: 'binance-futures', product: 'BTCUSDT', last: '1h', resolution: '1m', }); for await (const row of velo.stream(request)) { console.log(row.time, row.mid); } ``` ::: ## Definition ```ts function levels(scope: OrderbookScope): OrderbookLevelsBuilder; ``` ## Parameters ### scope.exchange and scope.product * **Type:** `FuturesExchange` and `string` * Use both together to target one exchange product ### scope.coin * **Type:** `string` * Use alone for the Velo-aggregated book Provide either `coin` or both `exchange` and `product`. ### scope.between / scope.last * **Type:** `readonly [number | Date, number | Date]` (`between`) or `LastDuration` (`last`) Provide exactly one of the two. * `between` is a `[begin, end)` pair of `Date` objects or millisecond timestamps * `last` is a trailing duration, anchored when the request is executed ### scope.resolution * **Type:** `OrderbookResolution` Only minute-based resolutions are supported. ## Return Type * **Type:** `OrderbookLevelsBuilder` Returns a request. Executing it resolves to [`OrderbookData`](/sdks/typescript/concepts/data-shapes), which exposes `rows()`, `snapshots()`, and `snapshotAt()`. Requests wider than the per-request bucket cap are split into several HTTP requests automatically. # Options API The `options` namespace provides typed queries for historical options metrics and implied-volatility term structures. ## APIs | API | Description | | --- | --- | | [`.terms()`](/sdks/typescript/api/options/terms) | Queries the BTC or ETH implied-volatility term structure. | | [`.iv()`](/sdks/typescript/api/options/iv) | Selects standardized implied-volatility tenors. | | [`.skew()`](/sdks/typescript/api/options/skew) | Selects standardized 25-delta skew tenors. | | [`.vega()`](/sdks/typescript/api/options/vega) | Selects coin or dollar vega. | | [`.delta()`](/sdks/typescript/api/options/delta) | Selects call or put delta in coins or dollars. | | [`.gamma()`](/sdks/typescript/api/options/gamma) | Selects coin or dollar gamma. | | [`.volume()`](/sdks/typescript/api/options/volume) | Selects call or put contract volume. | | [`.dollarVolume()`](/sdks/typescript/api/options/dollar-volume) | Selects total dollar volume. | | [`.premium()`](/sdks/typescript/api/options/premium) | Selects call or put premium. | | [`.notional()`](/sdks/typescript/api/options/notional) | Selects call or put notional. | | [`.dvol()`](/sdks/typescript/api/options/dvol) | Selects DVOL OHLC values. | | [`.indexPrice()`](/sdks/typescript/api/options/index-price) | Selects the underlying index price. | | [`.for()`](/sdks/typescript/api/options/for) | Selects the exchanges and the coins or products to query. | | [`.over()`](/sdks/typescript/api/options/over) | Selects the time window and resolution. | ## Required scope | Step | Property | Description | | --- | --- | --- | | [`.for()`](/sdks/typescript/api/options/for) | `exchanges` | Restricts the exchanges. Every exchange is selected when omitted. | | [`.for()`](/sdks/typescript/api/options/for) | `coins` / `products` | Targets Velo-aggregated coins, or exchange-native products. | | [`.over()`](/sdks/typescript/api/options/over) | `between` / `last` | An explicit `[begin, end)` range, or a trailing duration. | | [`.over()`](/sdks/typescript/api/options/over) | `resolution` | Sets the returned bucket size. | Every request needs a `.for()` step with exactly one target (`coins` or `products`) and an `.over()` step with one time range (`between` or `last`) and a `resolution`. Pass the result to [`velo.query()`](/sdks/typescript/api/query). Options rows are currently available from `deribit`. The `.terms()` query instead accepts `BTC`, `ETH`, or both. # options.terms Builds an immutable, validated request for the BTC or ETH implied-volatility term structure. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const points = await velo.query( options.terms({ coins: ['BTC', 'ETH'] }), ); ``` ## Definition ```ts function terms(params: TermsParams): OptionsTermsBuilder; ``` ## Parameters ### params * **Type:** `TermsParams` ### params.coins * **Type:** `readonly ('BTC' | 'ETH')[]` One or both supported coins. ## Return Type * **Type:** `OptionsTermsBuilder` Returns an immutable request builder. Pass it to [`velo.query()`](/sdks/typescript/api/query) to resolve `TermPoint[]`, or to [`velo.stream()`](/sdks/typescript/api/stream) to iterate `TermPoint` items. ### TermPoint | Property | Type | Description | | --- | --- | --- | | `coin` | `TermsCoin` | The underlying coin: `BTC` or `ETH`. | | `time` | `number` | The timestamp in milliseconds. | | `at_the_money_iv` | `number | null` | At-the-money implied volatility. | | `dte` | `number | null` | Days to expiration. | | `fwd_iv` | `number | null` | Forward implied volatility. | # options.iv Adds standardized at-the-money implied-volatility columns to an immutable query builder. Calling `.iv()` without arguments selects every tenor. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .iv(['1m', '3m']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function iv(): OptionsBuilder; function iv( tenors: readonly T[], ): OptionsBuilder>; ``` ## Parameters ### tenors * **Type:** `readonly OptionsIvTenor[]` * **Optional** * **Default:** `['1w', '1m', '3m', '6m']` | Tenor | Selected column | | --- | --- | | `1w` | `iv_1w` | | `1m` | `iv_1m` | | `3m` | `iv_3m` | | `6m` | `iv_6m` | ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.skew Adds standardized 25-delta skew columns to an immutable query builder. Calling `.skew()` without arguments selects every tenor. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .skew(['1m', '3m']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function skew(): OptionsBuilder; function skew( tenors: readonly T[], ): OptionsBuilder>; ``` ## Parameters ### tenors * **Type:** `readonly OptionsSkewTenor[]` * **Optional** * **Default:** `['1w', '1m', '3m', '6m']` | Tenor | Selected column | | --- | --- | | `1w` | `skew_1w` | | `1m` | `skew_1m` | | `3m` | `skew_3m` | | `6m` | `skew_6m` | ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.vega Adds an options vega column to an immutable query builder. Calling `.vega()` without arguments selects dollar vega. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .vega({ metric: 'coin' }) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function vega(): OptionsBuilder>; function vega( options: { readonly metric: M }, ): OptionsBuilder>; ``` ## Parameters ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether vega is measured in coins or dollars. ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.delta Adds options delta columns to an immutable query builder. Calling `.delta()` without arguments selects call and put delta in dollars. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .delta(['put'], { metric: 'coin' }) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function delta(): OptionsBuilder>; function delta( options: { readonly metric: M }, ): OptionsBuilder>; function delta

( parts: readonly P[], ): OptionsBuilder>; function delta< P extends OptionsDeltaPart, M extends OptionsDeltaMetric, >( parts: readonly P[], options: { readonly metric: M }, ): OptionsBuilder>; ``` ## Parameters ### parts * **Type:** `readonly OptionsDeltaPart[]` * **Optional** * **Default:** `['call', 'put']` | Part | `coin` column | `dollar` column | | --- | --- | --- | | `call` | `call_delta_coins` | `call_delta_dollars` | | `put` | `put_delta_coins` | `put_delta_dollars` | ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether delta is measured in coins or dollars. ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.gamma Adds an options gamma column to an immutable query builder. Calling `.gamma()` without arguments selects dollar gamma. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .gamma({ metric: 'coin' }) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function gamma(): OptionsBuilder>; function gamma( options: { readonly metric: M }, ): OptionsBuilder>; ``` ## Parameters ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether gamma is measured in coins or dollars. ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.volume Adds call and put contract-volume columns to an immutable query builder. Calling `.volume()` without arguments selects both sides. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .volume(['call']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function volume(): OptionsBuilder; function volume

( parts: readonly P[], ): OptionsBuilder>; ``` ## Parameters ### parts * **Type:** `readonly OptionsVolumePart[]` * **Optional** * **Default:** `['call', 'put']` | Part | Selected column | | --- | --- | | `call` | `call_volume` | | `put` | `put_volume` | ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.dollarVolume Adds the total options dollar-volume column to an immutable query builder. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .dollarVolume() .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function dollarVolume( ): OptionsBuilder; ``` ## Parameters None. ## Return Type * **Type:** `OptionsBuilder` Returns a builder typed with the accumulated columns. # options.premium Adds call and put premium columns to an immutable query builder. Calling `.premium()` without arguments selects both sides. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .premium(['put']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function premium(): OptionsBuilder; function premium

( parts: readonly P[], ): OptionsBuilder>; ``` ## Parameters ### parts * **Type:** `readonly OptionsPremiumPart[]` * **Optional** * **Default:** `['call', 'put']` | Part | Selected column | | --- | --- | | `call` | `call_premium` | | `put` | `put_premium` | ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.notional Adds call and put notional columns to an immutable query builder. Calling `.notional()` without arguments selects both sides. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .notional(['call']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function notional(): OptionsBuilder; function notional

( parts: readonly P[], ): OptionsBuilder>; ``` ## Parameters ### parts * **Type:** `readonly OptionsNotionalPart[]` * **Optional** * **Default:** `['call', 'put']` | Part | Selected column | | --- | --- | | `call` | `call_notional` | | `put` | `put_notional` | ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.dvol Adds Deribit's implied-volatility index OHLC columns to an immutable query builder. Calling `.dvol()` without arguments selects all four values. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .dvol(['close']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function dvol(): OptionsBuilder; function dvol

( parts: readonly P[], ): OptionsBuilder>; ``` ## Parameters ### parts * **Type:** `readonly OptionsDvolPart[]` * **Optional** * **Default:** `['open', 'high', 'low', 'close']` | Part | Selected column | | --- | --- | | `open` | `dvol_open` | | `high` | `dvol_high` | | `low` | `dvol_low` | | `close` | `dvol_close` | ## Return Type * **Type:** `OptionsBuilder>` Returns a builder typed with the accumulated columns. # options.indexPrice Adds the underlying index-price column to an immutable query builder. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .indexPrice() .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function indexPrice( ): OptionsBuilder; ``` ## Parameters None. ## Return Type * **Type:** `OptionsBuilder` Returns a builder typed with the accumulated columns. # options.for Defines which markets to query. Choose exactly one of `coins` or `products`, and optionally select specific `exchanges` (omit for all exchanges). The `.for()` step is required before a request can be executed. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .iv(['1m']) .for({ exchanges: ['deribit'], coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); ``` Omitting `exchanges` selects every options exchange: ```ts options.iv(['1m']).for({ coins: ['BTC'] }); ``` ## Definition ```ts function for(scope: MarketScope): OptionsBuilder; ``` ## Parameters ### scope.coins / scope.products * **Type:** `readonly string[]` Provide exactly one of the two. Use `coins` for Velo-aggregated symbols, `products` for exchange-specific symbols. ### scope.exchanges * **Type:** `readonly OptionsExchange[]` * **Optional** * **Default:** every options exchange When given, the returned row type narrows to exactly the exchanges selected. ## Return Type * **Type:** `OptionsBuilder` Returns a builder with the market scope recorded. Call [`.over()`](/sdks/typescript/api/options/over) to add the time window. # options.over Defines the time window to query. Choose exactly one of `between` or `last`, and select a `resolution`. The `.over()` step is required before a request can be executed. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples :::code-group ```ts [last] const data = await velo.query( options .iv(['1m']) .for({ coins: ['BTC'] }) .over({ last: '1D', resolution: '1h', }), ); ``` ```ts [between] const data = await velo.query( options .iv(['1m']) .for({ coins: ['BTC'] }) .over({ between: [ new Date('2026-01-01T00:00:00Z'), new Date('2026-02-01T00:00:00Z'), ], resolution: '4h', }), ); ``` ::: ## Definition ```ts function over(scope: WindowScope): OptionsBuilder; ``` ## Parameters ### scope.between / scope.last * **Type:** `readonly [number | Date, number | Date]` (`between`) or `LastDuration` (`last`) Provide exactly one of the two. * `between` is a `[begin, end)` pair of `Date` objects or millisecond timestamps * `last` is a trailing duration in minutes, hours, days, or weeks: `30m`, `2h`, `3D`, `1W`. It is anchored when the request is executed ### scope.resolution * **Type:** `Resolution` ## Return Type * **Type:** `OptionsBuilder` Returns a builder with the time window recorded. Pass it to [`velo.query()`](/sdks/typescript/api/query) or [`velo.stream()`](/sdks/typescript/api/stream). # Spot API The `spot` namespace provides typed queries for historical spot prices, volume, and trade counts. ## APIs | API | Description | | --- | --- | | [`.price()`](/sdks/typescript/api/spot/price) | Selects OHLC price columns. | | [`.volume()`](/sdks/typescript/api/spot/volume) | Selects coin or dollar volume columns. | | [`.trades()`](/sdks/typescript/api/spot/trades) | Selects buy, sell, or total trade counts. | | [`.for()`](/sdks/typescript/api/spot/for) | Selects the exchanges and the coins or products to query. | | [`.over()`](/sdks/typescript/api/spot/over) | Selects the time window and resolution. | ## Required scope | Step | Property | Description | | --- | --- | --- | | [`.for()`](/sdks/typescript/api/spot/for) | `exchanges` | Restricts the exchanges. Every exchange is selected when omitted. | | [`.for()`](/sdks/typescript/api/spot/for) | `coins` / `products` | Targets Velo-aggregated coins, or exchange-native products. | | [`.over()`](/sdks/typescript/api/spot/over) | `between` / `last` | An explicit `[begin, end)` range, or a trailing duration. | | [`.over()`](/sdks/typescript/api/spot/over) | `resolution` | Sets the returned bucket size. | Builder queries require exactly one target (either `coins` or `products`), one time range (`between` or `last`), and a `resolution`. # spot.price Adds spot price columns to an immutable query builder. Calling `.price()` without arguments selects all four OHLC columns. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .price(['close']) .for({ products: ['BTC-USD'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function price(): SpotBuilder; function price

( parts: readonly P[], ): SpotBuilder>; ``` ## Parameters ### parts * **Type:** `readonly SpotPricePart[]` * **Optional** * **Default:** `['open', 'high', 'low', 'close']` | Part | Selected column | | --- | --- | | `open` | `open_price` | | `high` | `high_price` | | `low` | `low_price` | | `close` | `close_price` | ## Return Type * **Type:** `SpotBuilder>` Returns a builder typed with the accumulated columns. # spot.volume Adds spot volume columns to an immutable query builder. Calling `.volume()` without arguments selects all dollar-volume columns. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .volume(['buy'], { metric: 'coin' }) .for({ products: ['BTC-USD'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function volume(): SpotBuilder>; function volume( options: { readonly metric: M }, ): SpotBuilder>; function volume

( parts: readonly P[], ): SpotBuilder>; function volume< P extends SpotVolumePart, M extends SpotVolumeMetric, >( parts: readonly P[], options: { readonly metric: M }, ): SpotBuilder>; ``` ## Parameters ### parts * **Type:** `readonly SpotVolumePart[]` * **Optional** * **Default:** `['total', 'buy', 'sell']` | Part | `coin` column | `dollar` column | | --- | --- | --- | | `total` | `coin_volume` | `dollar_volume` | | `buy` | `buy_coin_volume` | `buy_dollar_volume` | | `sell` | `sell_coin_volume` | `sell_dollar_volume` | ### options * **Type:** `{ readonly metric: 'coin' | 'dollar' }` * **Optional** * **Default:** `{ metric: 'dollar' }` Selects whether volume is measured in coins or dollars. ## Return Type * **Type:** `SpotBuilder>` Returns a builder typed with the accumulated columns. # spot.trades Adds spot trade-count columns to an immutable query builder. Calling `.trades()` without arguments selects buy, sell, and total trade counts. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .trades(['buy', 'sell']) .for({ products: ['BTC-USD'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` ## Definition ```ts function trades(): SpotBuilder; function trades

( parts: readonly P[], ): SpotBuilder>; ``` ## Parameters ### parts * **Type:** `readonly SpotTradePart[]` * **Optional** * **Default:** `['buy', 'sell', 'total']` | Part | Selected column | | --- | --- | | `buy` | `buy_trades` | | `sell` | `sell_trades` | | `total` | `total_trades` | ## Return Type * **Type:** `SpotBuilder>` Returns a builder typed with the accumulated columns. # spot.for Defines which markets to query. Choose exactly one of `coins` or `products`, and optionally select specific `exchanges` (omit for all exchanges). The `.for()` step is required before a request can be executed. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .price(['close']) .for({ exchanges: ['binance', 'coinbase'], coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); ``` Omitting `exchanges` selects every spot exchange: ```ts spot.price(['close']).for({ coins: ['BTC'] }); ``` ## Definition ```ts function for(scope: MarketScope): SpotBuilder; ``` ## Parameters ### scope.coins / scope.products * **Type:** `readonly string[]` Provide exactly one of the two. Use `coins` for Velo-aggregated symbols, `products` for exchange-specific symbols. ### scope.exchanges * **Type:** `readonly SpotExchange[]` * **Optional** * **Default:** every spot exchange When given, the returned row type narrows to exactly the exchanges selected. ## Return Type * **Type:** `SpotBuilder` Returns a builder with the market scope recorded. Call [`.over()`](/sdks/typescript/api/spot/over) to add the time window. # spot.over Defines the time window to query. Choose exactly one of `between` or `last`, and select a `resolution`. The `.over()` step is required before a request can be executed. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples :::code-group ```ts [last] const data = await velo.query( spot .price(['close']) .for({ coins: ['BTC'] }) .over({ last: '1D', resolution: '1h', }), ); ``` ```ts [between] const data = await velo.query( spot .price(['close']) .for({ coins: ['BTC'] }) .over({ between: [ new Date('2026-01-01T00:00:00Z'), new Date('2026-02-01T00:00:00Z'), ], resolution: '4h', }), ); ``` ::: ## Definition ```ts function over(scope: WindowScope): SpotBuilder; ``` ## Parameters ### scope.between / scope.last * **Type:** `readonly [number | Date, number | Date]` (`between`) or `LastDuration` (`last`) Provide exactly one of the two. * `between` is a `[begin, end)` pair of `Date` objects or millisecond timestamps * `last` is a trailing duration in minutes, hours, days, or weeks: `30m`, `2h`, `3D`, `1W`. It is anchored when the request is executed ### scope.resolution * **Type:** `Resolution` ## Return Type * **Type:** `SpotBuilder` Returns a builder with the time window recorded. Pass it to [`velo.query()`](/sdks/typescript/api/query) or [`velo.stream()`](/sdks/typescript/api/stream). # Catalog API The `catalog` namespace discovers the exchanges, coins, and product symbols available for each market. ## APIs | API | Description | | --- | --- | | [`.futures()`](/sdks/typescript/api/catalog/futures) | Fetches and filters futures products. | | [`.options()`](/sdks/typescript/api/catalog/options) | Fetches and filters options products. | | [`.spot()`](/sdks/typescript/api/catalog/spot) | Fetches and filters spot products. | Catalog filters are exact and case-insensitive. `coin` and `product` are mutually exclusive, but either may be combined with `exchange`. Omitting all filters returns the complete selected catalog. # catalog.futures Fetches the futures product catalog and optionally filters it by coin, product, or exchange. Active products are returned by default. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.futures({ coin: 'BTC', exchange: 'binance-futures', }), ); ``` ## Definition ```ts function futures(params?: FuturesCatalogParams): FuturesCatalogBuilder; ``` ## Parameters ### params * **Type:** `FuturesCatalogParams` * **Optional** | Property | Type | Description | | --- | --- | --- | | `coin` | `string` | Matches a Velo-aggregated coin symbol. | | `product` | `string` | Matches an exchange-native product symbol. | | `exchange` | `FuturesExchange` | Matches a supported futures exchange. | | `delisted` | `boolean` | When `true`, returns the delisted-only catalog. Defaults to `false`. | | `depth` | `boolean` | Keeps only rows whose orderbook-depth flag matches. | `coin` and `product` are mutually exclusive. All filters are exact and case-insensitive. ## Return Type * **Type:** `FuturesCatalogBuilder` Returns an immutable request builder. Passing it to [`velo.query()`](/sdks/typescript/api/query) resolves to `FutureProduct[]`: an array of matching catalog products, or an empty array when no products match. Per-request timeout, retry, and abort-signal options (`HttpRequestOptions`) are supplied as the second argument to [`velo.query()`](/sdks/typescript/api/query). | Property | Type | Description | | --- | --- | --- | | `exchange` | `FuturesExchange` | The exchange and futures market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | | `depth` | `boolean` | Whether order-book depth data is available. | | `end` | Optional `number` | Last available timestamp for a delisted product. | # catalog.options Fetches the active options product catalog and optionally filters it by coin, product, or exchange. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.options({ coin: 'BTC', exchange: 'deribit', }), ); ``` ## Definition ```ts function options(params?: OptionsCatalogParams): OptionsCatalogBuilder; ``` ## Parameters ### params * **Type:** `OptionsCatalogParams` * **Optional** | Property | Type | Description | | --- | --- | --- | | `coin` | `string` | Matches a Velo-aggregated coin symbol. | | `product` | `string` | Matches an exchange-native product symbol. | | `exchange` | `OptionsExchange` | Matches an options exchange. Currently accepts `deribit`. | `coin` and `product` are mutually exclusive. All filters are exact and case-insensitive. The options catalog does not support a `delisted` parameter. ## Return Type * **Type:** `OptionsCatalogBuilder` Returns an immutable request builder. Passing it to [`velo.query()`](/sdks/typescript/api/query) resolves to `OptionProduct[]`: an array of matching catalog products, or an empty array when no products match. Per-request timeout, retry, and abort-signal options (`HttpRequestOptions`) are supplied as the second argument to [`velo.query()`](/sdks/typescript/api/query). | Property | Type | Description | | --- | --- | --- | | `exchange` | `OptionsExchange` | The exchange and options market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | # catalog.spot Fetches the spot product catalog and optionally filters it by coin, product, or exchange. Active products are returned by default. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.spot({ coin: 'BTC', exchange: 'coinbase', }), ); ``` ## Definition ```ts function spot(params?: SpotCatalogParams): SpotCatalogBuilder; ``` ## Parameters ### params * **Type:** `SpotCatalogParams` * **Optional** | Property | Type | Description | | --- | --- | --- | | `coin` | `string` | Matches a Velo-aggregated coin symbol. | | `product` | `string` | Matches an exchange-native product symbol. | | `exchange` | `SpotExchange` | Matches a supported spot exchange. | | `delisted` | `boolean` | When `true`, returns the delisted-only catalog. Defaults to `false`. | `coin` and `product` are mutually exclusive. All filters are exact and case-insensitive. ## Return Type * **Type:** `SpotCatalogBuilder` Returns an immutable request builder. Passing it to [`velo.query()`](/sdks/typescript/api/query) resolves to `SpotProduct[]`: an array of matching catalog products, or an empty array when no products match. Per-request timeout, retry, and abort-signal options (`HttpRequestOptions`) are supplied as the second argument to [`velo.query()`](/sdks/typescript/api/query). | Property | Type | Description | | --- | --- | --- | | `exchange` | `SpotExchange` | The exchange and spot market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | | `end` | Optional `number` | Last available timestamp for a delisted product. | # Market Caps API The `marketCaps` namespace fetches the latest supply and valuation snapshot for one or more coins. ## APIs | API | Description | | --- | --- | | [`.query()`](/sdks/typescript/api/market-caps/history) | Creates a lazy market-cap query for one or more coins. | # marketCaps.history Builds an immutable, validated request for the latest supply and market-cap data. No request is sent until the builder is passed to [`velo.query()`](/sdks/typescript/api/query) or iteration begins through [`velo.stream()`](/sdks/typescript/api/stream). ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, marketCaps } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const caps = await velo.query( marketCaps.history({ coins: ['BTC', 'ETH'] }), ); ``` ## Definition ```ts function history( params: MarketCapsParams, ): MarketCapsHistoryBuilder; ``` ## Parameters ### params * **Type:** `MarketCapsParams` ### params.coins * **Type:** `readonly string[]` One or more coin symbols. ## Return Type * **Type:** `MarketCapsHistoryBuilder` Returns an immutable request builder. Passing it to [`velo.query()`](/sdks/typescript/api/query) resolves to `MarketCap[]`: an array of matching market-cap snapshots, or an empty array when no snapshots match. Passing it to [`velo.stream()`](/sdks/typescript/api/stream) yields `MarketCap` items. ### MarketCap | Property | Type | Description | | --- | --- | --- | | `coin` | `string` | The Velo-normalized coin symbol. | | `time` | `number` | Snapshot time as a Unix timestamp in milliseconds. | | `circ` | `number | null` | Circulating supply. | | `circ_dollars` | `number | null` | Circulating market capitalization in dollars. | | `fdv` | `number | null` | Fully diluted supply. | | `fdv_dollars` | `number | null` | Fully diluted valuation in dollars. | # News API The `news` namespace fetches historical news stories and subscribes to live stories, edits, and deletions. ## APIs | API | Description | | --- | --- | | [`.stories()`](/sdks/typescript/api/news/stories) | Fetches historical news stories, executed with [`velo.query()`](/sdks/typescript/api/query). | | [`.feed()`](/sdks/typescript/api/news/feed) | Describes a real-time news subscription, executed with [`velo.watch()`](/sdks/typescript/api/watch). | # news.stories Fetches historical news stories published after an optional millisecond timestamp. No request is sent until the builder is passed to [`velo.query()`](/sdks/typescript/api/query). ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo, news } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const stories = await velo.query( news.stories({ begin: Date.now() - 24 * 60 * 60 * 1000, }), ); for (const story of stories) { console.log(story.time, story.headline); } ``` ## Definition ```ts function stories(params?: NewsStoriesParams): NewsStoriesBuilder; ``` ## Parameters ### params * **Type:** `NewsStoriesParams` * **Optional** | Property | Type | Description | | --- | --- | --- | | `begin` | `number` | Only returns stories published after this millisecond timestamp. Defaults to `0`. | `begin` must be a non-negative safe integer. Omitting it returns all available stories. ## Return Type * **Type:** `NewsStoriesBuilder` Returns an immutable request builder. Passing it to [`velo.query()`](/sdks/typescript/api/query) resolves to `NewsStory[]`: an array of matching news stories, or an empty array when no stories match. News is served as a single JSON document rather than rows, so this builder is query-only: [`velo.stream()`](/sdks/typescript/api/stream) does not accept it, and passing it is a type error. Per-request timeout, retry, and abort-signal options (`HttpRequestOptions`) are supplied as the second argument to [`velo.query()`](/sdks/typescript/api/query), not to `news.stories()`. ### NewsStory | Property | Type | Description | | --- | --- | --- | | `id` | `number` | The story identifier. | | `time` | `number` | Publication timestamp in milliseconds. | | `effectiveTime` | `number` | Timestamp at which the story became market-relevant, in milliseconds. | | `effectivePrice` | `number | null` | Reference price associated with the story. | | `headline` | `string` | The story headline. | | `source` | Nullable `string` | The story publisher or source. | | `priority` | `number` | The story priority. | | `coins` | `string[]` | Coins associated with the story. | | `summary` | Nullable `string` | A summary of the story. | | `link` | Nullable `string` | A link to the original story. | # news.feed Describes a subscription to real-time news stories, edits, and deletions. Nothing connects until the request is executed with [`velo.watch()`](/sdks/typescript/api/watch). ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples Listeners can be passed as arguments, one per event type: ```ts import { Velo, news } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const watcher = await velo.watch(news.feed(), { on: { story: (story) => console.log('New:', story.headline), edit: (story) => console.log('Edited:', story.headline), delete: ({ id }) => console.log('Deleted:', id), error: (error) => console.error('News connection failed', error), }, onListenerError: (error) => { console.error('News listener failed', error); }, }); // Later: watcher.close(); ``` Or as a single listener receiving every event, discriminated by `type`: ```ts const watcher = await velo.watch(news.feed(), { on: (event) => { switch (event.type) { case 'story': console.log('New:', event.event.headline); break; case 'edit': console.log('Edited:', event.event.headline); break; case 'delete': console.log('Deleted:', event.event.id); break; case 'error': console.error('News connection failed', event.event); break; case 'close': console.log('Closed:', event.event.reason); break; } }, }); ``` `.on()` and `.off()` remain available for adding and removing listeners later. ## Definition ```ts function feed(): NewsFeedBuilder; ``` ## Parameters None. The live feed delivers every published story. ## Return Type * **Type:** `NewsFeedBuilder` Returns an immutable subscription builder. Pass it to [`velo.watch()`](/sdks/typescript/api/watch) to open a subscription. ## Watching the feed Pass the builder to [`velo.watch()`](/sdks/typescript/api/watch) to execute the subscription. The socket opens immediately, and the returned promise resolves to a `NewsWatcher` once the subscription is live. By default, a failed initial connection is retried up to 5 times while the promise remains pending, and the promise rejects if every attempt fails. See [Reconnection](/sdks/typescript/api/watch#reconnection) for the full retry policy. | Property | Type | Description | | --- | --- | --- | | `on` | listeners | Either a map of per-event listeners or one function receiving every event, tagged with `type`. | | `reconnect` | `boolean \| ResumeOptions` | Reconnects automatically after an unexpected drop, with jittered backoff. On by default. Pass `false` to opt out, or `{ baseDelayMs, maxDelayMs, retries }` to tune it. Omitting `retries` allows up to 5 initial retries and unlimited reconnection attempts after a drop. | | `signal` | `AbortSignal` | Permanently closes the watcher when aborted. | | `heartbeatTimeout` | `number` | Maximum time between heartbeat messages, in milliseconds. Defaults to `300_000`. | | `connectTimeout` | `number` | Maximum time for `.connect()` to open and subscribe, in milliseconds. Defaults to `30_000`. | | `onListenerError` | `(error: unknown) => unknown` | Handles errors thrown or rejected by event listeners. | Both timeout values must be positive safe integers. ### NewsWatcher A reusable watcher with a read-only `state` property. | Method | Description | | --- | --- | | `.on(type, listener)` | Adds a listener and returns the watcher. Adding the same listener more than once has no additional effect. | | `.off(type, listener)` | Removes a listener and returns the watcher. | | `.connect()` | Reopens the subscription. Not needed for the first connection, which [`velo.watch()`](/sdks/typescript/api/watch) performs, nor after an unexpected drop, which reconnects on its own. Concurrent calls share one connection attempt. | | `.disconnect()` | Intentionally disconnects while preserving the watcher and its listeners for reuse. | | `.close()` | Permanently closes the watcher and clears its listeners. Calling it more than once is safe. | ### Events | Event | Payload | Description | | --- | --- | --- | | `story` | `NewsStory` | A newly published story. | | `edit` | `NewsStory` | An updated story. | | `delete` | `NewsDelete` | An object containing the deleted story's numeric `id`. | | `error` | `VeloError` | A failure after the watcher has opened, such as a malformed message or heartbeat timeout. | | `close` | `NewsClose` | The WebSocket close `code`, `reason`, and `wasClean` status. | `NewsStory` has the same fields returned by [`.stories()`](/sdks/typescript/api/news/stories). ### States The watcher can be `idle`, `connecting`, `open`, `disconnected`, or `closed`. An unexpected connection loss moves it to `disconnected`, and the subscription reopens itself with jittered backoff until it is live again. Intentional endings never reconnect: `disconnect()` leaves the watcher `idle` and reusable, `close()` and an aborted signal leave it `closed`. :::warning Reconnecting does not replay what was missed. News is filtered on publication time, so stories published during a gap arrive on reconnect only if they are newer than the last one seen. If your application keeps a store of stories, refresh it with [`news.stories()`](/sdks/typescript/api/news/stories) when correctness across a gap matters. ::: Errors thrown or rejected by event listeners do not close the connection. They are passed to `onListenerError`, or reported with the runtime's default error reporting when that option is omitted. # Status API The `status` namespace checks whether the Velo API is reachable and the client's credentials are accepted. ## APIs | API | Description | | --- | --- | | [`.get()`](/sdks/typescript/api/status/get) | Checks API connectivity and credentials. | # status.get Checks that the Velo API is reachable and the client's credentials are valid. The request is sent immediately. ## Imports ```ts import { Velo } from 'velo-sdk'; ``` ## Examples ```ts import { Velo } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const status = await velo.status.get(); if (status === 'ok') { console.log('Connected to the Velo API'); } ``` ## Definition ```ts function get(options?: HttpRequestOptions): Promise; ``` ## Parameters ### options * **Type:** `HttpRequestOptions` * **Optional** Per-request timeout, retry, and abort-signal options. ## Return Type * **Type:** `Promise` Returns the string literal `"ok"` when the API is reachable and the credentials are valid. ## Errors Rejects with the corresponding request error for an unsuccessful HTTP response or a `VeloError` for an unexpected response body. # Client API Create a client with an API key, inspect the installed SDK version, or check API connectivity and credentials. ## Methods | Method | Description | | --- | --- | | [`.client`](/sdks/python/api/client/create) | Creates a Velo API client. | | [`.version`](/sdks/python/api/client/version) | Returns the SDK's hard-coded version string. | | [`.get_status`](/sdks/python/api/client/get-status) | Checks API connectivity and credentials. | # .client Creates a client that authenticates subsequent API requests with the supplied API key. ## Example ```python from velodata import lib as velo client = velo.client('api_key', retry=2) ``` ## Parameters ### key * **Type:** `str` Velo API key. ### retry * **Type:** `int` * **Optional** * **Default:** `2` Number of retries for server errors. ## Return type `velodata.lib.client` Returns an authenticated client instance. # .version Returns the version string embedded in the client implementation. ## Example ```python sdk_version = client.version() ``` ## Parameters None. ## Return type `str` :::note This method returns a hard-coded value from the client implementation. It may differ from the installed package version reported by package metadata. ::: # .get\_status Checks that the Velo API is reachable and the client's credentials are valid. ## Example ```python status = client.get_status() if status == 'ok': print('Connected to the Velo API') ``` ## Parameters None. ## Return type `str` Returns the API response body. A successful status request returns `"ok"`. # Catalog API List the products supported by the futures, options, and spot market-data endpoints. ## Methods | Method | Description | | --- | --- | | [`.get_products`](/sdks/python/api/catalog/get-products) | Lists products for a specified market type. | | [`.get_futures`](/sdks/python/api/catalog/get-futures) | Lists active or delisted futures products. | | [`.get_options`](/sdks/python/api/catalog/get-options) | Lists active options products. | | [`.get_spot`](/sdks/python/api/catalog/get-spot) | Lists active or delisted spot products. | Catalog methods return a `list[dict]`. Each record identifies an exchange, Velo-normalized coin, exchange-native product, and first available timestamp. Futures records also indicate whether orderbook depth is available. Delisted futures and spot records include their last available timestamp. # .get\_products Lists the supported products for a specified market type. The market-specific catalog methods are more convenient when the type is known in advance. ## Example ```python futures = client.get_products('futures') ``` ## Parameters ### product\_type * **Type:** `str` One of `"futures"`, `"options"`, or `"spot"`. ### delisted * **Type:** `bool` * **Optional** * **Default:** `False` When `True`, returns delisted-only products. Use the default for options. ## Return type `list[dict]` Returns one dictionary per supported product, or an empty list when no products match. # .get\_futures Lists supported futures products. Active products are returned by default. ## Example ```python active = client.get_futures() delisted = client.get_futures(delisted=True) depth_products = [product for product in active if product['depth']] ``` ## Parameters ### delisted * **Type:** `bool` * **Optional** * **Default:** `False` When `True`, returns delisted-only futures. ## Return type `list[dict]` Records include `exchange`, `coin`, `product`, `begin`, and `depth`. Delisted records also include `end`. # .get\_options Lists active options products. ## Example ```python options = client.get_options() ``` ## Parameters None. ## Return type `list[dict]` Records include `exchange`, `coin`, `product`, and `begin`. # .get\_spot Lists supported spot products. Active products are returned by default. ## Example ```python active = client.get_spot() delisted = client.get_spot(delisted=True) ``` ## Parameters ### delisted * **Type:** `bool` * **Optional** * **Default:** `False` When `True`, returns delisted-only spot products. ## Return type `list[dict]` Records include `exchange`, `coin`, `product`, and `begin`. Delisted records also include `end`. # Columns API Return the column names accepted by row requests for each market type. ## Methods | Method | Description | | --- | --- | | [`.get_futures_columns`](/sdks/python/api/columns/get-futures-columns) | Lists futures columns. | | [`.get_options_columns`](/sdks/python/api/columns/get-options-columns) | Lists options columns. | | [`.get_spot_columns`](/sdks/python/api/columns/get-spot-columns) | Lists spot columns. | Pass one or more returned names in the `columns` list supplied to [`.get_rows`](/sdks/python/api/rows/get-rows) or [`.batch_rows`](/sdks/python/api/rows/batch-rows). # .get\_futures\_columns Returns the column names accepted by futures row requests. ## Example ```python columns = client.get_futures_columns() params = { 'type': 'futures', 'columns': ['close_price', 'funding_rate'], # ... } ``` ## Parameters None. ## Return type `list[str]` The returned list contains: ```text open_price high_price low_price close_price coin_volume dollar_volume buy_trades sell_trades total_trades buy_coin_volume sell_coin_volume buy_dollar_volume sell_dollar_volume coin_open_interest_high coin_open_interest_low coin_open_interest_close dollar_open_interest_high dollar_open_interest_low dollar_open_interest_close funding_rate funding_rate_avg premium buy_liquidations sell_liquidations buy_liquidations_coin_volume sell_liquidations_coin_volume liquidations_coin_volume buy_liquidations_dollar_volume sell_liquidations_dollar_volume liquidations_dollar_volume ``` The aggregated three-month basis column, `3m_basis_ann`, is supported by row requests but is not included in this helper's returned list. # .get\_options\_columns Returns the column names accepted by options row requests. ## Example ```python columns = client.get_options_columns() params = { 'type': 'options', 'columns': ['iv_1m', 'skew_1m'], # ... } ``` ## Parameters None. ## Return type `list[str]` The returned list contains: ```text iv_1w iv_1m iv_3m iv_6m skew_1w skew_1m skew_3m skew_6m vega_coins vega_dollars call_delta_coins call_delta_dollars put_delta_coins put_delta_dollars gamma_coins gamma_dollars call_volume call_premium call_notional put_volume put_premium put_notional dollar_volume dvol_open dvol_high dvol_low dvol_close index_price ``` # .get\_spot\_columns Returns the column names accepted by spot row requests. ## Example ```python columns = client.get_spot_columns() params = { 'type': 'spot', 'columns': ['close_price', 'dollar_volume'], # ... } ``` ## Parameters None. ## Return type `list[str]` The returned list contains: ```text open_price high_price low_price close_price coin_volume dollar_volume buy_trades sell_trades total_trades buy_coin_volume sell_coin_volume buy_dollar_volume sell_dollar_volume ``` # Rows API Fetch historical futures, options, or spot rows as pandas DataFrames. Large requests are split into API-sized batches automatically. ## Methods | Method | Description | | --- | --- | | [`.get_rows`](/sdks/python/api/rows/get-rows) | Fetches every batch and returns one DataFrame. | | [`.batch_rows`](/sdks/python/api/rows/batch-rows) | Splits a row request into API-sized parameter dictionaries. | | [`.stream_rows`](/sdks/python/api/rows/stream-rows) | Fetches prepared batches and yields one DataFrame per batch. | ## Row parameters `get_rows()` and `batch_rows()` accept a parameter dictionary with the following fields: | Field | Type | Description | | --- | --- | --- | | `type` | `str` | One of `"futures"`, `"options"`, or `"spot"`. | | `exchanges` | `list[str]` | Exchanges to query. | | `products` | `list[str]` | Exchange-native products to query. Use this or `coins`. | | `coins` | `list[str]` | Velo-aggregated coins to query. Use this or `products`. | | `columns` | `list[str]` | Market-data columns to return. | | `begin` | `int` | Beginning of the time range as a Unix timestamp in milliseconds. | | `end` | `int` | End of the time range as a Unix timestamp in milliseconds. | | `resolution` | `int | str` | Bucket size as minutes or a string such as `"5m"`, `"1h"`, `"1d"`, `"1w"`, or `"1M"`. | If both `coins` and `products` are present, `products` takes precedence. String resolutions align `begin` down and `end` up to complete bucket boundaries. :::note Annualized three-month basis requests use the `3m_basis_ann` column with `coins` only. Do not include `products` or `exchanges` for that column. ::: # .get\_rows Fetches a historical market-data request. Requests larger than one API response are split and collected automatically. ## Example ```python end = client.timestamp() params = { 'type': 'futures', 'exchanges': ['binance-futures'], 'products': ['BTCUSDT'], 'columns': ['close_price', 'funding_rate'], 'begin': end - 24 * 60 * 60 * 1000, 'end': end, 'resolution': '5m', } rows = client.get_rows(params) ``` ## Parameters ### params * **Type:** `dict` See [Row parameters](/sdks/python/api/rows#row-parameters) for the accepted fields. If both `coins` and `products` are supplied, only `products` is used. ## Return type `pandas.DataFrame` Returns every matching row in one DataFrame. An empty response produces an empty DataFrame. # .batch\_rows Splits a row request into parameter dictionaries that fit within the API's per-request row limit. Use the result with [`.stream_rows`](/sdks/python/api/rows/stream-rows) when you want to process each batch as it arrives. ## Example ```python batches = client.batch_rows(params) for rows in client.stream_rows(batches): print(rows) ``` ## Parameters ### params * **Type:** `dict` See [Row parameters](/sdks/python/api/rows#row-parameters) for the accepted fields. Integer and string resolutions are supported. If both `coins` and `products` are supplied, only `products` is used. ## Return type `list[dict]` Returns the request dictionaries to pass to [`.stream_rows`](/sdks/python/api/rows/stream-rows). Small requests produce a one-item list. # .stream\_rows Executes the prepared requests returned by [`.batch_rows`](/sdks/python/api/rows/batch-rows) and yields a pandas DataFrame after each request completes. ## Example ```python batches = client.batch_rows(params) for rows in client.stream_rows(batches): process(rows) ``` ## Parameters ### batches * **Type:** `list[dict]` The list returned by `.batch_rows`. ## Yields `pandas.DataFrame` Yields one DataFrame per batch. A batch with no matching rows yields an empty DataFrame. :::note This is a synchronous generator. Use a regular `for` loop rather than `async for`. ::: # Orderbook API Fetch historical futures orderbook depth for one exchange product or a Velo-aggregated coin. :::warning Not all products support orderbooks, and orderbook history may not match candle history. Use [`.get_futures`](/sdks/python/api/catalog/get-futures) and select records whose `depth` field is true. ::: ## Methods | Method | Description | | --- | --- | | [`.depth`](/sdks/python/api/orderbook/depth) | Fetches and yields historical orderbook snapshots. | | [`.batch_depth`](/sdks/python/api/orderbook/batch-depth) | Splits a depth request into API-sized parameter dictionaries. | ## Depth parameters | Field | Type | Description | | --- | --- | --- | | `exchange` | `str` | Exchange for a specific product. Use with `product`. | | `product` | `str` | Exchange-native product. Use with `exchange`. | | `coin` | `str` | Velo-aggregated coin. Use instead of `exchange` and `product`. | | `begin` | `int` | Beginning of the time range as a Unix timestamp in milliseconds. | | `end` | `int` | End of the time range as a Unix timestamp in milliseconds. | | `resolution` | `int | str` | Bucket size in minutes or a string such as `"5m"`, `"1h"`, or `"1d"`. | Provide exactly one target: either `coin`, or both `exchange` and `product`. After string resolution conversion, the minute value must be `1`, `5`, `10`, `15`, `30`, `60`, or a multiple of `60`. # .depth Fetches historical orderbook depth and yields one snapshot at a time. Requests wider than the endpoint's per-request limit are split automatically. :::warning Not all products support orderbooks, and orderbook history may not match candle history. Use [`.get_futures`](/sdks/python/api/catalog/get-futures) and select records whose `depth` field is true. ::: ## Example :::code-group ```python [Exchange and product] end = client.timestamp() params = { 'exchange': 'binance-futures', 'product': 'BTCUSDT', 'begin': end - 60 * 60 * 1000, 'end': end, 'resolution': '5m', } for snapshot in client.depth(params): print(snapshot['timestamp'], snapshot['midprice']) ``` ```python [Aggregated coin] params = { 'coin': 'BTC', 'begin': end - 60 * 60 * 1000, 'end': end, 'resolution': '5m', } for snapshot in client.depth(params): print(snapshot) ``` ::: ## Parameters ### params * **Type:** `dict` See [Depth parameters](/sdks/python/api/orderbook#depth-parameters) for the accepted fields. ## Yields `dict` Each snapshot contains: | Key | Type | Description | | --- | --- | --- | | `timestamp` | `float` | Snapshot timestamp in milliseconds. | | `midprice` | `float` | Mid-market price. | | Price keys | `float` | Each remaining numeric key is a price whose value is the size at that price. | A batch with no matching depth data yields an empty dictionary. # .batch\_depth Splits a depth request into parameter dictionaries that fit the endpoint's per-request limit. [`.depth`](/sdks/python/api/orderbook/depth) calls this method automatically, so most applications do not need to call it directly. ## Example ```python batches = client.batch_depth(params) ``` ## Parameters ### params * **Type:** `dict` See [Depth parameters](/sdks/python/api/orderbook#depth-parameters) for the accepted fields. ## Return type `list[dict]` Returns one or more API request dictionaries. Each dictionary contains `begin`, `end`, `reso`, and `forward`, together with either `coin` or both `exchange` and `product`. # Options API Fetch the latest implied-volatility term structure for supported options underlyings. ## Methods | Method | Description | | --- | --- | | [`.get_term_structure`](/sdks/python/api/options/get-term-structure) | Fetches the latest BTC or ETH implied-volatility term structure. | For historical options rows, use the [Rows API](/sdks/python/api/rows) with `type` set to `"options"`. # .get\_term\_structure Fetches the latest BTC or ETH implied-volatility term structure. ## Example ```python terms = client.get_term_structure(['BTC', 'ETH']) ``` ## Parameters ### coins * **Type:** `list[str]` One or both supported coins: `"BTC"` and `"ETH"`. ## Return type `pandas.DataFrame` Returns the latest matching values with the following columns: | Column | Description | | --- | --- | | `coin` | Underlying coin. | | `time` | Snapshot timestamp in milliseconds. | | `at_the_money_iv` | At-the-money implied volatility. | | `dte` | Days to expiration. | | `fwd_iv` | Forward implied volatility. | Historical term-structure values are not returned by this method. # Market Caps API Fetch the latest supply and market-cap values for one or more coins. ## Methods | Method | Description | | --- | --- | | [`.get_market_caps`](/sdks/python/api/market-caps/get-market-caps) | Fetches the latest supply and market-cap values. | # .get\_market\_caps Fetches the latest supply and market-cap values for the requested coins. ## Example ```python market_caps = client.get_market_caps(['BTC', 'ETH']) ``` ## Parameters ### coins * **Type:** `list[str]` One or more Velo-normalized coin symbols. ## Return type `pandas.DataFrame` Returns the latest matching values with the following columns: | Column | Description | | --- | --- | | `coin` | Velo-normalized coin symbol. | | `time` | Snapshot timestamp in milliseconds. | | `circ` | Circulating supply. | | `circ_dollars` | Circulating market capitalization in dollars. | | `fdv` | Fully diluted supply. | | `fdv_dollars` | Fully diluted valuation in dollars. | Historical market-cap values are not returned by this method. # News API Fetch historical news stories or subscribe to the live priority-news feed. News methods are available through `client.news` and directly on `client`. ## Methods | Method | Description | | --- | --- | | [`.get_news`](/sdks/python/api/news/get-news) | Fetches historical news stories after an optional timestamp. | | [`.stream_news`](/sdks/python/api/news/stream-news) | Opens the live feed and yields control or story messages. | | [`.close_stream`](/sdks/python/api/news/close-stream) | Closes the active live-news connection. | # .get\_news Fetches historical news stories published after an optional millisecond timestamp. ## Example ```python begin = client.timestamp() - 24 * 60 * 60 * 1000 stories = client.news.get_news(begin=begin) for story in stories: print(story['time'], story['headline']) ``` ## Parameters ### begin * **Type:** `int` * **Optional** * **Default:** `0` Only returns stories published after this millisecond timestamp. ## Return type `list[dict]` Returns matching stories, or an empty list when none match. Story dictionaries can include: | Key | Description | | --- | --- | | `id` | Story identifier. | | `time` | Publication timestamp in milliseconds. | | `effectiveTime` | Timestamp at which the story became market-relevant. | | `effectivePrice` | Reference price associated with the story, when available. | | `headline` | Story headline. | | `source` | Publisher or source, when available. | | `priority` | Story priority. | | `coins` | Associated coin symbols. | | `summary` | Story summary, when available. | | `link` | Link to the original story, when available. | # .stream\_news Opens a WebSocket connection to the live priority-news feed and returns an asynchronous generator. ## Example ```python import asyncio import json async def stream(): async for message in client.news.stream_news(): if message in ('connected', 'heartbeat', 'closed'): print(message) else: story = json.loads(message) print(story) asyncio.run(stream()) ``` ## Parameters None. ## Yields `str` The generator yields: | Value | Description | | --- | --- | | `"connected"` | The feed is connected and subscribed. | | `"heartbeat"` | A server heartbeat was received. | | `"closed"` | The connection closed or receiving failed. The generator then ends. | | JSON string | A news story, edit, or delete message. Decode it with `json.loads()`. | The method does not reconnect automatically or replay messages missed while disconnected. # .close\_stream Closes the client's active live-news WebSocket connection. ## Example ```python await client.news.close_stream() ``` ## Parameters None. ## Return type `None` Calling this method when there is no active connection has no effect. # Utility API Create timestamps in the format expected by Velo API requests. ## Methods | Method | Description | | --- | --- | | [`.timestamp`](/sdks/python/api/utility/timestamp) | Returns the current Unix timestamp in milliseconds. | # .timestamp Returns the current Unix timestamp in milliseconds. ## Example ```python end = client.timestamp() begin = end - 24 * 60 * 60 * 1000 ``` ## Parameters None. ## Return type `int` Returns the number of milliseconds elapsed since the Unix epoch. # client.status Checks that the Velo API is reachable and that the client's credentials are valid. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const status = await client.status() if (status === 'ok') { console.log('Connected to the Velo API') } } main() ``` ## Definition ```js status(): Promise ``` ## Parameters None. ## Return Type * **Type:** `Promise` Resolves to the API response body. A successful status request returns `"ok"`. ## Errors Rejects with an `Error` if the request fails or the API returns an unsuccessful HTTP response. # client.futures Fetches Velo's futures product catalog. Active products are returned by default. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const active = await client.futures() const delisted = await client.futures(true) const depthProducts = active.filter((product) => product.depth) } main() ``` ## Definition ```js futures(delisted = false): Promise ``` ## Parameters ### delisted * **Type:** `boolean` * **Optional** * **Default:** `false` When `true`, returns delisted-only futures products. ## Return Type * **Type:** `Promise` Resolves to an array of catalog products. An empty array is returned when no products match. | Property | Type | Description | | --- | --- | --- | | `exchange` | `string` | The exchange and futures market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | | `depth` | `boolean` | Whether orderbook depth data is available. | | `end` | Optional `number` | Last available timestamp for a delisted product. | # client.options Fetches Velo's active options product catalog. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const products = await client.options() console.log(products) } main() ``` ## Definition ```js options(): Promise ``` ## Parameters None. ## Return Type * **Type:** `Promise` Resolves to an array of active options products. An empty array is returned when no products match. | Property | Type | Description | | --- | --- | --- | | `exchange` | `string` | The exchange and options market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | # client.spot Fetches Velo's spot product catalog. Active products are returned by default. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const active = await client.spot() const delisted = await client.spot(true) } main() ``` ## Definition ```js spot(delisted = false): Promise ``` ## Parameters ### delisted * **Type:** `boolean` * **Optional** * **Default:** `false` When `true`, returns delisted-only spot products. ## Return Type * **Type:** `Promise` Resolves to an array of spot products. An empty array is returned when no products match. | Property | Type | Description | | --- | --- | --- | | `exchange` | `string` | The exchange and spot market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | | `end` | Optional `number` | Last available timestamp for a delisted product. | # client.futuresColumns Synchronously returns the column names accepted by futures row requests. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const columns = client.futuresColumns() console.log(columns) } main() ``` ## Definition ```js futuresColumns(): string[] ``` ## Parameters None. ## Return Type * **Type:** `string[]` The returned array contains: ```text open_price high_price low_price close_price coin_volume dollar_volume buy_trades sell_trades total_trades buy_coin_volume sell_coin_volume buy_dollar_volume sell_dollar_volume coin_open_interest_high coin_open_interest_low coin_open_interest_close dollar_open_interest_high dollar_open_interest_low dollar_open_interest_close funding_rate funding_rate_avg premium buy_liquidations sell_liquidations buy_liquidations_coin_volume sell_liquidations_coin_volume liquidations_coin_volume buy_liquidations_dollar_volume sell_liquidations_dollar_volume liquidations_dollar_volume 3m_basis_ann ``` Pass one or more returned names in the `columns` array supplied to [`client.rows()`](/sdks/nodejs/api/rows). # client.optionsColumns Synchronously returns the column names accepted by options row requests. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const columns = client.optionsColumns() console.log(columns) } main() ``` ## Definition ```js optionsColumns(): string[] ``` ## Parameters None. ## Return Type * **Type:** `string[]` The returned array contains: ```text iv_1w iv_1m iv_3m iv_6m skew_1w skew_1m skew_3m skew_6m vega_coins vega_dollars call_delta_coins call_delta_dollars put_delta_coins put_delta_dollars gamma_coins gamma_dollars call_volume call_premium call_notional put_volume put_premium put_notional dollar_volume dvol_open dvol_high dvol_low dvol_close index_price ``` Pass one or more returned names in the `columns` array supplied to [`client.rows()`](/sdks/nodejs/api/rows). # client.spotColumns Synchronously returns the column names accepted by spot row requests. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const columns = client.spotColumns() console.log(columns) } main() ``` ## Definition ```js spotColumns(): string[] ``` ## Parameters None. ## Return Type * **Type:** `string[]` The returned array contains: ```text open_price high_price low_price close_price coin_volume dollar_volume buy_trades sell_trades total_trades buy_coin_volume sell_coin_volume buy_dollar_volume sell_dollar_volume ``` Pass one or more returned names in the `columns` array supplied to [`client.rows()`](/sdks/nodejs/api/rows). # client.rows Fetches historical futures, options, or spot data and asynchronously yields one row at a time. Requests larger than one API response are split automatically. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const end = Date.now() const rows = client.rows({ type: 'futures', exchanges: ['binance-futures'], products: ['BTCUSDT'], columns: ['close_price', 'funding_rate'], begin: end - 24 * 60 * 60 * 1000, end, resolution: '5m' }) for await (const row of rows) { console.log(row) } } main() ``` ## Definition ```js rows(params): AsyncIterable ``` ## Parameters ### params * **Type:** `Object` | Property | Type | Description | | --- | --- | --- | | `type` | `string` | One of `"futures"`, `"options"`, or `"spot"`. | | `exchanges` | `string[]` | Exchanges to query. An empty array selects all supported exchanges for the market type. | | `products` | `string[]` | Exchange-native products to query. Use this or `coins`. | | `coins` | `string[]` | Velo-aggregated coins to query. Use this or `products`. | | `columns` | `string[]` | Market-data columns to return. | | `begin` | `number` | Beginning of the time range as a Unix timestamp in milliseconds. | | `end` | `number` | End of the time range as a Unix timestamp in milliseconds. | | `resolution` | `number | string` | Bucket size in minutes or a string such as `"5m"`, `"1h"`, `"1d"`, `"1w"`, or `"1M"`. | At least one of `products` or `coins` must be an array. If both are supplied, `products` is used. String resolutions align `begin` down and `end` up to complete bucket boundaries. :::note Annualized three-month basis requests use `columns: ['3m_basis_ann']` with `coins` only. Do not include `products` or `exchanges` for that column. ::: Use [`client.futuresColumns()`](/sdks/nodejs/api/columns/futures-columns), [`client.optionsColumns()`](/sdks/nodejs/api/columns/options-columns), or [`client.spotColumns()`](/sdks/nodejs/api/columns/spot-columns) to list the columns accepted for each market type. ## Return Type * **Type:** `AsyncIterable` Returns an async iterable immediately. Each yielded object contains the row's identifying fields and the requested market-data columns. Requests exceeding the API's 22,500-value response limit are divided into consecutive requests while preserving row order. ## Errors Throws an `Error` before iteration for an invalid market type, time range, resolution, target, or empty `columns` array. Request errors surface while the async iterable is being consumed. # client.termStructure Fetches the latest BTC or ETH implied-volatility term structure. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const points = await client.termStructure({ coins: ['BTC', 'ETH'] }) console.log(points) } main() ``` ## Definition ```js termStructure(params): Promise ``` ## Parameters ### params * **Type:** `Object` ### params.coins * **Type:** `string[]` One or both supported coins: `"BTC"` and `"ETH"`. ## Return Type * **Type:** `Promise` Resolves to the latest matching term-structure points. | Property | Type | Description | | --- | --- | --- | | `coin` | `string` | The underlying coin: `BTC` or `ETH`. | | `time` | `number` | Snapshot timestamp in milliseconds. | | `at_the_money_iv` | `number` | At-the-money implied volatility. | | `dte` | `number` | Days to expiration. | | `fwd_iv` | `number` | Forward implied volatility. | Historical term-structure values are not returned by this method. # client.marketCaps Fetches the latest supply and market-cap values for the requested coins. ## Imports ```js const velo = require('velo-node') ``` ## Example ```js const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const marketCaps = await client.marketCaps({ coins: ['BTC', 'ETH'] }) console.log(marketCaps) } main() ``` ## Definition ```js marketCaps(params): Promise ``` ## Parameters ### params * **Type:** `Object` ### params.coins * **Type:** `string[]` One or more Velo-normalized coin symbols. ## Return Type * **Type:** `Promise` Resolves to the latest matching supply and market-cap values. | Property | Type | Description | | --- | --- | --- | | `coin` | `string` | Velo-normalized coin symbol. | | `time` | `number` | Snapshot timestamp in milliseconds. | | `circ` | `number` | Circulating supply. | | `circ_dollars` | `number` | Circulating market capitalization in dollars. | | `fdv` | `number` | Fully diluted supply. | | `fdv_dollars` | `number` | Fully diluted valuation in dollars. | Historical market-cap values are not returned by this method. # client.depth Fetches historical futures orderbook depth and asynchronously yields one snapshot at a time. Query either one exchange product or a Velo-aggregated coin. :::warning Not all products support orderbooks, and orderbook history may not match candle history. Use [`client.futures()`](/sdks/nodejs/api/catalog/futures) and select products whose `depth` field is `true`. ::: ## Imports ```js const velo = require('velo-node') ``` ## Examples :::code-group ```js [Exchange and product] const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const end = Date.now() const snapshots = client.depth({ exchange: 'binance-futures', product: 'BTCUSDT', begin: end - 60 * 60 * 1000, end, resolution: '5m' }) for await (const snapshot of snapshots) { console.log(snapshot.time, snapshot.mid) } } main() ``` ```js [Aggregated coin] const velo = require('velo-node') async function main() { const client = new velo.Client('api_key') const end = Date.now() const snapshots = client.depth({ coin: 'BTC', begin: end - 60 * 60 * 1000, end, resolution: '5m' }) for await (const snapshot of snapshots) { console.log(snapshot) } } main() ``` ::: ## Definition ```js depth(params): AsyncIterable ``` ## Parameters ### params * **Type:** `Object` | Property | Type | Description | | --- | --- | --- | | `exchange` | `string` | Exchange for a specific product. Use with `product`. | | `product` | `string` | Exchange-native product. Use with `exchange`. | | `coin` | `string` | Velo-aggregated coin. Use instead of `exchange` and `product`. | | `begin` | `number` | Beginning of the time range as a Unix timestamp in milliseconds. | | `end` | `number` | End of the time range as a Unix timestamp in milliseconds. | | `resolution` | `number | string` | Bucket size in minutes or a string such as `"5m"`, `"1h"`, or `"1d"`. | Provide exactly one target: either `coin`, or both `exchange` and `product`. Use `coin` only for aggregated orderbook data. After string resolution conversion, the minute value must be `1`, `5`, `10`, `15`, `30`, `60`, or a multiple of `60`. ## Return Type * **Type:** `AsyncIterable` Returns an async iterable immediately. Each yielded snapshot contains: | Property | Type | Description | | --- | --- | --- | | `time` | `number` | Snapshot timestamp in milliseconds. | | `mid` | `number` | Mid-market price. | | Price keys | `number` | Each remaining key is a price whose value is the size at that price. | Requests spanning more than 512 buckets are divided into consecutive requests automatically. For a complete workflow, see [Fetch Orderbook Data](/sdks/nodejs/guides/fetch-orderbook-data). ## Errors Throws an `Error` before iteration for an invalid time range, unsupported resolution, or invalid target combination. Request errors surface while the async iterable is being consumed. # Velo API Version: `1.0.0` ## Servers - `https://api.velo.xyz` ## Endpoints ### Data The data endpoints - [`GET /api/v1/rows`](/api/data#getrows): Get rows - [`GET /api/v1/terms`](/api/data#getterms): Get options term structure - [`GET /api/v1/caps`](/api/data#getcaps): Get market caps - [`GET /api/v1/heatmap`](/api/data#getorderbooklevels): Get orderbook levels ### News Curated crypto news stories, over HTTP and WebSocket. - [`GET /api/n/news`](/api/news#getnews): Get news - [`GET /api/w/connect`](/api/news#streamnews): Stream news (WebSocket) # Authentication \[Learn about how to authenticate for the Velo API] The Velo API authenticates every request with HTTP basic auth, using `api` as the username and your API key as the password. Set the raw header `Authorization: Basic base64(api:your_api_key)` to authenticate HTTP requests. If you use the [TypeScript SDK](/sdks/typescript), you can pass your key when constructing the client. You can get an API key from the [subscription](https://velo.xyz/subscription) page in the web app. # Data The data endpoints ## Get rows `GET /api/v1/rows` Returns data in CSV format. HTTP requests are limited to returning 22,500 values per request. See an example implementation of request batching [here](https://github.com/velodataorg/velo-node/blob/34489ca79211e4bae171c5da0f0b9beee3b2f214/lib/client.js#L72). Specify exactly one of `products` or `coins`. The API rejects requests carrying both, or neither. --- The `3m_basis_ann` column returns the 3-month annualized futures basis and follows stricter rules than other columns: - Only available with `type=futures`. - Must be the only entry in `columns`. - Must be requested with `coins`, not `products`. - Only `BTC` and `ETH` are supported. - `exchanges` may be omitted to include all exchanges with basis data. For example: `type=futures&columns=3m_basis_ann&coins=BTC,ETH`. ### Query parameters - `type` `string` _(required)_: Product type. - `exchanges` `string[]` _(required)_: Exchanges to include. Comma separated for multiple. May only be omitted for `3m_basis_ann` requests. - `products` `string`: Products to include. Comma separated for multiple. Exactly one of `products` or `coins` is required. - `coins` `string`: Coins to include. Comma separated for multiple. Exactly one of `products` or `coins` is required. - `columns` `string[]` _(required)_: Columns to return. Comma separated for multiple. Available values depend on `type`. - `begin` `integer ` _(required)_: Start of the time range as a millisecond timestamp. - `end` `integer ` _(required)_: End of the time range as a millisecond timestamp. - `resolution` `integer` _(required)_: Resolution in minutes, e.g. `240` for 4-hour candles. Any multiple of `60` beyond the listed values is also accepted. When `months=true`, interpreted as a number of months instead, with no divisibility constraint. - `months` `boolean`: Set to `true` to interpret `resolution` as a number of months instead of minutes, e.g. `resolution=1&months=true` for monthly candles. When enabled, the requested time range is limited: `end - begin` must not exceed 32 days times `resolution`. ### Header parameters - `Authorization` `string` _(required)_: HTTP basic auth: `api` as the username and your API key as the password. With curl, pass `--user "api:your_api_key"`. The equivalent raw header is `Basic base64(api:your_api_key)`. ### Responses #### `200`: The data in CSV format. #### `400`: Invalid request. #### `403`: Missing, invalid, or unauthorized API key. #### `429`: Rate limit exceeded.. #### `503`: The API is temporarily unavailable. ### Example request ```bash curl 'https://api.velo.xyz/api/v1/rows?type=futures&exchanges=binance-futures&products=BTCUSDT,ETHUSDT&columns=open_price,high_price,low_price,close_price&begin=1767225600000&end=1767268800000&resolution=240' \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` ```ts fetch('https://api.velo.xyz/api/v1/rows?type=futures&exchanges=binance-futures&products=BTCUSDT,ETHUSDT&columns=open_price,high_price,low_price,close_price&begin=1767225600000&end=1767268800000&resolution=240', { headers: { Authorization: 'Basic $(printf "api:your_api_key" | base64)' } }) ``` ## Get options term structure `GET /api/v1/terms` Returns the current options term structure in CSV format, for BTC and ETH. Each row is one listed expiry, sorted by expiry ascending: - `time` is the expiry as a millisecond timestamp. - `at_the_money_iv` is the at-the-money implied volatility for that expiry. - `dte` is the days to expiry. - `fwd_iv` is the forward implied volatility. This is a snapshot of the current term structure; there are no time range parameters. ### Query parameters - `coins` `string[]` _(required)_: Coins to include. Comma separated for multiple. Only `BTC` and `ETH` are supported. ### Header parameters - `Authorization` `string` _(required)_: HTTP basic auth: `api` as the username and your API key as the password. With curl, pass `--user "api:your_api_key"`. The equivalent raw header is `Basic base64(api:your_api_key)`. ### Responses #### `200`: The data in CSV format. #### `400`: Invalid request. #### `403`: Missing, invalid, or unauthorized API key. #### `429`: Rate limit exceeded. #### `503`: The API is temporarily unavailable. ### Example request ```bash curl 'https://api.velo.xyz/api/v1/terms?coins=BTC,ETH' \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` ```ts fetch('https://api.velo.xyz/api/v1/terms?coins=BTC,ETH', { headers: { Authorization: 'Basic $(printf "api:your_api_key" | base64)' } }) ``` ## Get market caps `GET /api/v1/caps` Returns the latest market capitalization data in CSV format, sorted by circulating market cap descending: - `time` is the timestamp of the data as a millisecond timestamp. - `circ` is the circulating supply in coins. - `circ_dollars` is the circulating market cap in dollars. - `fdv` is the fully diluted supply in coins. - `fdv_dollars` is the fully diluted valuation in dollars. This is a snapshot of the latest data, there is no historical data. ### Query parameters - `coins` `string` _(required)_: Coins to include. Comma separated for multiple. ### Header parameters - `Authorization` `string` _(required)_: HTTP basic auth: `api` as the username and your API key as the password. With curl, pass `--user "api:your_api_key"`. The equivalent raw header is `Basic base64(api:your_api_key)`. ### Responses #### `200`: The data in CSV format. #### `400`: Invalid request. #### `403`: Missing, invalid, or unauthorized API key. #### `429`: Rate limit exceeded. #### `503`: The API is temporarily unavailable. ### Example request ```bash curl 'https://api.velo.xyz/api/v1/caps?coins=BTC,ETH,SOL' \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` ```ts fetch('https://api.velo.xyz/api/v1/caps?coins=BTC,ETH,SOL', { headers: { Authorization: 'Basic $(printf "api:your_api_key" | base64)' } }) ``` ## Get orderbook levels `GET /api/v1/heatmap` Returns historical futures orderbook depth as headerless CSV. Specify exactly one target: either `exchange` and `product`, or `coin` by itself. A coin request aggregates depth across the tracked futures exchanges. Only a subset of futures products has orderbook history. The futures catalog marks covered products with `depth: true`. A single request may contain at most 512 resolution buckets; split longer ranges into contiguous requests. See [all supported symbols](/sdks/typescript/api/orderbook). ### Query parameters - `exchange` `string`: A futures exchange. Required with `product`, not allowed with `coin`. - `product` `string`: Exchange-native futures product. Required with `exchange`, not allowed with `coin`. - `coin` `string`: Velo-aggregated coin value. The orderbook data is then aggregated across tracked futures exchanges. Replaces `exchange` and `product`. - `begin` `integer ` _(required)_: Start of the time range as a millisecond timestamp. - `end` `integer ` _(required)_: End of the time range as a millisecond timestamp. Must be later than `begin`. - `reso` `integer` _(required)_: Snapshot resolution in minutes. The raw endpoint accepts `1`, `5`, `10`, `15`, `30`, or any positive multiple of `60`. The TypeScript SDK exposes the named subset `1m`, `5m`, `10m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `12h`, `1D`, and `1W`. - `forward` `integer`: Set to `1` to return snapshots ordered by time ascending. When omitted, snapshots are returned in descending order. ### Header parameters - `Authorization` `string` _(required)_: HTTP basic auth: `api` as the username and your API key as the password. With curl, pass `--user "api:your_api_key"`. The equivalent raw header is `Basic base64(api:your_api_key)`. ### Responses #### `200`: The price-grid step and orderbook snapshots as headerless CSV. #### `400`: Invalid request. #### `403`: Missing, invalid, or unauthorized API key, or the request spans more than 512 resolution buckets. #### `404`: No orderbook history was found for the requested target. #### `429`: Rate limit exceeded. #### `503`: The API is temporarily unavailable. ### Example request ```bash curl 'https://api.velo.xyz/api/v1/heatmap?exchange=binance-futures&product=BTCUSDT&begin=1767225600000&end=1767229200000&reso=1&forward=1' \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` ```ts fetch('https://api.velo.xyz/api/v1/heatmap?exchange=binance-futures&product=BTCUSDT&begin=1767225600000&end=1767229200000&reso=1&forward=1', { headers: { Authorization: 'Basic $(printf "api:your_api_key" | base64)' } }) ``` # News Curated crypto news stories, over HTTP and WebSocket. ## Get news `GET /api/n/news` Returns past news stories as JSON. ### Query parameters - `begin` `integer `: Only return stories published after this millisecond timestamp. Defaults to `0`, returning all stories. ### Header parameters - `Authorization` `string` _(required)_: HTTP basic auth: `api` as the username and your API key as the password. With curl, pass `--user "api:your_api_key"`. The equivalent raw header is `Basic base64(api:your_api_key)`. ### Responses #### `200`: The news stories as JSON. Body (`application/json`): - `stories` `object[]` - `id` `integer`: Unique identifier. - `time` `integer `: Timestamp the news was published, in milliseconds. - `effectiveTime` `integer `: Timestamp the news happened, in milliseconds. - `effectivePrice` `number | null`: Price of the relevant coin at the effective time, if available. - `headline` `string`: The headline. - `source` `string | null`: The news source. - `priority` `integer`: `1` = top priority only, `2` = everything else. - `coins` `string[]`: List of relevant coins. May be empty. - `summary` `string | null`: The summary. May include markdown. - `link` `string | null`: Source link. #### `403`: Missing, invalid, or unauthorized API key. #### `429`: Rate limit exceeded. ### Example request ```bash curl 'https://api.velo.xyz/api/n/news?begin=1767225600000' \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` ```ts fetch('https://api.velo.xyz/api/n/news?begin=1767225600000', { headers: { Authorization: 'Basic $(printf "api:your_api_key" | base64)' } }) ``` ## Stream news (WebSocket) `GET /api/w/connect` Streams news stories in real time over a WebSocket: ``` wss://api.velo.xyz/api/w/connect ``` ### Header parameters - `Authorization` `string` _(required)_: HTTP basic auth: `api` as the username and your API key as the password. If your WebSocket client cannot set headers, append the key to the path instead: `/api/w/connect/your_api_key`. ### Responses #### `101`: WebSocket handshake completed; the connection is upgraded and each subsequent frame is one of the JSON messages below. #### `400`: The request is not a valid WebSocket upgrade. ### Example request ```bash curl https://api.velo.xyz/api/w/connect \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` ```ts fetch('https://api.velo.xyz/api/w/connect', { headers: { Authorization: 'Basic $(printf "api:your_api_key" | base64)' } }) ``` # Rate Limits \[Understand rate limits for the API] The API rate limit is **120 requests per 30 seconds**. * Single requests return a max of [22.5k values](https://github.com/velodataorg/velo-node/blob/f5b00a589853e96b0f156ee23d1808721165ca20/lib/client.js#L87) * The [TypeScript SDK](/sdks/typescript) handles limiting and batching automatically If more than three IPs try to use the same account or API key within 5 minutes, only one may be allowed access. See the [Terms of Service](/terms-of-service) for details. # Selecting Data