Documentation
    Preparing search index...

    MarginTPSLContract class for managing Take Profit / Stop Loss operations.

    Index

    Constructors

    Methods

    • Parameters

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Add a conditional order (take profit or stop loss)

    • Parameters

      • marginManagerKey: string

        The key to identify the margin manager

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Cancel all conditional orders for a margin manager

    • Parameters

      • marginManagerKey: string

        The key to identify the margin manager

      • conditionalOrderId: string

        The ID of the conditional order to cancel

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Cancel a specific conditional order

    • Parameters

      • poolKey: string

        The key to identify the pool

      • marginManagerId: string

        The ID of the margin manager

      • conditionalOrderId: string

        The ID of the conditional order

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Get a specific conditional order by ID

    • Parameters

      • poolKey: string

        The key to identify the pool

      • marginManagerId: string

        The ID of the margin manager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Get all conditional order IDs for a margin manager

    • Parameters

      • marginManagerKey: string

        The key to identify the margin manager

      • maxOrdersToExecute: number

        Maximum number of orders to execute in this call

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Execute conditional orders that have been triggered This is a permissionless function that can be called by anyone

    • Parameters

      • poolKey: string

        The key to identify the pool

      • marginManagerId: string

        The ID of the margin manager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Get the highest trigger price for trigger_below orders Returns 0 if there are no trigger_below orders

    • Parameters

      • poolKey: string

        The key to identify the pool

      • marginManagerId: string

        The ID of the margin manager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Get the lowest trigger price for trigger_above orders Returns constants::max_u64() if there are no trigger_above orders

    • Parameters

      • poolKey: string

        The key to identify the pool

      • triggerBelowPrice: boolean

        Whether to trigger when price is below trigger price

      • triggerPrice: number

        The price at which to trigger the order

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Create a new condition for a conditional order

    • Parameters

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Create a new pending limit order for use in conditional orders

    • Parameters

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Create a new pending market order for use in conditional orders