Skip to content

Commit

Permalink
fix(PaperExchange): check if ticker exists before matching the order
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed Sep 8, 2024
1 parent d8b18e8 commit f8203fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/exchanges/src/exchanges/ccxt/paper-exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export class PaperExchange extends CCXTExchange {

for (const order of this.openOrders) {
const ticker = tickers[order.symbol];
if (!ticker) {
// console.warn(`[PaperExchange ${this.exchangeCode}] Ticker not found for symbol: ${order.symbol}`);
continue;
}

if (order.side === "buy" && order.price! >= ticker.ask!) {
const filledOrder = await xprisma.paperOrder.update({
Expand Down

0 comments on commit f8203fb

Please sign in to comment.