> For the complete documentation index, see [llms.txt](https://docs.somnia.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.somnia.network/developer/building-dapps/cross-chain-swaps-and-bridging.md).

# Cross-chain Swaps and Bridging

Most users don't start their journey on Somnia, their assets live on Ethereum, Arbitrum, Base, Solana, and dozens of other chains. To grow your dApp, you need a smooth way to move that liquidity **into, out of, and across** the Somnia ecosystem.

There are two ways to bring assets across, depending on who is doing the work:

* **For end users (no code):** Somnia's official bridge partners, [**Relay**](https://relay.link/bridge) and [**Stargate Finance**](https://stargate.finance/), let anyone bridge assets through their own interfaces. If you just need users to move funds and don't want to build any UI, point them to the [Bridging Info](/get-started/bridging-info.md) guide.
* **For developers (this section):** embed swaps and bridging **directly inside your dApp** with the [**LI.FI**](https://li.fi/) **SDK**, so users never have to leave your app.

***

## Why LI.FI for in-app bridging

LI.FI is the routing and execution layer for cross-chain liquidity. A single integration aggregates dozens of bridges and DEX aggregators across 50+ chains **(including Somnia's official partners Relay and Stargate)** normalises token standards, picks the optimal route, and monitors execution for you.

In other words, integrating LI.FI doesn't replace Relay or Stargate, it routes *through* them (and many others) and chooses the best option per transfer. A live USDC transfer from Arbitrum to Somnia, for example, is currently routed via Stargate under the hood.

LI.FI is **infrastructure.** It does the routing and execution, while *you* own the user experience. (The same way [Jumper Exchange](https://jumper.exchange/) is LI.FI's own front-end, your dApp becomes its own bridge/swap interface.)

You'll learn how to:

* [Add cross-chain and same-chain swaps directly inside your Somnia dApp with the **LI.FI SDK**](/developer/building-dapps/cross-chain-swaps-and-bridging/integrating-the-li.fi-sdk.md)
* Let users **bridge assets to and from Somnia** in your own UI
* Request **routes and quotes**, execute them, and **track transaction status** in-app
* Query supported **chains, tokens, bridges, and exchanges** programmatically

***

## Choosing an integration path

LI.FI offers several integration surfaces. This section focuses on the **SDK**, which gives you full programmatic control over the route lifecycle.

| Path                                                                                    | Best for                                                               | Effort |
| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------ |
| **SDK** (`@lifi/sdk`)                                                                   | Custom swap/bridge flows where you build the UI and control every step | Medium |
| Widget (`@lifi/widget`)                                                                 | Dropping a ready-made, themeable swap/bridge UI into a React app       | Low    |
| REST API (`li.quest/v1`)                                                                | Backend services, bots, and AI agents that construct requests directly | Medium |
| Bridge UIs ([Relay](https://relay.link/bridge) / [Stargate](https://stargate.finance/)) | End users moving funds manually — no integration needed                | None   |

> Whichever path you choose, LI.FI's official documentation is the source of truth for the latest implementation details: [https://docs.li.fi](https://docs.li.fi/).

{% hint style="info" %}
**Somnia at a glance** — when configuring LI.FI for Somnia, use Chain ID **`5031`**, native currency **SOMI** (18 decimals), RPC `https://api.infra.mainnet.somnia.network/`. Always confirm live route and token support with the LI.FI API before going to production (see the SDK guide).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.somnia.network/developer/building-dapps/cross-chain-swaps-and-bridging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
