Docs
Launch App

Pangolin Overview

Introduction to Pangolin
Audits
Tokens & Governance
Official Links & Communities
Become a Partner
Support
Roadmap
Privacy Policy & Legal Notices

Guides

Swapping Tokens
Providing Liquidity
Managing Liquidity Positions
Withdrawing Liquidity
Earning Rewards
Understanding SAR

Developers

Contracts & Integration Reference
APIs
Bug Bounty
Token Listing
Create A Multisig
Honeycomb↗

PangoPerps

API fundamentals
Public Info API
User API
Trading API
Order Management
Create Order
Batch Create Order
Cancel Order
Cancel Algo Order
Cancel Order by Client Order ID
Edit Order
Edit Algo Order
Cancel Algo Order by Client Order ID
Cancel All Pending Algo Orders
Cancel All Pending Orders
Cancel All After
Batch Cancel Orders
Batch Cancel Orders by Client Order ID
Get Order by Order ID
Get Order by Client Order ID
Create Algo Order
Get Algo Order by Order ID
Get Algo Order by Client Order ID
Get Orders
Get Algo Orders
Get Trades
Get Trade
Get Trades for an Order
Get Trades for an Algo Order
List PangoPerps Order Tags
Get One PangoPerps Order Tag
Liquidations
Assets/withdraw/settle PnL
Positions
Funding
PangoPerpsTrading APIOrder Management

Create Algo Order

Place a triggered order, including stop, take-profit/stop-loss, bracket, and trailing-stop configurations.

#Endpoint

POST /v1/algo/order

Mainnet: POST https://api.orderly.org/v1/algo/order

Testnet: POST https://testnet-api.orderly.org/v1/algo/order

Rate limit: 1 request per second. Use this authenticated endpoint for an order that needs a trigger before it can execute, such as a stop order. The API key must include the trading scope.

A STOP order activates when the market reaches its trigger price, then executes as the selected market or limit type. For positional take-profit/stop-loss orders, use a nested child_orders structure: the parent represents POSITIONAL_TP_SL and each close-position child uses TAKE_PROFIT or STOP_LOSS. For a trailing stop, set algo_type to TRAILING_STOP, type to MARKET, and provide callbackRate.

#Authentication headers

  • orderly-timestamp — signed-request timestamp in milliseconds.
  • orderly-account-id — PangoPerps account ID.
  • orderly-key — public API key.
  • orderly-signature — request signature.
  • x-recv-window — optional timeout threshold for placing the order, in milliseconds.
  • Content-Type: application/json — JSON request body.

#Request body

The request body is a JSON array of algorithmic order objects. These fields are supported:

Field Type Required / constraints Description
symbol string Required Market symbol.
algo_type string Required STOP, TP_SL, POSITIONAL_TP_SL, BRACKET, BRACKET + TP_SL, or TRAILING_STOP.
type string Required; LIMIT or MARKET. Required for STOP orders. Execution order type.
quantity number Required for most types; optional for POSITIONAL_TP_SL. For MARKET/ASK/BID, it may be omitted when order_amount is supplied. Order size.
side string Required for STOP; BUY or SELL. Order direction.
child_orders object[] Required Nested trigger or child-order definitions.
client_order_id string Optional; up to 36 characters, may contain hyphens but cannot start with one. Client-assigned ID.
price number Optional for TP_SL and POSITIONAL_TP_SL. Limit price where applicable.
trigger_price_type string Optional; MARK_PRICE is currently supported. Price source used to evaluate a trigger.
trigger_price number Optional Price that activates the order or child.
reduce_only boolean Optional Restrict the order to reducing an existing position.
visible_quantity boolean Optional; defaults to false in this endpoint schema. Visibility setting listed for algo-order requests.
order_tag string Optional; maximum 128 characters; immutable after placement. Referral or custom-fee tag. For PangoPerps custom fees, use enum:pangoperps:<enum_id>.
activatedPrice string For TRAILING_STOP Activation price for the trailing stop.
callbackRate string For TRAILING_STOP Trailing rate; 0.1 represents 10%.
callbackValue string For TRAILING_STOP Trailing callback value.
margin_mode enum Optional; CROSS or ISOLATED. Defaults to the symbol's current setting. Margin mode for the order.

