Nezha
  • 🏠Introduction to Nezha
  • How nezha works
    • Stake to Win
    • Nezha Epochs
    • Yield Farmer
  • Tickets
    • Stake per Ticket
    • Tickets
    • Bonus Tickets
    • Ticket Generation
  • The Draw
    • The Draw
    • Winning Sequence
    • No Draw Scenario
  • Prizes
    • Prize Tiers
    • Prizes
  • Fees
    • Staking
    • Unstaking
    • Claiming Prizes
  • Risks & Mitigations
    • Smart Contracts
    • Low Yield Returns
    • Negative Yield Returns
    • Tickets Outside Solana
    • Insurance Costs
  • Architecture
    • Overview
    • Game Contract
      • Epoch States
      • Token Accounts
      • State Accounts
      • Initialisation Instructions
      • State Transition Instructions
      • Other Instructions
      • Roles & Capabilities
      • Derived Account Roles
    • Draw Contract
      • State Accounts
      • Instructions
      • Roles & Capabilities
      • Derived Accounts
Powered by GitBook
On this page
  • [User] RequestStakeUpdate
  • [Admin] ApproveStakeUpdate
  • [Admin] CompleteStakeUpdate
  • [User|Admin] CancelStakeUpdate
  • [User] ClaimWinning { page, index }
  • [Admin] FundJackpot
  • [Admin] WithdrawVault
  • [Admin] RotateKey { key_type, value }
  1. Architecture
  2. Game Contract

Other Instructions

[Role] Instruction

[User] RequestStakeUpdate

  • Create a StakeUpdateRequest { amount } account.

  • if amount < 0, its considered a withdraw request.

  • Else it's a deposit request.

  • This request has an internal approval step for AML checks

[Admin] ApproveStakeUpdate

  • Mark StakeUpdate as AML check completed.

[Admin] CompleteStakeUpdate

  • Wait until funds are no longer locked in francium. ie, the Epoch is back to the Running state.

  • if deposit:

    • Move requested amount from PendingDepositVault into DepositVault

  • if withdraw:

    • Move requested amount from DepositVault into User's USDC ATA

    • If requested amount is more than the available balance, move all the available balance.

[User|Admin] CancelStakeUpdate

  • If the stake update was a deposit

    • Move the amount from PendingDepositVault into User's USDC ATA.

  • Delete the StakeUpdate account

[User] ClaimWinning { page, index }

  • Mark the winner entry as claimed.

  • Move the prize amount from the prize vault to deposit vault and update user's stake account.

[Admin] FundJackpot

  • prize_amount = EpochTierWinners(tier=1,epoch_index=current).amount

  • Move prize_amount from Admin's USDC ATA -> Tier1PrizeVault.

  • EpochTierWinners(tier, epoch_index).claimable = true

[Admin] WithdrawVault

  • vault = Treasury or Insurance

  • Move `amount` from `vault` into Admin's USDC ATA.

[Admin] RotateKey { key_type, value }

  • Change the authorized key of any of SuperAdmin, Admin, Investor.

  • This is updated as LatestEpoch.pubkeys.<key_type> = value

PreviousState Transition InstructionsNextRoles & Capabilities

Last updated 1 year ago