Chaos Architecture
Chaos Finance is built on top of the Solana LSD Stack from StaFi’s AI-powered LSaaS.
In the Solana ecosystem, "smart contracts" are called programs. Each program is an on-chain account that stores executable logic, organized into specific functions referred to as instructions.
Core Accounts:
- StakeManager: the main account of sSONIC that stores all the states such as: rate, stake info list and commission fee
- StakePool: an escrow account manages funds between stakers and sonic staking program
- UnstakeAccount: an account stores unstake info such as: recipient, amount and withdrawal index
Core roles:
- Admin: manages parameters of sSONIC network
Stake Flow
Users can stake SONIC to the network via stake
method, and users will receive equivalent amount of sSONIC.
Amount of sSONIC = stakingAmount * Total sSONIC Supply / Total SONIC Amount
Unstake Flow
Any sSONIC holders are valid users, and can call unstake
method to exchange SONIC with sSONIC.
Withdraw Flow
Users can get their principals and rewards by calling withdraw
method when there are enough amount of matured stakes.
Relay Service
Due to the limitation of smart contract, it could not launch an execution. So Chaos Finance introduces Relay service. It will trigger StakeManager, at a certain interval, to collect and calculate users' reward, distribute it to the platform and users.