Build a Delta Order to Sign
Build a Delta Order to Sign
POST
https://api.paraswap.io/delta/orders/build
This section explains how to construct a Delta Order, which is essential for executing trades using the Velora Delta API. The /orders/build endpoint retrieves a Delta price and allows fallback to market prices.
A successfully built order includes a structured object ready for signing.
Common errors include validation failures, unsupported assets, and signature mismatches.
Use this guide to generate a Delta Order and prepare it for signing before submission.
Query Parameters
price*
DeltaPrice
chainId*
string
Chain ID. (Mainnet - 1, Optimism - 10, BSC - 56, Polygon - 137, Fantom - 250, zkEVM - 1101, Base - 8453, Arbitrum - 42161, Avalanche - 43114, Gnosis - 100).
owner*
string
Order owner address.
beneficiary
string
Order beneficiary. Default: zero address
, meaning owner address.
slippage
number
Slippage in base points (100
is 1%
). Default: 100
.
deadline
number
Order expiry time as UNIX timestamp. Default: 1 hour from order creation.
nonce
string
Arbitrary uint256
value to be used as order nonce
. Default: value generated with internal algos
. It is recommended to omit this param.
permit
string
partiallyFillable
boolean
If true
, order will be generated as partially fillable. Default: false.
partnerAddress
string
Address of the partner. Used to collect fees from the order. Default: zero address
.
partnerFeeBps
number
Partner fee percent in base points (100
is 1%
). Max value is 200
. Default: 0
.
partnerTakesSurplus
boolean
If true
, partner will collect 50%
of the order surplus instead of flat percent fee. Default: false
.
Most common error types
ValidationError
- validation for params failedUnsupportedChain
- the chain ID is not supported by Delta.UnsupportedToken
- the token is not supported by Delta.InvalidHmac
-hmac
check failed, meaningprice
object returned from/quote
endpoint was mutated.
Supported Permits
Permit(ERC-2612)
- expected to have 224 bytes length.Permit2
TransferFrom
format - expected length is 96 bytes (32 for permitNonce, 64 for compact signature), amount and deadline should be the same as inOrder.
Allowance
format - expected length is 192 bytes.
DAI Style Permit
- expected length is 256 bytes.0x01
- specialpermit
value that signifies existingPermit2
allowance.
Sign an Order
Once the Delta Order is built, it must be signed using the EIP-712 standard before submission. This section provides a working example using ethers.js and axios.
Example:
Partner Fees
The fees are enabled by encoding partnerAndFee
param of the order, before its signed by a user.
The param includes three values:
partnerAddress
- on-chain address which will be able to collect the fees.partnerFeeBps
- flat fee percent which will be taken from the order. The value is in base points (100
is1%
), which the maximum allowed value of200
.partnerTakeSurplus
- a flag that, if set, allows the partner to collect50%
of thesurplus
as fees. It has no impact if passed together withpartnerFeeBps
, sincepartnerFeeBps
takes precedence.
These are encoded into a single uint256
value, which then is used as partnerAndFee
.
Last updated