Loops HouseKINU LP Guardian

NEAR HACKATHON
Links
Team
1 member- DEOwner
Deni Gian
Overview
KINU LP Guardian looks after a Rhea concentrated liquidity position on NEAR: an agent moves the range back when the price leaves it and closes the position at the loss the owner chose, without ever holding the owner's keys. The owner can take everything out in one approval at any time, without KINU, the agent or the contract owner, also while paused.
The problem: a range earns only while the price is inside it, so it needs constant care, and automating that usually means giving a bot a key that can take the funds.
How NEAR closes that gap, live on mainnet at lp.kinuonnear.near (v1.8):
- Function-call keys: the protocol limits the agent's key to three methods on one contract (poke, request_rebalance, exit); transfers are refused by NEAR itself.
- The contract checks every argument against the user's on-chain rules: allowed pools, range width, distance from the live price, actions per window, slippage, and a price it read itself 3 to 60 minutes earlier, so one pushed price cannot trigger a move. Payouts go only to the record's own wallet.
- The agent runs in an OutLayer TEE; its key is bound to the published, reproducible build, and Intel's attestation proves which wasm ran.
- The contract account has no key. The owner is a 2-of-3 Sputnik DAO and every upgrade waits 48 hours in public; a pauser can stop new starts, never the ways out.
The stop loss is counted from the owner's capital (each deposit at its own price), and the page shows capital, value, fees and the result against holding.
We ran the attack on mainnet: a valid agent key in an attacker's hands made 18 attempts to move funds, change rules, cash out and take over; all 18 were refused, each with a transaction link. The agent's first real re-centre on v1.8 is on chain too. Every test suite runs against the exact Rhea code from mainnet, and ./scripts/verify.sh checks all of this against mainnet with no keys.