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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bananapus/univ3-lp-split-hook-v6

v0.0.3

Published

Juicebox split hook that accumulates reserved project tokens, then deploys a Uniswap V3 liquidity position bounded by the project's issuance rate (ceiling) and cash-out rate (floor), with ongoing fee collection and liquidity rebalancing.

Downloads

44

Readme

nana-lp-split-hook-v5

Juicebox split hook that accumulates reserved project tokens, then deploys a Uniswap V3 liquidity position bounded by the project's issuance rate (ceiling) and cash-out rate (floor), with ongoing fee collection and liquidity rebalancing.

Architecture

| Contract | Description | |----------|-------------| | UniV3DeploymentSplitHook | IJBSplitHook implementation with a two-stage lifecycle. Before deployment: accumulates project tokens received via reserved-token splits. After deployment: burns newly received project tokens, manages the V3 LP position (fee collection, rebalancing), and routes LP fees back to the project with a configurable fee split to a fee project. Inherits JBPermissioned, ERC2771Context, Ownable. | | IUniV3DeploymentSplitHook | Interface declaring isPoolDeployed, deployPool, collectAndRouteLPFees, claimFeeTokensFor, plus events. | | IREVDeployer | Minimal interface for isSplitOperatorOf(projectId, operator) used to authorize fee-token claims. |

Lifecycle

1. Configure as a reserved-token split hook for a Juicebox project
   |
2. Controller calls processSplitWith() on each reserved-token distribution
   --> Tokens accumulate in accumulatedProjectTokens[projectId]
   |
3. Project owner calls deployPool(projectId, terminalToken, ...)
   --> Creates V3 pool at geometric mean of [cashOutRate, issuanceRate]
   --> Computes optimal cash-out fraction for LP geometry
   --> Cashes out a portion of project tokens for terminal tokens
   --> Mints V3 LP position bounded by [cashOutRate tick, issuanceRate tick]
   --> Burns leftover project tokens, adds leftover terminal tokens to project
   --> Sets projectDeployed[projectId] = true
   |
4. Future processSplitWith() calls burn received project tokens
   |
5. Anyone calls collectAndRouteLPFees(projectId, terminalToken)
   --> Collects fees from V3 position
   --> Routes terminal token fees: FEE_PERCENT to fee project, rest to original project
   --> Burns collected project token fees
   |
6. Anyone calls rebalanceLiquidity(projectId, terminalToken, ...)
   --> Removes old position, burns NFT
   --> Recalculates tick bounds from current rates
   --> Mints new position with updated bounds
   |
7. Revnet operator calls claimFeeTokensFor(projectId, beneficiary)
   --> Transfers accumulated fee-project tokens to beneficiary

Install

npm install
forge install

Develop

| Command | Description | |---------|-------------| | forge build | Compile (requires via_ir = true due to stack depth) | | forge test | Run tests | | forge test -vvv | Run tests with full trace |

Key Constants

| Constant | Value | Purpose | |----------|-------|---------| | BPS | 10000 | Basis points denominator | | UNISWAP_V3_POOL_FEE | 10000 (1%) | V3 pool fee tier | | TICK_SPACING | 200 | Tick spacing for 1% fee tier |

Constructor

constructor(
    address initialOwner,                              // Contract owner
    address directory,                                 // JBDirectory
    IJBPermissions permissions,                        // JBPermissions
    address tokens,                                    // JBTokens
    address uniswapV3Factory,                          // V3 Factory
    address uniswapV3NonfungiblePositionManager,       // V3 NonfungiblePositionManager
    uint256 feeProjectId,                              // Project ID to receive LP fee split
    uint256 feePercent,                                // Fee split in basis points (e.g. 3800 = 38%)
    address revDeployer,                               // REVDeployer for operator validation
    address trustedForwarder                           // ERC-2771 trusted forwarder
)

License

MIT