aavegotchi-gbm-skillView, create, cancel, bid, and claim Aavegotchi GBM auctions on Base mainnet (8453). Subgraph-first discovery (Goldsky), with onchain verification + executio...
Install via ClawdBot CLI:
clawdbot install cinnabarhorse/aavegotchi-gbm-skillDRY_RUN=1. Never broadcast unless explicitly instructed.~/.foundry/bin/cast chain-id --rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}" must be 8453.~/.foundry/bin/cast wallet address --private-key "$PRIVATE_KEY" must equal $FROM_ADDRESS.highestBid matches the highestBid you pass into commitBid / swapAndCommitBid.$PRIVATE_KEY.This skill includes shell commands. Treat any value you copy from a user or an external source (subgraph responses, chat messages, etc.) as untrusted.
Rules:
eval, bash -c, sh -c).0x + 40 hex chars."" to avoid accidental shell interpolation. Replace them with literal values only after validation.Quick validators (replace the placeholder values):
python3 - <<'PY'
import re
auction_id = "<AUCTION_ID>" # digits only
token_contract = "<TOKEN_CONTRACT_ADDRESS>" # 0x + 40 hex chars
token_id = "<TOKEN_ID>" # digits only
amount = "<TOKEN_AMOUNT>" # digits only
if not re.fullmatch(r"[0-9]+", auction_id):
raise SystemExit("AUCTION_ID must be base-10 digits only")
if not re.fullmatch(r"0x[a-fA-F0-9]{40}", token_contract):
raise SystemExit("TOKEN_CONTRACT_ADDRESS must be a 0x + 40-hex address")
if not re.fullmatch(r"[0-9]+", token_id):
raise SystemExit("TOKEN_ID must be base-10 digits only")
if not re.fullmatch(r"[0-9]+", amount):
raise SystemExit("TOKEN_AMOUNT must be base-10 digits only")
print("ok")
PY
Required env vars:
PRIVATE_KEY: EOA private key used for cast send (never print/log).FROM_ADDRESS: EOA address that owns NFTs and will submit txs.BASE_MAINNET_RPC: RPC URL. If unset, use https://mainnet.base.org.GBM_SUBGRAPH_URL: Goldsky subgraph endpoint for auctions.Optional env vars:
DRY_RUN: 1 (default) to only simulate via cast call. Set to 0 to broadcast via cast send.RECIPIENT_ADDRESS: for swap flows; receives any excess GHST refunded by the contract. Defaults to FROM_ADDRESS.GOLDSKY_API_KEY: optional; if set, include Authorization: Bearer ... header in subgraph calls.SLIPPAGE_PCT: defaults to 1 (%); used in swapAmount estimate math.GHST_USD_PRICE, ETH_USD_PRICE: optional overrides; if unset, fetch from CoinGecko in the swap math snippets.Recommended defaults (override via env if needed):
export BASE_MAINNET_RPC="${BASE_MAINNET_RPC:-https://mainnet.base.org}"
export GBM_DIAMOND="${GBM_DIAMOND:-0x80320A0000C7A6a34086E2ACAD6915Ff57FfDA31}"
export GHST="${GHST:-0xcD2F22236DD9Dfe2356D7C543161D4d260FD9BcB}"
export USDC="${USDC:-0x833589fCD6eDb6E08f4c7C32D4f71b54BDA02913}"
export GBM_SUBGRAPH_URL="${GBM_SUBGRAPH_URL:-https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-gbm-baazaar-base/prod/gn}"
export DRY_RUN="${DRY_RUN:-1}"
export SLIPPAGE_PCT="${SLIPPAGE_PCT:-1}"
Notes:
~/.foundry/bin/cast so they work in cron/non-interactive shells.See references/subgraph.md for canonical queries.
Auction by id (quick):
curl -s "$GBM_SUBGRAPH_URL" -H 'content-type: application/json' ${GOLDSKY_API_KEY:+-H "Authorization: Bearer $GOLDSKY_API_KEY"} --data '{
"query":"query($id:ID!){ auction(id:$id){ id type contractAddress tokenId quantity seller highestBid highestBidder totalBids startsAt endsAt claimAt claimed cancelled presetId category buyNowPrice startBidPrice } }",
"variables":{"id":"<AUCTION_ID>"}
}'
Active auctions (ends soonest first):
NOW=$(date +%s)
curl -s "$GBM_SUBGRAPH_URL" -H 'content-type: application/json' ${GOLDSKY_API_KEY:+-H "Authorization: Bearer $GOLDSKY_API_KEY"} --data "{
\"query\":\"query(\$now:BigInt!){ auctions(first:20, orderBy: endsAt, orderDirection: asc, where:{claimed:false, cancelled:false, startsAt_lte:\$now, endsAt_gt:\$now}){ id type contractAddress tokenId quantity highestBid highestBidder totalBids startsAt endsAt claimAt presetId category seller } }\",
\"variables\":{\"now\":\"$NOW\"}
}"
The onchain source of truth is the GBM diamond.
Confirm core auction fields (full struct decode):
~/.foundry/bin/cast call "$GBM_DIAMOND" \
'getAuctionInfo(uint256)((address,uint96,address,uint88,uint88,bool,bool,address,(uint80,uint80,uint56,uint8,bytes4,uint256,uint96,uint96),(uint64,uint64,uint64,uint64,uint256),uint96,uint96))' \
"<AUCTION_ID>" \
--rpc-url "$BASE_MAINNET_RPC"
Useful individual getters:
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getAuctionHighestBid(uint256)(uint256)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getAuctionHighestBidder(uint256)(address)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getAuctionStartTime(uint256)(uint256)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getAuctionEndTime(uint256)(uint256)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getContractAddress(uint256)(address)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getTokenId(uint256)(uint256)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
~/.foundry/bin/cast call "$GBM_DIAMOND" 'getTokenKind(uint256)(bytes4)' "<AUCTION_ID>" --rpc-url "$BASE_MAINNET_RPC"
Onchain method:
createAuction((uint80,uint80,uint56,uint8,bytes4,uint256,uint96,uint96),address,uint256)(uint256)High-level steps:
ContractNotAllowed).setApprovalForAll(GBM_DIAMOND,true)InitiatorInfo:startTime must be in the future.endTime - startTime must be between 3600 and 604800 seconds (1h to 7d).tokenKind is 0x73ad2146 (ERC721) or 0x973bb640 (ERC1155).buyItNowPrice optional; startingBid optional (if nonzero, you must approve GHST for the 4% prepaid fee).cast call using --from "$FROM_ADDRESS".cast send only when explicitly instructed (DRY_RUN=0).(contractAddress, tokenId).Simulate create (ERC721 example):
~/.foundry/bin/cast call "$GBM_DIAMOND" \
'createAuction((uint80,uint80,uint56,uint8,bytes4,uint256,uint96,uint96),address,uint256)(uint256)' \
"(<START_TIME>,<END_TIME>,1,<CATEGORY>,0x73ad2146,<TOKEN_ID>,<BUY_NOW_GHST_WEI>,<STARTING_BID_GHST_WEI>)" \
"<ERC721_CONTRACT_ADDRESS>" "<PRESET_ID>" \
--from "$FROM_ADDRESS" \
--rpc-url "$BASE_MAINNET_RPC"
Broadcast create (only when explicitly instructed):
~/.foundry/bin/cast send "$GBM_DIAMOND" \
'createAuction((uint80,uint80,uint56,uint8,bytes4,uint256,uint96,uint96),address,uint256)(uint256)' \
"(<START_TIME>,<END_TIME>,1,<CATEGORY>,0x73ad2146,<TOKEN_ID>,<BUY_NOW_GHST_WEI>,<STARTING_BID_GHST_WEI>)" \
"<ERC721_CONTRACT_ADDRESS>" "<PRESET_ID>" \
--private-key "$PRIVATE_KEY" \
--rpc-url "$BASE_MAINNET_RPC"
Post-create (find your newest auctions and confirm):
curl -s "$GBM_SUBGRAPH_URL" -H 'content-type: application/json' ${GOLDSKY_API_KEY:+-H "Authorization: Bearer $GOLDSKY_API_KEY"} --data '{
"query":"query($seller:Bytes!){ auctions(first:10, orderBy: createdAt, orderDirection: desc, where:{seller:$seller}){ id type contractAddress tokenId quantity createdAt startsAt endsAt claimed cancelled } }",
"variables":{"seller":"<FROM_ADDRESS_LOWERCASE>"}
}'
Onchain method:
cancelAuction(uint256)Steps:
claimed, cancelled, endsAt, highestBid.getAuctionInfo(auctionId) to verify ownership and state.cast call (--from "$FROM_ADDRESS").Simulate:
~/.foundry/bin/cast call "$GBM_DIAMOND" 'cancelAuction(uint256)' "<AUCTION_ID>" \
--from "$FROM_ADDRESS" \
--rpc-url "$BASE_MAINNET_RPC"
Broadcast (only when explicitly instructed):
~/.foundry/bin/cast send "$GBM_DIAMOND" 'cancelAuction(uint256)' "<AUCTION_ID>" \
--private-key "$PRIVATE_KEY" \
--rpc-url "$BASE_MAINNET_RPC"
Onchain method:
commitBid(uint256,uint256,uint256,address,uint256,uint256,bytes) (last bytes is ignored; pass 0x)Steps:
highestBid and token params; you must pass the exact current onchain highestBid or it reverts UnmatchedHighestBid.references/bid-math.md (uses onchain bidDecimals + stepMin).bidAmount.cast call (optional but recommended).Simulate:
~/.foundry/bin/cast call "$GBM_DIAMOND" \
'commitBid(uint256,uint256,uint256,address,uint256,uint256,bytes)' \
"<AUCTION_ID>" "<BID_AMOUNT_GHST_WEI>" "<HIGHEST_BID_GHST_WEI>" "<TOKEN_CONTRACT_ADDRESS>" "<TOKEN_ID>" "<TOKEN_AMOUNT>" 0x \
--from "$FROM_ADDRESS" \
--rpc-url "$BASE_MAINNET_RPC"
Broadcast (only when explicitly instructed):
~/.foundry/bin/cast send "$GBM_DIAMOND" \
'commitBid(uint256,uint256,uint256,address,uint256,uint256,bytes)' \
"<AUCTION_ID>" "<BID_AMOUNT_GHST_WEI>" "<HIGHEST_BID_GHST_WEI>" "<TOKEN_CONTRACT_ADDRESS>" "<TOKEN_ID>" "<TOKEN_AMOUNT>" 0x \
--private-key "$PRIVATE_KEY" \
--rpc-url "$BASE_MAINNET_RPC"
Onchain method:
swapAndCommitBid((address,uint256,uint256,uint256,address,uint256,uint256,uint256,address,uint256,uint256,bytes))Struct fields (in order):
tokenIn (USDC)swapAmount (USDC 6dp)minGhstOut (GHST wei; must be >= bidAmount)swapDeadline (unix; must be <= now + 86400)recipient (refund receiver for excess GHST)auctionIDbidAmount (GHST wei)highestBid (must match onchain)tokenContracttokenIDamount (tokenAmount/quantity)_signature (ignored; pass 0x)Compute swapAmount estimate in references/swap-math.md.
Simulate:
~/.foundry/bin/cast call "$GBM_DIAMOND" \
'swapAndCommitBid((address,uint256,uint256,uint256,address,uint256,uint256,uint256,address,uint256,uint256,bytes))' \
"($USDC,<SWAP_AMOUNT_USDC_6DP>,<MIN_GHST_OUT_GHST_WEI>,<SWAP_DEADLINE_UNIX>,${RECIPIENT_ADDRESS:-$FROM_ADDRESS},<AUCTION_ID>,<BID_AMOUNT_GHST_WEI>,<HIGHEST_BID_GHST_WEI>,<TOKEN_CONTRACT_ADDRESS>,<TOKEN_ID>,<TOKEN_AMOUNT>,0x)" \
--from "$FROM_ADDRESS" \
--rpc-url "$BASE_MAINNET_RPC"
Broadcast (only when explicitly instructed):
~/.foundry/bin/cast send "$GBM_DIAMOND" \
'swapAndCommitBid((address,uint256,uint256,uint256,address,uint256,uint256,uint256,address,uint256,uint256,bytes))' \
"($USDC,<SWAP_AMOUNT_USDC_6DP>,<MIN_GHST_OUT_GHST_WEI>,<SWAP_DEADLINE_UNIX>,${RECIPIENT_ADDRESS:-$FROM_ADDRESS},<AUCTION_ID>,<BID_AMOUNT_GHST_WEI>,<HIGHEST_BID_GHST_WEI>,<TOKEN_CONTRACT_ADDRESS>,<TOKEN_ID>,<TOKEN_AMOUNT>,0x)" \
--private-key "$PRIVATE_KEY" \
--rpc-url "$BASE_MAINNET_RPC"
Same method as above, but:
tokenIn = 0x0000000000000000000000000000000000000000--value must equal the swapAmount you pass inside the tuple.Broadcast (only when explicitly instructed):
~/.foundry/bin/cast send "$GBM_DIAMOND" \
'swapAndCommitBid((address,uint256,uint256,uint256,address,uint256,uint256,uint256,address,uint256,uint256,bytes))' \
"(0x0000000000000000000000000000000000000000,<SWAP_AMOUNT_WEI>,<MIN_GHST_OUT_GHST_WEI>,<SWAP_DEADLINE_UNIX>,${RECIPIENT_ADDRESS:-$FROM_ADDRESS},<AUCTION_ID>,<BID_AMOUNT_GHST_WEI>,<HIGHEST_BID_GHST_WEI>,<TOKEN_CONTRACT_ADDRESS>,<TOKEN_ID>,<TOKEN_AMOUNT>,0x)" \
--value "<SWAP_AMOUNT_WEI>" \
--private-key "$PRIVATE_KEY" \
--rpc-url "$BASE_MAINNET_RPC"
Onchain methods:
claim(uint256)batchClaim(uint256[])Claim readiness:
now >= endsAt.now >= endsAt + cancellationTime.cancellationTime is readable from storage slot 12 (see references/recipes.md).claimAt (if populated), but always verify onchain.Simulate:
~/.foundry/bin/cast call "$GBM_DIAMOND" 'claim(uint256)' "<AUCTION_ID>" \
--from "$FROM_ADDRESS" \
--rpc-url "$BASE_MAINNET_RPC"
Broadcast (only when explicitly instructed):
~/.foundry/bin/cast send "$GBM_DIAMOND" 'claim(uint256)' "<AUCTION_ID>" \
--private-key "$PRIVATE_KEY" \
--rpc-url "$BASE_MAINNET_RPC"
Onchain methods:
buyNow(uint256)swapAndBuyNow((address,uint256,uint256,uint256,address,uint256))These are not required for the primary use case, but are adjacent to bidding flows. If you use them, follow the same safety gating:
cast call)auction, auctions, bid, bids):curl -s "$GBM_SUBGRAPH_URL" -H 'content-type: application/json' ${GOLDSKY_API_KEY:+-H "Authorization: Bearer $GOLDSKY_API_KEY"} --data '{ "query":"{ __schema { queryType { fields { name } } } }" }' \
| python3 -c 'import json,sys; f=[x[\"name\"] for x in json.load(sys.stdin)[\"data\"][\"__schema\"][\"queryType\"][\"fields\"]]; print([n for n in f if n in (\"auction\",\"auctions\",\"bid\",\"bids\")])'
curl -s "$GBM_SUBGRAPH_URL" -H 'content-type: application/json' ${GOLDSKY_API_KEY:+-H "Authorization: Bearer $GOLDSKY_API_KEY"} --data '{\"query\":\"query($id:ID!){ auction(id:$id){ id contractAddress tokenId } }\",\"variables\":{\"id\":\"0\"}}'
~/.foundry/bin/cast call "$GBM_DIAMOND" \
'getAuctionInfo(uint256)((address,uint96,address,uint88,uint88,bool,bool,address,(uint80,uint80,uint56,uint8,bytes4,uint256,uint96,uint96),(uint64,uint64,uint64,uint64,uint256),uint96,uint96))' \
0 \
--rpc-url "$BASE_MAINNET_RPC"
UnmatchedHighestBid: you passed a stale highestBid param. Refetch onchain and retry.InvalidAuctionParams: token contract / id / amount mismatch. Refetch and verify.AuctionNotStarted / AuctionEnded: timing mismatch. Check startsAt/endsAt (subgraph + onchain).AuctionClaimed: already claimed or cancelled. Check claimed (subgraph + onchain).BiddingNotAllowed: diamond paused, contract bidding disabled, or re-entrancy lock. Refetch onchain state.LibTokenSwap: swapAmount must be > 0LibTokenSwap: deadline expiredLibTokenSwap: Insufficient output amount (increase swapAmount or slippage)Generated Mar 1, 2026
An NFT marketplace integrates this skill to allow users to participate in Aavegotchi GBM auctions directly from their platform. It automates bidding and claiming processes, enhancing user engagement by providing real-time auction data and secure transaction execution. This reduces friction for users who want to acquire or sell Aavegotchi NFTs without leaving the marketplace interface.
A DeFi protocol uses this skill to enable users to bid on Aavegotchi NFTs as part of a yield farming strategy, where holding specific NFTs boosts rewards. It automates auction monitoring and bidding based on predefined criteria, optimizing capital allocation. This adds a gamified layer to yield farming, attracting users interested in both DeFi and NFT ecosystems.
A gaming guild employs this skill to manage Aavegotchi NFT auctions for its members, facilitating collective bidding on high-value assets to share ownership. It ensures secure, onchain verification and execution, minimizing risks of outbidding or errors. This streamlines asset acquisition for guilds, enabling efficient resource pooling and strategic investment in gaming assets.
A trading bot developer incorporates this skill to create automated systems that bid on Aavegotchi GBM auctions based on market trends and price signals. It leverages subgraph data for real-time auction discovery and onchain safety checks to prevent losses. This allows for high-frequency, algorithmic trading in the NFT space, targeting arbitrage opportunities and portfolio diversification.
An educational platform uses this skill as a hands-on example for teaching Web3 development, covering topics like subgraph queries, onchain interactions, and security best practices. Students learn to build and deploy similar tools, gaining practical experience with smart contracts and decentralized applications. This bridges the gap between theory and real-world application in blockchain education.
Offer a software-as-a-service platform where users subscribe to access automated bidding and management tools for Aavegotchi GBM auctions. Revenue is generated through monthly or annual subscription fees, with tiered plans based on features like advanced analytics or higher transaction limits. This model targets power users and institutions seeking efficiency and reliability in NFT trading.
Provide a service that charges a small percentage fee on each successful bid or claim transaction facilitated through the skill. Revenue is earned directly from user transactions, incentivizing the service to optimize success rates and security. This aligns with user interests by only charging when value is delivered, making it attractive for occasional traders and high-volume users alike.
License the skill to enterprises such as NFT marketplaces, DeFi platforms, or gaming companies for integration into their existing products. Revenue comes from one-time licensing fees or ongoing support contracts, tailored to the scale and customization needs of each client. This model leverages the skill's robust safety features and subgraph integration to enhance third-party offerings.
💬 Integration Tip
Ensure all environment variables are securely configured, especially PRIVATE_KEY and BASE_MAINNET_RPC, and always test with DRY_RUN=1 before broadcasting transactions to avoid costly errors.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.