> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LI.FI (lifi)

> Multi-chain bridge and DEX aggregator via LiFiDiamond proxy. Routes through bridges and DEXes for cross-chain swaps.

Multi-chain bridge and DEX aggregator via LiFiDiamond proxy. Routes through bridges and DEXes for cross-chain swaps.

| Fact | Value |
| - | - |
| Category | Bridges |
| Family | none |
| Namespace | `Lifi` on ethereum, optimism, bsc, gnosis, polygon, fantom, arc, base, arbitrum, avalanche |
| Chains | ethereum, optimism, bsc, gnosis, polygon, fantom, arc, base, arbitrum, avalanche |

## Notes

* LI.FI is a bridge **aggregator** -- it routes through underlying bridges (Across, Stargate, Hop, cBridge, etc.)
* Uses a Diamond proxy pattern (EIP-2535)
* The Diamond address is the same on every chain but Arc, whose address differs
* Uses standard EVM chain IDs for `destinationChainId`
* The `bridge` field in BridgeData specifies which underlying bridge to use
* `hasSourceSwaps` / `hasDestinationCall` enable swap-then-bridge or bridge-then-execute patterns
* Requires ERC-20 approval to the LiFi Diamond address
* Finality depends on the underlying bridge selected (varies from 1 minute to 20 minutes)

## Its names in a program

On Ethereum, `Lifi` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Ethereum's lifiDiamond, `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE`.
  require(Lifi.LiFiDiamond != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond` |
| [Optimism](https://docs.eco.com/sauce-sdk/reference/chains/optimism.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond` |
| [BNB Chain](https://docs.eco.com/sauce-sdk/reference/chains/bsc.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond` |
| [Gnosis](https://docs.eco.com/sauce-sdk/reference/chains/gnosis.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond`; not on this deployment: `startBridgeTokensViaAcrossV4` |
| [Polygon](https://docs.eco.com/sauce-sdk/reference/chains/polygon.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond` |
| [Fantom](https://docs.eco.com/sauce-sdk/reference/chains/fantom.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond`; not on this deployment: `startBridgeTokensViaAcrossV4` |
| [Arc](https://docs.eco.com/sauce-sdk/reference/chains/arc.md) | lifiDiamond | `0xA4072583658Fae592A3506A42431cb6316a8d40b` | `Lifi.LiFiDiamond` |
| [Base](https://docs.eco.com/sauce-sdk/reference/chains/base.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond` |
| [Arbitrum One](https://docs.eco.com/sauce-sdk/reference/chains/arbitrum.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond` |
| [Avalanche C-Chain](https://docs.eco.com/sauce-sdk/reference/chains/avalanche.md) | lifiDiamond | `0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE` | `Lifi.LiFiDiamond`; not on this deployment: `startBridgeTokensViaAcrossV4` |

## ABI

### `LiFiDiamondABI`

`import LiFiDiamondABI from "./protocols/lifi/LiFiDiamondABI.json";` Speaks for: lifiDiamond.

* `startBridgeTokensViaAcrossV4((bytes32 transactionId, string bridge, string integrator, address referrer, address sendingAssetId, address receiver, uint256 minAmount, uint256 destinationChainId, bool hasSourceSwaps, bool hasDestinationCall) bridgeData, (bytes32 receiverAddress, bytes32 refundAddress, bytes32 sendingAssetId, bytes32 receivingAssetId, uint256 outputAmount, uint128 outputAmountMultiplier, bytes32 exclusiveRelayer, uint32 quoteTimestamp, uint32 fillDeadline, uint32 exclusivityParameter, bytes message) acrossData) payable`
* `extractBridgeData(bytes data) pure returns ((bytes32 transactionId, string bridge, string integrator, address referrer, address sendingAssetId, address receiver, uint256 minAmount, uint256 destinationChainId, bool hasSourceSwaps, bool hasDestinationCall) bridgeData)`

Not on Gnosis's lifiDiamond (`0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE`), whose code does not dispatch them: `startBridgeTokensViaAcrossV4`. Do not call them there: the call does not run the function, and whether it reverts is up to that code.

Not on Fantom's lifiDiamond (`0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE`), whose code does not dispatch them: `startBridgeTokensViaAcrossV4`. Do not call them there: the call does not run the function, and whether it reverts is up to that code.

Not on Avalanche C-Chain's lifiDiamond (`0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE`), whose code does not dispatch them: `startBridgeTokensViaAcrossV4`. Do not call them there: the call does not run the function, and whether it reverts is up to that code.

## Next steps

* [Protocols](https://docs.eco.com/sauce-sdk/reference/protocols.md): the other protocols, by what they do.
* [Protocols and tokens](https://docs.eco.com/sauce/names.md): calling a contract by its namespace, or through its ABI.
* [Glossary](https://docs.eco.com/sauce/glossary.md): the words these pages use, in plain terms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.