tardis-dev
Version:
Convenient access to tick-level historical and real-time cryptocurrency market data via Node.js
150 lines • 5.11 kB
TypeScript
import { BookChange, DerivativeTicker, Trade } from '../types';
import { Mapper } from './mapper';
export declare class DydxTradesMapper implements Mapper<'dydx', Trade> {
canHandle(message: DyDxTrade): boolean;
getFilters(symbols?: string[]): {
readonly channel: "v3_trades";
readonly symbols: string[] | undefined;
}[];
map(message: DyDxTrade, localTimestamp: Date): IterableIterator<Trade>;
}
export declare class DydxBookChangeMapper implements Mapper<'dydx', BookChange> {
private _bidsOffsets;
private _asksOffsets;
canHandle(message: DyDxOrderbookSnapshot | DyDxOrderBookUpdate): boolean;
getFilters(symbols?: string[]): {
readonly channel: "v3_orderbook";
readonly symbols: string[] | undefined;
}[];
map(message: DyDxOrderbookSnapshot | DyDxOrderBookUpdate, localTimestamp: Date): IterableIterator<BookChange>;
}
export declare class DydxDerivativeTickerMapper implements Mapper<'dydx', DerivativeTicker> {
private readonly pendingTickerInfoHelper;
canHandle(message: DydxMarketsSnapshot | DyDxMarketsUpdate | DyDxTrade): boolean;
getFilters(symbols?: string[]): ({
readonly channel: "v3_markets";
readonly symbols: string[];
} | {
readonly channel: "v3_trades";
readonly symbols: string[] | undefined;
})[];
map(message: DydxMarketsSnapshot | DyDxMarketsUpdate | DyDxTrade, localTimestamp: Date): IterableIterator<DerivativeTicker>;
}
type DyDxTrade = {
type: 'channel_data';
connection_id: 'e368fe1e-a007-44bd-9532-8eacc81a8bbc';
message_id: 229;
id: 'BTC-USD';
channel: 'v3_trades';
contents: {
trades: [{
size: '0.075';
side: 'SELL';
price: '57696';
createdAt: '2021-05-01T00:00:34.046Z' | undefined;
}];
};
};
type DyDxOrderbookSnapshot = {
type: 'subscribed';
connection_id: '22be6448-1464-45ff-ae7d-1204eac64d0f';
message_id: 1;
channel: 'v3_orderbook';
id: '1INCH-USD';
contents: {
bids: [{
price: '5';
offset: '118546101';
size: '50';
}];
asks: [{
price: '7';
offset: '120842096';
size: '20';
}];
};
};
type DyDxOrderBookUpdate = {
type: 'channel_data';
connection_id: '22be6448-1464-45ff-ae7d-1204eac64d0f';
message_id: 161;
id: '1INCH-USD';
channel: 'v3_orderbook';
contents: {
offset: '125090042';
bids: [string, string][];
asks: [string, string][];
};
};
type DydxMarketsSnapshot = {
type: 'subscribed';
connection_id: '8c11ee31-dbca-49fa-9df0-fc973948b7b5';
message_id: 3;
channel: 'v3_markets';
contents: {
markets: {
[key: string]: {
market: 'BTC-USD';
status: 'ONLINE';
baseAsset: 'BTC';
quoteAsset: 'USD';
stepSize: '0.0001';
tickSize: '1';
indexPrice: '57794.7000';
oraclePrice: '57880.5200';
priceChange24H: '4257.9';
nextFundingRate: '0.0000587260';
nextFundingAt: '2021-05-01T00:00:00.000Z';
minOrderSize: '0.001';
type: 'PERPETUAL';
initialMarginFraction: '0.04';
maintenanceMarginFraction: '0.03';
volume24H: '4710467.697100';
trades24H: '663';
openInterest: '101.2026';
incrementalInitialMarginFraction: '0.01';
incrementalPositionSize: '0.5';
maxPositionSize: '30';
baselinePositionSize: '1.0';
allTimeLiquidationQuoteVolume: '3001153.615633';
dailyLiquidationQuoteVolume: '6047.074828';
};
};
};
};
type DyDxMarketsUpdate = {
type: 'channel_data';
connection_id: '8c11ee31-dbca-49fa-9df0-fc973948b7b5';
message_id: 221;
channel: 'v3_markets';
contents: {
[key: string]: {
market: 'BTC-USD';
status: 'ONLINE';
baseAsset: 'BTC';
quoteAsset: 'USD';
stepSize: '0.0001';
tickSize: '1';
indexPrice: '57794.7000';
oraclePrice: '57880.5200';
priceChange24H: '4257.9';
nextFundingRate: '0.0000587260';
nextFundingAt: '2021-05-01T00:00:00.000Z';
minOrderSize: '0.001';
type: 'PERPETUAL';
initialMarginFraction: '0.04';
maintenanceMarginFraction: '0.03';
volume24H: '4710467.697100';
trades24H: '663';
openInterest: '101.2026';
incrementalInitialMarginFraction: '0.01';
incrementalPositionSize: '0.5';
maxPositionSize: '30';
baselinePositionSize: '1.0';
allTimeLiquidationQuoteVolume: '3001153.615633';
dailyLiquidationQuoteVolume: '6047.074828';
};
};
};
export {};
//# sourceMappingURL=dydx.d.ts.map