Backpack · Arazzo Workflow

Backpack Flatten Open Orders on a Market

Version 1.0.0

List open orders on a market, cancel them all, and confirm none remain.

1 workflow 1 source API 1 provider
View Spec View on GitHub CryptocurrencyExchangeWalletsTradingPerpetualsSolanaWeb3DeFixNFTAnchorCoralCentralized ExchangeSelf-CustodyReal-TimeArazzoWorkflows

Provider

backpack

Workflows

flatten-market-orders
Cancel all open orders on a single market and confirm none remain.
Lists the open orders for the market, cancels all of them, and re-lists to confirm there are no remaining open orders.
3 steps inputs: apiKey, signature, symbol, timestamp, window outputs: cancelledOrders, remainingOrders
1
listOpenOrders
List the open orders for the market so the caller knows what will be cancelled.
2
cancelAll
Cancel all open orders on the specified market.
3
confirmCleared
Re-list the open orders for the market after the bulk cancel and return them as remainingOrders. Arazzo criteria cannot express "the list is empty", so this step does not fail when orders remain; the caller must check that remainingOrders is an empty array.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Backpack Flatten Open Orders on a Market
  summary: List open orders on a market, cancel them all, and confirm none remain.
  description: >-
    A risk-control flow for the Backpack Exchange. It lists the open orders for a
    single market, cancels every open order on that market, and then re-lists the
    open orders to confirm the book is clear for the account. Every step inlines
    its request — including the ED25519 signing headers required on authenticated
    calls — so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: orderApi
  url: ../openapi/backpack-order-api-openapi.yml
  type: openapi
workflows:
- workflowId: flatten-market-orders
  summary: Cancel all open orders on a single market and confirm none remain.
  description: >-
    Lists the open orders for the market, cancels all of them, and re-lists to
    confirm there are no remaining open orders.
  inputs:
    type: object
    required:
    - symbol
    - apiKey
    - signature
    - timestamp
    properties:
      symbol:
        type: string
        description: The market symbol to flatten (e.g. SOL_USDC).
      apiKey:
        type: string
        description: Base64 encoded ED25519 verifying key for the X-API-KEY header.
      signature:
        type: string
        description: Base64 encoded ED25519 signature for the X-SIGNATURE header.
      timestamp:
        type: integer
        description: Unix time in milliseconds for the X-TIMESTAMP header.
      window:
        type: integer
        description: Request validity window in milliseconds for the X-WINDOW header (default 5000).
  steps:
  - stepId: listOpenOrders
    description: >-
      List the open orders for the market so the caller knows what will be
      cancelled.
    operationId: get_open_orders
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: X-SIGNATURE
      in: header
      value: $inputs.signature
    - name: X-TIMESTAMP
      in: header
      value: $inputs.timestamp
    - name: X-WINDOW
      in: header
      value: $inputs.window
    - name: symbol
      in: query
      value: $inputs.symbol
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      openOrders: $response.body
  - stepId: cancelAll
    description: >-
      Cancel all open orders on the specified market.
    operationId: cancel_open_orders
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: X-SIGNATURE
      in: header
      value: $inputs.signature
    - name: X-TIMESTAMP
      in: header
      value: $inputs.timestamp
    - name: X-WINDOW
      in: header
      value: $inputs.window
    requestBody:
      contentType: application/json; charset=utf-8
      payload:
        symbol: $inputs.symbol
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      cancelledOrders: $response.body
  - stepId: confirmCleared
    description: >-
      Re-list the open orders for the market after the bulk cancel and return
      them as remainingOrders. Arazzo criteria cannot express "the list is
      empty", so this step does not fail when orders remain; the caller must
      check that remainingOrders is an empty array.
    operationId: get_open_orders
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: X-SIGNATURE
      in: header
      value: $inputs.signature
    - name: X-TIMESTAMP
      in: header
      value: $inputs.timestamp
    - name: X-WINDOW
      in: header
      value: $inputs.window
    - name: symbol
      in: query
      value: $inputs.symbol
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      remainingOrders: $response.body
  outputs:
    cancelledOrders: $steps.cancelAll.outputs.cancelledOrders
    remainingOrders: $steps.confirmCleared.outputs.remainingOrders

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/backpack-flatten-market-orders-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.