Hedged liquidations for tokenized stocks: seize on Morpho, short on Hyperliquid, sell via Uniswap v4
eiz3 is an ERC-4626 USDC vault that handles these liquidations differently. When a Morpho loan backed by NVDAx goes underwater, the vault liquidates it and right away opens a matching short on xyz:NVDA on Hyperliquid's HyperCore, which trades around the clock. From then on the vault is price-neutral. If NVDA moves, the stock and the short cancel out.
Then it sells slowly. The vault's NVDAx/USDC pool on Uniswap v4 runs our hook. When someone buys NVDAx, the hook fills them straight from the vault's stock at HyperCore's oracle price plus a small spread (0.10% while the market is open, 1% after the bell), and the vault buys back that much of the short. The hook only sells when the pool price is at or above its ask, so a buyer never pays more than the pool would have charged. Whatever no buyer takes, the keeper sells into the pool in small chunks and closes the short as it goes. The pool fee also goes up after hours.
A Chainlink CRE workflow gives the contracts what they can't read on-chain: whether the US market is open, how much NVDA the HyperCore order book can absorb (this caps how big a liquidation the vault will take), and a signed snapshot of the hedge account. If that data goes stale, the vault stops liquidating instead of guessing.
LPs deposit USDC and earn the liquidation discount without taking on stock price risk.
It's live on Base Sepolia at seiz3.xyz, on Morpho's and Uniswap's own deployments. On /try you can get test tokens, borrow against NVDAx at the limit, get liquidated about 15 seconds later, see the short open on HyperCore testnet, and watch the vault sell back down to flat.
The contracts are Solidity 0.8.28 with Foundry. There are four:
Seiz3VaultRemote is the vault. It liquidates on Morpho Blue, queues the hedge, and unwinds into v4. Seiz3HookRemote is the Uniswap v4 hook. HyperCoreGateway is the link to HyperCore. RiskParams receives the CRE reports. The hackiest part is the gateway. We started on HyperEVM, where contracts read HyperCore through precompiles and place orders through CoreWriter. Uniswap v4 isn't officially deployed on HyperEVM testnet, so we moved to Base Sepolia, which has both Morpho Blue and the v4 PoolManager. HyperCoreGateway copies HyperCore's precompile and CoreWriter interfaces on Base:
The vault writes orders into the gateway. A TypeScript relayer picks them up and places IOC orders from our hedge account on Hyperliquid. It uses the vault's cloid, so an order never goes out twice. The relayer posts the account state back to the gateway along with an ack. Reads come from the latest snapshot. If the snapshot is older than maxStateAge, reads revert and the vault fails closed. Because of this, the vault logic barely changed in the move.
Uniswap: the hook uses beforeSwap with a returned delta to fill buyers off the curve. In one callback it sends the buyer's USDC to the vault, settles the vault's NVDAx into the PoolManager, returns the delta and sets the dynamic fee. v4's flash accounting is what made this possible: the liquidity lives in the vault, not in the hook or the pool. One catch we hit: the hook takes USDC before the swapper has paid, so the payout comes from the PoolManager's own balance. We cap each fill at that balance. Also, v4-periphery's HookMiner ran out of gas inside forge script when mining a salt for a hook this size, so we wrote our own miner that hashes the init code only once.
Chainlink CRE: the workflow is written in TypeScript and runs on a cron.
Market status comes from Data Streams (the NVDA regular-hours stream), and every node has to agree. Each node pulls Hyperliquid's l2Book, and the DON takes the median bid depth inside our hedge band. That number becomes the vault's max liquidation size. It also checks Chainlink's NVDA/USD Data Feed on Ethereum against HyperCore's oracle and sets capacity to zero if they drift apart. This check is off on testnet because HyperCore testnet's price is stale. It writes two reports: one to RiskParams, and a hedge-account snapshot to the gateway that keeps things running if our relayer dies. Without CRE, the contracts would have to trust one bot for all of this. For the hackathon it runs as cre workflow simulate --broadcast every minute instead of as a deployed DON. It reads at the latest block because Base Sepolia's finalized head lags by hours.
Off-chain: the keeper, relayer, bots and API are TypeScript with viem. All ABIs are generated with wagmi from the forge output, so changing a contract breaks the TS build. A Hono API makes one Multicall3 call per second and streams the result over SSE to a Next.js 16 dashboard. Everything runs in docker compose behind a Cloudflare tunnel.
Tests: the Foundry tests deploy real Morpho Blue and PoolManager bytecode, with a mock HyperCore behind a test relayer. They run a full round: weekend, borrow, crash, liquidate, short, hook fill, buy-back, Monday unwind, flat. Fork tests run the same round against Base Sepolia's real deployments.
Testnet caveats: NVDAx and USDC are mock tokens, and the lending oracle is ours. On HyperCore testnet the other side of our hedges is our own market maker bot, because there's no real flow there. The orders themselves are real HyperCore orders. Other bots buy through the hook and keep the Morpho market at about 90% utilization, so a max borrow goes underwater in about 15 seconds and you can watch the whole flow live

