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.
Request Body Parameters
chainId*
number
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.
bridge
DeltaBridge
Required only for cross-chain orders. See below for details
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
Encoded permit to be used in order settlement. Supported permit types are described here. Default: 0x.
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.
DeltaBridge structure:
protocolSelector
string
Selector that indicates the bridge protocol used. Obtained from the price API
destinationChainId
number
Destination chain ID. (Mainnet - 1, Optimism - 10, BSC - 56, Polygon - 137, Fantom - 250, zkEVM - 1101, Base - 8453, Arbitrum - 42161, Avalanche - 43114, Gnosis - 100).
outputToken
string
Output token on the destination chain. List of supported output tokens can be obtained from /bridge-info endpoint. Output token can also be obtained from price.bridge.outputToken
scalingFactor
number
Specifies difference between the decimals in source bridge token and destination token
protocolData
string
Protocol-specific data, obtained from pricing API
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-hmaccheck failed, meaningpriceobject returned from/quoteendpoint was mutated.
Supported Permits
Permit(ERC-2612)- expected to have 224 bytes length (owner, spender, value, deadline, v, r, s).Permit2TransferFromformat - expected length is 96 bytes (32 for permitNonce, 64 for compact signature), amount and deadline should be the same as inOrder.Allowanceformat - expected length is 192 bytes.
DAI Style Permit- expected length is 256 bytes.0x01- specialpermitvalue that signifies existingPermit2allowance.
Delta Contract should be specified as a spender is a permit.
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:
Sign an order (cross-chain)
The following snippet provides an example implementation of constructing the DeltaBridge structure for the cross-chain swap
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 (100is1%), which the maximum allowed value of200.partnerTakeSurplus- a flag that, if set, allows the partner to collect50%of thesurplusas fees. It has no impact if passed together withpartnerFeeBps, sincepartnerFeeBpstakes precedence.
These are encoded into a single uint256 value, which then is used as partnerAndFee.
Last updated