Skip to content

feat: add ORE mining game connector (experimental) - #578

Draft
fengtality wants to merge 5 commits into
developmentfrom
feat/ore-connector
Draft

feat: add ORE mining game connector (experimental)#578
fengtality wants to merge 5 commits into
developmentfrom
feat/ore-connector

Conversation

@fengtality

@fengtality fengtality commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Experimental connector for the ORE v3 mining game on Solana.
  • Provides an API for the core mining operations and read-only game state.
  • Supports both regular and hardware (Ledger) wallets.

All instruction and account layouts were taken from the ORE api crate
(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 squares
  • POST /connectors/ore/ore/check-round — Checkpoint (settle) rewards for a completed round
  • POST /connectors/ore/ore/claim-sol — Claim SOL rewards
  • POST /connectors/ore/ore/claim-ore — Claim ORE token rewards

Info Endpoints

  • GET /connectors/ore/ore/account-info — Miner account state for a wallet
  • GET /connectors/ore/ore/board-info — Game board and round state
  • GET /connectors/ore/ore/system-info — Treasury and ORE token supply info

Not 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:

  • ORE Program: oreV3EG1i9BEgiAJ8b177Z2S2rMarzak4NMv1kULvWv
  • ORE Token Mint: oreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcp

Options in conf/ore.yml:

  • commitment: transaction confirmation level (default: confirmed)
  • priorityFee: priority fee in microlamports (default: 0)

Test plan

  • Start Gateway with pnpm start --passphrase=xxx --dev
  • GET /connectors/ore/ore/system-info returns treasury/supply data
  • GET /connectors/ore/ore/board-info returns current round info
  • GET /connectors/ore/ore/account-info?walletAddress=<wallet> returns miner state
  • Deploy, checkpoint, claim-sol, claim-ore with a funded wallet

🤖 Generated with Claude Code

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>
@rapcmia rapcmia moved this to Backlog in Pull Request Board Dec 19, 2025
@rapcmia rapcmia moved this from Backlog to In Discussion in Pull Request Board Jan 6, 2026
fengtality and others added 3 commits August 3, 2026 13:58
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants