Skip to content

Commit dcb947e

Browse files
authored
Mexc integration (#69)
* feat(mexc-integration): added mappers * feat(mexc-integration): added possibility to override message parsing for real time feeds * feat(mexc-integration): added real time feed * feat(mexc-integration): using protobufjs * feat(mexc-integration): need to remove this file since it was committed by mistake * feat(mexc-integration): couple of fixes and improvements * feat(mexc-integration): fixed apply snapshot updates * feat(mexc-integration): fixed apply snapshot updates * feat(mexc-integration): improved can handle checks, * feat(mexc-integration): streaming dat needs to have proper snapshots * feat(mexc-integration): aligned snapshot channel with shape with regular exchange messages * feat(mexc-integration): adjusted tests * feat(mexc-integration): fixed mapping * feat(mexc-futures-integration): updated proto schema * feat(mexc-futures-integration): updated mapping * feat(mexc-integration): adjusted to new snapshot shape * feat(mexc-integration): adjusted to new snapshot shape
1 parent 655df69 commit dcb947e

13 files changed

Lines changed: 1805 additions & 1 deletion

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"follow-redirects": "^1.15.9",
7474
"https-proxy-agent": "^8.0.0",
7575
"p-map": "^7.0.4",
76+
"protobufjs": "^8.6.2",
7677
"socks-proxy-agent": "^9.0.0",
7778
"ws": "^8.18.3"
7879
},

src/consts.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const EXCHANGES = [
5858
'hyperliquid',
5959
'lighter',
6060
'bullish',
61+
'mexc',
6162
'polymarket'
6263
] as const
6364

@@ -526,6 +527,13 @@ const LIGHTER_CHANNELS = ['order_book', 'trade', 'ticker', 'market_stats', 'spot
526527

527528
const BULLISH_CHANNELS = ['V1TALevel2', 'V1TALevel1', 'V1TAAnonymousTradeUpdate', 'V1TATickerResponse', 'V1TAIndexPrice'] as const
528529

530+
const MEXC_CHANNELS = [
531+
'spot@public.aggre.deals.v3.api.pb@10ms',
532+
'spot@public.aggre.depth.v3.api.pb@10ms',
533+
'spot@public.aggre.depth.snapshot.v3.api.pb@10ms',
534+
'spot@public.aggre.bookTicker.v3.api.pb@10ms'
535+
] as const
536+
529537
const POLYMARKET_CHANNELS = [
530538
'book',
531539
'price_change',
@@ -597,5 +605,6 @@ export const EXCHANGE_CHANNELS_INFO = {
597605
hyperliquid: HYPERLIQUID_CHANNELS,
598606
lighter: LIGHTER_CHANNELS,
599607
bullish: BULLISH_CHANNELS,
608+
mexc: MEXC_CHANNELS,
600609
polymarket: POLYMARKET_CHANNELS
601610
}

src/mappers/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { kucoinMappers } from './kucoin.ts'
3333
import { kucoinFuturesMappers } from './kucoinfutures.ts'
3434
import { lighterMappers } from './lighter.ts'
3535
import { Mapper } from './mapper.ts'
36+
import { mexcMappers } from './mexc.ts'
3637
import { okexMappers } from './okex.ts'
3738
import { phemexMappers } from './phemex.ts'
3839
import { poloniexMappers } from './poloniex.ts'
@@ -85,6 +86,7 @@ const registeredMappers = mergeExchangeMappers(
8586
kucoinMappers,
8687
kucoinFuturesMappers,
8788
lighterMappers,
89+
mexcMappers,
8890
okexMappers,
8991
phemexMappers,
9092
poloniexMappers,

0 commit comments

Comments
 (0)