wave

1inch built a swap-strategy VM with no compiler. We wrote it and a feed where likes are capital.

wave

Created At

ETHGlobal Lisbon 2026

Project Description

Wave is a social market for on-chain market-making strategies, built on 1inch SwapVM. Traditional social networks measure vanity metrics—likes, follows, views. These signals cost nothing to produce, so they ultimately hold little value, which is why social graphs are flooded with bots. Wave measures something different: capital. On-chain, the only endorsement that cannot be faked is one that requires real money. On Wave, a “like” is the liquidity committed behind a strategy. The feed is powered by a The Graph subgraph, and each profile is represented by an ENS name. 1inch introduced a virtual machine where market-making strategies exist as bytecode rather than deployed contracts, settling live on Aqua. However, no compiler was provided. Wave fills this gap by shipping both a compiler and a social market around it. A strategist can express intent in plain language, for example: “keep ETH/USDC balanced, halt if Chainlink deviates 1.5%.” An LLM parses this intent into a bounded, schema-validated format. From there, a deterministic TypeScript compiler transforms it into verified SwapVM bytecode, with a reject-and-rewrite safety mechanism. The resulting strategy is deployed live on Aqua (Sepolia), assigned an ENS subname containing its program hash, and published in an X-style feed. Ranking is driven by a real, on-chain-based algorithm: returnPct × recency × log(followers) Every metric is sourced from the blockchain or ENS. There is no traditional database. If the subgraph stops, strategy cards lose their stats but remain visible. If ENS stops, the feed becomes empty. The result is a system where a simple sentence becomes a live, self-adjusting market maker—and where strategies that attract real capital rise to the top, because reputation is finally tied to something that has real cost.

How it's Made

The stack is a seven-layer vertical pipeline running live on Sepolia testnet — no Anvil fork, no mock data, with one explicit exception: a MockAggregatorV3 used to trigger the judge-controlled circuit breaker, since a real Chainlink feed cannot be manipulated on demand.

On-chain (Solidity / Foundry) We vendored 1inch’s SwapVM (release/1.1) and self-deployed the full Aqua stack on Sepolia, since 1inch ships Aqua on mainnets only. We also qualified for the 1inch bounty by executing a live swap through our router, where quote() equals swap() by VM design and the Swapped event is emitted on-chain. We extended the VM with two new first-class instructions: _inventorySkew2D: deviation-weighted inventory rebalancing. _oracleGuard2D: a maker-protection circuit breaker that reverts or clamps on oracle deviation and always halts on staleness. These are trust-free opcodes, validated against SwapVM’s seven documented invariants with a mutation-killing fuzz suite. We explicitly avoided external calls (_extrinsics), which 1inch warns can silently break quote/swap consistency.

Compiler (TypeScript) The compiler is a deterministic pipeline: Zod → AST → IR → bytecode Its output is byte-identical to Solidity’s ProgramBuilder, enforced via a shared keccak constant on both sides. It guarantees: Canonical instruction ordering for security-critical correctness. Rejection of unsafe intents with a visible diff. Automatic rewrite into a safe, canonical program before emission. This goes beyond template-based systems, which cannot enforce these guarantees structurally.

Agent (Mastra + z.ai + MCP) The agent runs in its own container and is strictly bounded: The LLM only fills a predefined schema; it does not generate code. A pure-function policy consumes The Graph subgraph deltas. Strategies are autonomously retuned with zero user interaction: dock → recompile → ship. Each retune explicitly references the Swapped entity ID that triggered it. Human-in-the-loop controls are limited to stopping or removing strategies. The retune set and the HITL set are strictly disjoint.

Data and Identity (The Graph + ENS) A first-party subgraph indexes: Swapped events. Aqua lifecycle events: Pushed, Pulled, Docked, Shipped (committed capital = the “like”). ENS TextChanged events, used as the follow graph. This acts as the discovery layer that Aqua intentionally does not provide. ENS subnames store a v0.programhash record. Before settlement, takers verify: keccak(bytecode) == ENS record == on-chain StrategyDeployed event This ensures full integrity between identity, code, and execution.

Frontend The UI is built with Next.js App Router using SSR. LLM calls and API keys remain server-side, and no business logic is exposed to the client. Notably hacky There is no database anywhere in the system. Every field on a feed card resolves directly from: A subgraph entity, or An ENS getText call. If the subgraph goes down, cards remain visible but lose stats. If ENS goes down, the feed becomes empty.

Result Wave is a social market for on-chain market-making strategies built on 1inch SwapVM. Instead of vanity metrics, it measures capital. On-chain, the only endorsement that cannot be faked is one that costs money — so on Wave, a “like” is liquidity committed to a strategy. A strategist writes intent in plain language, for example: “keep ETH/USDC balanced, halt if Chainlink deviates 1.5%.” An LLM parses it into a bounded schema, and a deterministic compiler turns it into verified SwapVM bytecode with a reject-and-rewrite safety mechanism. The strategy deploys live on Aqua on Sepolia, receives an ENS subname containing its program hash, and appears in a feed ranked by: returnPct × recency × log(followers) All signals are derived from on-chain data or ENS. The result is that a simple sentence becomes a live, self-retuning market maker — and strategies that attract real capital rise to the top, because reputation finally has a real cost.

Small corrections A couple of phrases were smoothed for consistency: “no business logion” → “no business logic”. Repeated blocks were removed. I standardized code identifiers and punctuation for readability.

background image mobile

Join the mailing list

Get the latest news and updates