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.
UnsupportedChain - the chain ID is not supported by Delta.
UnsupportedToken - the token is not supported by Delta.
InvalidHmac - hmac check failed, meaning price 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 in Order.
Allowance format - expected length is 192 bytes.
DAI Style Permit - expected length is 256 bytes.
0x01 - special permit value that signifies existing Permit2 allowance.
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:
import { ethers, TypedDataEncoder } from "ethers"; // ethers V6
import axios from "axios";
const userWallet = new ethers.Wallet(ethers.id("alice"));
const userAddress = userWallet.address;
const chainId = 1;
// fetch price
const { data: quoteData } = await axios.get("https://api.paraswap.io/quote?mode=delta&...");
const price = quoteData.delta;
// prepare build order params
const buildOrderParams = {
price,
owner: userAddress,
chainId,
partnerAddress: "0x81037e7be71bce9591de0c54bb485ad3e048b8de",
partnerFeeBps: 100, // 1%
partnerTakesSurplus: false, // the default
};
// build the order to sign
const { data: buildOrderData } = await axios.post("https://api.paraswap.io/delta/orders/build", buildOrderParams);
const { domain, types, value: order } = buildOrderData.toSign;
// hash the order
const eip712Hash = TypedDataEncoder.hash(
domain,
types,
order,
);
// sign and compact
const signature = userWallet.signingKey.sign(typedHash).compactSerialized; // ERC-2098 representation
Sign an order (cross-chain)
The following snippet provides an example implementation of constructing the DeltaBridge structure for the cross-chain swap
This is just technical explanation. If you are using our Order Building endpoint, this knowledge is not required.
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 (100is 1%), which the maximum allowed value of 200.
partnerTakeSurplus - a flag that, if set, allows the partner to collect 50% of the surplus as fees. It has no impact if passed together with partnerFeeBps, since partnerFeeBps takes precedence.
These are encoded into a single uint256 value, which then is used as partnerAndFee.
Last updated
The delta object retrieved from /quote .
Output token on the destination chain. List of supported output tokens can be obtained from /bridge-info
The address of the Across MultiCallHandler on the destination chain. Should be used when outputToken is ETH and beneficiary is a smart contract, or when ouputToken is WETH and benfeficiary is an EOA (see below for an example implementation). Otherwise should be set to zero address. The address can be obtained from /multicall-handlers