I’ve been reviewing a typical transaction from the ICPSwap ledger, and I have some questions about how the fees are calculated for token swaps. Here’s a snippet of the transaction I’m referring to:

```
{
"token0Fee": 0,
"token1Fee": 0,
"poolFee": "3000",
"token0Price": 1.0010005,
"token1Price": 8.063265489197322,
...
}
```

- How exactly are the
,`token0Fee`

and`token1Fee`

fields used? In this transaction, both are 0, but I’m curious when and how they are applied in general.`poolFee`

- For the
, does it reduce the output amount of the token I’m receiving (`poolFee`

`token1`

in this case)? If so, is the correct formula for calculating the final amount of`token1`

:

Final amount of token1=Pre-fee amount of token1×(1− poolFee/100000) - Can someone provide a concrete example calculation for swapping
**1000 units of**into`token0`

(ckUSDC)`token1`

(ICP), assuming the same prices as above?

Thank you in advance for the help!