Users can invest in pools that are managed by other users. When users invest in a pool, they receive tokens that represent their stake in the pool. To withdraw from a pool, users can burn their pool tokens and pay a performance fee to the pool manager (if they are withdrawing for a profit). Users receive their share of the pool’s assets when they withdraw.
Pools are represented by smart contracts that pool managers can interact with using the platform’s UI. These contracts send transactions to whitelisted DeFi projects on the pool’s behalf, eliminating the possibility of pool managers withdrawing other users’ investments into their own account or calling unsupported contracts. Tradegen will integrate more DeFi projects as more projects launch on Celo.
Pool managers can execute transactions on whitelisted DeFi projects by specifying the external contract, encoding the function signature as bytes data, and passing the data as a parameter to a pool’s executeTransaction() function. The data gets verified by a ‘verifier’ contract for the specified external contract. The ‘verifier’ contract checks the function signature against whitelisted signatures and checks for valid parameters. This prevents pool managers from withdrawing funds from Tradegen or interacting with unsupported protocols.