UNPKG

@drift-labs/common

Version:

Common functions for Drift

33 lines (32 loc) 1.33 kB
import { PerpMarketAccount, SpotMarketAccount, MarketType, SpotMarketConfig, DriftEnv, PerpMarketConfig, DriftClient } from '@drift-labs/sdk'; declare function getMarketConfig(driftEnv: DriftEnv, marketType: typeof MarketType.PERP, marketIndex: number): PerpMarketConfig; declare function getMarketConfig(driftEnv: DriftEnv, marketType: typeof MarketType.SPOT, marketIndex: number): SpotMarketConfig; export declare const MARKET_UTILS: { getBaseAssetSymbol: (marketName: string, removePrefix?: boolean) => string; getPausedOperations: (marketAccount: PerpMarketAccount | SpotMarketAccount) => string[]; PerpOperationsMap: { UPDATE_FUNDING: string; AMM_FILL: string; FILL: string; SETTLE_PNL: string; SETTLE_PNL_WITH_POSITION: string; }; SpotOperationsMap: { UPDATE_CUMULATIVE_INTEREST: string; FILL: string; WITHDRAW: string; }; InsuranceFundOperationsMap: { INIT: string; ADD: string; REQUEST_REMOVE: string; REMOVE: string; }; getMarketConfig: typeof getMarketConfig; getMaxLeverageForMarket: (marketType: MarketType, marketIndex: number, driftClient: DriftClient) => { maxLeverage: number; highLeverageMaxLeverage: number; hasHighLeverage: boolean; }; }; export {};