stake-diem
Auto-stake — check sDIEM balance on-chain, claim FeeLocker + withdraw LP to restore Venice inference credits when low
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Auto-stake — check sDIEM balance on-chain, claim FeeLocker + withdraw LP to restore Venice inference credits when low
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Decide how to allocate DIEM between Venice compute staking, WETH swap for x402 API access, Uniswap LP, and Aerodrome LP. Run once per tick before any capital movement.
Read all agent on-chain positions via the check-portfolio.ts script. Use this instead of raw curl/cast calls to avoid hex encoding mistakes.
Claim DIEM from FeeLocker, run accumulate-vs-build analysis, and route earnings to LP or Venice staking. Scheduled every 12 hours via aeon. DRY-RUN BY DEFAULT — pass --live to execute.
Launch a Liquid Protocol token with a LiquidPresaleVault presale. STAKE MODE ONLY (policy 2026-06-12) — depositors lock DIEM and always get it back; allocation is lock-to-earn. One vault per launch, 10% of supply, 60d default lock.
Working in the deploy-autonomous GitHub template repo — agent harness, identity layer, Venice provider, safety modules, and the create-identity CLI.
Proactive health check — skill failures, LP state, memory flags, FeeLocker balance. Run 3× daily to surface issues before they compound.
| name | Stake DIEM |
| description | Auto-stake — check sDIEM balance on-chain, claim FeeLocker + withdraw LP to restore Venice inference credits when low |
| var | |
| tags | ["agent","on-chain","venice"] |
Keep the agent's Venice inference credits funded by checking sDIEM on-chain and
topping up whenever the balance falls below stake_min_diem in aeon.yml.
This skill runs without Venice inference credits — all actions are on-chain
reads + a script execution. It must be able to run even when sDIEM = 0.
stake_min_diem: 5 # stake if sDIEM < this
stake_target_diem: 20 # target balance after top-up
Read these values now:
STAKE_MIN=$(grep 'stake_min_diem:' aeon.yml | awk '{print $2}' | tr -d ' ')
STAKE_TARGET=$(grep 'stake_target_diem:' aeon.yml | awk '{print $2}' | tr -d ' ')
STAKE_MIN="${STAKE_MIN:-5}"
STAKE_TARGET="${STAKE_TARGET:-20}"
Read the active LP token IDs from memory/lp-positions.json (preferred) or fall
back to scanning the last 7 days of memory/logs/ for a line matching
tokenId=<number>. Use the highest-liquidity position.
LP_TOKEN_ID=$(node --import tsx -e "
import { readFileSync } from 'fs';
try {
const pos = JSON.parse(readFileSync('memory/lp-positions.json','utf8'));
const best = pos.positions?.sort((a,b) => BigInt(b.liquidity||0) > BigInt(a.liquidity||0) ? 1 : -1)[0];
if (best?.tokenId) { process.stdout.write(String(best.tokenId)); }
} catch { /* no file */ }
" 2>/dev/null)
Read stakedInfos on-chain for the agent wallet without needing any API key:
RPC_URL="${RPC_URL:-https://mainnet.base.org}"
AGENT_WALLET=$(grep '"wallet"' platform/registry.json | grep -o '"0x[^"]*"' | tr -d '"' | head -1)
# Call stakedInfos(address) on DIEM contract (0x940181a94A35A4569E4529A3CDfB74e38FD98631)
# selector = keccak256("stakedInfos(address)")[0:4] = 0x9b7ef7b3 (verify on-chain)
PAYLOAD="0x9b7ef7b3$(printf '%064s' "${AGENT_WALLET#0x}" | tr ' ' '0')"
RESULT=$(curl -s -X POST "$RPC_URL" \
-H "Content-Type: application/json" \
-d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_call\",\"params\":[{\"to\":\"0x940181a94A35A4569E4529A3CDfB74e38FD98631\",\"data\":\"$PAYLOAD\"},\"latest\"]}" \
| grep -o '"result":"[^"]*"' | cut -d'"' -f4)
# amountStaked is first 32-byte word (wei, 18 decimals)
STAKED_WEI="0x${RESULT:2:64}"
STAKED_DIEM=$(node -e "console.log((BigInt('$STAKED_WEI') / BigInt('1000000000000000000')).toString())" 2>/dev/null || echo "0")
echo "sDIEM staked: $STAKED_DIEM"
If STAKED_DIEM >= STAKE_MIN: log STAKE_DIEM_OK (staked=$STAKED_DIEM, min=$STAKE_MIN) and exit without staking. No notification needed.
npx tsx scripts/stake-diem.ts --target "$STAKE_TARGET" ${LP_TOKEN_ID:+--token-id "$LP_TOKEN_ID"}
This is a dry-run. Read the output to confirm:
If total available DIEM < 1, log STAKE_DIEM_SKIP (reason=insufficient_diem) and notify:
⚠️ stake-diem: sDIEM low ($STAKED_DIEM < $STAKE_MIN) but insufficient DIEM available to stake. Manual top-up required.
Then exit.
npx tsx scripts/stake-diem.ts --target "$STAKE_TARGET" ${LP_TOKEN_ID:+--token-id "$LP_TOKEN_ID"} --live
Capture the exit code. On success (exit 0):
stakedInfos as in Step 1 to confirm new balance.memory/logs/${today}.md:
stake-diem: staked ${new_amount} DIEM | sDIEM ${old} → ${new} | tx: ${hash}
✅ stake-diem: topped up to ${new_staked} sDIEM — Venice inference credits restored.
On failure (non-zero exit):
memory/logs/${today}.md.❌ stake-diem: FAILED — check memory/logs/${today}.md. sDIEM still $STAKED_DIEM.
| Condition | Action |
|---|---|
sDIEM ≥ stake_min_diem | Log OK, exit 0, no notify |
| sDIEM low, DIEM available | Execute stake live, log + notify result |
| sDIEM low, no DIEM | Log SKIP, notify warning |
| Tx fails | Log error, notify failure |
PRIVY_* or AGENT_PRIVATE_KEY env vars already set by the workflow.https://mainnet.base.org automatically.AGENT_WALLET in Step 1 reads from platform/registry.json — no hardcoded addresses.