-
Notifications
You must be signed in to change notification settings - Fork 4
sink-1 #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
skushagra9
wants to merge
40
commits into
develop-new
Choose a base branch
from
kushagra/eng-2156
base: develop-new
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
sink-1 #144
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rocessing - Introduced new project 'ichi' for Hemi staking protocol. - Implemented BatchProcessor for handling staking events and maintaining time-weighted balances. - Added GraphQL schema definitions for ActiveBalances and PoolProcessState. - Integrated with Absinthe API for data transmission and crash recovery. - Established database models and utility functions for managing active balances and process state. - Included token metadata for supported tokens and helper functions for balance management.
- Updated ioredis to version 5.7.0 in package.json and pnpm-lock.yaml. - Added @types/ioredis as a development dependency. - Introduced a new file emain.ts for handling balance updates and event processing using Redis. - Modified processor.ts to include temporary configurations for the Hemi staking protocol.
- Reformatted code for better readability by adjusting indentation and spacing. - Enhanced the constructor and method definitions for clarity. - Updated comments for better understanding of the logic and flow. - Maintained existing functionality while improving overall code organization.
- Added PositionToggle type to TwbAdapter for future event handling. - Implemented indexPriceData method for price data indexing. - Introduced enrichers for processing time-weighted balance events. - Updated onEvent method to include positionToggle handling. - Improved comments and todos for better clarity and future development.
- Introduced Price and PriceStore types for managing price data. - Added PriceProvider interface for computing prices on cache misses. - Implemented PriceService class for retrieving or computing prices. - Updated TwbAdapter and TwbEngine to accommodate new price handling logic. - Improved enrichers for processing time-weighted balance events with clearer structure and comments. - Enhanced overall code readability and organization.
…clarity - Added comments to clarify the purpose of methods and logic within the run function. - Introduced backfillPriceDataForBatch method for more efficient price data backfilling. - Updated existing comments and todos for better readability and future development. - Removed the indexPriceData method and adjusted related logic to streamline processing. - Enhanced overall structure and organization of the TwbEngine class.
… and event processing - Updated TwbAdapter methods to return Promises for better asynchronous handling. - Refactored priceAsset method to accept timestamp and asset directly. - Improved flushPeriodic logic to handle final block and backfilling scenarios more efficiently. - Enhanced enrichers to properly compute time-weighted averages for price data. - Added file system logging for enriched windows data. - Cleaned up comments and todos for clarity and future development.
…r clarity and performance
…prove data handling and fixed pricing bug when no data was in the last bucket (uses last known value)
…richers, including new event types and improved data structure for protocol metadata
…on ingestion in Engine with gas fee analysis
…rate processor.ts file
…enhancing data processing and metadata handling
… engine, improving log and transaction handling
…ng it from the adapter)
… LP token pricing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 feat: Complete VUSD Mint Adapter & Core Engine Fixes
🔧 New VUSD Mint Adapter
vusd-mint.tsadapter to track Mint events with full metadata capturevusd-mint.absinthe.jsonfor Ethereum mainnet🏗️ Dual Sink Architecture
⚙️ Transaction Processing Fixes
transaction: trueto log subscriptions💰 Pricing & ValueUSD Resolution
📊 Time-Weighted Balance Schema Refinement
bal:{asset}:{user}:{contractAddress}🔄 Configuration Enhancements
🛠️ Core Engine Improvements
📈 Event Enrichment Pipeline
(done because we don't have startTs and endTs for txn events, we can make it a single function in future)
Added
enrichEventsWithAssetPricefor asset price resolutiondisplayAmountandvalueUsdfields on eventsAdded
enrichEventsWithGasPricingfor gas fee USD calculationsPurpose: Calculates transaction gas costs in USD for comprehensive cost analysis
Process:
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) as gas tokengasFeeWei = gasPrice × gasUsedgasFeeNative = gasFeeWei ÷ 10^18(Wei to ETH)gasFeeUsd = gasFeeNative × ethPricegasFeeUsdfield on eventsEnhanced
buildEventswith eventName field and proper timestamp handlingImproved cleanup pipeline for API-ready data formatting
🔍 Data Structure Fixes
basefield to RawEvent interface for enriched data📝 Important Note: Asset Configuration Requirement
Token Address vs Contract Address Clarification:
Required: VUSD token address (0x677ddbd918637E5F2c79e164D402454dE7dA8619) must be explicitly configured in main.ts and feed config
Why: The pricing engine needs the actual token address to fetch metadata (decimals, symbol) for proper amount calculations
Previous confusion: Initially attempted using the minting contract address, which doesn't contain token metadata
Recommendation: This pattern should be better documented as it's not immediately obvious that token addresses (not contract addresses) are required for asset configuration
This distinction is crucial for proper decimal handling and price resolution in the enrichment pipeline.