Skip to content

Commit

Permalink
Refine Tardis symbology normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Nov 20, 2024
1 parent 6d5e970 commit cbbe657
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 4 additions & 2 deletions docs/integrations/tardis.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ This includes the following:

## Symbology and normalization

The Tardis integration seamlessly integrates with NautilusTrader's crypto exchange adapters through consistent symbol normalization.
Each exchange's raw symbols are normalized to follow Nautilus symbology conventions as detailed below:
The Tardis integration ensures seamless compatibility with NautilusTrader’s crypto exchange adapters
by consistently normalizing symbols. Typically, NautilusTrader uses the native exchange naming conventions
provided by Tardis. However, for certain exchanges, raw symbols are adjusted to adhere to the Nautilus symbology normalization, as outlined below:

### Common rules

Expand All @@ -91,6 +92,7 @@ Each exchange's raw symbols are normalized to follow Nautilus symbology conventi
- **Binance**: Nautilus appends the suffix `-PERP` to all perpetual symbols.
- **Bybit**: Nautilus uses specific product category suffixes, including `-SPOT`, `-LINEAR`, `-INVERSE`, `-OPTION`.
- **dYdX**: Nautilus appends the suffix `-PERP` to all perpetual symbols.
- **Gate.io**: Nautilus appends the suffix `-PERP` to all perpetual symbols.

For detailed symbology documentation per exchange:

Expand Down
6 changes: 0 additions & 6 deletions nautilus_core/adapters/src/tardis/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ pub fn normalize_symbol_str(
symbol.push_str("-PERP");
}

Exchange::HuobiDmSwap | Exchange::HuobiDmLinearSwap
if instrument_type == InstrumentType::Perpetual =>
{
symbol.push_str("-PERP");
}

_ => {}
}

Expand Down
4 changes: 2 additions & 2 deletions nautilus_trader/adapters/tardis/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ async def _request_bars(
),
)

self._log.info(
self._log.debug(
f"Streamed {len(bar_capsules):,} {bar_type} bars from replay",
LogColor.MAGENTA,
)
Expand All @@ -482,7 +482,7 @@ async def _request_bars(
and (end is None or bar.ts_event <= end)
]

self._log.info(
self._log.debug(
f"Sending response with {len(bars):,} bars after filtering",
LogColor.MAGENTA,
)
Expand Down

0 comments on commit cbbe657

Please sign in to comment.