dex

Publish Order

This endpoint interacts with the Kyberswap protocol to manage limit orders on the decentralized exchange. It allows you to either create a new limit order or cancel an existing one, based on the parameters provided in your request. A successful call returns detailed information including the order ID, the current order status, and a reference ID for tracking the transaction.

💡 Compute Unit Value: 35 (Fixed)

post/defi/v1/dex/publishorder

Request

  • Base URL
    https://svc.blockdaemon.com
  • URL
    https://svc.blockdaemon.com/defi/v1/dex/publishorder
  • Auth
    API key in header X-API-Key

Request body

dexId'2200' | '2201' | '2202' | '2203' | '2204' | '2205' | '2206'

The unique ID to specify the decentralized exchange (DEX) within a particular blockchain. Find more here.

orderType'create' | 'cancel'

The type of order to publish. Can be 'create' or 'cancel'. Defaults to 'create'.

makerAssetstring

The token address of the asset that the Maker is selling.

takerAssetstring

The token address of the asset that the Maker expects in return.

fromstring required

The address of the sender (Maker) initiating the transaction.

tostring

The address of the recipient (Taker) for the transaction.

amountInstring

Amount of the input token to provide, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: to swap 1 WETH (18 decimals), use "1000000000000000000"; to swap 1 USDC (6 decimals), use "1000000".

amountOutstring

Amount of the output token to receive, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: 1 WETH (18 decimals) = "1000000000000000000"; 1 USDC (6 decimals) = "1000000".

deadlinestring

The deadline for the transaction to be executed (in UNIX Timestamp format).

orderIdboolean

The unique identifier of the order to retrieve. Use this to fetch details for a specific order.

saltstring

A randomized value to prevent replay attacks, used as an additional input in hashing.

enableFeeboolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

Example request

{
  "dexId": "2200",
  "orderType": "create",
  "makerAsset": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
  "takerAsset": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "amountIn": "1000000000000000000",
  "amountOut": "1000000000000000000",
  "deadline": "1707313948",
  "orderId": "95167",
  "salt": "140518201020656697335313758999689041588",
  "enableFee": false
}

Response

Successful response

statusinteger
msgstring
dataobject

Example response

{
  "status": 200,
  "msg": "success",
  "data": {
    "orderId": "97837",
    "orderStatus": "Succeeded",
    "referenceId": "23479c6e906f49b8be4dccd062f69676"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.