create-tx endpoint is intended to be used for both estimating and constructing order transactions. There are detailed breakdowns of parameters
and the response fields.
We do recommend reading deeper into these articles, but if you want to get up and running, have a look at the quick start section.
Swagger specs of create-tx can be found here.
Paired Quote and Transaction
Thecreate-tx ednpoint is intentionally dual-purpose:
- It estimates a realistic, market-aware outcome (
estimation) - It constructs a ready-to-sign transaction (
tx) whenever the call includes the necessary wallet data
create-tx
can be explored here. For a hands-on
walk-through, see the Quick Start section of the docs.
Why Quote and Transaction Are Paired
DLN works with intent-based orders that traverse two independent blockchains, two swaps, and several off-chain actors (API, solvers, validators). An accurate quote must already account for:- Source-chain liquidity and gas
- Destination-chain liquidity and gas
- A solver’s operating expenses and target margin
- Short-term market volatility during the time the order is in flight
- Generating that quote is the most computationally expensive step; producing the transaction payload afterwards is trivial. A “lightweight quote” would be misleading and would cause orders to be ignored by solvers.
How the create-tx Endpoint Behaves
| Scenario | Returned Fields | Typical Use-Case |
|---|---|---|
| All required fields present (wallet connected, amounts known) | estimation and tx | Production trade flow |
| Wallet address missing (connect-wallet screen, fiat on-ramp flow) | estimation | Pre-trade previews, fiat on-ramp flows |
Do Not Replay the Quote Into a Second Call
Passing the returned
srcChainTokenInAmount and dstChainTokenOutAmount back to create-tx forces the endpoint into limit-order quoting
strategy (both amounts fixed). Limit orders can drive solver profit negative, so they
are typically ignored—use the original quote + transaction pair and let the user sign immediately.- Converts a healthy market order into a potentially unattractive limit order
- Slashes the fulfillment probability
Timing Guarantees
Quotes remain solvent if the paired transaction is signed and broadcast within ~30 seconds. Beyond that window:- Gas cost or price movements may exceed the solver’s margin.
- Solvers will skip the order; users must cancel and retry.
prependOperatingExpenses=true, approve a slightly higher allowance (≈ +30 %) or approve infinity to avoid a second approval if operating expenses drift upward while the user is signing.
Estimation and Full Pair
Estimation and Full Pair
Key Takeaways
- One endpoint, one response—never separate quote retrieval from transaction generation.
- The estimate/transaction pair maximizes fulfillment probability by eliminating UI-induced latency.
- When wallet addresses are unknown, call
create-txfor estimation only, then repeat once addresses are set. - Re-using quoted amounts in a second request reduces the likelihood of order fulfillment and should be avoided.