From 9a419c36ace8ebd16ed88fb3dcd11d587fdcbf1e Mon Sep 17 00:00:00 2001 From: discountry Date: Fri, 3 Oct 2025 03:08:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20Lighter=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=99=A8=E7=9A=84=E8=AE=A2=E5=8D=95=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BD=BF=E7=94=A8=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E6=9C=AA=E6=9D=A5=E6=97=B6=E9=97=B4=E6=88=B3=E4=BB=A5?= =?UTF-8?q?=E7=AC=A6=E5=90=88=E9=93=BE=E7=9A=84=E9=A2=84=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/exchanges/lighter/gateway.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/exchanges/lighter/gateway.ts b/src/exchanges/lighter/gateway.ts index b27850e..552b949 100644 --- a/src/exchanges/lighter/gateway.ts +++ b/src/exchanges/lighter/gateway.ts @@ -745,9 +745,10 @@ export class LighterGateway { if (params.stopPrice != null) { triggerPriceScaled = decimalToScaled(params.stopPrice, this.priceDecimals); } - const orderExpiry = resultTimeInForce === LIGHTER_TIME_IN_FORCE.IMMEDIATE_OR_CANCEL - ? BigInt(IMMEDIATE_OR_CANCEL_EXPIRY_PLACEHOLDER) - : BigInt(DEFAULT_ORDER_EXPIRY_PLACEHOLDER); + // Align with chain expectations: use absolute future timestamp (ms) for OrderExpiry + // and a shorter-lived tx ExpiredAt. 28 days for order expiry, ~10 minutes for tx expiry. + const TWENTY_EIGHT_DAYS_MS = 28 * 24 * 60 * 60 * 1000; + const orderExpiry = BigInt(Date.now() + TWENTY_EIGHT_DAYS_MS); return { marketIndex: this.marketId,