How to know the tax of a smart contract

i want to calculate tax of smart contract so i thought i need to make a simulation of transfer but in this question
Contract Tax Question - Smart Contracts - OpenZeppelin Forum

says there is a buy tax and sell tax i searched into it and understand what it means but i am confused as to how it is applied

  • is it only applied on the liquidity pool contract so when someone buys with weth or sell for weth the
    owner gets the tax in terms of dex ?
  • and for platforms that lets you buy with fiat currencies some of the contract tokens is deducted and
    added to owner as tax ?
    i am using web3 with matic testnet i want to know how should i run this simulation to get the tax amount in %

There is no "standard tax" definition in DeFi, so anyone is free to implement whatever they choose to.

However, in a system which allows trading between token XXX and token YYY, tax is typically applied in one or more of the following places:

  • The transfer function in the XXX token contract
  • The transfer function in the YYY token contract
  • The trade function in the pool contract