There are no protocol fees for AshSwap Aggregator or platform fees on AshSwap UI, however, UI providers may implement platform fees. If a platform fee is set, AshSwap will take 10% of the platform fees charged by integrators.
First, register with us the wallet you use for collecting the fees and the fees you would like to set for your platform. Then, use that wallet as the protocol argument in your integration.
constswapWithPaths=async () => {constintegrator='erd...'; // your fee walletconstagService=newAggregator({chainId:ChainId.Mainnet, protocol: integrator});// use the response to display on the UIconstsorswap=awaitagService.getPaths('EGLD','ASH-a642d1',1e18);if (!sorswap) thrownewError(`Could not find any paths for EGLD to ASH`);constinteraction=awaitagService.aggregateFromPaths(sorswap,100);// remember to set the sender (caller) before sending the txconsttx=interaction.withSender(newAddress('erd...')).check().buildTransaction();// sign and send tx to the network// sendTransactions({// transactions: [tx],// })}
Fees are taken from token inputs, so over time, fees can consist of multiple tokens, so we allow you to query by indexes. The numbers 0 and 100 at the end of the query are the start index and end index, respectively.
When the number of fee tokens is too large, to make sure the transaction doesn't go over the gas limit or it doesn't make sense economically to claim small fee tokens, you can claim fees by tokens.