You can configure your swaps to collect a custom fee from end users on each swap
call. For how custom fees fit into the overall fees breakdown, see
How Swap Fees Work.
If you use this feature, Arc keeps 10% of the custom fee you collect from your
end users.
Prerequisites
Before you begin, ensure that you’ve:
These are required so any example below runs with a valid kit and adapter.
Set a custom fee on a swap
This example adds a 1% (100 basis points) fee to a single swap call:
const output = await kit.swap({
from: { adapter, chain: "Ethereum" },
tokenIn: "USDT",
amountIn: "1.00",
tokenOut: "USDC",
config: {
kitKey: process.env.KIT_KEY as string,
customFee: {
percentageBps: 100, // 1% fee
recipientAddress: "YOUR_WALLET_ADDRESS",
},
},
});