LI.FI Documentation
LI.FI WebsiteAPI ReferenceHelp / FAQ / Create support ticketRequest API Key
  • ๐ŸกGetting Started
    • โ“What is LI.FI
    • ๐ŸŒŸWhy LI.FI?
    • ๐Ÿ†šLI.FI vs Aggregators/DEXs/Bridges
    • ๐Ÿ“–LI.FI Terminology
    • โ“FAQ
    • ๐Ÿ’กUse Cases
      • Mobile/Gaming Wallets
    • ๐ŸนLI.FI vs. Other Aggregators
    • ๐ŸคPartnership
    • ๐ŸŒPowered by LI.FI
  • ๐Ÿ”Security First
  • โœ…List: Chains, Bridges, DEX Aggregators, Solvers
  • ๐Ÿ’ฒMonetization / Take Fees
  • ๐Ÿ”ŽTransaction Explorer
  • ๐Ÿ”Rate Limits & API Key
  • How to get integrated by LI.FI?
    • For Bridges
    • For DEXs/Aggregators/Solvers
  • ๐Ÿ†˜Technical FAQ
  • LI.FI PRODUCTS
    • Glacis
    • LI.FI Solver
    • LI.FI Intents System
  • LI.FI API
    • โš™๏ธLI.FI API
      • Transferring Tokens (Example)
      • Requesting supported Chains
      • Requesting all supported Tools
      • Requesting all known Tokens
      • Getting Token Information
      • Getting all possible Connections
      • Requesting a Quote
        • Token Transfer
        • Optimizing quote response timing
        • Cross-Chain Contract Calls
        • Possible Tool Errors
        • Testing your integration
      • Status of a Transaction
      • Requesting Analytics Data
    • โš”๏ธTX-Batching aka "Zaps"
    • ๐Ÿ„Solana
      • Request examples
    • ๐Ÿช™Bitcoin
      • Request examples
    • โ›ฝLI.Fuel
  • Integrate LI.FI SDK
    • ๐Ÿš€LI.FI SDK Overview
    • ๐Ÿ“ฆInstall LI.FI SDK
    • โš™๏ธConfigure SDK
    • ๐ŸชConfigure SDK Providers
    • ๐Ÿ“œRequest Routes/Quotes
    • ๐ŸŽฏExecute Routes/Quotes
    • โ›“๏ธChains and Tools
    • ๐Ÿ’ฐToken Management
    • ๐Ÿ•ต๏ธTesting Integration
    • ๐Ÿš—Migrate from v2 to v3
  • INTEGRATE LI.FI WIDGET
    • ๐ŸงฉLI.FI Widget Overview
    • ๐Ÿ“ฆInstall Widget
    • ๐ŸŽฎSelect Widget Variants
    • โš™๏ธConfigure Widget
    • ๐ŸŽจCustomize Widget
    • โšกWidget Events
    • ๐Ÿ‘›Wallet Management
    • ๐ŸŒInternationalization
    • โš›๏ธCompatibility with Next.js, Remix, Nuxt, etc.
    • ๐Ÿ›ฃ๏ธReact Router Compatibility
    • ๐Ÿ“–Widget API Reference
    • ๐Ÿš—Migrate from v2 to v3
  • Smart Contracts
    • Overview
    • Deployments/Contract Addresses
    • Audits
  • Support & Misc.
    • API Status
    • Technical Help Desk & FAQ
    • Create a Partner Ticket
    • Discord Support
    • Telegram Support
    • Twitter
    • Github
    • Licenses
Powered by GitBook
LogoLogo

Connect with us

  • Github
  • Twitter
  • Discord
  • LinkedIn

More Information

  • Help Desk / FAQ
  • API Reference
  • Website
On this page
  • Example Scenarios
  • How does it work?
  • How to use Zaps utilizing our API directly
  • How to use Zaps utilizing our SDK
  • How to use Zaps utilizing our Widget (Beta - NFT Checkout Example)
  • Example Implementations

Was this helpful?

Export as PDF
  1. LI.FI API

TX-Batching aka "Zaps"

LI.FI supports transaction batching on the same chain and across chains.

User journeys in crypto are cumbersome. We want to reduce the amount of manual steps and clicks a user has to make at any given time in order to improve the user's experience and increase conversion-rates. For this, LI.FI supports transaction batching, the execution of multiple transaction steps with one signature. This works on same-chain swaps as well as in any cross-chain scenario.

Example Scenarios

Scenario 1: Swap CAKE on BSC to MAGIC on ARB

This would require to swap+bridge+swap.

a) Swap CAKE into a stable coin like USDC on BSC (bridges only support stable coins and native currencies

b) Bridge USDC on BSC to USDC on ARB

c) Swap USDC on ARB to MAGIC on ARB

Scenario 2: Use my USDC on OPT and deposit yvAjnaEURe into a Yearn vault on Gnosis

This would require to bridge+swap+deposit:

a) Bridge USDC from OPT to Gnosis via a bridge

b) Swap USDC on Gnosis into yvAjnaEURe via a DEX aggregator

c) Deposit yvAjnaEURe into Yearn

Scenario 3: Let the user buy an NFT with any asset on any chain

a) Swap/bridge as necessary

b) Purchase NFT

We can do all these things within one transaction.

How does it work?

LI.FI has its own multi-chain smart contract system that allows it to engage and pass information across all liquidity players it aggregates and batch transactions into one. Not all bridges support passing on information alongside the bridging transaction though. So here are the bridges that we utilize for cross-chain transaction batching:

  1. Connext (amarok)

  2. Stargate

  3. CelerIM

  4. Across+ - Soon

How to use Zaps utilizing our API directly

If you're implementing our API natively, check out the following API documentation around contract calls:

In order to play with our API directly, you might want to use our API reference and playground:

How to use Zaps utilizing our SDK

How to use Zaps utilizing our Widget (Beta - NFT Checkout Example)

LI.FI's widget provides an NFT checkout process. Take a look at the example on Github to learn more and contact our dev team for potential complications while setting this up, since it's in a beta stage.

Example Implementations

You can find multiple implementation examples in our Github repository:

Happy Hacking!

Last updated 7 months ago

Was this helpful?

Contact our to discover how you can partner with us and integrate into your platform.

Once we pass this data onto the bridges, the bridges make the contract calls on the destination chain. They also pay the gas fee for these transactions by taking a cut in the original token bridged. For example, Connext has a that helps relayers pay the gas fee.

When you request a route from SDK for a cross-chain swap, you can pass the contract call data through the SDK as an extra parameter:

โš”๏ธ
business partnerships team
LI.FI
relayer fee
LI.FI
Cross-Chain Contract Calls | LI.FI Documentation
Perform multiple contract calls across blockchainsLI.FI API Documentation
Request Routes/Quotes | LI.FI Documentation
Request a route including a contract-call
widget/packages/widget-embedded at main ยท lifinance/widgetGitHub
Request a route including a contract-call within our widget
sdk/examples/node/examples at main ยท lifinance/sdkGitHub
Logo
Logo
Logo
Logo
Logo