Skip to content

Commit f9f7d90

Browse files
Hiksangclaude
andcommitted
fix: Lighter funding — add required limit/side params + position_fundings field
API requires limit and side params (returns 400 without them). Response field is position_fundings (not funding). Payment amount is in change field (not amount/payment). 0 → 68 payments, $0.016 matches Lighter dashboard $0.01. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1f5c90c commit f9f7d90

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/exchanges/lighter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ export class LighterAdapter implements ExchangeAdapter {
756756
return items.slice(0, limit).map((f) => ({
757757
time: Number(f.timestamp ?? 0) * 1000,
758758
symbol: String(f.symbol ?? ""),
759-
payment: String(f.amount ?? f.payment ?? "0"),
759+
payment: String(f.change ?? f.amount ?? f.payment ?? "0"),
760760
}));
761761
}
762762

@@ -889,8 +889,10 @@ export class LighterAdapter implements ExchangeAdapter {
889889
return this.restGetAuth("/positionFunding", {
890890
account_index: String(this._accountIndex),
891891
market_id: String(marketId),
892+
limit: "100",
893+
side: "all",
892894
}).then((res) => {
893-
const items = ((res as Record<string, unknown>).funding ?? (res as Record<string, unknown>).data ?? []) as Record<string, unknown>[];
895+
const items = ((res as Record<string, unknown>).position_fundings ?? (res as Record<string, unknown>).funding ?? (res as Record<string, unknown>).data ?? []) as Record<string, unknown>[];
894896
return items.map((f) => ({ ...f, symbol: f.symbol ?? sym }));
895897
});
896898
})

0 commit comments

Comments
 (0)