Skip to Content
Maintenance & Bots

Maintenance and bots

Two categories of upkeep:

  • Permissionless bounded upkeep — MaintenanceHub
  • Opt-in compounding — per-user best-effort keepers

Policy: No official crown-taking bot shipped.

Self-run agents (bot-owned wallets)

A self-run agent plays from its own wallet (EOA or smart contract):

  • no DelegationHub sessions
  • no custody of user funds
  • simplest integration surface (agent owns positions and rewards)

Recommended tooling:

Operational defaults:

  • simulate before sending
  • cap spend for takeovers
  • use conservative slippage floors and short deadlines

Opt-in delegated bots (DelegationHub sessions)

DelegationHub enables session-based delegation for user opt-in automation.

Why this exists:

  • a bot can execute actions for a user address without taking custody
  • sessions are time-limited and revocable
  • protocol contracts enforce permissions onchain via DelegationHub.isAuthorized(...)

Session shape:

  • delegate (bot executor)
  • perms (bitmask)
  • expiry (unix seconds)

Common delegated tasks:

TaskContract methodRequired permission
Take over Crown for a userMineCore.takeoverFor(user)P_TAKEOVER_FOR
Update reign payout routingMineCore.setCurrentReignRecipients(...)P_SET_REIGN_ETH_RECIPIENT / P_SET_REIGN_ETH_RECIPIENT_TO_CALLER_ONLY and/or P_SET_REIGN_CLAIM_RECIPIENT / P_SET_REIGN_CLAIM_RECIPIENT_TO_USER_ONLY
Claim Barons rewardsClaimAllHelper.claimShareholderForUser(user, ...)P_CLAIM_SHAREHOLDER_FOR
Withdraw King fallback bucketClaimAllHelper.withdrawKingBalanceForUser(user)P_WITHDRAW_KING_BUCKET_FOR
Claim all (bundle)ClaimAllHelper.claimAllFor(user, ...)P_CLAIM_ALL_FOR
Enter Furnace for a user (bot pays)Furnace.enterWithEthFor(user, ...)P_FURNACE_ENTER_ETH_FOR
Maintain veCLAIM lock (extend)VeClaimNFT.extendLockForUser(user, tokenId, ...)P_VE_EXTEND_LOCK_FOR
Maintain veCLAIM locks (merge)VeClaimNFT.mergeLocksForUser(user, fromTokenId, intoTokenId)P_VE_MERGE_LOCKS_FOR
Unlock expired veCLAIM lockVeClaimNFT.unlockExpiredForUser(user, tokenId)P_VE_UNLOCK_EXPIRED_FOR
Update King auto-lock configMineCore.setKingAutoLockConfigForUser(user, ...)P_SET_KING_AUTO_LOCK_CONFIG_FOR
Update Barons auto-compound configShareholderRoyalties.setAutoCompoundConfigForUser(user, ...)P_SET_SHAREHOLDER_AUTOCOMPOUND_CONFIG_FOR
Update vault auto-compound configLpStakingVault7D.setAutoCompoundConfigForUser(user, ...)P_SET_LP_AUTOCOMPOUND_CONFIG_FOR

Notes:

  • Delegated takeover defaults to routing the dethroned-King 75% ETH payout to the bot executor (to support looping).
  • King-stream mined CLAIM stays with the user unless the session grants P_ROUTE_REIGN_CLAIM_TO_CALLER.
  • Under contention, reverts are normal. Read price right before sending and avoid leaving txs pending for long.

Next reads:

MaintenanceHub.poke

Signature: poke(PokeArgs args)

PokeArgs (ABI order):

FieldPurpose
offerIds: uint256[]Buy intent IDs (bonus target escrows) to execute
maxOffers: uint256Clamped to MAX_MAINTENANCE_OFFERS_PER_CALL=25
deadline: uint256Aerodrome swap deadline
minClaimOutStaking: uint256Slippage for staking harvest swap

What poke does (best-effort, never reverts on subcall failure):

  1. MarketRouter: executeAutoFurnace for up to N escrowIds
  2. VeClaimNFT: checkpointGlobalState() + checkpointTotalVe()
  3. ShareholderRoyalties: flushPendingShareholderETH()
  4. Furnace: tick() — accrues LP rewards stream and overflow drip
  5. LpStakingVault7D: harvestFeesToRewards(deadline, minClaimOut)
  6. Forward any WETH bounty to caller

Keeper patterns

TaskMethodBound
Shareholder auto-compoundShareholderRoyalties.compoundForMany(users[])25 users/call
Vault auto-compoundLpStakingVault7D.compoundForMany(users[])25 users/call
Settle listed locksMarketRouter.sellListedLockToFurnace(tokenId)25 listings/sweep
Cancel expired listingsMarketRouter.cancelExpiredListing(tokenId)25 listings/sweep
Expire buy intents (bonus target escrows)MarketRouter.cancelExpiredBonusTargetEscrow(offerId)25 intents/sweep

Sweep listings task

Settles Market listings (limit sells) when the net payout meets or exceeds the seller’s Minimum payout (minClaimOut):

  1. Scan for LockListed events to find active listings (track expiresAtTime)
  2. If block.timestamp > expiresAtTime: call cancelExpiredListing(tokenId) (permissionless cleanup)
  3. Otherwise, compute a net payout from the live quote (after duration penalty) and check if claimOutNet >= minClaimOut
  4. Call sellListedLockToFurnace(tokenId) to settle

Expire buy intents task

Cancels expired Buy intents (bonus target escrows) and refunds remaining budget to buyers:

  1. Scan for active buy intents via bonus target escrow events
  2. Check if block.timestamp > intent.expiresAt
  3. Call cancelExpiredBonusTargetEscrow(offerId) to refund

Guidance:

  • Treat compound calls as best-effort
  • Surface pause reasons in UX
  • Use conservative minVeOut from Furnace quotes

Slippage and deadlines

ConceptUsage
minClaimOutAerodrome swaps (harvest paths)
minVeOutFurnace entry / compounding paths

Typical defaults:

  • Swap slippage: 0.5–1%
  • ve slippage: 0.5–1%
  • Deadline: now + 120s