Skip to content

Commit

Permalink
feat: add log
Browse files Browse the repository at this point in the history
  • Loading branch information
nofir committed Dec 12, 2024
1 parent 19d4baa commit 935bca8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/jobs/okx-sync/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { addToRelayOrdersQueue } from "../relay-orders";
import { db, pgp } from "../../common/db";
import { logger } from "../../common/logger";
import { Okx, OkxOrder } from "../../utils/okx";
import {config} from "../../config";

export const fetchOrders = async (options: {
side: "buy" | "sell";
Expand Down Expand Up @@ -58,7 +59,19 @@ export const fetchOrders = async (options: {
const handleOrder = async (order: OkxOrder) => {
try {
const parsed = await okx.parseOrder(order);

if (parsed) {
if (config.chainId === 324) {
logger.error(
"fetch_orders_okx",
JSON.stringify({
message: `handleOrder. hash=${parsed.order.hash()}`,
order,
orderJSON: JSON.stringify(order),
})
);
}

parsedOrders.push({
kind: parsed.kind,
order: parsed.order,
Expand Down

0 comments on commit 935bca8

Please sign in to comment.