Skip to main contentSame-chain swaps in DLN enable seamless token-for-token conversions on a single network. Instead of crossing chains, the operation remains localized,
yet leverages the same design principles that drive DLN’s broader market order execution. Routing, simulation, and transaction construction are all
part of the swap process where deBridge API does the heavy lifting, creating an efficient and resilient experience. The developers get to focus on
building dapps, while deBridge ensures that users receive reliable quotes and executable transactions. Additionally, with affiliate
fees supported, deBridge integrations can be monetized effectively.
At a high level, the flow is straightforward: before a user connects their wallet to the app, an estimation request to the DLN API is used to
fetch the quote for a chosen pair. Once the wallet is connected, the transaction endpoint should be used. It delivers the quote, just like the
estimation endpoint, but with the addition of yielding a ready-to-submit payload, which completes the swap. Behind this simple sequence, the API
carries out substantial work: it evaluates routes across several aggregators, reconciles live market conditions, and generates transactions structured
to succeed in execution rather than exist as optimistic quotes. Dapps usually deal with slippage statically - they set it to some value and forget
about it. This approach leads to subpar user experience when markets start shifting. With deBridge, users remain protected from adverse market effects
with adaptive slippage as the core focus of same-chain swaps. After years of refinement, deBridge developed a way to set slippage dynamically,
based on real-time conditions and route simulations. This mirrors DLN’s philosophy across all orders—providing both grounded estimates and final
transaction calls from a single request sequence.
For integrators, two immediate benefits emerge. First, there is no need to manually pre-compute complex slippage or routing logic. Second, the user
experience remains responsive: an estimate can be fetched before wallet details are available, and then repeated with additional information to
receive an executable payload. The API is intentionally designed to minimize latency - if the users like what they see, they can proceed to sign and
submit quickly, because milliseconds matter.
Reliability of quotes
DLN’s API emphasizes “minimum reasonable” outcomes through market-aware protections. When intermediary swaps are required (for example, when moving
between volatile assets and their paired counterparts), DeFi aggregators are queried and the route is simulated prior to returning calldata. The
result is a quote grounded in what can be executed at the time of request, rather than an idealized price projection.
Given that market conditions shift rapidly, the returned quotes carry a freshness expectation: signing and submission should occur within
approximately 30 seconds, after which re-quoting is recommended. Interfaces that integrate DLN are therefore expected to encourage timely
confirmations or refresh estimates automatically.
Contracts and integration model
On EVM chains, same-chain swaps consistently route through the DeBridgeRouter
. The API abstracts away low-level venue interaction, delivering
transaction objects that are pre-targeted and structured for execution. On Solana, the response is intentionally minimal: the tx
field contains a
single hex-encoded VersionedTransaction
that can be deserialized and signed by wallets.
Integration simplicity
The same-chain swap process is designed to be as straightforward as possible, with a tight API surface that minimizes complexity and potential points
of failure, ensuring a smooth integration experience and superb user experience.
The flow relies on two key endpoints:
/v1.0/chain/estimation
— provides a quote, usable prior to wallet connection or before recipient details are specified.
/v1.0/chain/transaction
— repeats the request with wallet and recipient information, returning a ready-to-sign transaction object.
Both are documented in the public OpenAPI
reference.
Adaptive slippage and slippage management
Explicit slippage can be provided, but the recommended practice is to defer to the API’s automatic controls. DLN interprets auto
as a dynamic
guardrail derived from live conditions and route simulation, thus providing adaptive slippage in the response. This approach provides resilience
in volatile markets, instead of relying on a slippage value that doesn’t adapt to the market conditions. Manual overrides should be reserved for
exceptional cases; otherwise, automatic limits ensure consistency and protection.
Affiliate fees
Affiliate fees transform same-chain swaps from a pure utility into a monetizable integration pathway. At the protocol level, every swap request can
carry parameters that define both the affiliate fee percentage and the recipient of those fees. This ensures that each executed swap can
simultaneously deliver value to end users and revenue back to the integrator.
On EVM chains, settlement occurs automatically during the swap transaction execution. On Solana, integration
leverages Jupiter’s referral infrastructure, where referral keys act as the designated recipient, and accumulated fees can be claimed via the Jupiter
dashboard.
Because affiliate fees are embedded in the request layer, no additional complexity is introduced to the swap flow itself. The estimation and
transaction endpoints function as usual, with affiliate metadata included transparently. This design aligns with DLN’s guiding principle of minimizing
integration friction while unlocking new revenue streams for integrators.
Tracking and observability
Swap outcomes are tracked through the Stats API. Queries can be performed using filteredList
for wallet histories, or by transaction hash for a
single order, or by the referral code for the integration.
Same-chain Swaps are available in the deBridge Explorer under the Same-Chain filter.
For tracking orders related to an integration, referral code must be generated and included in requests. Instructions for generating a referral code
are available in the referrers guide.
Summary
DLN’s same-chain swaps are designed to eliminate fragility from a straightforward action. The API performs live simulation during estimation,
constructs transactions that are execution-ready, applies conservative automatic limits with adaptive slippage, and enforces freshness to prevent
stale quotes. With a single router contract on EVM chains and a minimal serialization path on Solana, the integration process prioritizes robustness
and clarity. Built-in support for affiliate fees and referral tracking adds a monetization layer without increasing integration complexity, while
observability through the Stats API and Explorer reinforces transparency across all activity. For detailed request and response specifications, the
OpenAPI reference and Integration
Guidelines provide full coverage.