Docs
Version 0 alpha (v0alpha)
Limit Order
Get

Getting Limit Orders

💡

This API is currently in alpha, and can be changed or removed without notice. Also, the maker needs to be whitelisted to use it. Please reach out to us via email for more information.

GET /v0alpha/limit-orders returns limit orders that are created by the maker (same as the request signer).

Cancelled orders (including permanently invalid orders like expired ones) will be deleted from our database immediately. Thus you will not see them in the response.

💡
This API requires authentication.

Endpoint

GET https://api.swapscanner.io/v0alpha/limit-orders?issuedAt=1614556800&salt=0x0&signature=0x0

Request Message Schema

{
  "domain": {
    "name": "Swapscanner Limit Order Protocol",
    "version": "v0",
    "chainId": "8217",
    "verifyingContract": "TBD",
    "salt": "0xYourSaltHere"
  },
  "primaryType": "GetLimitOrdersRequest",
  "types": {
    "EIP712Domain": [
      { "name": "name", "type": "string" },
      { "name": "version", "type": "string" },
      { "name": "chainId", "type": "uint256" },
      { "name": "verifyingContract", "type": "address" },
      { "name": "salt", "type": "bytes32" }
    ],
    "GetLimitOrdersRequest": [{ "name": "issuedAt", "type": "uint256" }]
  }
}
  • issuedAt - UNIX timestamp (in seconds) when you issued the request. issuedAt and salt will together work as a countermeasure for replay attacks.

    Your computer and the Swapscanner API server could be a clock difference, resulting in the message expiring earlier than expected. In such case, try subtracting 1~2 seconds from your current timestamp. However, do not subtract too much since we have TTL.

Response Body

[
  {
    "order": {
      "salt": "0xa432632382fce00d4b8c3f68a55043ef74a560c44480919e37e7eb890b0ea9c3",
      "nonce": "0x0",
      // 2023-11-16T03:00:00.000Z
      "expiresAt": "0x655585b0",
      "making": {
        // 1,000,000 oUSDC
        "token": "0x754288077d0ff82af7a5317c7cb8c444d421d103",
        "amount": "0xe8d4a51000"
      },
      "taking": {
        // 1,000,000 wKLAY
        "token": "0x19aac5f612f524b754ca7e7c41cbfa2e981a4432",
        "amount": "0xd3c21bcecceda1000000"
      },
      "maker": "0x6115b85a7aa4c4e5f03B93FD4A279dc2Bdf7f430",
      "permittedTaker": "0x0000000000000000000000000000000000000000"
    },
    "orderHash": "0xf1d82a6887bdc01a73609d52fdcf0a8cab436e02d29ef26cb324faaf9ac1cc60",
    "signature": "0xa8a3bbe9240e9fa578d48df575464f4980786dc93e88d2758c3ab5eae8b98c0f6b07cb4cb19ef8860696603341d9e15e034bec485a9517513c092ccfd9ab94fc1c",
    "status": "INACTIVE",
    "reason": "INSUFFICIENT_ALLOWANCE"
  },
  {
    "order": {
      "salt": "0x37827693dfcb822ea0ef42341c81f7757cfe056c925ac8a53404e0899eea2883",
      "nonce": "0x0",
      // 2023-11-16T03:00:00.000Z
      "expiresAt": "0x655585b0",
      "making": {
        // 1,000,000 oUSDC
        "token": "0x754288077d0ff82af7a5317c7cb8c444d421d103",
        "amount": "0xe8d4a51000"
      },
      "taking": {
        // 1,000,000 wKLAY
        "token": "0x19aac5f612f524b754ca7e7c41cbfa2e981a4432",
        "amount": "0xd3c21bcecceda1000000"
      },
      "maker": "0xdcbb62c5127e7af18de57b426ace12b773c7c6c8",
      "permittedTaker": "0x0000000000000000000000000000000000000000"
    },
    "orderHash": "0xd0056e57b2192cfa1832ac0b4730ad11264f84e10ddbc015f3cf9b35e4756299",
    "signature": "0x00af393bfa32cf78f4b340b189a6ec4bf4169d524994bddd8ebf1f263f49bf2ab6fa7c8103b9147305c298aa3b64fd1eeede0fbd0c55ed22cff32b91664df5eabb",
    "status": "INACTIVE",
    "reason": "INSUFFICIENT_BALANCE"
  },
  {
    "order": {
      "salt": "0x519fd8023344a3dc7ac5c731b76d804037804902d9bf3f7a6b0ffa7739131555",
      "nonce": "0x0",
      // 2023-11-16T03:00:00.000Z
      "expiresAt": "0x655585b0",
      "making": {
        // 1,000,000 oUSDC
        "token": "0x754288077d0ff82af7a5317c7cb8c444d421d103",
        "amount": "0xe8d4a51000"
      },
      "taking": {
        // 1,000,000 wKLAY
        "token": "0x19aac5f612f524b754ca7e7c41cbfa2e981a4432",
        "amount": "0xd3c21bcecceda1000000"
      },
      "maker": "0x06f2b7eb919258bc25634a65d4baa72172cbbc5d",
      "permittedTaker": "0x0000000000000000000000000000000000000000"
    },
    "orderHash": "0x9cab6a3756a1a346dcc080b40bb43f0354c3106800a9b5fb3d0fcbf0613bcfc0",
    "signature": "0xb5d932b11f3a203069c868280cddf209a757f2e2ebc13bf70ef419e7b792a93e415e6147d5e540f2cd1f65f0c99c1e1f2447bb32312de20ce123037556ced5d0b1",
    "status": "ACTIVE"
  }
]