Skip to content

orangesantra/TLIS-hook

Repository files navigation

Time-Locked Intent Settlement (TLIS) Hook

A Uniswap V4 hook implementing privacy-preserving batch auctions using time-locked intents to reduce MEV and improve execution quality.

for detailed architechture refer to flowchart folder.

Deployment

Chain - Sepolia

  • POOL_MANAGER = 0x8C4BcBE6b9eF47855f97E675296FA3F6fafa5F1A
  • DRAND_ORACLE = 0xf7801a6025b2d2d6e2b22895bf928f84bcefb9d7
  • TLIS_HOOK = 0xF1CB36943FF487579B02BC2CAcA1a20e071DC0C0
  • TEST_USDC = 0xEC476a01F537992aD68D8C16AAcc12a214f05dAC
  • TEST_WETH = 0x7D07C0A8a726aa9c30d5477F15Aa1D0B8532c589
  • MODIFY_LIQUIDITY_ROUTER = 0xc5595C6011523D9AF9C01242F35fb683C3DE8731

Overview

The TLIS Hook allows users to submit encrypted trading intents that are collected into batches and executed after a time delay. This design prevents front-running, reduces sandwich attacks, and enables better price discovery through batch settlement.

Key Features

  • Privacy Through Time-Locking: Encrypted intents prevent MEV exploitation
  • Batch Processing: 5-minute collection windows for better price discovery
  • Keeper System: Priority execution with economic incentives
  • Fee Distribution: 50% of fees to executors, protocol sustainability

Quick Start

Build

forge build

Test

forge test --match-path test/TLISHook.t.sol -vvv

Architecture

Users submit encrypted intents → Batched for 5 minutes → Time-locked for 1 minute → Keeper priority execution → Open execution → Settlement

Contract Functions

Submit Intent

function submitIntent(PoolKey calldata poolKey, bytes calldata encryptedData) 
    external payable returns (bytes32 intentHash)

Fee: 0.001 ETH

Execute Batch

function executeBatch(PoolId poolId, uint256 batchId) external

Executes batch after unlock time. Keepers get priority in first minute.

Register as Keeper

function registerKeeper() external payable

Minimum bond: 0.1 ETH

Configuration

  • BATCH_DURATION: 5 minutes
  • EXECUTION_DELAY: 1 minute
  • MIN_KEEPER_BOND: 0.1 ETH
  • BATCH_FEE: 0.001 ETH

Foundry Documentation

https://book.getfoundry.sh/

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors