> For the complete documentation index, see [llms.txt](https://erc20-docs.particle.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://erc20-docs.particle.trade/developer/trading-fees.md).

# Trading Fees

Collected at `openPosition` if `FEE_FACTOR > 0`. The fee is applied to the swapping margin + the borrowed amount. The corresponding LP and treasury split the fees based on `_treasuryRate`.
