npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@poolshark/limit

v1.0.3

Published

🦈 Poolshark Limit Protocol 🦈

Downloads

232

Readme

🦈 Poolshark Limit Contracts 🦈

A liquidity pool to support one-way and two-way liquidity positions.

An implementation of Limit, a limit order liquidity pool, written in Solidity.

This follows the specification detailed in the Poolshark whitepaper.

What's New

The concept of "claim ticks" are introduced to inform up to what price tick a user has been filled.

Each tick will have an epoch that is marked as ticks are crossed.

This will allow the smart contracts to verify the correct claim tick.

Installation

git clone https://github.com/poolshark-protocol/limit
cd limit
yarn install

This repo makes full use of Echidna's assertion testing to fully test and analyze the Limit smart contracts.

Testing

Tests can be run via the following commands.

Only Hardhat is supported for now, with Foundry support soon to follow.

yarn clean
yarn compile
yarn test

Contracts can be deployed onto Arbitrum Sepolia using the deploy script:

npx hardhat deploy-limitpools --network arb_sepolia

Contracts

Limit Pool

Limit Pool is the liquidity pool contract which contains all the calls for the pool. Outside of the claim process, it is a relatively simple AMM liquidity pool which uses a both a tick bitmap to find ticks to cross and an epoch map to store epochs for any positions boundaries of Limit LPs. Positions are implemented via an ERC-1155 for transferability and composability. The contracts are implemented with extremely limited admin functionality, namely modifying fees up to a defined ceiling of 1% and adding new fee tiers. Limit Pools utilize epochs to determine to what tick in the user's position range they have been filled. A fillFee can be turned on by the protocol if desired, taking a portion of any filled positions amounts and directing that to a chosen feeTo address. If ever a pool were to ever require an extensive sync, a user burning a position could simply skip the syncing process by passing sync = true.

Supported Interfaces

ERC-165: Standard Interface Detection

ERC-1155: Multi Token Standard

Limit Pool Factory

The factory which handles the deployment of new Limit Pools. The factory works by cloning the implementation contract to match a given Limit pool type. Each pool type has its own unique implementation, which can have varying details such as AMM curve math (i.e. Constant Product, Constant Sum, etc.), or other unique design choices.

Supported Interfaces

ERC-1167: Minimal Proxy Contract

Testing Design

Coverage

ERC-1155 Functions

totalSupply balanceOf transfer transferFrom approve allowance

General Functions

mintLimit mintRange burnLimit burnRange swap quote snapshotLimit snapshotRange immutables priceBounds

Limit LP Visual Diagram

image