Monetization
Your project needs to get whitelisted and configured by us before the fees can be collected. Please reach out to sales@li.finance to get setup to collect fees.
How it works
The fees gets deducted from users’ sending asset on source chain.
EVM
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 and collected in a FeeCollection
sub-contract inside LI.FI Contracts. You can then withdraw the funds using the wallet specified by you during the integration.
Solana
When using LI.FI Widget or calling our SDK/API to request quotes for a transaction, the fee parameter works the same way but the specified fee will be sent to the provided Solana fee collection address with every transaction so no withdrawal is needed.
You can configure different wallets for different chains.
How to set up
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:
How to withdraw fees
Checking collected fees
The fee collector wallet balance can be retrieved via /v1/integrators/{integratorId}
where {integratorId}
is either your fee collector wallet or integrator string.
The response will contain a balance of each token on each chain.
Generate transaction data for withdrawal request
Transaction data can be retreived from /v1/integrators/{integratorId}/withdraw/{chainId}
.
The response will return a transaction data object and an contract address of our fee collector.
Submit the withdrawal tx onchain
Submit the tx onchain on the chain for which withdraw transaction data was requested from the fee collector wallet.
Sender has to be a whitelisted fee collector wallet for that chain.