bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 31쪽 중 10쪽
networks supported by DLN.
No parameters.
**Example response:**
```json theme={null}
{
"chains": [
{ "chainId": "1", "chainName": "Ethereum" },
{ "chainId": "56", "chainName": "BNB Chain" },
{ "chainId": "137", "chainName": "Polygon" },
{ "chainId": "42161", "chainName": "Arbitrum" },
{ "chainId": "7565164", "chainName": "Solana" }
]
}
```
### `create_tx`
Get quotes for cross-chain swaps.
| Parameter | Type | Required | Description |
| ------------------------------- | ------- | -------- | --------------------------------------- |
| `srcChainId` | string | Yes | Source chain ID |
| `srcChainTokenIn` | string | Yes | Source token address |
| `srcChainTokenInAmount` | string | Yes | Amount in smallest units (wei/lamports) |
| `dstChainId` | string | Yes | Destination chain ID |
| `dstChainTokenOut` | string | Yes | Destination token address |
| `dstChainTokenOutRecipient` | string | Yes | Recipient wallet address |
| `srcChainOrderAuthorityAddress` | string | Yes | Sender's wallet address |
| `dstChainOrderAuthorityAddress` | string | Yes | Recipient's authority address |
| `dstChainTokenOutAmount` | string | No | Output amount or `"auto"` (default) |
| `prependOperatingExpenses` | boolean | No | Include operating expenses in input |
<Warning>
All token amounts must be in the smallest unit of the token. For example, 1 USDC = `"1000000"` (6 decimals), 1 ETH =
`"1000000000000000000"` (18 decimals). Use `search_tokens` to find the correct `decimals` value.
</Warning>
<Note>
The native token (ETH, BNB, MATIC, etc.) is represented by the zero address: `0x0000000000000000000000000000000000000000`.
SOL on Solana is represented with `11111111111111111111111111111111` and Wrapped SOL (WSOL) is represented with
`So11111111111111111111111111111111111111112`.
</Note>
### `estimate_same_chain_swap`
Estimates a same-chain token swap. Returns the expected output amount, fees, slippage, and aggregator comparisons.
| Parameter | Type | Required | Description |
| ----------------------- | ------ | -------- | --------------------------------------------- |
| `chainId` | string | Yes | Chain ID (native or deBridge internal) |
| `tokenIn` | string | Yes | Input token address (zero address for native) |
| `tokenInAmount` | string | Yes | Amount in smallest units (wei/lamports) |
| `tokenOut` | string | Yes | Output token address |
| `tokenOutAmount` | string | No | Expected output or `"auto"` (default) |
| `slippage` | string | No | Slippage tolerance or `"auto"` (default) |
| `affiliateFeePercent` | number | No | Affiliate fee percentage |
| `affiliateFeeRecipient` | string | No | Affiliate fee recipient address |
<Tip>
This tool accepts both native chain IDs (e.g. `4326` for MegaETH) and deBridge internal IDs.
</Tip>
### `get_trade_dapp_url`
Generates a shareable deBridge App URL for a given trade.
| Parameter | Type | Required | Description |
| ---------------- | ------ | -------- | ------------------------------------------------ |
| `inputChain` | string | Yes | Source chain ID |
| `outputChain` | string | Yes | Destination chain ID |
| `amount` | string | Yes | Human-readable amount (e.g., `"1.5"`) |
| `inputCurrency` | string | No | Source token address (empty for native) |
| `outputCurrency` | string | No | Destination token address (empty for native) |
| `dlnMode` | string | No | `"simple"` or `"advanced"` (default: `"simple"`) |
<Tip>
Unlike `create_tx`, this tool uses human-readable amounts — pass `"1.5"` for 1.5 ETH, not the wei value.
</Tip>
**Example output:**
```
https://app.debridge.finance/order?inputChain=1&outputChain=42161&inputCurrency=&outputCurrency=&amount=1.5&dlnMode=simple
```
## Workflow
The recommended sequence for performing a swap:
1. **Resolve chains** — call `get_supported_chains` to find the chain IDs for the source and destination networks.
2. **Resolve tokens** — call `search_tokens` with the chain ID to get the token contract addresses and decimals.
3. **Get a quote** — call `create_tx` for cross-chain swaps or `estimate_same_chain_swap` for same-chain swaps.
4. **Share a link** — call `get_trade_dapp_url` to generate a deBridge App URL the user can open to execute the swap.
<Note>
The MCP server never touches private keys or signs transactions. The user always completes the swap themselves: open the
generated link, connect their wallet, review, and sign. This browser handoff is a deliberate security boundary — the server
handles pricing and quoting, while the user retains full control over execution.
</Note>
## Example
**Prompt:** `Bridge 1 ETH from Arbitrum to USDC on Solana`
1. **Resolve chains** — call `get_supported_chains` to find that Arbitrum is `42161` and Solana is `7565164`.
2. **Resolve source token** — call `search_tokens` with `query: "ETH"` and `chainId: "42161"` to get the native token address
(`0x0000000000000000000000000000000000000000`, 18 decimals).
3. **Resolve destination token** — call `search_tokens` with `query: "USDC"` and `chainId: "7565164"` to get the USDC address on
Solana.
4. **Create the transaction** — call `create_tx` with the resolved addresses and `srcChainTokenInAmount: "1000000000000000000"` (1
ETH in wei). The response includes the estimated output amount and transaction data.
5. **Generate a link** — call `get_trade_dapp_url` with `inputChain: "42161"`, `outputChain: "7565164"`, `amount: "1"`, and the
resolved token addresses.
6. **User completes the swap** — the user opens the generated link in their browser, connects their wallet, and signs the
transaction.
## Configuration
The standard configuration works for most frameworks:
```json theme={null}
{
"mcpServers": {
"debridge-mcp": {
"command": "npx",
"args": [
"-y",
"@debridge-finance/debridge-mcp@latest"
]
}
}
}
```
<Accordion title="Claude Code">
```bash theme={null}
claude mcp add debridge npx -- -y @debridge-finance/debridge-mcp@latest
```
</Accordion>
<Accordion title="Cursor">
Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
```json theme={null}
{
"mcpServers": {
"debridge-mcp": {
"command": "npx",
"args": [
"-y",
"@debridge-finance/debridge-mcp@latest"
]
}
}
}
```
</Accordion>
<Accordion title="VS Code + GitHub Copilot">
Add to `.vscode/mcp.json`:
```json theme={null}
{
"servers": {
"debridge-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@debridge-finance/debridge-mcp@latest"]
}
}
}
```
</Accordion>
<Accordion title="Windsurf">
Add to `~/.codeium/windsurf/mcp_config.json`:
```json theme={null}
{
"mcpServers": {
"debridge-mcp": {
"command": "npx",
"args": [
"-y",
"@debridge-finance/debridge-mcp@latest"
]
}
}
}
```
</Accordion>
<Accordion title="Docker">
Clone [the repository](https://github.com/debridge-finance/debridge-mcp/tree/main) and build from source:
```bash theme={null}
docker build -t debridge-mcp .
docker run -p 3000:3000 debridge-mcp
```
</Accordion>
## Environment Variables
| Variable | Default | Description |
| --------------- | --------- | ----------------------------------------- |
| `MCP_TRANSPORT` | `stdio` | Set to `"http"` for HTTP streaming mode |
| `PORT` | `3000` | HTTP server port (HTTP mode only) |
| `HOST` | `0.0.0.0` | HTTP server bind address (HTTP mode only) |
## Resources
* [GitHub Repository](https://github.com/debridge-finance/debridge-mcp)
* [npm Package](https://www.npmjs.com/package/@debridge-finance/debridge-mcp)
* [DLN API Documentation](/dln-details/integration-guidelines/order-creation/authentication)
* [deBridge App](https://app.debridge.finance)
# Overview
Source: https://docs.debridge.com/dln-details/other-ways-to-integrate
Overview of widget, app linking, and smart contract integration options.
The other ways to integrate the deBridge Liquidity Network are:
### Widget
* Integrate cross-chain and same-chain swaps within minutes
* Flexible, yet battle-tested module
* [Details](/dln-details/widget/deBridge-widget)
### App Linking
* Create sharable links with your [referral code](/dln-details/affiliates/referrers) and earn points
* Useful for individual referrers or integrators
* [Details](/dln-details/widget/app)
### MCP Server
* Connect AI coding agents to deBridge for cross-chain and same-chain swaps
* Works with Claude Code, Cursor, VS Code, Windsurf, and other MCP-compatible tools
* [Details](/dln-details/mcp/mcp-server)
### Smart Contracts
* See how deBridge trusted smart contracts work
* Interact directly with the smart contracts (not recommended)
* [Details](/dln-details/integration-guidelines/smart-contracts/introduction)
<Danger>
For a vast majority of use-cases, it is not advised to interact with the contracts directly. It is advised to create transaction data through
[`create-tx`](/dln-details/integration-guidelines/order-creation/creating-order/creating-order) API calls.
Forming DLN orders is a complex task that requires a lot of underlying infrastructure to get just right, with transactions being simulated across
several aggregators for every supported chain.
</Danger>
# deBridge Hooks
Source: https://docs.debridge.com/dln-details/overview/deBridge-hooks
deBridge Hooks is a core feature of the DLN protocol that allows users, protocols, and market makers to attach arbitrary on-chain actions to the orders that would get executed upon their fulfillment.
The DLN protocol allows users to place cross-chain orders with an arbitrary on-chain action attached as an inseparable part of it,
enabling cryptographically signed operations to be performed on the destination chain upon order fulfillment.
An action itself — called a hook — is a raw destination chain-specific data, that represents either an instruction (or a set of instructions) to be
executed on Solana, or a hook enriched with a custom payload, or even a transaction call to be executed on a EVM-based chain. A hook can perform
actions of any complexity, including operations on the outcome of the order. This effectively enriches the interactions between users and protocols,
enabling cross-chain communications that were not possible before. A few possible use cases:
* Asset distribution: one can place a cross-chain order that buys an asset and immediately distributes it across a set of addresses;
* Blockchain abstraction: a dApp can place a cross-chain order that buys an asset and deposits it onto the staking protocol on behalf of a signing
user;
* User onboarding: a service can place a cross-chain order (from a user's familiar blockchain to a blockchain a user has not tried before) that buys a
stable coin and tops up user's wallet with a small amount of native blockchain currency to enable the user to start submitting transactions right
away;
* Action triggers: a cross-chain order could trigger conditional actions that emit events, change state, even to prevent an order from being filled;
* Anything else you might thought about!
Additionally, a hook is bundled with a bunch of properties (hook metadata) that define hook behavior.
<Warning>
Information passed through hooks is non-authenticated by default, so you can't know who was the real sender unless you pass an authenticated
signature in the hook itself, and verify the signature in the called program/smart contract.
In case you need to authenticate a smart contract as a sender, you must use the [deBridge messaging protocol](/dmp-details/dmp/protocol-overview).
</Warning>
# Hooks are a part of an order
Orders are identified by a [deterministic order ID](/dln-details/protocol-specs/deterministic-order-id), and the hash of the hook's raw data is essentially a part
of this ID (see the last two fields of the [deterministic order ID](/dln-details/protocol-specs/deterministic-order-id)), so once a user signs-off an order with a
hook, he eventually makes a cryptographic confirmation that he is willing to sell input asset for output asset AND execute a specific action along
with the output asset on the destination chain.
The proper execution of the hook during order fulfillment is guaranteed by [`DlnDestination`](/dln-details/overview/deployed-contracts) — the DLN smart contract responsible for filling orders,
which ensures that the given hook along with other properties of the order actually matches the given order ID. This means that trying to spoof a hook
would lead to a different ID of a non-existent order, so the solver is compelled to pass specific hook data, otherwise, he won't be able to unlock
liquidity in the source chain upon fulfillment.
# Hooks are trustless
DLN is an open market, so anyone can place arbitrary orders (even non-profitable, or having fake hooks), and anyone with available liquidity can be a
solver and fill any open order. The [`DlnDestination`](/dln-details/overview/deployed-contracts) smart contract simply ensures that the requested amount is provided in full and further forwarded
either to the recipient or to a hook's target (via the [`DlnExternalCallAdapter`](/dln-details/overview/deployed-contracts) smart contract). This means that a hook's target should be designed with
an assumption that anyone can place and fill arbitrary orders with arbitrary hooks, and thus never expose permissions only on the fact that the caller
is a trusted DLN contract because the DLN contract here is only an intermediary, not a guard.
# Hooks atomicity
Even though hooks are an inseparable part of DLN orders, their execution scenario is a matter of hook configuration.
Hooks can be *success-required* and *optional-success*:
* *success-required* hooks ARE REQUIRED to finish successfully. If the hook gets reverted, the entire transaction gets reverted as well, which is
guaranteed by the DLN smart contract.
* *optional-success* hooks ARE ALLOWED to fail. In the event of failure, the DLN smart contract would send the order's outcome further to the fallback
address specified as a part of a hook envelope.
Hooks can be *atomic* and *non-atomic*:
* *atomic hooks* ARE REQUIRED to be executed atomically along with the order fulfillment. In other words, the order with such a hook is either filled and
the hook is executed, or not at all. Mind that if the hook is an success-required hook and it fails, the entire order would not get filled, and the
order's authority would need to cancel the order.
If the hook is a *success-optional* hook and its' execution fails, then the order would get filled, and the order's outcome would get sent further to
the fallback address specified as a part of a hook envelope.
* *non-atomic hooks* ARE ALLOWED (but not required) to be executed later, which is up to the solver who fills the order. If the solver fills the order but
does not execute a hook, the order is marked is filled, but its outcome is stored securely in the DLN intermediary contract along with the hook,
waiting until anyone (an arbitrary third party, like a solver) initiates a transaction to execute the hook, OR until the trusted authority of an order
on the destination chain cancels the hook to receive the order's outcome in full.
Smart contracts on the EVM-based chains support all the options above. Smart contracts on Solana only support non-atomic success-required hooks due to
the limitations of the chain.
# Hook cancellation policy
Even though hooks are an indivisible part of orders placed onto DLN, their execution and cancellation flow may vary.
Atomic hooks are executed along with an order fulfillment, so they either succeed, or silently fail (if they are optional-success hooks), or revert
and prevent the order from getting filled (if they are success-required hooks). In the worst-case scenario, when they get reverted, the assigned
authority of an order in the destination chain may only cancel the entire order.
Non-atomic hooks are allowed to be executed later in a separate transaction after an order gets filled. In this case, the hook (along with the outcome
of an order) remains pending execution in the intermediary smart contract, and the trusted authority of an order on the destination chain may cancel
the hook and receive the order's outcome in full.
# Who pays for hook execution?
Submitting a transaction to execute a hook implies paying a transaction fee. The deBridge Hooks engine provides two
distinct ways to incentivize solvers and other trustless third parties to submit transactions to execute hooks.
The most straightforward way to cover hook execution is to lay the cost in the spread of an order: say, there is an order to sell 105 USDC on Solana
and buy 100 USDC on Ethereum with a hook that deposits the bought amount to the LP: in this case, the difference between sell amount and buy amount (5
USDC) must cover all the fees and costs, including the cost of this hook execution. This is the preferred approach for atomic hooks that target
EVM-based chains because in this case, the hook is part of the execution flow of a transaction that fills the order.
Additionally, hook metadata may explicitly define a reward that the deBridge Hooks engine contract should cut off from the order's outcome (before the
outcome is transferred to a hook) in favor of a solver who pays for a transaction: for example, there could be an order to sell 106 USDC on Ethereum,
buy 101 USDC on Solana with a hook that deposits exactly 100 USDC to the LP and leaves 1 USDC as a reward. This approach works for non-atomic hooks,
and the smart contract guarantees that a solver would get exactly the specified amount of the outcome.
The DLN API simplifies a hook's cost estimation by automatically simulating transactions upon order creation.
# Common pitfalls
A common source of frustration is a blockchain where a hook is expected to run: hooks are built for destination chains. For example,
an order that sells SOL on Solana and buys ETH on Ethereum would get placed on Solana with the hook data encoded specifically for EVM, and vice versa.
Atomic success-required hooks that get reverted would prevent their orders from getting fulfilled, causing users' funds to stuck, which would require
users to initiate a [cancellation procedure](/dln-details/integration-guidelines/order-creation/cancelling-order). This increases friction and worsens the overall user experience, so it is advised to carefully test hooks,
and estimate potential fulfillments before placing orders with such hooks in production. The API [takes the burden](/dln-details/integration-guidelines/order-creation/hooks/integrating-hooks) of proper hook data validation,
encoding, and hook simulation, ensuring that an order can get filled on the destination chain.
# Examples
* [Order from Ethereum to Solana](https://app.debridge.com/order?orderId=0xd78af2a21f4c7dc1fb11e85fff608739d8af167b4ff91b03bc3a097822fcc966) with a non-atomic hook
* [Order from Ethereum to Polygon](https://app.debridge.com/order?orderId=0x401c8eb93a1358bbe2924e98446ed35fbb73dabd638aa183de3aca0af2582a40) with an atomic success-required hook
# Availability
deBridge Hooks are available on all supported blockchains. Hooks can be encoded programmatically while interacting directly with smart
contracts or passed to the DLN API via a simple high-level interface.
Further reading:
* [Easy usage with the DLN API: Integrating deBridge hooks](/dln-details/integration-guidelines/order-creation/hooks/integrating-hooks)
* Technical specification: [Hook data](/dln-details/protocol-specs/hook-data)
# Deployed Contracts
Source: https://docs.debridge.com/dln-details/overview/deployed-contracts
deBridge Liquidity Network deployed contracts
The following smart contracts have been deployed across supported chains to power the DLN:
# Solana
| **Smart Contract** | **Address** | **Description** |
| ------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `DlnSource` | [src5qyZHqTqecJV4aY6Cb6zDZLMDzrDKKezs22MPHr4](https://solscan.io/account/src5qyZHqTqec프로젝트로 돌아가기