LogoLogo
Join DiscordFollow on XBridge FundsLong $BERA
  • Doc Bros v1
    • Overview
    • Key Features
      • Speed & Liquidity is Key
      • Bropetual Markets
      • A Hub for Berachain DeFi
    • Proof-of-Liquidity
      • Reward Vault
    • Power of Points
    • Partners & Integrations
    • Campaigns
      • bro.trade Em Up
  • bullish bros
    • SuperBros NFT
  • Technicals
    • What is Proof-of-Liquidity?
    • One-Click Trading
    • Funding Rates
  • Liquidations & Insurance Fund
  • Vertex Edge Sequencer
  • Fees
  • PnL Settlements
  • Withdrawals
  • Pricing (Oracles)
  • links & resources
    • bro.trade Links
      • Website
      • Trade Bropetuals
      • Discord
      • X (Twitter)
      • Medium
      • Swap on OogaBooga
    • Berachain Links
      • Berachain.com
      • Official Bridge
      • BeraHub
      • Berascan
      • Bera Discord
      • Berachain X (Twitter)
      • Berachain Docs
    • FAQ
  • developer bros
    • API
      • Gateway
        • Executes
          • Place Order
          • Cancel Order
          • Cancel and Place
          • Cancel Product Order
          • Withdraw Colleteral
          • Transfer Quote
          • Liquidate Subaccount
          • Mint LP
          • Burn LP
          • Link Signer
        • Queries
          • All Products
          • Contracts
          • Fee Rates
          • Health Groups
          • Insurance
          • Linked Signer
          • Market Liquidity
          • Market Prices
          • Max Lp Mintable
          • Max Order Size
          • Max Withdrawable
          • Min Deposit Rates
          • Nonces
          • Order
          • Orders
          • Status
          • Subaccount Info
          • Symbols
        • Signing
          • Examples
          • Q A
      • Subscriptions
        • Authentication
        • Streams
        • Events
        • Rate Limits
      • Archive (indexer)
        • Candlesticks
        • Events
        • Funding Rate
        • Interest Funding Payments
        • Linked Signer Rate Limit
        • Liquidation Feed
        • Maker Statistics
        • Market Snapshots
        • Matches
        • Merkle Proofs
        • Oracle Price
        • Orders
        • Perp Prices
        • Product Snapshots
        • Rewards
        • Signatures
        • Subaccounts
        • Summary
        • HONEY Price
      • Trigger
        • Executes
          • Place Order
          • Cancel Orders
          • Cancel Product Orders
        • Queries
          • List Trigger Orders
      • V2
        • Apr
        • Assets
        • Contracts
        • Orderbook
        • Pairs
        • Tickers
        • Trades
      • Rate limits
      • Errors
      • Symbols
      • Depositing
      • Withdrawing (on-chain)
      • Integrate via Smart Contracts
      • Definitions / Formulas
    • On-Chain Contracts
Powered by GitBook
On this page
  • Request
  • Request Parameters
  • Signing
  • Response
  1. developer bros
  2. API
  3. Trigger
  4. Queries

List Trigger Orders

Request

POST [TRIGGER_ENDPOINT]/query

Body

{
  "type": "list_trigger_orders",
  "tx": {
    "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000",
    "recvTime": "1688768157050"
  },
  "signature": "0x",
  "product_id": 1,
  "pending": false,
  "max_update_time": "1688768157050",
  "limit": 20
}

POST [TRIGGER_ENDPOINT]/query

Body

{
  "type": "list_trigger_orders",
  "tx": {
    "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43746573743000000000000000",
    "recvTime": "1688768157050"
  },
  "signature": "0x",
  "digests": ["0x5886d5eee7dc4879c7f8ed1222fdbbc0e3681a14c1e55d7859515898c7bd2038"]
  "limit": 20
}

Request Parameters

Note: max_update_time It's the time that the trigger order last changed state. For example, if a trigger order is placed & pending, the update time = time of placement. If the trigger order is cancelled, then the update time = time of cancellation.

Parameter
Type
Required
Description

tx

object

Yes

tx.sender

string

Yes

Hex string representing the subaccount’s 32 bytes (address + subaccount name) of the tx sender.

tx.recvTime

string

Yes

Encoded time in milliseconds after which the list trigger orders transaction will be ignored. cannot be more than 100 seconds from the time it is received by the server.

signature

string

Yes

product_id

number

No

If provided, returns all trigger orders for the given product; otherwise, returns trigger orders for all products.

pending

boolean

Yes

If set to true, returns all pending trigger orders; otherwise, returns all executed and cancelled orders.

max_update_time

number

No

If provided, returns all trigger orders that were last updated up to max_update_time. must be a unix epoch in seconds.

max_digest

string

No

If provided, returns all trigger orders up to the given order digest (exclusive). This can be used for pagination.

digests

string[]

No

If provided, only returns the trigger orders for the associated digests. Note: all other filters are ignored when digests is provided.

limit

number

No

If provided, returns the most recently updated trigger orders up to limit. defaults to 100. max limit is 500.

Signing

The solidity typed data struct that needs to be signed is:

struct ListTriggerOrders {
    bytes32 sender;
    uint64 recvTime;
}

sender: a bytes32 sent as a hex string; includes the address and the subaccount identifier

recvTime: the time in milliseconds (a recv_time) after which the transaction should be ignored by the trigger service. cannot be more than 100 seconds from the time it is received by the server.

Note: for signing you should always use the data type specified in the solidity struct which might be different from the type sent in the request e.g: recvTime should be an uint64 for Signing but should be sent as a string in the final payload.

Response

Success

{
  "status": "success",
  "data": {
    "orders": [
      {
        "order": {
          "order": {
            "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43000000000000000000000000",
            "priceX18": "1000000000000000000",
            "amount": "1000000000000000000",
            "expiration": "2000000000",
            "nonce": "1",
          },
          "signature": "0x...",
          "product_id": 1,
          "spot_leverage": true,
          "trigger": {
            "price_above": "1000000000000000000"
          },
          "digest": "0x..."
        },
        "status": "pending",
        "updated_at": 1688768157050
      }
    ]
  },
  "request_type": "query_list_trigger_orders"
}

Note: trigger orders can have the following statuses:

  • pending: initial state. trigger criteria has not been met nor has it been cancelled.

  • triggered: trigger criteria was met, and order was submitted for execution.

Failure

{
  "status": "failure",
  "signature": {signature}
  "error": "{error_msg}"
  "error_code": {error_code}
  "request_type": "query_list_trigger_orders"
}
PreviousQueriesNextV2

Last updated 3 months ago

List trigger orders transaction object. See section for details on the transaction fields.

Signed transaction. See section for more details.

cancelled: trigger order was cancelled due to any of the following: user requested via , order expired, account becomes unhealthy if order is triggered.

cancel trigger order
Signing
Signing