Each child order can include its own symbol, algo_type, side, type, price, trigger_price, trigger_price_type, quantity, reduce_only, and further child_orders, depending on the chosen order structure.

#Example request: bracket with positional take-profit and stop-loss

bash
curl --request POST \
  --url 'https://api.orderly.org/v1/algo/order' \
  --header 'Content-Type: application/json' \
  --header 'orderly-account-id: <account-id>' \
  --header 'orderly-key: <public-api-key>' \
  --header 'orderly-signature: <signature>' \
  --header 'orderly-timestamp: <timestamp-in-ms>' \
  --data '[
    {
      "symbol": "PERP_ETH_USDC",
      "algo_type": "BRACKET",
      "quantity": 0.25,
      "side": "BUY",
      "type": "LIMIT",
      "price": 3450.5,
      "child_orders": [
        {
          "symbol": "PERP_ETH_USDC",
          "algo_type": "POSITIONAL_TP_SL",
          "child_orders": [
            {
              "symbol": "PERP_ETH_USDC",
              "algo_type": "TAKE_PROFIT",
              "side": "SELL",
              "type": "CLOSE_POSITION",
              "trigger_price_type": "MARK_PRICE",
              "trigger_price": 3600,
              "reduce_only": true
            },
            {
              "symbol": "PERP_ETH_USDC",
              "algo_type": "STOP_LOSS",
              "side": "SELL",
              "type": "CLOSE_POSITION",
              "trigger_price_type": "MARK_PRICE",
              "trigger_price": 3300,
              "reduce_only": true
            }
          ]
        }
      ]
    }
  ]'

#Successful response

#Additional request example: standalone TP/SL orders

HTTP 200 returns an order identifier and summary fields for the accepted algo order.

json
[
  {
    "symbol": "PERP_ETH_USDC",
    "algo_type": "TP_SL",
    "quantity": 0.25,
    "trigger_price_type": "MARK_PRICE",
    "child_orders": [
      {
        "symbol": "PERP_ETH_USDC",
        "algo_type": "TAKE_PROFIT",
        "side": "SELL",
        "type": "MARKET",
        "trigger_price": 3600,
        "reduce_only": true
      },
      {
        "symbol": "PERP_ETH_USDC",
        "algo_type": "STOP_LOSS",
        "side": "SELL",
        "type": "MARKET",
        "trigger_price": 3300,
        "reduce_only": true
      }
    ]
  },
  {
    "symbol": "PERP_ETH_USDC",
    "algo_type": "POSITIONAL_TP_SL",
    "trigger_price_type": "MARK_PRICE",
    "child_orders": [
      {
        "symbol": "PERP_ETH_USDC",
        "algo_type": "TAKE_PROFIT",
        "side": "SELL",
        "type": "CLOSE_POSITION",
        "trigger_price_type": "MARK_PRICE",
        "trigger_price": 3600,
        "reduce_only": true
      },
      {
        "symbol": "PERP_ETH_USDC",
        "algo_type": "STOP_LOSS",
        "side": "SELL",
        "type": "CLOSE_POSITION",
        "trigger_price_type": "MARK_PRICE",
        "trigger_price": 3300,
        "reduce_only": true
      }
    ]
  }
]
json
{
  "success": true,
  "data": {
    "order_id": 123456789,
    "client_order_id": "pango-algo-001",
    "algo_type": "STOP",
    "quantity": 0.25
  },
  "timestamp": 1702989203989
}
PreviousGet Order by Client Order IDNext Get Algo Order by Order ID

On this page

  • Endpoint
  • Authentication headers
  • Request body
  • Example request: bracket with positional take-profit and stop-loss
  • Successful response
  • Additional request example: standalone TP/SL orders

Try it on Pangolin

Everything in these docs is live in the app.

SwapLiquidityStakePerps

Need help?

DiscordTelegramX