Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/src/exchanges/hyperliquid/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface HyperliquidRawTrade {
hash: string; // transaction hash
time: number; // timestamp (ms)
tid: number; // trade id
users: string[]; // [takerAddress, makerAddress]
}

export interface HyperliquidRawMid {
Expand All @@ -87,6 +88,7 @@ export interface HyperliquidRawFill {
fee: string;
tid: number;
feeToken: string;
builderFee?: string; // present when order was placed through a builder
}

export interface HyperliquidRawOpenOrder {
Expand All @@ -96,7 +98,7 @@ export interface HyperliquidRawOpenOrder {
side: string;
sz: string;
timestamp: number;
origSz: string;
origSz?: string; // only returned by frontendOpenOrders, not openOrders
cloid?: string;
}

Expand Down
3 changes: 2 additions & 1 deletion core/src/exchanges/hyperliquid/normalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ export class HyperliquidNormalizer implements IExchangeNormalizer<HyperliquidRaw
}

normalizeOpenOrder(raw: HyperliquidRawOpenOrder): Order {
const origSz = parseFloat(raw.origSz);
const currentSz = parseFloat(raw.sz);
// origSz is only available from frontendOpenOrders; fall back to sz
const origSz = raw.origSz !== undefined ? parseFloat(raw.origSz) : currentSz;

return {
id: String(raw.oid),
Expand Down
Loading