Client Types

Typescript types used within SDK

TradeContainer
type TradeContainer = {
    trade: Trade;
    tradeInfo: TradeInfo;
    liquidationParams: LiquidationParams;
    initialAccFees: InitialAccFees;
    receivedAt?: number;
};
Trade
type Trade = {
    user: string;
    index: number;
    pairIndex: PairIndex;
    leverage: number;
    long: boolean;
    isOpen: boolean;
    collateralIndex: number;
    tradeType: TradeType;
    collateralAmount: number;
    openPrice: number;
    sl: number;
    tp: number;
};
TradeInfo
type TradeInfo = {
    createdBlock: number;
    tpLastUpdatedBlock: number;
    slLastUpdatedBlock: number;
    maxSlippageP: number;
    lastOiUpdateTs: number;
    collateralPriceUsd: number;
    contractsVersion: number;
    lastPosIncreaseBlock: number;
};
InitialAccFees
type InitialAccFees = {
    accPairFee: number;
    accGroupFee: number;
    block: number;
};
TradeInfo
type TradeInfo = {
    createdBlock: number;
    tpLastUpdatedBlock: number;
    slLastUpdatedBlock: number;
    maxSlippageP: number;
    lastOiUpdateTs: number;
    collateralPriceUsd: number;
    contractsVersion: number;
    lastPosIncreaseBlock: number;
};
LiquidationParams
type LiquidationParams = {
    maxLiqSpreadP: number;
    startLiqThresholdP: number;
    endLiqThresholdP: number;
    startLeverage: number;
    endLeverage: number;
};
TradingGroup
type TradingGroup = {
    maxLeverage: number;
    minLeverage: number;
    name: string;
};
Fee
type Fee = {
    openFeeP: number;
    closeFeeP: number;
    minPositionSizeUsd: number;
    triggerOrderFeeP: number;
};
PairDepth
type PairDepth = {
    onePercentDepthAboveUsd: number;
    onePercentDepthBelowUsd: number;
};
PairParamsBorrowingFees
type PairParamsBorrowingFees = {
    pairs: BorrowingFeePair[];
    groups: BorrowingFeeGroup[];
};
Pair
type Pair = {
    name: string;
    description: string;
    from: string;
    to: string;
    feeIndex: number;
    groupIndex: number;
    pairIndex: PairIndex;
    spreadP: number;
};
TradeHistoryRecord
type TradeHistoryRecord = {
    action: string;
    address: string;
    long: number;
    collateralPriceUsd: number;
    collateralIndex: number;
    date: string;
    leverage: number;
    pair: string;
    pnl_net: number;
    price: number;
    size: number;
    tx: string;
    collateralDelta: number | null;
    leverageDelta: number | null;
    marketPrice: number | null;
};
MarketOrder
type MarketOrder = {
    trader: string;
    pairIndex: PairIndex;
    index: number;
    block: number;
    open: boolean;
};
ChartBar
type ChartBar = {
    close: number;
    high: number;
    isBarClosed: boolean;
    isLastBar: boolean;
    low: number;
    open: number;
    time: number;
};
LeaderboardTrader
type LeaderboardTrader = {
    address: string;
    tradesCount: number;
    winrate: number;
    pnl: number;
    volume: number;
    score: number;
    totalPnlUsd: number;
};
OpenTradeParams
type OpenTradeParams = [
    address: string,
    pairIndex: PairIndex,
    x1: number,
    x2: number,
    wei: number,
    price: string,
    buy: boolean,
    leverage: number,
    takeProfit: string,
    stopLoss: string
];
OiWindowsSettings
type OiWindowsSettings = {
    startTs: number;
    windowsDuration: number;
    windowsCount: number;
};
PairOi
type PairOi = {
    oiLongUsd: number;
    oiShortUsd: number;
};
OiWindows
type OiWindows = {
    [key: string]: PairOi;
};
CollateralConfig
type CollateralConfig = {
    collateral: string;
    isActive: boolean;
    precision: number;
    precisionDelta: number;
    decimals?: number;
};
FeeTiers
type FeeTiers = {
    tiers: FeeTier[];
    multipliers: number[];
    currentDay: number;
};
TraderFeeTiers
type TraderFeeTiers = {
    traderInfo: TraderInfo;
    inboundPoints: number;
    outboundPoints: number;
    lastDayUpdatedPoints: number;
    expiredPoints: number[];
};
PairFactor
type PairFactor = {
    cumulativeFactor: number;
    protectionCloseFactor: number;
    protectionCloseFactorBlocks: number;
};
OpenInterest
type OpenInterest = {
    long: number;
    short: number;
    max: number;
};
PendingOrder
type PendingOrder = {
    trade: Trade;
    user: string;
    index: string;
    isOpen: boolean;
    orderType: PendingOrderType;
    createdBlock: string;
    maxSlippageP: string;
};
PairGroup
type PairGroup = {
    groupIndex: number;
    block: number;
    initialAccFeeLong: number;
    initialAccFeeShort: number;
    prevGroupAccFeeLong: number;
    prevGroupAccFeeShort: number;
    pairAccFeeLong: number;
    pairAccFeeShort: number;
};
BorrowingFeePair
type BorrowingFeePair = BorrowingOi & {
    feePerBlock: number;
    accFeeLong: number;
    accFeeShort: number;
    accLastUpdatedBlock: number;
    feeExponent: number;
    oi: OpenInterest;
    groups: PairGroup[];
};
BorrowingFeeGroup
type BorrowingFeeGroup = {
    feePerBlock: number;
    accFeeLong: number;
    accFeeShort: number;
    accLastUpdatedBlock: number;
    feeExponent: number;
    oi: OpenInterest;
};
TradeType
enum TradeType {
    TRADE = 0,
    LIMIT = 1,
    STOP = 2
}
PositionType
enum PositionType {
    LONG = "LONG",
    SHORT = "SHORT"
}
PendingOrderType
enum PendingOrderType {
    MARKET_OPEN = 0,
    MARKET_CLOSE = 1,
    LIMIT_OPEN = 2,
    STOP_OPEN = 3,
    TP_CLOSE = 4,
    SL_CLOSE = 5,
    LIQ_CLOSE = 6
}
CounterType
enum CounterType {
    TRADE = 0,
    PENDING_ORDER = 1
}
PairIndex
enum PairIndex {
    BTCUSD = 0,
    ETHUSD = 1,
    LINKUSD = 2,
    DOGEUSD = 3,
    MATICUSD = 4,
    ADAUSD = 5,
    SUSHIUSD = 6,
    AAVEUSD = 7,
    ALGOUSD = 8,
    BATUSD = 9,
    COMPUSD = 10,
    DOTUSD = 11,
    EOSUSD = 12,
    LTCUSD = 13,
    MANAUSD = 14,
    OMGUSD = 15,
    SNXUSD = 16,
    UNIUSD = 17,
    XLMUSD = 18,
    XRPUSD = 19,
    ZECUSD = 20,
    EURUSD = 21,
    USDJPY = 22,
    GBPUSD = 23,
    USDCHF = 24,
    AUDUSD = 25,
    USDCAD = 26,
    NZDUSD = 27,
    EURCHF = 28,
    EURJPY = 29,
    EURGBP = 30,
    LUNAUSD = 31,
    YFIUSD = 32,
    SOLUSD = 33,
    XTZUSD = 34,
    BCHUSD = 35,
    BNTUSD = 36,
    CRVUSD = 37,
    DASHUSD = 38,
    ETCUSD = 39,
    ICPUSD = 40,
    MKRUSD = 41,
    NEOUSD = 42,
    THETAUSD = 43,
    TRXUSD = 44,
    ZRXUSD = 45,
    SANDUSD = 46,
    BNBUSD = 47,
    AXSUSD = 48,
    GRTUSD = 49,
    HBARUSD = 50,
    XMRUSD = 51,
    ENJUSD = 52,
    FTMUSD = 53,
    FTTUSD = 54,
    APEUSD = 55,
    CHZUSD = 56,
    SHIBUSD = 57,
    AAPLUSD = 58,
    FBUSD = 59,
    GOOGLUSD = 60,
    AMZNUSD = 61,
    MSFTUSD = 62,
    TSLAUSD = 63,
    SNAPUSD = 64,
    NVDAUSD = 65,
    VUSD = 66,
    MAUSD = 67,
    PFEUSD = 68,
    KOUSD = 69,
    DISUSD = 70,
    GMEUSD = 71,
    NKEUSD = 72,
    AMDUSD = 73,
    PYPLUSD = 74,
    ABNBUSD = 75,
    BAUSD = 76,
    SBUXUSD = 77,
    WMTUSD = 78,
    INTCUSD = 79,
    MCDUSD = 80,
    METAUSD = 81,
    GOOGLUSD2 = 82,
    GMEUSD2 = 83,
    AMZNUSD2 = 84,
    TSLAUSD2 = 85,
    SPYUSD = 86,
    QQQUSD = 87,
    IWMUSD = 88,
    DIAUSD = 89,
    XAUUSD = 90,
    XAGUSD = 91,
    USDCNH = 92,
    USDSGD = 93,
    EURSEK = 94,
    USDKRW = 95,
    EURNOK = 96,
    USDINR = 97,
    USDMXN = 98,
    USDTWD = 99,
    USDZAR = 100,
    USDBRL = 101,
    AVAXUSD = 102,
    ATOMUSD = 103,
    NEARUSD = 104,
    QNTUSD = 105,
    IOTAUSD = 106,
    TONUSD = 107,
    RPLUSD = 108,
    ARBUSD = 109,
    EURAUD = 110,
    EURNZD = 111,
    EURCAD = 112,
    GBPAUD = 113,
    GBPNZD = 114,
    GBPCAD = 115,
    GBPCHF = 116,
    GBPJPY = 117,
    AUDNZD = 118,
    AUDCAD = 119,
    AUDCHF = 120,
    AUDJPY = 121,
    NZDCAD = 122,
    NZDCHF = 123,
    NZDJPY = 124,
    CADCHF = 125,
    CADJPY = 126,
    CHFJPY = 127,
    LDOUSD = 128,
    INJUSD = 129,
    RUNEUSD = 130,
    CAKEUSD = 131,
    FXSUSD = 132,
    TWTUSD = 133,
    PEPEUSD = 134,
    DYDXUSD = 135,
    GMXUSD = 136,
    FILUSD = 137,
    APTUSD = 138,
    IMXUSD = 139,
    VETUSD = 140,
    OPUSD = 141,
    RNDRUSD = 142,
    EGLDUSD = 143,
    TIAUSD = 144,
    STXUSD = 145,
    FLOWUSD = 146,
    KAVAUSD = 147,
    GALAUSD = 148,
    MINAUSD = 149,
    ORDIUSD = 150,
    ILVUSD = 151,
    KLAYUSD = 152,
    SUIUSD = 153,
    BLURUSD = 154,
    FETUSD = 155,
    CFXUSD = 156,
    BEAMUSD = 157,
    ARUSD = 158,
    SEIUSD = 159,
    BTTUSD = 160,
    ROSEUSD = 161,
    WOOUSD = 162,
    AGIXUSD = 163,
    ZILUSD = 164,
    GMTUSD = 165,
    ASTRUSD = 166,
    ONEINCHUSD = 167,
    FLOKIUSD = 168,
    QTUMUSD = 169,
    OCEANUSD = 170,
    WLDUSD = 171,
    MASKUSD = 172,
    CELOUSD = 173,
    LRCUSD = 174,
    ENSUSD = 175,
    MEMEUSD = 176,
    ANKRUSD = 177,
    IOTXUSD = 178,
    ICXUSD = 179,
    KSMUSD = 180,
    RVNUSD = 181,
    ANTUSD = 182,
    WAVESUSD = 183,
    SKLUSD = 184,
    SUPERUSD = 185,
    BALUSD = 186,
    WTIUSD = 187,
    XPTUSD = 188,
    XPDUSD = 189,
    HGUSD = 190,
    JUPUSD = 191,
    MANTAUSD = 192,
    BONKUSD = 193,
    PENDLEUSD = 194,
    OSMOUSD = 195,
    ALTUSD = 196,
    UMAUSD = 197,
    MAGICUSD = 198,
    API3USD = 199,
    STRKUSD = 200,
    DYMUSD = 201,
    NTRNUSD = 202,
    PYTHUSD = 203,
    SCUSD = 204,
    WIFUSD = 205,
    PIXELUSD = 206,
    JTOUSD = 207,
    MAVIAUSD = 208,
    MYROUSD = 209,
    STGUSD = 210,
    BOMEUSD = 211,
    ETHFIUSD = 212,
    METISUSD = 213,
    AEVOUSD = 214,
    ONDOUSD = 215,
    MNTUSD = 216,
    KASUSD = 217,
    RONINUSD = 218,
    ENAUSD = 219,
    WUSD = 220,
    ZEUSUSD = 221,
    TNSRUSD = 222,
    TAOUSD = 223,
    OMNIUSD = 224,
    PRCLUSD = 225,
    MERLUSD = 226,
    SAFEUSD = 227,
    SAGAUSD = 228,
    LLUSD = 229,
    MSNUSD = 230,
    REZUSD = 231,
    NOTUSD = 232,
    IOUSD = 233,
    BRETTUSD = 234,
    ATHUSD = 235,
    ZROUSD = 236,
    ZKUSD = 237,
    LISTAUSD = 238,
    BLASTUSD = 239,
    RATSUSD = 240,
    BNXUSD = 241,
    PEOPLEUSD = 242,
    TURBOUSD = 243,
    SATSUSD = 244,
    POPCATUSD = 245,
    MOGUSD = 246,
    OMUSD = 247,
    COREUSD = 248,
    JASMYUSD = 249,
    DARUSD = 250,
    MEWUSD = 251,
    DEGENUSD = 252,
    SLERFUSD = 253,
    UXLINKUSD = 254,
    AVAILUSD = 255,
    BANANAUSD = 256
}

Last updated