Skip to main content

cache_alias_for_symbol

Function cache_alias_for_symbol 

Source
pub fn cache_alias_for_symbol(symbol: &str) -> Option<String>
Expand description

Returns the secondary cache-alias key for a Nautilus instrument symbol.

For outcome symbols, this is the +<encoding> token form (matching the coin field on spotClearinghouseState balances). For perp / spot symbols it is the leading segment before the first - (the base asset or sanitized base for HIP-3 perps). Returns None for an empty symbol.

Used by cache_instrument, order-response report builders, and the bar lookup so all three derive the same alias and stay in sync as the symbol shape evolves.