An AI-Powered Liquid Staking and CDP(Collateralized Debt Position) Protocol on Sui
Octopus Finance is the first AI-protected Liquid Staking CDP (Collateralized Debt Position) protocol built natively on Sui Network. We solve DeFi's critical capital efficiency problem: when users stake assets to earn yield, their capital becomes locked and unusable in other protocols. Traditional CDP platforms compound this by exposing users to constant liquidation risk, forcing them to monitor positions 24/7 or lose their collateral while they sleep. Our solution has three core innovations:
**The protocol features a Walrus-powered Strategy Marketplace where users can clone proven vault management strategies with verifiable track records. Each strategy includes complete backtests, performance history, and AI model weights—all stored immutably on Walrus decentralized storage. Users can apply strategies like "Conservative Yield" (23% APY, low risk) or "Degen Max" (45% APY, high risk) with one click.
Real-world impact: Traditional CDP users lose 10-20% potential yield annually due to over-collateralization fears and liquidation risks. Octopus users maintain healthy positions automatically, compound rewards continuously, and utilize capital across multiple yield opportunities simultaneously. A user with 10,000 SUI can now earn staking rewards + borrow against that same capital + deploy borrowed funds into additional yield strategies—all while sleeping soundly knowing AI agents protect their positions.
Octopus Finance exploits Sui's parallel execution and ultra-low transaction fees to build a highly performant, low-latency AI-protected CDP protocol that's impossible on traditional blockchains.
🔷 Smart Contract Architecture (Sui Move)
We deployed 5 core Move modules to Sui testnet:
liquid_staking.move - Integrates directly with Sui's native staking validators. Users stake SUI and receive octSUI liquid tokens at 1:1 ratio with automatic reward accrual. The exchange rate mechanism adjusts based on accumulated staking yield (~7% APY).
vault_manager.move - ERC4626-style CDP core where each vault is a unique Sui Object. This object-centric design enables true parallel execution—AI agents rebalance 100+ vaults simultaneously without state conflicts. Calculates health factors: (collateral_value × liquidation_threshold) / debt_value. Minimum health factor: 1.0, AI triggers at 1.35.
liquidation.move - Capital-efficient flash liquidations via Programmable Transaction Blocks (PTBs). Atomic execution: borrow octUSD → repay vault debt → seize collateral → swap on Cetus DEX → repay loan + 3% keeper reward. Single transaction or full revert.
ai_adapter.move - Capability-based AI authorization using Sui's security model. Mints AICapability objects with granular permissions (rebalance, compound, emergency_exit) and rate limiting (48 actions/day max). Fully revocable by vault owners.
strategy_registry.move - Stores only 32-byte Walrus blob IDs on-chain, referencing full strategy configurations (500KB+ each) stored on Walrus. Reduces on-chain storage costs by 99%.
Why Sui's Architecture Is Critical:
Sui's parallel execution lets AI agents process 100+ vaults concurrently without serialization bottlenecks. Ethereum would process these sequentially, creating dangerous delays during high volatility.
Sui's low transaction fees (pennies vs. $50+/day on Ethereum) make our AI agents economically viable. Checking vaults every 5 minutes and executing frequent rebalances would be cost-prohibitive on high-fee chains.
Programmable Transaction Blocks enable atomic multi-step operations. We bundle stake → open_vault → borrow → authorize_ai in ONE transaction (4 separate txs on Ethereum with frontrunning risks).
This combination delivers low-latency rebalancing (<30 second response time from price drop to AI action) that prevents liquidations before they happen.
🔷 AI Agent System (TypeScript + Eliza Framework)
Vault Manager Agent - Polls all vaults every 5 minutes via Sui RPC. When health factor drops below 1.35:
Liquidation Keeper Agent - Custom Gemini Agent predicts liquidation probability from: price volatility, time patterns, volume changes, sentiment. When probability >85% and health <1.0, executes flash liquidation. Model improved keeper profitability by 34%.
🔷 Walrus Integration - For Stategy Storage
Walrus stores three critical data types:
Strategy Templates - 500KB+ configurations (rebalance thresholds, backtest results, risk parameters). On-chain storage would cost ~0.5 SUI per strategy; Walrus costs <0.01 SUI with immutability preserved.
Liquidation Proofs - Immutable snapshots (pre-liquidation prices, vault state, tx hash) for dispute resolution. Users can verify exact conditions at liquidation time.
AI Model Weights - 100MB XGBoost model stored once, loaded by all keepers. Enables community-trained models—anyone can upload better models.
The Hack: Walrus lacks native Sui SDK, so we built a Cloudflare Workers bridge service that uploads via Walrus HTTP API and writes blob IDs to Sui contracts. 99.9% uptime, seamless integration.
🔷 Frontend (Next.js 14 + Sui TypeScript SDK)

