Skip to main content
Gasless lets a user trade with zero native balance: they sign an authorization off-chain, DZap submits the transaction and pays gas, then recovers the gas cost from the trade output in the source token. Gasless is EVM-only and the source token must be an ERC-20 that supports EIP-2612 permits (or use allowance/Permit2 mode). Pick Swap or Bridge below; the tabs stay in sync across Setup, Steps, End-to-end, and API usage.
Nothing here gives DZap open-ended access to funds. The intent signature is bound to a single txId, carries a deadline, and is consumed by a per-user nonce, so it cannot be replayed.

Setup

A gasless same-chain swap on Arbitrum: 5 USDC to WETH, with 0 ETH in the wallet.

Steps

The gasless path is quote, sign a permit, execute, and confirm. tradeGasless() does the whole tail in one call: it builds the transaction, collects the intent signature from the wallet, and submits it to DZap. These steps use the EIP-2612 permit mode, the one that works for a wallet with zero native balance. Allowance and Permit2 are in Authorization modes.
1

Quote

Pass gasless: true. The returned destAmount is already net of the relayer’s gas.
Confirm the source token supports EIP-2612 permits before offering the zero-gas path: quotes don’t check this. See Fees & limits for the $1 per-pair minimum and the End-to-end tab for the pre-flight check.
2

Sign the permit

Sign an EIP-2612 permit for the source token. This is off-chain, so it costs zero gas.
Signing an EIP-2612 permit for a token that does not implement it throws. If permit.eip2612.supported is false for your token, use allowance or Permit2 mode from Authorization modes.
3

Execute

Feed the permit back in as permitData and call tradeGasless(). It builds the transaction, prompts the user to sign the intent, and submits it to DZap.
DZap pays gas and deducts the equivalent from the output in the source token. Call buildTradeTxn({ ...request }) first only to preview the authoritative fees.executorFee. Full request shape: Execute trade.
4

Status

tradeGasless() resolves with the hash DZap submitted. Track it like a regular trade.
status.gasless is true. Same-chain gasless swaps settle fast; terminal states are COMPLETED, FAILED, PARTIAL, and REFUNDED. See Track trade status.

End-to-end

API usage

The REST flow is the same sequence tradeGasless() performs. Unlike a regular trade, the gasless build returns a set of hashes you must sign as an EIP-712 intent, so the sign step is client-side code, not a curl.
1

Quote

Send gasless: true. Pick a route’s recommendedSource.
2

Build

The gasless build returns the hashes to sign, not raw calldata. fees.executorFee is the authoritative fee.
Build response (trimmed)
3

Sign the intent (EIP-712)

Read the user’s nonce from the router, then sign a SignedGasLessSwapData intent over the hashes from the build response.
4

Execute

Submit the signed intent. The permit object carries the token permit plus the intent signature, nonce, and deadline.
The response carries status and the txnHash DZap submitted.
5

Status

Fees and limits

The gasless fee is charged in the source token and deducted from what the user receives. The quote returns an estimate; the build returns the authoritative number. Show the quote’s protocolFee while the user is still choosing, and re-read executorFee from the build for the confirmation screen. Both carry the same shape:
Fee entry
amount is in the source token’s smallest unit; amountUSD is the same fee in dollars. included: true means it is already reflected in the quoted output, so do not subtract it again.
Do not read the gasless fee from fee.gasFee. On a gasless quote that array is always empty: the estimate lives in fee.protocolFee, and the final number in the build’s fees.executorFee.
Minimum trade size. The fee has to be covered by the trade, so the API enforces a $1 minimum per pair. Below it, the pair returns an explicit error instead of routes. Branch on status/message rather than inferring the floor from an empty route list, the threshold is server-side and moves with gas prices.
Source token must support EIP-2612 permits for the zero-gas path. Quotes and builds don’t enforce this, so verify it yourself before offering gasless:
If supportsPermit is false, the token can’t use the EIP-2612 path, so fall back to allowance or Permit2 mode (Authorization modes). In a multi-token trade every srcToken must qualify, and the gasless fee is split across tokens proportionally to their USD value.
Gasless or regular?

Authorization modes

DZap can only move the source token if it is authorized to. The steps above use EIP-2612 permit, the only mode that works for a wallet with zero native balance. The other two need one on-chain approval first, after which every gasless trade is a single intent signature. For allowance mode, run getAllowance / approve with ApprovalModes.Default once, then call tradeGasless() with no permitData. For Permit2, approve with ApprovalModes.PermitBatchWitnessTransferFrom, then call tradeGasless() with hasPermit2ApprovalForAllTokens: true. Details: Check allowance and Approval mechanisms.
sign() takes a PermitTypes value (a signature scheme). approve() and getAllowance() take an ApprovalModes value (an on-chain approval target: Default is the router, anything else is Permit2). ApprovalModes has no EIP2612Permit member because an EIP-2612 permit is a signature and never approves anything on-chain.

Reference

Endpoints

Base URLs: https://api.dzap.io (production), https://staging.dzap.io (staging). Send your API key as the x-api-key header, see Rate Limits for the unauthenticated caps.

SDK methods

Last modified on September 21, 2026