By integrating XY Finance API to request transaction quotes, dApps can now include a fee parameter to specify the percentage of the transaction volume they wish to collect as fees. This percentage fee will be deducted from the user's initial asset in the transaction and directly distributed to the designated wallet address. XY Finance will receive a percentage share of the collected fees based on the specific use case and transaction volume.
How to set up
To configure the fee collection, there are two relevant parameters that you can adjust: affiliate and commission rate during the execution of Get Quote and Build Swap Transaction
commission rate represents the fee you wish to collect. It is an integer between 0 and 100,000. In this range, 100,000 corresponds to 10%, 10,000 represents 1%, and so on in a similar fashion.
affiliate parameter represents the address where you want to receive the fees. The collected fee in every transaction will be directly transferred to this address. Before proceeding, please ensure that the provided address is under your management and capable of receiving assets correctly.
Below are examples demonstrating how to configure the fee setup.