Order‑Creation Fees (always paid)
When an order is placed, the protocol levies two mandatory fees:- Flat fee – a fixed amount in the source‑chain native token paid to deBridge validators for processing the eventual unlock message. The current value is stored in DlnSource.globalFixedNativeFee().
- Variable protocol fee (4 bps) – deducted from the input token. This value is set in the percentFee field returned by create-tx and is visible in the DlnSource contract.
Runtime Costs (built into the spread)
Because DLN has no central liquidity pool (0-TVL model), additional costs must be baked into the order, so a solver is willing to fulfil it: Taker margin (≈ 4 bps) – the solver’s profit. The API inserts it automatically when creating a market or a reverse-market order. If a limit order (not recommended) is created, integrators need to make sure that the margin remains or the order may be ignored. Operating expenses – the gas a solver spends on three transactions (fulfil, send unlock, claim). The API estimates the amount and exposes it underestimation.costsDetails
when prependOperatingExpenses=true
.
Recommendation – set prependOperatingExpenses=true so the estimate is added on top of srcChainTokenInAmount. This makes the fee transparent to the user and avoids approval mismatches. More information can be found here.
Optional Fees
Affiliate Fee
Affiliate fee is a share of the input token sent to a beneficiary when the order hits ClaimedUnlock. Configure with affiliateFeePercent and affiliateFeeRecipient. Details can be found in the Affiliate Fees article.Hook Execution Reward
If a non‑atomic hook is attached to an order, reward parameter in HookDataV1 may be set. The solver receives this amount before the hook runs.Additional Costs
- Pre‑Order‑Swap slippage (converting a non‑reserve input asset into a reserve asset during order placement).
- Pre‑Fill‑Swap slippage (converting a reserve asset into the requested asset on the destination chain).
- Gas for ERC‑20 approvals.
- Quote staleness if the user signs more than ~30 s after fetching it.
estimation.costsDetails
and acted upon in runtime.
Getting Live Values
Fee Type | Source |
---|---|
Flat fee | DlnSource.globalFixedNativeFee() or response.tx.value |
Variable fee | DlnSource.percentFeeBps() or costsDetails → DlnProtocolFee |
Operating expenses | costsDetails → EstimatedOperatingExpenses |
Recommended taker margin | costsDetails → TakerMargin |
create-tx
API will already calculate everything
according to supplied request parameters.
Example
Sell 1000 USDC on Arbitrum, buy USDC on Polygon (auto‑quote) withprependOperatingExpenses
set to true
.
Flat fee: 0.001 ETH
Variable fee: 0.04 % × 1 000 = 0.40 USDC
Taker margin: 0.40 USDC
Operating expenses: ≈ 0.03 USDC
The user would need to approve either an unlimited amount for the ERC-20 contract or approve the amount calculated below:
Best Practice Checklist for Integrators
- Always call create-tx to create a market order or a reverse-market order unless intentionally placing a limit order (not recommended).
- Enable prependOperatingExpenses .
- Refresh the quote after 30 s if the order is not submitted.
- Either approve an unlimited allowance for ERC-20 tokens, or include a 30% buffer over the estimated operating expenses to account for cases where the transaction is not approved and submitted within 30 seconds of receiving the create-tx response. This ensures that the approval remains valid even if the quote is refreshed and prevents the need for users to repeat the approval step.
- Show the flat fee and the spread components separately in the UI.
- Surface a warning if the solver margin drops below ~4 bps for limit orders.