Introduction to Hemera & UDFs
Hemera Protocol introduces User-Defined Functions (UDFs) as a powerful tool to access and analyze blockchain data efficiently. UDFs simplify the extraction of critical data, enabling seamless interaction with protocols like Staking, Lending, and DEX on Taiko. This guide will help fast-track your journey in building UDFs for Taiko with practical examples and tools.
Why build with Hemera’s UDF:
- Assured Prizes to eligible UDFs submitted during grant factory Hackathon
- Supports Taiko Ecosystem
- Build vast extension of application around Staking, lending, dexes, DIDs, Data Dashboards, etc.
Recommended Use Cases for UDFs on Taiko:
<aside>
ℹ️ Here are some recommended use cases to inspire your UDF projects! While these ideas serve as guidance, you're not limited to this list—feel free to build anything you envision!
</aside>
<aside>
🏗️
1. Staking:
- Deposit and Withdraw Records: Capture staking deposits and withdrawals for each user.
- Staked Token Amount (token_address + amount): Monitor the total amount of tokens staked per address.
- Earnings for Each Address: Track staking rewards or earnings generated for each user.
- Applications on Taiko:
<aside>
🏗️
Lending
- Collateral and Borrowing Records: Log every addition of collateral and borrowing action.
- Amount of Asset (token_address + amount) Borrowed: Monitor the amount of assets borrowed per wallet.
- Liquidation Records: Record liquidation events per wallet.
Total Value of Liquidations: Capture the overall value of liquidations associated with each wallet.
- Applications on Taiko:
<aside>
🏗️
DEX
- Trading (Swap) Records: Track each swap or trade executed by users.
- Total Number of Trades, Trading Volumes, and P&L: Calculate the total number of trades, trading volumes, and profit/loss per wallet.
- Liquidity Adds and Removes: Capture events where users add or remove liquidity from liquidity pools.
- Applications on Taiko:
</aside>
▶️ Steps to Build UDFs with Hemera on Taiko
Documentation and Reference Links: