LeoYeAI/agent-master-skills / skills/aavegotchi-gbm-skill
aavegotchi-gbm-skill
VerifiedView, create, cancel, bid, and claim Aavegotchi GBM auctions on Base mainnet (8453). Subgraph-first discovery (Goldsky), with onchain verification + execution via Foundry cast. Safety-first: DRY_RUN defaults to 1 (simulate with cast call; only broadcast with cast send when DRY_RUN=0 and explicitly instructed).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 16.3 KB |
| _meta.json | config | 299 B |
| references/addresses.md | markdown | 1.7 KB |
| references/bid-math.md | markdown | 1.8 KB |
| references/logs.md | markdown | 1.7 KB |
| references/presets.md | markdown | 1.1 KB |
| references/recipes.md | markdown | 3.8 KB |
| references/subgraph.md | markdown | 3.3 KB |
| references/swap-math.md | markdown | 2.8 KB |
references/swap-math.md
View on GitHub# Swap Amount Math (USDC / ETH -> GHST)
This file defines how to estimate the `swapAmount` argument for:
- `swapAndCommitBid((...))`
- `swapAndBuyNow((...))`
Important notes:
- `swapAmount` is the amount of `tokenIn` you will spend (USDC 6dp or ETH wei).
- `minGhstOut` is a GHST wei minimum output (slippage protection). For bidding and buy-now, set it to the exact required GHST amount:
- bid: `minGhstOut = bidAmount`
- buy-now: `minGhstOut = buyNowPrice`
- Swaps can still fail due to price impact or route conditions (`LibTokenSwap: Insufficient output amount`). If that happens, increase `swapAmount` and/or `SLIPPAGE_PCT`.
Defaults:
- `SLIPPAGE_PCT=1` (1%)
## Price Sources (CoinGecko)
If `GHST_USD_PRICE` / `ETH_USD_PRICE` are unset, fetch them:
```bash
curl -s 'https://api.coingecko.com/api/v3/simple/price?ids=aavegotchi,ethereum&vs_currencies=usd' \
| python3 -c 'import json,sys; j=json.load(sys.stdin); print(\"GHST_USD\", j[\"aavegotchi\"][\"usd\"]); print(\"ETH_USD\", j[\"ethereum\"][\"usd\"])'
```
## USDC swapAmount (6 decimals)
Given:
- `min_ghst_out_wei` (bidAmount or buyNowPrice)
- `ghst_usd_price`
Compute:
1. `ghst = min_ghst_out_wei / 1e18`
2. `usd = ghst * ghst_usd_price`
3. `base_usdc_6dp = usd * 1e6`
4. `swapAmount = ceil(base_usdc_6dp * (1 + SLIPPAGE_PCT/100))`
Python reference:
```bash
python3 - <<'PY'
from decimal import Decimal, getcontext, ROUND_CEILING
getcontext().prec = 80
min_ghst_out_wei = Decimal("<MIN_GHST_OUT_GHST_WEI>") # replace
ghst_usd_price = Decimal("<GHST_USD_PRICE>") # replace
slippage_pct = Decimal("<SLIPPAGE_PCT>") # default 1
ghst = min_ghst_out_wei / (Decimal(10) ** 18)
usd = ghst * ghst_usd_price
base_usdc = usd * (Decimal(10) ** 6)
swap_amount = (base_usdc * (Decimal(1) + slippage_pct / Decimal(100))).to_integral_value(rounding=ROUND_CEILING)
print("swapAmount (USDC 6dp):", int(swap_amount))
PY
```
## ETH swapAmount (wei)
Given:
- `min_ghst_out_wei`
- `ghst_usd_price`
- `eth_usd_price`
Compute:
1. `ghst = min_ghst_out_wei / 1e18`
2. `usd = ghst * ghst_usd_price`
3. `eth = usd / eth_usd_price`
4. `base_eth_wei = eth * 1e18`
5. `swapAmountWei = ceil(base_eth_wei * (1 + SLIPPAGE_PCT/100))`
Python reference:
```bash
python3 - <<'PY'
from decimal import Decimal, getcontext, ROUND_CEILING
getcontext().prec = 80
min_ghst_out_wei = Decimal("<MIN_GHST_OUT_GHST_WEI>") # replace
ghst_usd_price = Decimal("<GHST_USD_PRICE>") # replace
eth_usd_price = Decimal("<ETH_USD_PRICE>") # replace
slippage_pct = Decimal("<SLIPPAGE_PCT>") # default 1
ghst = min_ghst_out_wei / (Decimal(10) ** 18)
usd = ghst * ghst_usd_price
eth = usd / eth_usd_price
base_eth_wei = eth * (Decimal(10) ** 18)
swap_amount = (base_eth_wei * (Decimal(1) + slippage_pct / Decimal(100))).to_integral_value(rounding=ROUND_CEILING)
print("swapAmount (ETH wei):", int(swap_amount))
PY
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |