Program Reference
Program ID, all 9 instructions, PDA seeds, account layouts, and fee constants for the Gridsteal Anchor program.
Program Details
On-chain identity and network.
The program is upgradeable. The deployer holds the upgrade authority. A future audit will precede any upgrade authority burn.
There is no admin instruction. The GlobalConfig stores the treasury wallet address, but no instruction changes program logic after deployment.
GridState and TileState are the canonical source of truth. No off-chain database is authoritative. The frontend reads directly from program accounts via getProgramAccounts.
Instructions
All 9 callable instructions and their purpose.
Discriminators use the seed pattern "global:instruction_name" — the first 8 bytes of SHA-256 of that string.
One-time setup. Creates the GlobalConfig PDA and sets the treasury wallet. Called once by the deployer at program deployment.
Creates a GridState PDA and Vault PDA for a given SPL mint. The caller becomes the grid creator permanently. The grid is immediately live and tiles are claimable.
Claims an empty tile OR buys out an existing holder. The buyer sets their own listed price at claim time. First claim: grid starting price + 5% of new_price as deposit (no fee). Buyout: existing price + 20% fee + 5% of new_price as deposit. Seller receives 100% of their listed price + their deposit back atomically.
Updates the holder's listed tile price. Subject to 20-minute cooldown. Tax is accrued at the old price before the new price takes effect.
Transfers SOL from holder's wallet to vault, increasing deposit balance. Tax is accrued first, then reward_debt is reset to reflect the new deposit level.
Pulls excess deposit back to the holder's wallet. Cannot reduce deposit below 5% of listed price. Tax is accrued first.
Holder voluntarily gives up their tile. Remaining deposit is refunded. Tile resets to unowned state at the grid's starting_price.
Transfers accumulated rewards (Harberger tax share + buyout fee share) from vault to holder. Amount is proportional to deposit weight in the grid.
Anyone can inject SOL directly into the grid's reward accumulator. Useful for creator incentive campaigns, partnerships, or bootstrapping a new grid.
PDA Seeds
Deterministic account addresses for all program accounts.
All accounts are Program Derived Addresses. The frontend derives these off-chain before submitting transactions. Seeds must match the program exactly.
Fee Constants
All hardcoded rates in the program.
