"Diamond is forever."
Diamond Money (Symbol: DYMD) presents a deflationary currency mechanism built on provable randomness. The protocol operates a 5x5 grid where each square represents a unique combination of five diamond shapesโTrillions, Asscher, Princess, Oval, and Pearโpaired with five colors: Black, Blue, Green, Red, and Yellow. Players place wagers on squares, and when the verifiable random function reveals the winning combination, those who matched exactly receive uncut diamonds at a 4x multiplier of their bet in SOL. Those who matched only the shape or color accumulate half-matches that persist across rounds, waiting to combine with their counterpart to form complete diamonds.
The currency itself is strictly deflationary, with an absolute supply cap of 15,000,000 DYMD enforced at the protocol level. Diamonds exist in two states: uncut and cut. Uncut diamonds accumulate through winning bets and half-match combinations, stored in user profiles until withdrawal. When users convert uncut diamonds to cut diamonds, a 15% fee is extracted and deposited into the global uncut pool, creating a deflationary mechanism that reduces circulating supply while rewarding those who maintain their uncut holdings. The uncut pool distributes proportional rewards to all uncut diamond holders based on their relative share, incentivizing long-term participation rather than immediate withdrawal.
The economic engine derives its momentum from a 10% buyback support mechanism, including operational fees. This continuous flow of capital into the DYMD market operates on Solana's energy-efficient blockchain, where transaction costs remain minimal even as buyback volume scales. The mechanism allocates 20% of all buyback proceeds to a staking mechanism, rewarding those who lock their DYMD tokens and contribute to network stability. The remaining 80% undergoes permanent removal from circulation through a burn mechanismโvaporized with precision, ensuring that each buyback event not only supports market liquidity but also accelerates the deflationary trajectory toward the absolute supply cap.
The game mechanics reward strategic play through the half-match system. When a player holds both a shape half-match and a color half-match, they combine to form complete uncut diamonds at one-twentieth (1/20) the normal rate. This system transforms near-misses into future value. The accumulation persists across games, creating a persistent incentive structure that rewards consistent participation.
All operations execute on-chain with cryptographic guarantees. The verifiable random function ensures that game outcomes are provably fair and cannot be manipulated, while the immutable supply cap and deflationary mechanics operate as mathematical constants rather than policy decisions. Automated mining capabilities allow for systematic strategies without requiring manual intervention for each round.
The 5ร5 betting grid combines diamond shapes with colors:
| Shape | Black | Blue | Green | Red | Yellow |
|---|---|---|---|---|---|
| Trillions | 1 | 2 | 3 | 4 | 5 |
| Asscher | 6 | 7 | 8 | 9 | 10 |
| Princess | 11 | 12 | 13 | 14 | 15 |
| Oval | 16 | 17 | 18 | 19 | 20 |
| Pear | 21 | 22 | 23 | 24 | 25 |
Parameters:
game_index: u32- The index of the game to place bets onbets: Vec<BetInput>- A vector of bet inputs, where eachBetInputcontains:square: u8- The square number to bet on (1-25)amount: u64- The bet amount in lamports
Accounts:
player(mut, signer) - The player placing the betglobal_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)game_state(mut) - Game state PDA for the current game (seeds:GAME_STATE_SEED,game_index)user_profile(mut) - User profile PDA (seeds:USER_PROFILE_SEED,player.key())prev_game_state(mut) - Previous game state PDA for settlement (seeds:GAME_STATE_SEED, previous game index)wsol_mint- WSOL mint accountwsol_vault(mut) - Global WSOL vault ATA (address fromglobal_state.wsol_vault)fees_account(mut) - Fees account that receives 50% of rake (address fromglobal_state.fees_account)token_program- Token programsystem_program- System program
Purpose: Allows players to place bets on one or more squares in the current game. The instruction validates all bets, initializes the game state if needed, settles any previous game wagers, and processes the bets by transferring funds to the WSOL vault. It calculates and distributes rake (50% to fees account, 50% to house rake), updates bet tracking for both the user and game state, assigns bettor numbers for squares, and ensures bets are within the 60-second game window. The instruction also handles user profile initialization and wager management automatically.
Parameters:
game_index: u32- The index of the game to request settlement forforce: [u8; 32]- A 32-byte seed for the VRF randomness request (cannot be all zeros)
Accounts:
payer(mut, signer) - The account paying for the VRF requestglobal_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)game_state(mut) - Game state PDA (seeds:GAME_STATE_SEED,game_index), must not be fulfilledrandomness(mut) - VRF randomness account PDA (seeds:RANDOMNESS_ACCOUNT_SEED,force, program: ORAO VRF)treasury(mut) - VRF treasury accountconfig(mut) - VRF network state PDA (seeds:CONFIG_ACCOUNT_SEED, program: ORAO VRF)vrf- ORAO VRF programsystem_program- System program
Purpose: Initiates the settlement process for a completed game by requesting verifiable random function (VRF) randomness from the ORAO VRF network. This instruction can only be called after 60 seconds have passed since the game started and ensures the game is the current active game. It stores the randomness account address in the game state for later use during settlement. The VRF randomness will be used to determine the winning square, bonus values, match mode, and match player for the game.
Parameters:
game_index: u32- The index of the game to settle
Accounts:
payer(mut, signer) - The account paying for the transactionglobal_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)game_state(mut) - Game state PDA (seeds:GAME_STATE_SEED,game_index)randomness- VRF randomness account (must matchgame_state.randomness_account)
Purpose: Finalizes the game settlement by reading the fulfilled VRF randomness and determining the game outcomes. It extracts the winning square (1-25), bonus value, match mode, and match player from the randomness data. If no bets were placed on the winning square, the total pool is added to unclaimed winnings. If the bonus value is 69, the bonus pool is transferred to the game state. The instruction marks the game as settled, stores all outcome values, and clears the game start timestamp to allow the next game to begin. This instruction is idempotent and can be safely called multiple times.
Parameters:
game_index: u32- The index of the game to settle wagers forwithdraw_amount: u64- Amount of uncut diamonds to withdraw (must be 0 ifwithdraw_allis true)withdraw_all: bool- If true, withdraw all uncut diamondssol_amount: u64- Amount of SOL to withdraw in lamports (must be 0 ifsol_allis true)sol_all: bool- If true, withdraw all available SOL
Accounts:
player(mut, signer) - The player settling their wageruser_profile(mut) - User profile PDA (seeds:USER_PROFILE_SEED,player.key())game_state(mut) - Game state PDA (seeds:GAME_STATE_SEED,game_index)global_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)wsol_vault(mut) - WSOL vault ATA owned by global_state (address fromglobal_state.wsol_vault)diamond_mint(mut) - Diamond token mint (address fromglobal_state.diamond_mint)user_diamond_account(mut) - User's diamond token account (ATA)wsol_mint(mut) - WSOL mint accountuser_wsol_account(mut) - User's WSOL ATA (created if needed, then closed after transfer)token_program- Token programassociated_token_program- Associated token programsystem_program- System program
Purpose: Allows players to settle their outstanding wagers and withdraw their winnings. The instruction first settles any pending wager for the specified game if the game has been settled, calculating winnings based on the winning square, bonus, match mode, and match player. For diamond withdrawals, it calculates the user's proportional share of the uncut pool, applies a 15% fee (added to the uncut pool), and mints cut diamonds to the user (subject to MAX_DIAMONDS limit). For SOL withdrawals, it transfers WSOL from the vault to the user's wallet. The instruction handles both partial and full withdrawals for both diamonds and SOL, and is idempotent for already-settled wagers.
Parameters:
- None (instruction-level parameters only)
Accounts:
payer(mut, signer) - The account paying for the game creationglobal_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)game_state(mut) - Game state PDA for the new game (seeds:GAME_STATE_SEED,global_state.game_index + 1)system_program- System program
Purpose: Creates a new game round by initializing a new game state account and incrementing the global game index. The instruction sets the game start timestamp to the current clock time, initializes all game state fields to their default values (zero bets, no winning square, etc.), and ensures the previous game has been settled before creating a new one. This instruction is idempotent and will return successfully if the game already exists, making it safe to call multiple times. The game state is created as a PDA using the game index as part of the seed.
Parameters:
rounds: u32- Number of betting rounds to execute (must be > 0 and <= 1,000,000)amt_per_sq: u64- Bet amount per square in lamports (must be between MIN_BET_AMOUNT and MAX_BET_AMOUNT)num_sq: u8- Number of squares to bet on per round (must be between 1 and 25)
Accounts:
user(mut, signer) - The user initializing auto betting (funds the auto bet)auto_bet_state(mut) - Auto bet state PDA (seeds:AUTO_BET_STATE_SEED,user.key())wsol_mint- WSOL mint accountwsol_ata(mut) - WSOL ATA for the auto bet state (authority:auto_bet_state)token_program- Token programassociated_token_program- Associated token programsystem_program- System program
Purpose:
Initializes an automated betting system for a user by creating an auto bet state account and a WSOL associated token account. The instruction calculates the total amount needed (rounds ร amt_per_sq ร num_sq + transaction fees) and transfers that amount from the user's wallet to the auto bet state's WSOL ATA. The auto bet state stores the betting parameters and will be used by the process_auto instruction to automatically place bets on behalf of the user. This allows users to set up recurring bets without manually calling place_bet for each round.
Parameters:
game_index: u32- The index of the game to place bets onsquares: Vec<u8>- A vector of square numbers to bet on (must matchnum_sqfrom the auto bet state)
Accounts:
auto_key(mut, signer) - Authorized auto key (validated against admin_state)admin_state(mut) - Admin state PDA (seeds:b"diamond-money-admin")auto_bet_state(mut) - Auto bet state PDA (seeds:AUTO_BET_STATE_SEED,auto_bet_state.user)user_profile(mut) - User profile PDA (seeds:USER_PROFILE_SEED,auto_bet_state.user)global_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)game_state(mut) - Game state PDA (seeds:GAME_STATE_SEED,game_index)prev_game_state(mut) - Previous game state PDA (seeds:GAME_STATE_SEED, previous game index)wsol_ata(mut) - WSOL ATA for the auto bet state (address fromauto_bet_state.wsol_ata)wsol_vault(mut) - Global WSOL vault ATA (address fromglobal_state.wsol_vault)wsol_mint- WSOL mint accountfees_account(mut) - Fees account (address fromglobal_state.fees_account)auto_key_wsol_ata(mut) - Auto key's temporary WSOL ATA (created if needed)token_program- Token programassociated_token_program- Associated token programsystem_program- System program
Purpose: Processes a single round of automated betting on behalf of a user. This instruction is called by an authorized auto key (admin-controlled) and places bets using funds from the user's auto bet state WSOL ATA. It validates that the squares list matches the configured number of squares, transfers funds to the global WSOL vault, handles rake distribution, updates game state and user wager tracking, and decrements the remaining rounds counter. The instruction also handles game state initialization, previous game settlement, and ensures the user hasn't already placed bets in the current game. This enables automated, recurring betting without requiring the user to sign each transaction.
Parameters:
- None
Accounts:
user(mut, signer) - The user closing their auto bet state (receives remaining funds)auto_bet_state(mut, close) - Auto bet state PDA (seeds:AUTO_BET_STATE_SEED,user.key()), closed to userwsol_ata(mut) - WSOL ATA for the auto bet state (address fromauto_bet_state.wsol_ata)wsol_mint- WSOL mint accountuser_wsol_ata(mut) - User's WSOL ATA (created if needed)token_program- Token programassociated_token_program- Associated token programsystem_program- System program
Purpose: Closes an auto bet state account and returns any remaining WSOL funds to the user. The instruction transfers any remaining balance from the auto bet state's WSOL ATA to the user's wallet, closes both the auto bet state's WSOL ATA and the auto bet state account itself, and returns the rent to the user. This allows users to clean up their auto betting setup and recover any unused funds that weren't spent on betting rounds. The instruction ensures only the owner of the auto bet state can close it.
Parameters:
rounds: u32- New number of betting rounds (must be > 0 and <= 1,000,000)amt_per_sq: u64- New bet amount per square in lamports (must be between MIN_BET_AMOUNT and MAX_BET_AMOUNT)num_sq: u8- New number of squares to bet on per round (must be between 1 and 25)
Accounts:
auto_key(mut, signer) - Authorized auto key (validated against admin_state)admin_state(mut) - Admin state PDA (seeds:b"diamond-money-admin")user- User's wallet key (the one whose auto bet state is being refreshed)user_profile(mut) - User profile PDA (seeds:USER_PROFILE_SEED,user.key())auto_bet_state(mut) - Auto bet state PDA (seeds:AUTO_BET_STATE_SEED,user.key())global_state(mut) - Global state PDA (seeds:GLOBAL_STATE_SEED)wsol_vault(mut) - WSOL vault ATA owned by global_state (address fromglobal_state.wsol_vault)wsol_ata(mut) - WSOL ATA for the auto bet state (address fromauto_bet_state.wsol_ata)wsol_mint- WSOL mint accounttoken_program- Token programsystem_program- System program
Purpose:
Updates the parameters of an existing auto bet state and optionally transfers any available SOL winnings back into the auto betting pool. This instruction can only be called by the authorized auto key and only if auto refresh is enabled for the user's auto bet state. If the user has sol_payable > 0, it transfers those winnings from the global WSOL vault to the auto bet state's WSOL ATA, effectively reinvesting winnings into continued automated betting. The instruction then updates the rounds, amount per square, and number of squares parameters, allowing users to adjust their automated betting strategy without closing and recreating the auto bet state.