interface TradeReader { getAccount(accountId): Promise<ReaderAccountResponse>; getDepositWithdrawHistory(accountId,
limit,
offset): Promise<ReaderDepositWithdrawHistory>; getHistoricalLpPairVolumes(limit,
offset,
liquidityPoolId,
pair?): Promise<ReaderHistoricalLpPairVolume[]>; getLiquidityPools(): Promise<ReaderLiquidityPool[]>; getPositions(limit,
offset,
options?): Promise<ReaderSubgraphPosition[]>; getSystemParam(paramName): Promise<BigNumber>; getSystemParams(): Promise<SystemParams>; getTradeGasFeeUsd(): Promise<BigNumber>; getTradeHistory(accountId,
page): Promise<{ accountId: number; accountUser: string; createdTimestampUnixMillis: number; expiryTimestampUnixMillis: number; id: string; kind: { kind: "market"; } | { args: { limitPrice: BigNumber; }; kind: "limit"; } | { args: { stopLoss?: null | { kind: "position"; } | { id: string; kind: "order"; }; triggerPrice: BigNumber; }; kind: "stopMarket"; } | { args: { limitPrice: BigNumber; triggerPrice: BigNumber; }; kind: "stopLimit"; } | { args: { takeProfit?: null | { kind: "position"; } | { id: string; kind: "order"; }; triggerPrice: BigNumber; }; kind: "limitTrigger"; } | { kind: string; }; lpId: string; nonce: string; pair: Pair; signature: string; size: { amount: BigNumber; unit: "lpc" | "lot"; }; status: { content: { status: "placed"; } | { content: { timestampUnixMillis: number; triggerPrice: BigNumber; }; status: "triggered"; }; status: "open"; } | { content: { price: BigNumber; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { content: { txHash: string; }; status: "settled"; }; timestampUnixMillis: number; }; status: "filled"; } | { content: { reason: string; timestampUnixMillis: number; userCancellation?: null | { address: string; nonce: string; signature: { r: string; s: string; v: number; }; }; }; status: "cancelled"; }; }[]>; getUserAccountIds(userAddress,
userRole): Promise<number[]>; getWithdrawGasFeeUsd(): Promise<BigNumber>; } Methods
getDepositWithdrawHistory
- getDepositWithdrawHistory(accountId, limit, offset): Promise<ReaderDepositWithdrawHistory>
Parameters
- accountId: number
- limit: number
- offset: number
getHistoricalLpPairVolumes
- getHistoricalLpPairVolumes(limit, offset, liquidityPoolId, pair?): Promise<ReaderHistoricalLpPairVolume[]>
Parameters
- limit: number
- offset: number
- liquidityPoolId: string
Optional
pair: string
getSystemParam
- getSystemParam(paramName): Promise<BigNumber>
Returns Promise<BigNumber>
getTradeGasFeeUsd
- getTradeGasFeeUsd(): Promise<BigNumber>
Returns Promise<BigNumber>
getTradeHistory
- getTradeHistory(accountId, page): Promise<{
accountId: number;
accountUser: string;
createdTimestampUnixMillis: number;
expiryTimestampUnixMillis: number;
id: string;
kind: {
kind: "market";
} | {
args: {
limitPrice: BigNumber;
};
kind: "limit";
} | {
args: {
stopLoss?: null | {
kind: "position";
} | {
id: string;
kind: "order";
};
triggerPrice: BigNumber;
};
kind: "stopMarket";
} | {
args: {
limitPrice: BigNumber;
triggerPrice: BigNumber;
};
kind: "stopLimit";
} | {
args: {
takeProfit?: null | {
kind: "position";
} | {
id: string;
kind: "order";
};
triggerPrice: BigNumber;
};
kind: "limitTrigger";
} | {
kind: string;
};
lpId: string;
nonce: string;
pair: Pair;
signature: string;
size: {
amount: BigNumber;
unit: "lpc" | "lot";
};
status: {
content: {
status: "placed";
} | {
content: {
timestampUnixMillis: number;
triggerPrice: BigNumber;
};
status: "triggered";
};
status: "open";
} | {
content: {
price: BigNumber;
settlementStatus: {
status: "queued";
} | {
status: "beforeTx";
} | {
status: "indexing";
} | {
content: {
txHash: string;
};
status: "settled";
};
timestampUnixMillis: number;
};
status: "filled";
} | {
content: {
reason: string;
timestampUnixMillis: number;
userCancellation?: null | {
address: string;
nonce: string;
signature: {
r: string;
s: string;
v: number;
};
};
};
status: "cancelled";
};
}[]> Parameters
- accountId: number
- page: number
Returns Promise<{
accountId: number;
accountUser: string;
createdTimestampUnixMillis: number;
expiryTimestampUnixMillis: number;
id: string;
kind: {
kind: "market";
} | {
args: {
limitPrice: BigNumber;
};
kind: "limit";
} | {
args: {
stopLoss?: null | {
kind: "position";
} | {
id: string;
kind: "order";
};
triggerPrice: BigNumber;
};
kind: "stopMarket";
} | {
args: {
limitPrice: BigNumber;
triggerPrice: BigNumber;
};
kind: "stopLimit";
} | {
args: {
takeProfit?: null | {
kind: "position";
} | {
id: string;
kind: "order";
};
triggerPrice: BigNumber;
};
kind: "limitTrigger";
} | {
kind: string;
};
lpId: string;
nonce: string;
pair: Pair;
signature: string;
size: {
amount: BigNumber;
unit: "lpc" | "lot";
};
status: {
content: {
status: "placed";
} | {
content: {
timestampUnixMillis: number;
triggerPrice: BigNumber;
};
status: "triggered";
};
status: "open";
} | {
content: {
price: BigNumber;
settlementStatus: {
status: "queued";
} | {
status: "beforeTx";
} | {
status: "indexing";
} | {
content: {
txHash: string;
};
status: "settled";
};
timestampUnixMillis: number;
};
status: "filled";
} | {
content: {
reason: string;
timestampUnixMillis: number;
userCancellation?: null | {
address: string;
nonce: string;
signature: {
r: string;
s: string;
v: number;
};
};
};
status: "cancelled";
};
}[]>
getUserAccountIds
- getUserAccountIds(userAddress, userRole): Promise<number[]>
Returns Promise<number[]>
getWithdrawGasFeeUsd
- getWithdrawGasFeeUsd(): Promise<BigNumber>
Returns Promise<BigNumber>