* 🚧 depth chart * ✨ Fixed types and shortened FundingRateTooltip * 💄 update depth chart color scale to use css var * 💄 use layer-6 instead of text-1 * 🌐 Add localization, fix nits
41 lines
826 B
TypeScript
41 lines
826 B
TypeScript
import { OrderSide } from '@dydxprotocol/v4-client-js';
|
|
import { FundingDirection } from './markets';
|
|
|
|
// ------ Depth Chart ------ //
|
|
export enum DepthChartSeries {
|
|
Asks = 'Asks',
|
|
Bids = 'Bids',
|
|
MidMarket = 'MidMarket',
|
|
}
|
|
|
|
export type DepthChartDatum = {
|
|
size: number;
|
|
price: number;
|
|
depth: number;
|
|
seriesKey: DepthChartSeries;
|
|
};
|
|
|
|
export type DepthChartPoint = {
|
|
side: OrderSide;
|
|
price: number;
|
|
size: number;
|
|
};
|
|
|
|
export const SERIES_KEY_FOR_ORDER_SIDE = {
|
|
[OrderSide.BUY]: DepthChartSeries.Bids,
|
|
[OrderSide.SELL]: DepthChartSeries.Asks,
|
|
};
|
|
|
|
// ------ Funding Chart ------ //
|
|
export enum FundingRateResolution {
|
|
OneHour = 'OneHour',
|
|
EightHour = 'EightHour',
|
|
Annualized = 'Annualized',
|
|
}
|
|
|
|
export type FundingChartDatum = {
|
|
time: number;
|
|
fundingRate: number;
|
|
direction: FundingDirection;
|
|
};
|