Search projects, hackathons, sponsors and tech

    ← All projects

    Under

    Under: resell unused AWS/GCP/Azure cloud commitments, priced by a Uniswap v4 time-decay hook.

    Demo

    About

    Under — a secondary market for unused cloud commitments Enterprises pay for years of AWS, Google Cloud and Azure up front to unlock discounts, then leave a large share of that capacity unused. Today it's almost impossible to resell: deals are slow, bilateral and opaque, and whatever isn't consumed by the deadline is simply written off. Under turns that wasting asset into a liquid, on-chain market. A verified seller tokenizes their commitment into an ERC-20 (ccAWS / ccGCP / ccAzure). It trades against USDC on a Uniswap v4 pool whose price is set by a custom time-decay hook: the value of a commitment falls toward zero as it nears expiry, because a buyer has less time left to actually spend the credit. The hook prices this mechanically — factor = timeLeft / horizon — so the discount widens automatically as the deadline approaches. No order book and no waiting for a counterparty: you trade instantly against the pool, in both directions (buy USDC→cc, or sell cc→USDC). Because these are claims on the real world, the market can't be anonymous. Trust is minimized in three layers: - World ID (Selfie Check) proves a real human is behind each trade — anti-fraud, not KYC. - ENSv2 carries each participant's eligibility as a credential a delegated compliance role can revoke live, without ever moving the name. - A seller bond puts real collateral on the line, slashable to compensate a defrauded buyer on-chain. The custom-curve hook uses ERC-6909 claims for its reserves and forwards the real trader's identity through a dedicated router (solving the hook-caller-vs-router identity problem). Everything is live on Ethereum Sepolia with real Circle USDC across seven markets.

    How it's made

    Smart contracts (Foundry, Solidity 0.8.26, via_ir). The core is a custom-curve Uniswap v4 hook (TimeDecayHook). It implements beforeSwap to return a BeforeSwapDelta and price the swap itself instead of using a constant-product curve: factor = min(timeLeft, horizon) / horizon, so 1 commitment token = factor USDC, decaying to 0 at expiry. Since the hook has no LPs, it holds its own reserves as ERC-6909 claim tokens in the PoolManager (a CSMM pattern): seedLiquidity calls manager.unlock, and the unlockCallback settles the ERC-20 in and takes 6909 claims out. Concentrated liquidity is disabled via beforeAddLiquidity. Hook address mining. v4 encodes hook permissions in the address's low bits, so we use HookMiner + CREATE2 to mine addresses whose low 14 bits equal BEFORE_SWAP | BEFORE_SWAP_RETURNS_DELTA | BEFORE_ADD_LIQUIDITY — every hook ends in …888. The identity problem (the interesting risk). A hook only sees the router as msg.sender, not the real trader — so gating on identity is meaningless unless you control the caller. We wrote a dedicated CommitmentRouter that forwards the true msg.sender in hookData; each hook keeps an allowedRouter allowlist and reads eligibility for the forwarded user. A blocking test asserts direct/unauthorized-router swaps revert. ENSv2 (Sepolia beta). This was the hackiest part: the beta ETHRegistrar is undocumented, so we reverse-engineered its commit-reveal flow (priced in an ERC-20, not ETH, with signed requests) from the namechain source. The beta's shared resolver rejects setText, so we deployed our own CommitmentResolver holding commitment.* records, plus an EnsEligibilityAdapter mapping address → node → isEligibleSeller. Revocation is a single commitment.status write via an EAC-delegated role — the name never moves. World ID 4.0. idkit v4 dropped the classic widget, so we use IDKitRequestWidget + the selfieCheckLegacy preset with an rp_context signed server-side (signRequest with the RP signing key). Proofs verify at developer.world.org/api/v4/verify/{rp_id}; on success a desk key onboards the buyer on-chain (resolver.onboard + adapter.bind) so eligibility lands before the buy. Seller bond. SellerBond (deposit / hasBond / slash) puts collateral on the line, slashable to a compensation pool; the hook refuses to let unbonded sellers seed. Frontend & infra. Next.js 15 + wagmi v2 + viem, on Vercel. Wagmi's barrel pulls in Coinbase/base packages that break the build, fixed with a webpack alias = false. Portfolio reads holdings across all markets in one useReadContracts multicall. Notable gotchas. (1) Mining 7 hooks in one Foundry script frame hit MemoryOOG — HookMiner leaks memory per salt iteration — so we deploy one market per invocation (fresh EVM each run). (2) We migrated all markets to real Circle USDC and seeded them token-only, so no real USDC was needed to bootstrap — buyers pay real USDC in, and the sell-side reserve fills as people buy. Everything is live on Ethereum Sepolia: seven markets, real Circle USDC, ENSv2 credentials and World Selfie Check.