The Manager is the contract that coordinates the movement of capital throughout the system. It pulls funds from the pools and deploys them to various DeFi protocols. Capital is deployed through the use of Controllers that are
delegatecall'ed to, specific to the protocol interfacing with. Deployment of capital happens in 'cycles'. It is important to note that cycle deployment can happen over multiple transactions due to the gas limitations. To indicate that a cycle deployment is complete the
completeflag must be passed when calling
execute()to indicate the rollover is complete.
Rewards are computed off-chain in a backend service (compute rewards service) that evaluates the last cycle's deployed capital and it's efficiency. There are three types of parties that are entitled to TOKE rewards:
- Providers of Capital
- Pricers of Capital
- Directors of CapitalOnce the "compute rewards service" has computed rewards, it'll publish all reward payloads, a signed typed data message (ERC712), out to IPFS. This payload is signed by a secure key in the backend. Rewards are cumulative so when the service is calculating, it will pull the last cycles balances from IPFS, and add the additional amount The message indicates the account, chain, total amount claimable (not taking into account amounts that have been claimed), and a nonce. The rewards contract will keep a balance of claimed amounts and only give the user the difference each time they claim. At this point the user can decide if they want to claim their rewards or not. If a user decides to claim, the message along with the signature is submitted to the rewards contract by the user. This results in the contract transferring the amount claimable to the account address.