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:
Let`s break that down by looking into how we have implemented custom indexing for Flaunch PositionManager. For this example we will cover only it`s swap flow.
The PositionManager implements an additional internal swap 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 PoolSwap event:
Therefore, additional indexing needs to be added:
internal swap amounts to be calculated:
amount = flAmount + ispAmount;
internal swap fees to be calculated:
fees = flFee + ispFee + uniFee;
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.
If you believe you are prepared to share the data with us, please feel free to complete the form 📝
Last updated