This path is exposed as
sdk.swap in code (the namespace predates the Delta/Market naming). sdk.swap is the Market execution path for swaps.When to use this
- The user has gas on the source chain and is happy to submit a transaction.
- You need the cheapest path across DEX aggregation (no auction, no off-chain settlement).
- You want full control over slippage, gas, and recipient.
- You don’t need crosschain or MEV-protected settlement. See Delta for that.
The flow
Get a price route
Call
sdk.swap.getRate (or sdk.quote.getQuote with mode: 'market') to choose source token, destination token, amount, and side. The response includes the routed path and expected output.Approve the source token (or sign a Permit)
Call
sdk.swap.approveToken so the TokenTransferProxy can pull the source token, or sign a Permit / Permit2 message with TokenTransferProxy as the verifying contract.Build the transaction
Call
sdk.swap.buildTx with the price route, slippage (or destAmount), user address, and partner. The response is a fully-populated TransactionRequest.Full example
Sign a Permit instead of approving
If the source token supports EIP-2612 (or Permit2), skip the on-chain approval and sign a typed-data message with theTokenTransferProxy as the verifying contract.
Other methods
sdk.swap.getSpender()returns theTokenTransferProxyaddress you approve.sdk.swap.getBalances(userAddress): token balances and allowances in one call.sdk.swap.getTokens()lists Velora-supported tokens on the active chain.sdk.swap.getAdapters()returns the DEX adapters available to the router.sdk.swap.swapTx(params)is a one-call orchestrator (rate + build + send). Convenience over the four-step flow.
Partner fee
Addpartner (and optionally partnerAddress, partnerFeeBps, partnerTakesSurplus) to every getRate, buildTx, and getQuote call to capture revenue. See Monetize for the full field reference.
Related pages
- Swaps → Delta: gasless intent-based swaps.
- Monetize — partner-fee fields and tradeoffs.
- Configure providers for wallet-library setup.
- API reference → Market, the underlying HTTP endpoints.