LogoLogo
  • HOOKRANK
    • Introduction
  • CORE FEATURES
    • Dashboard
      • Hook List
      • Hook Details
    • Earnings Analytics
    • Gas Spendings
    • Total Value Locked
    • Transaction Volume
  • HOOKS KNOWLEDGE
    • NoOp Hooks
  • HookRank indexing
    • Events
      • Swap
      • Initialize
      • ModifyLiquidity
    • Tracked Data
  • PUBLIC API
    • Introduction
    • Endpoints
      • /api/public/v1/uniswap/hooks/networks
        • GET
      • /api/public/v1/uniswap/hooks/currencies
        • GET
      • /api/public/v1/uniswap/hooks
        • GET
      • /api/public/v1/uniswap/hooks/{{chainId}}/{{hookAddress}}
        • GET
      • /api/public/v1/uniswap/hooks/{{chainId}}/{{hookAddress}}/contract-metadata
        • GET
  • GUIDES
    • FAQs
    • How To Provide Custom Hook Integration Data
  • EXTERNAL LINKS
    • Twitter / X
    • GitHub
    • Discord
    • Brand Kit
Powered by GitBook
On this page
  • Picture This:
  • First Things First:
  • What To Prepare:
  • For Instance:
  1. GUIDES

How To Provide Custom Hook Integration Data

Picture This:

You're a hook developer who's just created an amazing AwesomeHook, unlocking a PowerfulFeature for your users. You've dotted all the i's, crossed all the t's - development is complete, audit is done, and you're ready to welcome users. But there's just one tiny problem... How do you reach the hook enthusiasts who'd love your creation?

Then you stumble upon HookRank's X account and BAM! 💡 It hits you like a bolt from the blue: "This is exactly what I need!" Excited, you dive into HookRank's documentation, only to feel your heart sink as you read about hook indexing: "They only index standard Uniswap hooks... My beautiful project uses custom events - it'll never fit in!"

But wait! Here's where we say: "Hold up! Don't give up just yet! 🎉" Whether your hook follows standard patterns or blazes its own trail with custom events, we've got you covered. You can teach us how to index your awesome hook, and we'll make sure it gets the spotlight it deserves. In return, you'll get access to our amazing community of premium liquidity providers and hook enthusiasts.

Ready to learn how to get your hook indexed? Let's dive into what you need to provide! 🚀


First Things First:

Take a peek at our existing indexing order and ask yourself: "Do any of these events they're tracking ring a bell?" If you spot even one familiar event - you're already on the right track.

Now, here's where it gets technical: your hook might be using these events, but with its own specific implementation. Maybe your Total Value Locked needs to be calculated through a different formula? Or perhaps you've implemented a custom curve for price calculations? Or you've designed a multi-component fee model that works differently from the standard ones?

Whatever makes your hook unique, we need to understand these specific characteristics. Think of it as documenting your hook's core mechanics - we need to know the exact differences to index it correctly.

If your hook operates entirely with custom events, don't worry - we've got you covered. Simply provide us with your event specifications and explain how they correlate to our standard metrics. We need to understand how your events translate into the key indicators we track.


What To Prepare:

To make the integration process smooth and efficient, here's what you should prepare:

  • A list of your custom events with their parameters and descriptions - think of it as your hook's event dictionary

  • Formulas or logic explaining how standard metrics (TVL, volume, fees or any other value from Tracked Data) should be calculated using your events

  • Any special conditions or states that affect these calculations

  • (Optional but helpful) A simple test case with example event emissions and expected metric outcomes

The more detailed your documentation is, the faster we can get your hook properly indexed and showcased to our community.


For Instance:

event PoolSwap(PoolId indexed poolId, 
               int flAmount0, int flAmount1,   //  stage amounts
               int flFee0, int flFee1,         // Fair Launch stage fees
               int ispAmount0, int ispAmount1, //  stage amounts
               int ispFee0, int ispFee1,       // Internal Swap stage fees
               int uniAmount0, int uniAmount1, // amounts returned with Uniswap 
               int uniFee0, int uniFee1);      // Uniswap 

Therefore, additional indexing needs to be added:

  1. internal swap amounts to be calculated: amount = flAmount + ispAmount;

  2. internal swap fees to be calculated: fees = flFee + ispFee + uniFee;

  3. Using these values, all indexing follows the established flow, omitting the creation of a new Swap entity. Instead, the existing Swap entity from this transaction is loaded, and the respective values are incremented.

PreviousFAQs

Last updated 2 months ago

Let`s break that down by looking into how we have implemented custom indexing for Flaunch . For this example we will cover only it`s swap flow.

The PositionManager implements an additional mechanism that occurs before the standard Uniswap swap flow. This internal swap is used to handle fee conversions and distributions within the protocol. When indexing these swaps, we need to account for both the standard Uniswap swap metrics and the internal swap components, which are emitted through the event:

If you believe you are prepared to share the data with us, please feel free to complete the 📝

PositionManager
internal swap
PoolSwap
form