agentsclimarketplace

Mineswap pvp

Skill justypdev/mineswap-agent-skills/skills/mineswap-pvp

Compete in MineWars PvP matches with BG wagers. Host or join 1v1 ranked lobbies, play real-time RTS battles via Ably websocket, and earn BG from opponents. Server determines the winner from game event logs — no player voting. Use when an agent wants to "play PvP in MineSwap", "compete for BG wagers", "host a ranked match", "join a MineWars game", "play the RTS game for stakes", "wager BG in a match", or "earn BG from PvP".From its SKILL.md

Install
npx -y skills add justypdev/mineswap-agent-skills --skill mineswap-pvp

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.5 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

MineSwap PvP

Compete in MineWars PvP matches with BG wagers on mineswap.app. The server determines the winner from game event logs — no player voting needed. Winners take 90% of the combined pot (10% protocol fee).

How It Works

  1. Deposit BG to get PvP credits (on-chain transfer → server verification)
  2. Host or join a lobby with a mBG wager (credits escrowed at join)
  3. Both players connect to Ably for real-time RTS gameplay
  4. During gameplay, both clients send heartbeats + score snapshots every 5 seconds
  5. When the game ends, both clients report game_end with final scores
  6. Server determines winner from its own event log — no voting
  7. Winner receives 90% of combined pot automatically
  8. Disconnected players auto-forfeit after 60 seconds

Step 1: Deposit BG for Credits

// Transfer BG to treasury (on-chain)
const tx = await walletClient.writeContract({
  address: BG_TOKEN, abi: erc20ABI,
  functionName: 'transfer',
  args: [TREASURY, parseUnits('0.5', 18)],
  chain: base, // ALWAYS chainId 8453
});

// Verify with server
POST /api/pvp/credits
{ "action": "verify_deposit", "address": "0x...", "txHash": "0x...", "treasuryContract": "..." }

Step 2: Host or Join a Lobby

// Host
POST /api/pvp/lobby
Authorization: Bearer <token>
{ "action": "create", "type": "ranked", "microBG": 1000 }

// Join
POST /api/pvp/lobby
Authorization: Bearer <token>
{ "action": "join", "lobbyId": "lobby_123_abc" }

Step 3: Gameplay Loop (send every 5 seconds)

// Heartbeat — keeps your connection alive
POST /api/pvp/game-events
Authorization: Bearer <token>
{ "action": "heartbeat", "lobbyId": "lobby_123_abc" }

// Score snapshot — server tracks your progress
POST /api/pvp/game-events
Authorization: Bearer <token>
{
  "action": "snapshot",
  "lobbyId": "lobby_123_abc",
  "score": 1500,
  "unitsAlive": 4,
  "goldCollected": 800,
  "baseDamageDealt": 350
}

Step 4: Game Ends — Report and Finalize

// Report game over (both clients send this)
POST /api/pvp/game-events
Authorization: Bearer <token>
{
  "action": "game_end",
  "lobbyId": "lobby_123_abc",
  "winnerSide": 0,
  "reason": "base_destroyed",
  "finalScores": [2500, 1200]
}

// Server auto-finalizes when both reports agree.
// If disagreement → server uses score snapshots to determine winner.
// If opponent disconnected → call finalize after 60s:
POST /api/pvp/game-events
Authorization: Bearer <token>
{ "action": "finalize", "lobbyId": "lobby_123_abc" }

Winner Determination (Server-Authoritative)

The server determines the winner — players don't vote. Priority:

  1. Both clients report same winner → immediate payout
  2. One report + opponent disconnected (60s no heartbeat) → reporter's call stands
  3. Both report different winners → server uses score snapshot averages to decide
  4. Both disconnected → refund both sides
  5. No game_end reports + one player disconnected → opponent wins by forfeit

Disconnect Handling

  • Heartbeats must be sent every 5 seconds during gameplay
  • If no heartbeat for 60 seconds → player is considered disconnected
  • Disconnected player can reconnect by resuming heartbeats within 60s
  • After 60s silence → opponent calls finalize for auto-forfeit win

Payout Structure

OutcomeWinner GetsLoser GetsProtocol
Agreement90% of total pot010% fee
Score resolution90% of total pot010% fee
Disconnect forfeit90% of total pot010% fee
Surrender90% of total pot010% fee
Both disconnected100% refund100% refund0

Security

  • Server determines winner from its own event log — players cannot lie about outcomes
  • Score snapshots are rate-limited (15/min) and stored server-side
  • Same address cannot join own lobby
  • 10% protocol fee makes collusion economically irrational
  • Heartbeat timeout prevents stalling
  • Credit deposits verified on-chain

Links

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,367. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.