โš”๏ธ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.

Contact our business partnerships team to discover how you can partner with us and integrate LI.FI into your platform.

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

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 relayer fee that helps relayers pay the gas fee.

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

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

Request a route including a contract-call

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.

Request a route including a contract-call within our widget

Example Implementations

You can find multiple implementation examples in our Github repository:

Happy Hacking!

Last updated