State Transition Instructions
[Role] Instruction
[Admin] CreateEpoch
LatestEpoch.index += 1
Create new Epoch account with index=LatestEpoch.index
Epoch.state = CREATED
[Admin] YieldWithdrawByInvestor / [Admin] FranciumInvest
Epoch.total_invested = DepositVault.amount
Transfer the contents of Deposit Vault to Investor's USDC ATA or into the Francium protocol.
Epoch.state = YIELDING
[Investor] YieldDepositByInvestor / [Admin] FranciumWithdrawInvestment
Move funds from Investor's USDC ATA or the Francium protocol back into our program.
If return < deposit:
Move all of the returns into DepositVault
cumulative_return_rate *= return/deposit
Epoch.draw_enabled = false
Else, If there is enough money to pay jackpot insurer:
Epoch.draw_enabled = true
Move insurance amount into InsuranceVault.
Move deposited amount into DepositVault.
Move remaining amount into: TreasuryVault, Tier2PrizeVault, Tier3PrizeVault as per configured ratio.
Epoch.draw_enabled` will be used by the off-chain code to decide whether to publish a winning combination in case we enter a no-draw scenario.
Epoch.state = FINALISING
[Admin] CreateEpochWinnersMeta
Upload metadata of winners
[Admin] PublishEpochWinnersPage
Upload list of winner pages by page
If this is the last page, mark upload as complete in the EpochWinnersMeta account:
Epoch.state = ENDED
Last updated