| name | lidogent |
|---|---|
| description | Use when a request involves staking ETH via Lido, wrapping stETH to wstETH, managing AI agent yield-bearing budgets, or interacting with the AgentTreasury smart contract on Ethereum Mainnet. |
You are an AI agent with access to a yield-bearing operating budget powered by Lido stETH staking. Your principal is locked in the AgentTreasury contract, and you can only spend from accrued yield. All spending is enforced onchain.
- Stake ETH to receive stETH via Lido
- Wrap stETH to wstETH and lock as principal in AgentTreasury
- Spend yield (wstETH) to pay for AI services (Claude, ChatGPT, Gemini, Perplexity)
- Query your available yield, principal, and spending history
- Manage sub-agent budgets and permissions
| Contract | Address |
|---|---|
| AgentTreasury | 0x783e1512bFEa7C8B51A92cB150FEb5A04b91E9Aa |
| Lido stETH | 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 |
| wstETH | 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 |
| Chainlink ETH/USD | 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 |
- Human deposits ETH → Lido stakes it → receives stETH
- stETH is wrapped to wstETH (non-rebasing) via Lido wstETH contract
- wstETH is locked as principal in AgentTreasury
- Over time,
stEthPerToken()increases as Lido distributes staking rewards - Yield = current stETH value of wstETH - initial value at deposit - total spent
- Agent can only spend the yield portion — principal is structurally inaccessible
Current APR: fetched from https://eth-api.lido.fi/v1/protocol/steth/apr/last
getAvailableYield() → uint256 // Spendable yield in wstETH
getCurrentValue() → uint256 // Current stETH value of all wstETH
principalWstETH() → uint256 // Locked principal
totalSpentWstETH() → uint256 // Cumulative spent
paused() → bool // Is spending frozen
getCycleInfo() → (duration, spent, limit, resetAt)
getSubAgentRemaining(address) → uint256spend(address to, uint256 wstETHAmount) // Send yield to whitelisted recipientsetParentAgent(address)
addSubAgent(address, uint256 budgetCap)
pauseSubAgent(address) / resumeSubAgent(address)
setWhitelistEnabled(bool) / setWhitelist(address, bool)
setCapEnabled(bool) / setPerTxCap(uint256)
setRateLimitEnabled(bool) / setCycleLimit(uint256)
pause() / unpause()
withdrawPrincipal(uint256)All enforced at the smart contract level:
- Whitelist — When enabled, agent can only send to approved addresses
- Per-Transaction Cap — Maximum wstETH per single spend
- Cycle Rate Limit — Maximum total wstETH per cycle (e.g. 30 days)
- Sub-Agent Budget — Each sub-agent has its own cap, resets per cycle
- Pause — Owner can freeze all spending instantly
User sends ETH → Lido.submit() → receives stETH
1. Approve stETH to wstETH contract (0x7f39...)
2. wstETH.wrap(stETHAmount) → receives wstETH
3. Approve wstETH to AgentTreasury (0x783e...)
4. AgentTreasury.depositWstETH(amount) → principal locked
AgentTreasury.depositETH{value: amount}() → auto-stakes + wraps + locks
- User selects AI model (Claude, ChatGPT, Gemini, Perplexity)
- User sends message → backend proxies to OpenRouter API
- AI responds → cost deducted from agent's yield balance
- Activity logged to localStorage for tracking
API endpoint: POST /api/chat
{
"model": "claude",
"messages": [{"role": "user", "content": "..."}]
}| Data | Source | Type |
|---|---|---|
| ETH price | Chainlink ETH/USD (0x5f4e...) | Onchain |
| stETH APR | Lido API (eth-api.lido.fi) | API |
| Principal | AgentTreasury.principalWstETH() | Onchain |
| Yield | AgentTreasury.getAvailableYield() | Onchain |
| Total spent | AgentTreasury.totalSpentWstETH() | Onchain |
| stETH balance | ERC20.balanceOf() | Onchain |
| wstETH rate | wstETH.stEthPerToken() | Onchain |
| ETH balance | Native balance query | Onchain |
- Principal is never accessible to the agent — no function exists
- Only yield is spendable — enforced by smart contract math
- All permissions onchain — whitelist, caps, rate limits
- No mocks — all contracts deployed and verified on Ethereum Mainnet
- Non-rebasing — uses wstETH for clean yield accounting
- Public deposits — anyone can fund the treasury
- stETH Integration Guide — rebasing drift is the key section
- wstETH Contract Docs
- Lido Deployed Contracts
- Lido JS SDK