0 when you do not want a fee.
Fees apply only when the BopAMM leg succeeds. Fallback output from swapWithFallback is not fee-charged by the BopAMM router.
How fees work
The requestedfee is the total fee on gross BopAMM output, in basis points, capped at 1,000 bps. The router applies its configured protocol share to that total fee, sends the remainder to your fee_recipient, and delivers the remaining output to the swap recipient.
For example, if the gross BopAMM output is 1,000 units and fee = 25, the total router fee is 2.5 units. A configured protocol share applies to that 2.5, and the rest goes to your fee recipient.
The router checks minAmountOut after fees. If you set a fee yourself, calculate your minimum from the post-fee amount.
Pack the router fee
BopAmmRouter takes a single packed uint256 fee argument.
Add a fee to router calldata
When you buildswapWithAllowance calldata yourself, pass the packed fee as the final argument.
FEE argument is used when composing swapWithFallback manually.
Add a fee through /quote
For /quote-generated swapWithFallback calldata, pass fee and fee_recipient as query parameters. The endpoint packs them into tx.data for you.
buyTokens[].minimumAmount already reflects fee plus slippage, and the returned tx.data carries the packed router fee.