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

    Type Alias ApiPerpetualsMarketOrderBody

    ApiPerpetualsMarketOrderBody: {
        builderCode?: PerpetualsBuilderCodeParamaters;
        cancelSlTp: boolean;
        collateralChange: number;
        hasPosition: boolean;
        leverage?: number;
        marketId: PerpetualsMarketId;
        reduceOnly: boolean;
        side: PerpetualsOrderSide;
        size: bigint;
        slippage: Slippage;
        slTp?: {
            builderCode?: PerpetualsBuilderCodeParamaters;
            gasCoinArg?: TransactionObjectArgument;
            isSponsoredTx?: boolean;
            size?: bigint;
            stopLossPrice?: number;
            takeProfitPrice?: number;
            triggerPriceType?: PerpetualsStopOrderTriggerPriceType;
        };
        sponsor?: PerpetualsSponsorConfig;
        txKind?: SerializedTransaction;
        walletAddress: SuiAddress;
    } & (
        | { accountCapId?: ObjectId; accountId: PerpetualsAccountId }
        | { vaultId: ObjectId }
    )

    API request body for placing a market order in a given market.

    This form is used by the backend and includes contextual information like accountId or vaultId.

    Type Declaration

    • OptionalbuilderCode?: PerpetualsBuilderCodeParamaters

      Optional integrator fee configuration for this order.

      If provided, the integrator specified in the configuration will receive a fee on the taker volume generated by this order. The integrator must have been previously approved by the account owner, and the fee must not exceed the maximum fee the user approved for that integrator.

    • cancelSlTp: boolean

      True is position is closed.

    • collateralChange: number

      Change in collateral allocated to this position (collateral units).

    • hasPosition: boolean

      Whether the account already has a position in this market.

    • Optionalleverage?: number

      Optional leverage override.

    • marketId: PerpetualsMarketId

      Market ID associated with the request.

    • reduceOnly: boolean

      If true, order can only reduce an existing position.

    • side: PerpetualsOrderSide

      Order side: 0 for bid or long, 1 for ask or short.

    • size: bigint

      Order size in scaled base units.

    • slippage: Slippage

      Allowable max slippage for trade execution.

    • OptionalslTp?: {
          builderCode?: PerpetualsBuilderCodeParamaters;
          gasCoinArg?: TransactionObjectArgument;
          isSponsoredTx?: boolean;
          size?: bigint;
          stopLossPrice?: number;
          takeProfitPrice?: number;
          triggerPriceType?: PerpetualsStopOrderTriggerPriceType;
      }

      Optional SL/TP instructions to be placed along with the market order.

      • OptionalbuilderCode?: PerpetualsBuilderCodeParamaters

        Optional integrator fee configuration applied when the SL/TP fires.

      • OptionalgasCoinArg?: TransactionObjectArgument

        Optional gas coin argument used when extending the transaction.

      • OptionalisSponsoredTx?: boolean

        Whether the transaction is sponsored rather than paid directly by the wallet.

      • Optionalsize?: bigint

        Order size in base units.

      • OptionalstopLossPrice?: number

        Stop-loss trigger price.

      • OptionaltakeProfitPrice?: number

        Take-profit trigger price.

      • OptionaltriggerPriceType?: PerpetualsStopOrderTriggerPriceType

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

    • Optionalsponsor?: PerpetualsSponsorConfig

      Optional transaction sponsorship configuration.

    • OptionaltxKind?: SerializedTransaction

      Optional serialized transaction kind if assembled by the API.

    • walletAddress: SuiAddress

      Wallet address used to identify the signer or owner.