---
title: "Publish Order"
method: POST
path: "/defi/v1/dex/publishorder"
tags: ["dex"]
---

# Publish Order

`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`

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)

## Request body

- DexPublishorderRequest: The request body for a /defi/v1/dex/publishorder
  - `dexId` '2200' | '2201' | '2202' | '2203' | '2204' | '2205' | '2206': The unique ID to specify the decentralized exchange (DEX) within a particular blockchain. Find more [here](https://docs.blockdaemon.com/docs/defi-api-supported-protocols#supported-dexs-protocols).
  - `orderType` 'create' | 'cancel': The type of order to publish. Can be 'create' or 'cancel'. Defaults to 'create'.
  - `makerAsset` string: The token address of the asset that the Maker is selling.
  - `takerAsset` string: The token address of the asset that the Maker expects in return.
  - `from` string, required: The address of the sender (Maker) initiating the transaction.
  - `to` string: The address of the recipient (Taker) for the transaction.
  - `amountIn` string: 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".
  - `amountOut` string: 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".
  - `deadline` string: The deadline for the transaction to be executed (in UNIX Timestamp format).
  - `orderId` boolean: The unique identifier of the order to retrieve. Use this to fetch details for a specific order.
  - `salt` string: A randomized value to prevent replay attacks, used as an additional input in hashing.
  - `enableFee` boolean: Flag to include a basis points fee transaction alongside the main transaction when set to true.

## Response `200`

Successful response

- object
  - `status` integer
  - `msg` string
  - `data` object

---

[API](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api.md) - [All operations](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/revisions/ec053b7c8041?raw)
