I am using PDAs in my Solana smart contract to hold SPL-Tokens deposited by users. I would like to be able to take a percentage of each deposit sent to a user's PDA as a fee. However, to my understanding, there is nothing stopping a user from just sending tokens directly to the PDA without my smart contract "knowing". Is there a way to block this sort of action? I was thinking of the possibility of the PDA "freezing" its ATAs so that it cannot accept transfers and then only when a user deposits from our platform, it would "unfreeze" its ATAs to enable it to accept more deposits but I don't know if this "freezing" action is possible. Could anyone please provide any guidance? Thank you.
I have thought of the possibility of adding a function to my smart contract that I would run daily to check the current token balances for all PDAs and compare it to the day before (which I would store in the PDA) and then take a percentage of that difference. However, I'm not sure this is the most efficient way to do this as this would require a lot of transactions.