feat: add ORE mining game connector (experimental) - #578
Draft
fengtality wants to merge 5 commits into
Draft
Conversation
Add connector for ORE v3 mining game on Solana with the following features: Mining Operations: - deploy: Deploy SOL to game board squares - checkpoint: Checkpoint to update rewards - claimSol: Claim SOL rewards - claimOre: Claim ORE token rewards Staking Operations: - stake: Stake ORE tokens - unstake: Unstake ORE tokens - claimStake: Claim staking rewards Info Endpoints: - accountInfo: Get miner and stake account info - boardInfo: Get game board and round state - systemInfo: Get treasury and token supply info 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This was referenced May 27, 2026
…ctor # Conflicts: # src/app.ts # src/templates/root.yml
The connector was written against an older ORE build and was broken against the currently-deployed program (oreV3EG1i9BEgiAJ8b177Z2S2rMarzak4NMv1kULvWv). Verified every instruction and account layout against live mainnet transactions and the ORE `api` crate (regolith-labs/ore). Instruction fixes (account count / data now match live txs): - deploy: 11 -> 12 accounts (add treasury; authority writable; entropy var = fixed VAR_ADDRESS BWCaDY96..., not the config field) - checkpoint: 6 -> 8 accounts (add authority + automation; board writable) - claimSol: 3 -> 5 accounts (add board, ore program) - claimOre: 9 -> 11 accounts and add required `bps: u64` arg (claim 100% = 10000) State parser fixes (Board/Miner/Round/Treasury) to match the repr(C) structs exactly (correct field order/offsets; Numeric = 16 bytes; Treasury is 48 bytes). Remove staking (stake/unstake/claimStake): those instructions no longer exist in the core ORE program — staking moved to a separate program (regolith-labs/ore-stake). Dropped the routes, schemas, stake-account parsing, and stake fields from account-info/system-info. Also removed treasuryBalanceSol/totalStaked (not in the Treasury struct) and the unused Config parser. Updated discriminators (bury 13->24, newVar 17->19, buyback=13; dropped setFeeCollector/setBuffer), rewrote ORE_INTEGRATION_GUIDE.md to the verified layouts, and removed the stale hand-written idl/ore.json (unused, not built). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1YS88ZAY2rXVLmgvyN4oY
The deploy route treated any miner whose last round was older than the current round as needing a checkpoint (`miner.roundId < currentRoundId`). A miner that already settled a long-past round (checkpointId == roundId) would then try to re-checkpoint a round whose account no longer exists, and the deploy would fail. Gate the auto-checkpoint on an actually-unsettled past round (`miner.checkpointId < miner.roundId && miner.roundId < currentRoundId`). Verified live on mainnet: deploy + checkpoint both land for a wallet with a stale settled round (tx 2SXHu5… deploy, 4JuykY… checkpoint). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1YS88ZAY2rXVLmgvyN4oY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All instruction and account layouts were taken from the ORE
apicrate(regolith-labs/ore) and verified against live mainnet transactions of the deployed
program (
oreV3EG1i9BEgiAJ8b177Z2S2rMarzak4NMv1kULvWv).Features
Mining Operations
POST /connectors/ore/ore/deploy— Deploy SOL to game board squaresPOST /connectors/ore/ore/check-round— Checkpoint (settle) rewards for a completed roundPOST /connectors/ore/ore/claim-sol— Claim SOL rewardsPOST /connectors/ore/ore/claim-ore— Claim ORE token rewardsInfo Endpoints
GET /connectors/ore/ore/account-info— Miner account state for a walletGET /connectors/ore/ore/board-info— Game board and round stateGET /connectors/ore/ore/system-info— Treasury and ORE token supply infoNot included: staking
Staking (stake / unstake / claim-yield) is not part of the core ORE program — it lives
in a separate program (regolith-labs/ore-stake). The previously-drafted staking endpoints
targeted instructions that no longer exist and have been removed. Staking can be added later
as a separate connector/PR against ore-stake.
Configuration
Program IDs are fixed protocol constants for ORE v3:
oreV3EG1i9BEgiAJ8b177Z2S2rMarzak4NMv1kULvWvoreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcpOptions in
conf/ore.yml:commitment: transaction confirmation level (default:confirmed)priorityFee: priority fee in microlamports (default: 0)Test plan
pnpm start --passphrase=xxx --devGET /connectors/ore/ore/system-inforeturns treasury/supply dataGET /connectors/ore/ore/board-inforeturns current round infoGET /connectors/ore/ore/account-info?walletAddress=<wallet>returns miner state🤖 Generated with Claude Code