Recommended way to create a DeFi app with tax and reinvestment logic?

So I am coming for event streaming background where we do things based on Events.
I am trying to relate the same with the Cloud functions we have here.

Lets say userA trying to contract.withdraw() -> Emits withdraw event -> triggers cloud functions -> send token to user’s address with some tax logic etc.

Now my question is, my contract looks so simple. Wouldn’t people call this is a Ponzi?
What is the recommended way to do this?