Reconcile a Hedera fractional fee using net_of_transfers

A marketplace can see a nominal transfer of 250 tokens but a receiver credit of 245 or a sender debit of 255. Its accounting depends on how the HTS fractional fee is configured.

Read the fee rule effective at transfer time

For an illustrative fungible token, suppose a single two-percent fee applies with no effective minimum or maximum and no exemptions. Calculate in the token’s smallest units. The fee collector receives five units in either configuration.

nominal = 250
fee = nominal * 2 // 100
assert fee == 5
assert nominal - fee == 245
assert nominal + fee == 255

Match debits and credits to the flag

With net_of_transfers false, debit the sender 250 and credit the recipient 245 and collector 5. With true, debit the sender 255 and credit the recipient 250 and collector 5. Inspect assessed custom fees in the transaction record to verify exemptions and other rules. Keep the payer’s HBAR network fee in its own ledger.

Sources