Program Derived Accounts and what purpose they serve in the protocol.
StakeAccount
When a user stakes on an Opportunity Market option, a Stake Account is created to keep track of how much money the user staked and for which option. The option choice is encrypted, meaning anyone observing the transactions on chain cannot tell which of the available options the user staked on.
Once a user's stake is stored in a Stake Account, it cannot be increased, only withdrawn completely. A user can, however, have multiple Stake Accounts for the same option. So if they wish to stake more, a new Stake Account can be opened.
OpportunityMarketOption
Account representing an option in the market. This account also holds the tally of the total revealed stake amount for this option.
OpportunityMarket
Account representing the Opportunity Market itself. This account stores the market configuration and keeps track of current market state.
OpportunityMarketSponsor
Tracks an individual sponsor's contribution to a market's reward pool. The sponsored amount can be withdrawn before staking period is over, unless the sponsor chose to mark it as permanently locked.
TokenVault
Vault account that tracks collected protocol fee amount. One such account per token mint.