aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Full stop-order representation on-chain.

    Can represent:

    • SL/TP orders (slTp)
    • Standalone stops (nonSlTp)
    interface PerpetualsStopOrderData {
        builderCode?: PerpetualsBuilderCodeParamaters;
        expiryTimestamp?: bigint;
        limitOrder?: { orderType: PerpetualsOrderType; price: bigint };
        marketId: string;
        nonSlTp?: {
            reduceOnly: boolean;
            stopIndexPrice: number;
            triggerIfGeStopIndexPrice: boolean;
            triggerPriceType: PerpetualsStopOrderTriggerPriceType;
        };
        objectId: string;
        orderState: PerpetualsOrderState;
        side: PerpetualsOrderSide;
        size: bigint;
        slTp?: {
            limitOrderId?: bigint;
            stopLossPrice?: number;
            takeProfitPrice?: number;
            triggerPriceType: PerpetualsStopOrderTriggerPriceType;
        };
    }
    Index

    Optional integrator fee configuration applied when this stop order fires.

    expiryTimestamp?: bigint

    Optional expiration time (ms or seconds, depending on protocol).

    limitOrder?: { orderType: PerpetualsOrderType; price: bigint }

    Optional limit order parameters when the stop triggers.

    Type Declaration

    • orderType: PerpetualsOrderType

      Order type semantics.

    • price: bigint

      Limit price to post or execute at, scaled bigint.

    marketId: string

    Market the stop order is tied to.

    nonSlTp?: {
        reduceOnly: boolean;
        stopIndexPrice: number;
        triggerIfGeStopIndexPrice: boolean;
        triggerPriceType: PerpetualsStopOrderTriggerPriceType;
    }

    Non-SL/TP standalone stop configuration.

    Type Declaration

    • reduceOnly: boolean

      Whether the stop can only reduce an existing position.

    • stopIndexPrice: number

      Price threshold used for triggering (interpreted per triggerPriceType).

    • triggerIfGeStopIndexPrice: boolean

      If true, triggers when price >= threshold, otherwise price <= threshold.

    • triggerPriceType: PerpetualsStopOrderTriggerPriceType

      Which on-chain price the trigger uses: 0 = index, 1 = book, 2 = mark.

    objectId: string

    ID of the stop order object on-chain.

    Current state of the stop order in its lifecycle.

    Direction of the stop order.

    size: bigint

    Size to execute when triggered (scaled base units).

    slTp?: {
        limitOrderId?: bigint;
        stopLossPrice?: number;
        takeProfitPrice?: number;
        triggerPriceType: PerpetualsStopOrderTriggerPriceType;
    }

    Stop loss / take profit configuration.

    Type Declaration

    • OptionallimitOrderId?: bigint

      Unique order identifier for limit order sl/tp is tied to.

    • OptionalstopLossPrice?: number

      Price at which to trigger a stop loss (interpreted per triggerPriceType).

    • OptionaltakeProfitPrice?: number

      Price at which to take profit (interpreted per triggerPriceType).

    • triggerPriceType: PerpetualsStopOrderTriggerPriceType

      Which on-chain price the trigger uses: 0 = index, 1 = book, 2 = mark.