---
title: "Create Order"
method: POST
path: "/defi/v1/dex/createorder"
tags: ["dex"]
---

# Create Order

`POST /defi/v1/dex/createorder`

## Request

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

Generates an unsigned limit order message for decentralized trading, specifying parameters for maker/taker assets, amounts, fees, and execution conditions. The endpoint returns EIP-712 domain data, type definitions, and a structured payload (including salt, addresses, and asset data), which must be signed using the Blockdaemon SDK to finalize the order on-chain.

> 💡 
**Compute Unit Value:** `15` (Fixed)

## Request body

- DexCreateorderRequest: The request body for a /defi/v1/dex/createorder
  - `dexId` '1900' | '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).
  - `amountOutMin` string: Minimum acceptable output amount in the token's smallest denomination (base units). Provides slippage protection — the transaction reverts if the output falls below this value. Set to "0" to disable slippage protection. Examples: to require at least 0.99 USDC (6 decimals), use "990000"; to require at least 0.99 WETH (18 decimals), use "990000000000000000".
  - `decayStartTime` string, required: The start time for Dutch auction bidding. Provide a UNIX Timestamp.
  - `decayEndTime` string, required: The end time for Dutch auction bidding. Provide a UNIX Timestamp.
  - `deadline` string, required: The latest time the transaction is valid before expiration. Provide a UNIX Timestamp.
  - `from` string, required: The wallet address of the token sender.
  - `path` string[], required: Array of token contract addresses for the order pair. Provide [inputTokenAddress, outputTokenAddress].
  - `amountIn` string, required: 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".
  - `to` string, required: The wallet address of the recipient of the token.
  - `slippage` string: The percentage of the total swap value that is acceptable as slippage. Default: 1%. Valid range: 0% ≤ slippage ≤ 10%.
  - `enableFee` boolean: Flag to include a basis points fee transaction alongside the main transaction when set to true.
  - `makerAsset` string, required: The token address of the asset the Maker is offering (selling) in the order.
  - `takerAsset` string, required: The token address of the asset the Maker expects to receive (buying) in return.
  - `amountOut` string, required: 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".

## 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)
