From 971a2a6adbc92c04bfaaf04c96344e7d4d25902c Mon Sep 17 00:00:00 2001 From: discountry Date: Fri, 3 Oct 2025 15:35:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=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=E7=AE=80=E5=8C=96=E5=B8=82?= =?UTF-8?q?=E5=9C=BA=E8=AE=A2=E5=8D=95=E7=9A=84=E5=8D=B3=E6=97=B6=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/exchanges/lighter/gateway.ts | 8 +++----- src/ui/App.tsx | 7 +------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/exchanges/lighter/gateway.ts b/src/exchanges/lighter/gateway.ts index 2b50284..3f5a1c3 100644 --- a/src/exchanges/lighter/gateway.ts +++ b/src/exchanges/lighter/gateway.ts @@ -746,13 +746,11 @@ export class LighterGateway { triggerPriceScaled = decimalToScaled(params.stopPrice, this.priceDecimals); } // Align with chain expectations: - // - IOC and MARKET/STOP_MARKET orders must use Nil/Immediate expiry + // - Pure MARKET orders use immediate expiry (0) + // - STOP orders rest until trigger, so they require an absolute future expiry // - All other orders use absolute future timestamp (ms) for ~28 days const TWENTY_EIGHT_DAYS_MS = 28 * 24 * 60 * 60 * 1000; - const isImmediate = - resultTimeInForce === LIGHTER_TIME_IN_FORCE.IMMEDIATE_OR_CANCEL || - resultType === LIGHTER_ORDER_TYPE.MARKET || - resultType === LIGHTER_ORDER_TYPE.STOP_LOSS; + const isImmediate = resultType === LIGHTER_ORDER_TYPE.MARKET; const orderExpiry = isImmediate ? BigInt(IMMEDIATE_OR_CANCEL_EXPIRY_PLACEHOLDER) : BigInt(Date.now() + TWENTY_EIGHT_DAYS_MS); diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 11de91b..b82d24c 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -42,12 +42,7 @@ export function App() { const copyright = useMemo(() => loadCopyrightFragments(), []); const integrityOk = useMemo(() => verifyCopyrightIntegrity(), []); const exchangeId = useMemo(() => resolveExchangeId(), []); - const strategies = useMemo(() => { - if (exchangeId === "lighter") { - return STRATEGIES.filter((s) => s.id !== "trend"); - } - return STRATEGIES; - }, [exchangeId]); + const strategies = useMemo(() => STRATEGIES, []); useInput( (input, key) => {