> For the complete documentation index, see [llms.txt](https://docs.yifi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yifi.io/getting-started/how-it-works.md).

# How it works

## How it works

> Pick what you're swapping from and to. YiFi finds the best route and walks you through it.

### The basic flow

{% stepper %}
{% step %}

#### **Select a source and destination**

Any of supported 25,000+ tokens, on the same chain or across 100+ chains.
{% endstep %}

{% step %}

#### Review the quote

Rate, expected output, fees, and estimated time, compared across every connected provider.
{% endstep %}

{% step %}

#### **Confirm**

Sign with your wallet, or send to the deposit address shown, depending on the route.
{% endstep %}

{% step %}

#### Track it

Watch progress until the funds land at the destination.
{% endstep %}
{% endstepper %}

What happens after you confirm depends on which rail the quote uses.

### On-chain swaps (DEX)

For swaps and bridges that settle through DEXs, your funds stay in your own wallet until you sign.

1. Select your tokens and enter an amount.
2. Approve the token if it's your first time swapping it.
3. Review the live estimate: output, gas fees.
4. Sign the transaction in your wallet.&#x20;

{% hint style="info" %}
Same-chain swaps settle immediately; cross-chain routes may take a few minutes as they bridge.
{% endhint %}

### Off-chain swaps (CEX)

For the widest coverage and no gas, YiFi can route through a CEX exchange partner instead.

1. Select your tokens and enter an amount – no wallet connection required.
2. Review the quote and get a deposit address.
3. Send funds to that address from any wallet or exchange.
4. The provider completes the swap and sends the output to your destination address. Track status in the UI.

### Private swaps

For a route that's harder to link on-chain, use **Private** or **Stealth** modes. Same basic flow as above, with an extra hop in between – see [Private Swaps](/swap-types/private-swaps.md) for how the two options differ.

{% hint style="info" %}
Every floating quote is indicative. The final amount can shift with market movement, so always check the live estimate on the confirmation screen before you send or sign.
{% endhint %}

### Three rails comparison

| Parameter             | On-chain (DEX)        | Off-chain (CEX)       | Private               |
| --------------------- | --------------------- | --------------------- | --------------------- |
| **Custody**           | Non-custodial         | Custodial during swap | Custodial during swap |
| **Wallet connection** | Required              | Not required          | Not required          |
| **User pays gas**     | Yes                   | No                    | No                    |
| **Coverage**          | EVM, Solana, Tron     | 150+ (incl. non-EVM)  | 150+ (incl. non-EVM)  |
| **Privacy**           | On-chain, transparent | Provider's hot-wallet | Untraceable on-chain  |

### Key benefits

* **Route comparison.** Every quote is checked against all connected on-chain, off-chain, and private providers.
* **No wallet needed on some routes.** Off-chain and private routes work without connecting a wallet or holding gas.
* **Full quote transparency.** See expected output, time, and fees before you confirm – nothing hidden.
* **Cross-chain in one flow.** Swapping and bridging combine automatically when source and destination are on different chains.

{% hint style="success" icon="star" %}
YiFi Swap moves your capital between assets and chains. Once it's where you want it, you can put it to work in YiFi Earn – swapping and yield are two separate steps by design.
{% endhint %}

### Fees and pricing

* **Network (gas) fees** go to the blockchain, not to YiFi – only on on-chain routes.
* **Provider fees** vary by route and are set by the underlying provider.
* **YiFi service fee** applies across rails.

See [Fees](/economy-and-integration/fees.md) for the full breakdown.

### Attribution

To earn on the flow, every quote and order must be attributed to your partner account – by API key or a referral ID. See Partner Portal.
