@@ -27,6 +27,11 @@ function getQtyScale(symbol: string) {
2727 return 1
2828}
2929
30+ function isExcludedFromNormalizedOutput ( symbol : string ) {
31+ // Matches tardis-api metadata: Phemex spot OL/USDT uses sOLUSDT, which collides with SOLUSDT when normalized.
32+ return symbol === 'sOLUSDT'
33+ }
34+
3035const COINS_STARTING_WITH_S = [
3136 'SOLUSD' ,
3237 'SUSHIUSD' ,
@@ -163,10 +168,13 @@ export const phemexTradesMapper: Mapper<'phemex', Trade> = {
163168 } ,
164169
165170 * map ( message : PhemexTradeMessage , localTimestamp : Date ) : IterableIterator < Trade > {
171+ const symbol = message . symbol
172+ if ( isExcludedFromNormalizedOutput ( symbol ) ) {
173+ return
174+ }
175+
166176 if ( 'trades' in message ) {
167177 for ( const [ timestamp , side , priceEp , qty ] of message . trades ) {
168- const symbol = message . symbol
169-
170178 yield {
171179 type : 'trade' ,
172180 symbol : symbol . toUpperCase ( ) ,
@@ -181,8 +189,6 @@ export const phemexTradesMapper: Mapper<'phemex', Trade> = {
181189 }
182190 } else if ( 'trades_p' in message ) {
183191 for ( const [ timestamp , side , price , qty ] of message . trades_p ) {
184- const symbol = message . symbol
185-
186192 yield {
187193 type : 'trade' ,
188194 symbol : symbol . toUpperCase ( ) ,
@@ -253,6 +259,10 @@ export const phemexBookChangeMapper: Mapper<'phemex', BookChange> = {
253259
254260 * map ( message : PhemexBookMessage , localTimestamp : Date ) : IterableIterator < BookChange > {
255261 const symbol = message . symbol
262+ if ( isExcludedFromNormalizedOutput ( symbol ) ) {
263+ return
264+ }
265+
256266 if ( 'book' in message ) {
257267 const mapBookLevel = mapBookLevelForSymbol ( symbol )
258268 yield {
0 commit comments