Skip to content

Example implementation of Limit order pools in Uniswap V4 via hooks

Notifications You must be signed in to change notification settings

Syzygy106/limit-order-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Take Profits Hook

A proof-of-concept Uniswap v4 hook that lets LPs or traders place limit-style take-profit orders on any supported pool. The hook tracks target ticks, executes swaps when prices cross them, and issues ERC-1155 claim tokens that can later be redeemed for the output asset.

⚠️ This is not production-ready. It’s a learning + experimentation hook based on the Atrium Limit Orders workshop.

Overview

In this hook, a user can:

Place a take-profit order: e.g., sell token0 for token1 when price reaches a given tick.

Cancel an order: reclaim their unfilled input tokens.

Automatically execute orders: when the pool tick crosses their target.

Redeem: claim the output tokens from executed orders using ERC-1155 “claim tokens.”

Because hooks in Uniswap v4 can run custom logic on swaps, we detect when price crosses a target tick in afterSwap and perform the order execution immediately.

About

Example implementation of Limit order pools in Uniswap V4 via hooks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published