Orders

Fetch Post Order Details

Use this endpoint to preview the outcome of a potential order. It provides critical information such as:

  • Estimated liquidation price (post-order)

  • AMM fees

  • Expected fill price

  • Margin impact, price impact and other execution metrics

POST https://perps-api-mainnet.polynomial.finance/post-trade-details?chainId=<chain_id>

Query

Name
Value

chain_id

8008 (mainnet) Addresses

Headers

Name
Value

Content-Type

application/json

Accept

application/json

x-api-key

Backend API key(optional)

Request body

Name
Type
Description

accountId

string

Perp Account Id. Returned by accounts api <ADD_LINK>

marketId

string

From markets api response.

sizeDelta

string

With 18 decimals precision. Ex -1000000000000000000 for shorting -1 size

Response

{
    "totalFees": "113173321557870967",
    "fillPrice": "2735468306793171306346",
    "newHealthFactor": 2.6465412772448293,
    "settlementReward": "112673318234506925",
    "ammFees": "500003323364042",
    "nonVipAmmFees": "500003323364042",
    "priceImpact": "669242470939254",
    "newMarginUsage": 37.78516543830542,
    "feasible": true,
    "isPriceImpactProfitable": false,
    "liquidationPrice": "0",
    "errorMsg": null
}

Retrieve All Orders

Use this endpoint to fetch the full list of orders associated with the account.

GET https://perps-api-mainnet.polynomial.finance/orders/v2?owner=<wallet_addr>&ownershipType=SuperOwner&statuses=<status>

Query

Name
Value

wallet_addr

8008 (mainnet) Addresses

statuses

Support : [Created,Committed,Expired,LimitSubmitted,LimitExecuted] Eg: statuses=Commited,Expired

Headers

Name
Value

Content-Type

application/json

Accept

application/json

x-api-key

Backend API key(optional)

Response

{
  "owner": "0x3000001daCFD0d259fadC5124a7C14f4F544F2DC",
  "orders": [
    {
      "orderType": "Limit",
      "user": "0xc000007EE5FA8d10eEe31Cf06ba5B2E6f0487436",
      "accountId": "100000183460469231731687303715884105732",
      "marketId": "100",
      "chainId": 8008,
      "size": "401328244675427",
      "signature": null,
      "expiry": 1780774691910,
      "priceRange": {
        "priceA": "1",
        "priceB": "4000000000000000000",
        "acceptablePrice": "4200000000000000000",
        "priceANum": 1e-18,
        "priceBNum": 4,
        "acceptablePriceNum": 4.2
      },
      "tpPriceRange": {
        "priceA": "0",
        "priceB": "0",
        "acceptablePrice": "0",
        "priceANum": 0,
        "priceBNum": 0,
        "acceptablePriceNum": 0
      },
      "slPriceRange": {
        "priceA": "0",
        "priceB": "0",
        "acceptablePrice": "0",
        "priceANum": 0,
        "priceBNum": 0,
        "acceptablePriceNum": 0
      },
      "status": "LimitSubmitted",
      "orderId": 28180,
      "onchain": true,
      "hasLimitOrder": true,
      "hasTpSlOrder": false,
      "tpSlExecutionType": null,
      "limitOrderExecutionDetails": null,
      "tpslOrderExecutionDetails": null,
      "submissionTxDetails": {
        "chainId": 8008,
        "blockNumber": 15600261,
        "blockHash": "0xdf081b8f06c62f8e8ed56c6778e433fb50980a306efe199ac5863db40a053409",
        "txHash": "0x319168e6578bbf4c54f71996146978012d762cf0f0d1a2686880dbf435d45916",
        "logIndex": 1,
        "timestamp": 1749238697
      },
      "updateTxDetails": null,
      "timestamp": 1749238698182
    }
    ...
  ],
  "totalCount": 3
}

Last updated

Was this helpful?