A product surface wants single-network token conversions that behave like reliable transactions, not optimistic quotes. The integration path is intentionally compact: first, ask for a quote; then, once the sender and recipient are known, request the fully constructed transaction. Under the hood, DLN simulates routes across multiple aggregators and returns calldata that targetsDocumentation Index
Fetch the complete documentation index at: https://docs.debridge.com/llms.txt
Use this file to discover all available pages before exploring further.
DeBridgeRouter on EVM, or a serialized transaction on
Solana. The result is an estimation-then-execution loop that stays responsive and grounded in market reality, with the added benefit of adaptive
slippage that takes real-time conditions into account.
What this guide covers
- Endpoints and request shapes to obtain quotes and ready-to-send transactions.
- EVM and Solana submission flows based on the provided TypeScript examples.
- Where affiliate fee parameters plug into the flow.
- Tracking and observability via the Stats API for histories and per-swap lookups.
- Freshness and slippage guidance for resilient UX at scale.
Reference: DLN OpenAPI specification. Reference: Stats API for order tracking.
Architecture in brief
A same-chain swap never leaves its origin network. The DLN API handles route discovery and simulation, returning:- EVM:
txwithto,data, and (when required)value, crafted to callDeBridgeRouter. - Solana:
tx.datacontaining a hex-encodedVersionedTransactionthat is deserialized, updated with a recent blockhash, signed, and sent.
Endpoints
Get a quote (estimation)
UseGET /v1.0/chain/estimation to retrieve a quote for the desired pair. This step is suitable when the wallet is not connected or recipient is
not yet known.
Minimal request - SOL for USDC on Solana
- The response contains pricing, route details, aggregator comparison, and costs metadata used to inform UI and future submission.
- The recommended value for slippage parameter is
auto. The API selects a minimum reasonable slippage band from live market conditions and simulations.
Full response schema
Full response schema
Get an executable transaction
UseGET /v1.0/chain/transaction to obtain the same quote fields plus a tx object ready to be signed and broadcast.
Minimal request - USDC for MATIC on Polygon
tx object contains only:
Compared Aggregators
DLN’s same-chain swaps leverage multiple DeFi aggregators to ensure competitive pricing and route diversity. Response payload for both estimation and transaction endpoints includes thecomparedAggregators field, which lists the aggregators queried during route discovery. This transparency allows
integrators to understand the aggregator choice and provides insights into the liquidity sources considered for the swap.
EVM submission flow
The EVM submission sequence mirrors a typical ERC-20 flow plus a single call toDeBridgeRouter:
- Fetch estimation with
/v1.0/chain/estimationto present the quote. - Request transaction and quote via
/v1.0/chain/transactiononce the sender and recipient are known. - Ensure allowance for
tokenIntowardtx.to- theDeBridgeRoutercontract. Deployed contracts page should be consulted for the correct address. - Send the main transaction using the returned
txobject.
Complete EVM example
The full, production-ready script (logging, receipt checks, explorer links) is available here and can be reused for inspiration in real integrations.Solana submission flow
The Solana variant returns a serializedVersionedTransaction ready to be deserialized, refreshed, signed, and sent:
- Request transaction and quote via
/v1.0/chain/transactionwith Solana chain id. - Deserialize the hex
tx.datainto aVersionedTransaction. - Refresh
blockhashwithgetLatestBlockhash()and settx.message.recentBlockhash.- Optionally, adjust CU price/limit using a helper (as in the provided example).
- Sign and send the raw transaction, then confirm.
Complete Solana example
The full script (simulation, CU sizing, prioritization fee median, and final submission) is available here and can be reused for inspiration in real integrations.Affiliate fees
Affiliate fees are supported in the same-chain flow. The parameters used areaffiliateFeePercent and affiliateFeeRecipient.
More details are available in the the Same-Chain Affiliate Fees article.
The higher the affiliate fee, the worse rates the users using the app will get.
Tracking and observability
Tracking is performed with the Stats API. The default order history endpoints now include same-chain swaps when requested explicitly.Wallet histories (filtered list)
For listing same-chain swaps of a single walletPOST https://dln-api.debridge.finance/api/Orders/filteredList should be used with a filterMode: "SameChain" parameter.`:
Allowed values for filterMode are:
"CrossChain"(default)"SameChain""Mixed"
Example response
Example response
Same-chain swaps do not create an on-chain DLN order entity. The Stats API maps same-chain data into an order-like representation purely for
consistency in histories and dashboards.
Single order lookup
To get details of a single order from the transaction hash,GET https://dln-api.debridge.finance/api/SameChainSwap/${chainId}/tx/${transactionHash}
should be used with chainId and transactionHash parameters. Response structure is identical to the order object in the filtered list.
Freshness and slippage
Quotes are tied to current market conditions and route simulations. Signing and submission should occur shortly after a transaction payload is received; stale quotes should be refreshed every 30 seconds. The recommended value forslippage parameter is "auto". The API selects a minimum
reasonable slippage bound based on volatility and route simulation, a design that reduces execution risk without forcing conservative hard-coding.
Example links
- EVM same-chain swap script (USDC → native on Polygon).
- Solana same-chain swap script (USDC → native).
- Estimation-only script demonstrating
/v1.0/chain/estimation. - Filtered history script using
api/Orders/filteredListwithfilterMode.
Production checklist
- Fetch the
estimationendpoint for quotes before the wallet is connected; request thetransactionendpoint for quotes and a transaction object oncesenderAddressandtokenOutRecipientare known. - Prefer adaptive
slippagewithauto. - On EVM, ensure
tokenInallowance toward theDeBridgeRoutertarget intx.to. - Refresh quotes every 30 seconds if signing is delayed to avoid staleness.
- Use Stats API
filterListendpoint withfilterMode: "SameChain"for observability.