All projects

Jelly Layer - Liquidation Engine that runs on chainlink CRE

This is liquidation engine on top of cre go sdk, which handles a lifecycle like a strategy around Oracle Extractible Value (OEV potential) and simulates the risk factor for a protocol.

Risk & Compliance World

What it is

Jelly Layer CRE is a decentralized liquidation and Oracle Extractable Value (OEV) coordination layer built on the Chainlink CRE SDK. It connects oracle price updates to lending-protocol liquidations in a structured way: when a Chainlink oracle emits an AnswerUpdated event, the system detects liquidatable positions, prioritizes them, assigns executors, runs liquidations on-chain, and distributes captured OEV among protocol, executors, and (optionally) validators. The product is designed to be protocol-agnostic via adapters (starting with a “Jelly Mock” lending pool for testing), with configurable OEV splits, execution strategies (staker pool, auction, round-robin), and integration points for real lending protocols such as Aave V3, Morpho Blue, or Compound V3. Basically, it is an OEV-aware liquidation engine that runs as a CRE workflow and coordinates who liquidates what and how value is shared.
On the tech side, the system is a Go-based CRE workflow with five handlers:
 Detection: triggered by Chainlink AnswerUpdated or a cron (for demos); it reads positions from the lending adapter, computes OEV potential per position, and submits a prioritized list to an on-chain PriorityQueue.
 Prioritization: triggered by PrioritiesSubmitted; it reads the queue, fetches real-time volatility (e.g. via HTTP) per collateral token, scores positions (health factor, OEV potential, volatility), applies a cascading filter, and calls updateQueue on the PriorityQueue. 
 Execution: triggered by QueueUpdated; it selects executors from the ExecutorRegistry (or from the LiquidationAuctionHouse when using auctions), then calls LiquidationOrchestrator.executeLiquidation (only callable by the Jelly Engine) which in turn calls the lending pool’s liquidate(borrower).
Distribution: triggered by LiquidationExecuted; it decodes captured OEV, optionally settles auction state, and calls the OEVDistributor (captureOEV / distribute) to split value by configurable protocol/executor/validator shares. The stack uses the SmartContractKit CRE SDK (EVM log triggers, cron, HTTP), go-ethereum for ABI encoding, and a small set of Solidity contracts: JellyLendingPool (mock positions + getAllPositions / liquidate), LiquidationOrchestrator, PriorityQueue, ExecutorRegistry, LiquidationAuctionHouse, and OEVDistributor. The MVP delivers this full pipeline on a testnet (for now it is Sepolia) with the Jelly Mock adapter, a runnable full-demo script : Detection → Prioritization → Execution → Distribution with broadcast, volatility-aware prioritization, and config-driven execution strategy and OEV splits, forming a working reference implementation for OEV-aware liquidations on CRE.

Special features:
1.Plug and Play setup through adapters (for instance in the code base its available with a mock setup named as "jelly mock")
2.Generic pipeline which can be sandwiched for other MEV attacks like frontrunning.
3.A complete Protocol agnostic setup

How it Works

Its built on CRE's go sdk latest version, uses http capabalitites for other api's to tune in, with on chain quoting system acting as a glue to all the four core workflow logics. There is a mix of golang and solidity code in order to simulate it end to end.

Links

Created by

  • Adiya Biradar