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
  • How it works
  • For EVM
  • For Solana and SUI
  • How to setup monetization
  • How to charge fees
  • Widget example
  • SDK example
  • API example
  • Transaction example
  • How to withdraw fees
  • Manually claiming the fee
  • The Call Flow

Was this helpful?

Export as PDF

Monetization / Take Fees

As an integrator, you can monetize LI.FI and collect fees from our Widget/SDK/API integration.

Last updated 29 days ago

Was this helpful?

Our Fee Collector contract has been and is deployed to all our supported chains!

Any dApp that integrates LI.FI's Widget, SDK, or our API can now take fees from the volume they put through LI.FI.

How it works

When using LI.FI Widget or calling our SDK/API to request quotes for a transaction, you can pass a fee parameter specifying the percentage fee you'd be taking from the requested transaction. This percentage fee will be deducted from the user's initial asset

For EVM

After fees are deducted from the user's initial asseet it is collected in a FeeCollection sub-contract inside LI.FI Contracts. You can then withdraw the funds from the wallet specified by you during our integration.

For Solana and SUI

Fees from every asset are sent directly to fee collector wallet specified during the setup.

The fees are collected on every chain and for every token individually.

You can configure different wallets for different chains.

How to setup monetization

To set up your account and to start collecting fees, please create an account on portal.li.fi and follow the setup instructions.

Only wallets that have been whitelisted as authorized fee collectors can trigger and withdraw fees from the fee collector contract.

How to charge fees

The fee parameter is the percent of the integrator's fee, that is taken from every transaction. The parameter expects a float number e.g 0.02 refers to 2% of the transaction volume. The maximum fee amount should be less than 100%. Also, you should pass your custom integrator string to ensure the fees are collected to the right account. LI.FI will receive a percentage share of the collected fees depending on the use case and volume.

See examples of how to set up fee collection for different environments:

Widget example

import { LiFiWidget, WidgetConfig } from '@lifi/widget';

const widgetConfig: WidgetConfig = {
  // Set fee parameter to 3%
  fee: 0.03,
  // Other options...
};

export const WidgetPage = () => {
  return (
    <LiFiWidget integrator="fee-demo" config={widgetConfig} />
  );
};

SDK example

import { LiFi } from '@lifi/sdk';

// Create an instance with default parameters for fee collection
const lifi = new LiFi({
  integrator: 'fee-demo',
  defaultRouteOptions: {
    fee: 0.03,
  },
  // Other options...
});

API example

const url = 'https://li.quest/v1/quote?fromChain=DAI&toChain=POL&fromToken=0x4ecaba5870353805a9f068101a40e0f32ed605c6&toToken=0x2791bca1f2de4661ed88a30c99a7a9449aa84174&fromAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&toAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&fromAmount=1000000&integrator=fee-demo&fee=0.03';
const options = {method: 'GET', headers: {accept: 'application/json'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Transaction example

Here you can find a link to the transaction where the integrator's fee was taken and the FeesCollected event was emitted.

How to withdraw fees

When you successfully integrate our system and start collecting fees, you can withdraw the collected fees on EVM chains.

There are two ways to claim fees:

  1. Via portal.li.fi

  2. Manually claiming from feeCollector contract

Manually claiming the fee

The Call Flow

More API examples can be found .

In the first step, it’s important to get the information about all collected fees with /v1/integrators/{integratorId} , where in the {integratorId} parameter you need to pass your integrator string. The response will contain fee balances for all supported chains and tokens.

To withdraw collected fees via /v1/integrators/{integratorId}/withdraw/{chainId} you need to pass your wallet address or your custom integrator string and the id of the chain from which the token’s fees should be withdrawn. As an optional parameter, an array of the token’s addresses might be provided to include in the generated transaction only the specified funds.

💲
here
endpoint
endpoint
https://etherscan.io/tx/0x81ee878547ffd1d0091b71c9cd9c0bbe2cab7e13ab5b160b709904c9b272f878etherscan.io
Link to Etherscan
audited