Skip to main content

normalize_spot_symbol

Function normalize_spot_symbol 

Source
pub fn normalize_spot_symbol(symbol: &str) -> String
Expand description

Normalizes a Kraken spot symbol to use BTC instead of XBT.

Kraken’s REST API returns XBT for Bitcoin (following ISO 4217 conventions), but their WebSocket v2 API uses the more common BTC format. This function normalizes symbols so that instruments and subscriptions use consistent, industry-standard symbols. Handles XBT in both base position (XBT/USD -> BTC/USD) and quote position (ETH/XBT -> ETH/BTC).