Lend from your wallet, borrow cheaper as a verified human, and get liquidated only as much as needed
AquaPrime is a zero-custody credit market built on 1inch Aqua and SwapVM, designed around two simple principles: lenders should never have to lock capital into a custodial pool, and borrowers should never be wiped out by blunt liquidations.
Traditional lending protocols force liquidity providers to deposit assets into shared smart contract vaults, creating systemic honeypots and fragmented capital. AquaPrime eliminates deposits entirely by leveraging 1inch Aqua’s balance virtualization. A lender’s capital stays securely in their own wallet, where a single signature allows the same USDC to simultaneously back three live strategies: an under-collateralized credit line, a liquidation backstop, and an AMM. This achieves three times the capital efficiency with zero dollars sitting idle in contracts. Capital moves only at the exact microsecond a borrower draws a loan: aqua.pull routes USDC straight from the lender’s wallet to the borrower, and repayments flow directly back via aqua.push.
When positions go underwater, legacy protocols punish borrowers by dumping fifty to one hundred percent of their position at fixed penalties. AquaPrime replaces this with a mathematical scalpel inside the execution engine. We engineered a custom SwapVM opcode, 0xf0 (SolvencyDutchGuard), which dynamically calculates and auctions only the precise slice of collateral required to restore a position to a safe 1.02 health factor. It executes a Dutch auction ramping from a 1.5% to 6% discount over ten minutes, then asserts post-trade invariants to revert any fill exceeding the surgical cap. In our full-lifecycle integration tests, an insolvent borrower lost only 2.0 WETH out of 10, compared to roughly 4.6 WETH seized under standard close-factor rules. A second custom opcode, 0xf1 (OracleBackstopBid), lets LPs post standing oracle-priced bids that absorb this seized collateral, enabling keepers to execute zero-capital flash rescues across both orders in a single atomic transaction.
To protect the protocol without invasive identity checks, we integrated World ID Proof of Human through IDKit. Verified humans unlock an 115% collateral tier alongside a three-minute grace window, compared to 150% for anonymous accounts. The proof is verified against World’s Developer Portal API and permanently attested on-chain via EIP-712, preventing Sybil attackers from farming the lower tier with multiple wallets while requiring zero KYC.
For autonomous liquidation keepers, we introduced a cryptographic human-in-the-loop checkpoint using World ID Agent Pass. When an agent identifies an underwater position, it stages the auction and pauses. Before spending its hot key, it requires fresh human authorization via an OIDC step-up flow with PKCE, max_age=0, and an essential biometric authentication claim. The approval is bound to the exact borrower and action for 120 seconds. If cancelled, expired, or replayed, the backend fails closed with an HTTP 403 and refuses to broadcast. Because World’s enterprise portal gates production registration, the demo exercises our production-grade validation code against a standards-compliant local login server clearly identified in the interface.
Privacy is enforced at the network layer. Every JSON-RPC read the browser makes—including balances, health factors, and simulated SwapVM quotes, is routed through the Ethereum Foundation Anon-RPC Nox mixnet in a sandboxed, null-origin iframe. This closes a critical MEV attack vector where node operators surveil read queries to front-run profitable liquidations. The implementation is fail-closed, surfacing a clear notice rather than silently leaking traffic over cleartext if the mixnet drops.
AquaPrime is fully deployed on Ethereum Sepolia against the canonical 1inch Aqua contract, native Circle USDC, and Chainlink ETH/USD, with all five contracts verified on Sourcify. The system is backed by 43 contract tests including a 40-position property test of the surgical math, 19 frontend unit tests, and an end-to-end browser test validating the complete lifecycle. The protocol generates sustainable revenue through a 10% reserve factor on interest and a 0.5% protocol fee on liquidated collateral, all without ever taking custody of user funds.
Pitch: https://aquaprime-1.vercel.app/pitch
AquaPrime was engineered from the ground up to push the boundaries of 1inch Aqua and SwapVM, combining low-level EVM assembly and bytecode manipulation with zero-knowledge identity and privacy-preserving networking.
At the smart contract layer (Solidity 0.8.30, Hardhat, viaIR, Cancun EVM), we consume the canonical 1inch Aqua contract directly and redeployed the core SwapVM engine as AquaPrimeRouter. We overrode the router’s internal dispatch logic to inject an AquaPrime-specific opcode bank. Our primary custom instruction, 0xf0 (SolvencyDutchGuard), wraps the stock LimitSwap curve using a sandwich pattern: it invokes the VM execution loop from within itself. Before the curve runs, it asserts that the position is truly insolvent and that any human grace window has elapsed, then mathematically clamps the VM registers (balanceIn and balanceOut) to the exact surgical slice derived from x = (T·R·D − V)(1−d) / (T·R(1−d) − (1+f)). After the curve executes, it checks the filled amounts and reverts the entire transaction with SurgicalCapExceeded if the taker extracted more than the computed slice. Our second custom instruction, 0xf1 (OracleBackstopBid), allows liquidity providers to maintain a standing, oracle-priced bid directly from their wallet at a slight discount.
The core lending market lives in CreditPositionRegistry, which inherits from AquaApp. Credit lines are native Aqua strategies shipped by lenders: borrowing triggers aqua.pull to draw funds directly from the lender’s wallet to the borrower, while repayments route back via aqua.push. When a position falls underwater, the registry dynamically ships a one-off 0xf0 auction order into Aqua. Upon execution, SwapVM’s postTransferIn maker hook executes on the registry to burn debt and distribute protocol fees. Our LiquidationExecutor contract ties the entire liquidation loop together in a single atomic transaction: it fills the 0xf0 auction, sells the seized collateral into the LP’s 0xf1 backstop order inside SwapVM’s pre-transfer-in callback, and settles the debt through Aqua, enabling keepers to execute liquidations with zero upfront capital.
We encountered several non-trivial engineering hurdles while building this. First, both our router and registry initially exceeded the 24.576 KB EIP-170 contract size limit. We resolved this by hand-crafting an AquaOpcodes-compatible dispatch table (retaining only essential controls, decay, fee, and limit instructions), correcting opcode numbering collisions between stock SwapVM and AquaSwapVM (such as conflicting salt indices), and modularizing off-chain order construction into an external StrategyBuilder contract. Second, integer rounding dust in collateral accounting previously prevented completely liquidated positions from closing, causing bad debt to go unrecorded; we implemented a sweep threshold to clean dust and accurately book shortfall debt. To guarantee mathematical solvency under all market conditions, we wrote a 40-position property test verifying that the surgical formula always restores health factors between 1.00 and 1.03 regardless of price volatility.
For identity, we integrated World ID 4.0 IDKit using proofOfHuman credentials with an RP-signed request. Proofs are validated server-side against World’s v4 Developer Portal API, binding the proof’s signal hash directly to the borrower's wallet. The backend then issues an EIP-712 attestation that the registry verifies on-chain, permanently storing a one-to-one mapping between nullifier and wallet without collecting personal data. During integration, we hit a subtle responsive bug where the stock IDKit modal collapsed into a mobile layout on screens 1024 pixels or narrower, inadvertently redirecting desktop laptop users to world.org; we resolved this by rebuilding the panel on IDKit’s headless useIDKitRequest hook, allowing our staging environment to open the World ID Simulator directly with the pre-loaded connect URL. For keeper security, we implemented the World ID Agent Pass specification as a full OIDC step-up flow featuring PKCE S256, max_age=0, essential biometric acr claims, and strict nonce freshness, binding single-use approvals to specific borrower actions for 120 seconds.
Privacy is integrated at the transport layer via Ethereum Foundation Anon-RPC. Using @anon-rpc/browser-harness, we run a hash-pinned Nox mixnet worker inside a sandboxed, null-origin iframe, routing all Viem contract reads through it with fail-closed security. During high-concurrency testing, public RPC rate limits occasionally broke the worker bootstrap; we engineered an ordered multi-RPC fallback mechanism that rotates the exit node's target provider while keeping all client traffic sealed inside the mixnet. On the server side, Next.js was aggressively caching chain reads across restarts; we enforced explicit no-store policies across all internal RPC fetch handlers to ensure instant state freshness.
The frontend is built with Next.js 14, Viem, Wagmi, Tailwind, and Framer Motion. It features an interactive hero ocean powered by a custom GLSL shader in React Three Fiber (complete with Gerstner wave displacement, Fresnel sky reflections, and cursor wake physics), an animated canvas visualizer demonstrating virtual liquidity allocations across strategies, an interactive risk simulator matching the contract's fixed-point math, and a live SwapVM bytecode inspector that disassembles order instructions and reveals register transformations before and after 0xf0 execution. The entire system is backed by a one-command local orchestration script, a Playwright browser automation suite validating the complete borrower and rescue lifecycle, and a deterministic background keeper agent scanning blocks for liquidatable positions.

