Skip to content

[Epic] Native asset and USD values calculations for XGraphs #1

@sh-rn

Description

@sh-rn

Overview

The overall goal is to populate all the token price fields in terms of the native asset (e.g., UNI price in terms of ETH, JOE price in terms of AVAX, etc.), while integrating the new functionality into the existing solution and maintaining the performance and efficiency of the system.

  1. Extend the existing data model to store token prices in terms of the native asset for each block in a new TokenPrice table.
  2. Update the EventProcessorStageExchange_Bundle class to:
    • Calculate token prices in terms of the native asset using the bundle table data, with additional calculations for each token done in parallel using multiple worker threads.
    • Store the calculated token prices in the new TokenPrice table.
    • Use the Redis cache to efficiently store and retrieve token prices.
    • Accept a token_pairs parameter, allowing the class to track multiple token pairs without the need for separate derived classes.
    • Update the _process() method to handle calculations for multiple token pairs.
  3. Modify the main processing loop to include instances of the updated EventProcessorStageExchange_Bundle class with the desired token pairs to track.

ref code: https://github.com/blocknetdx/XQuery/blob/master/xquery/event/processor_exchange_bundle.py

Tasks:

#4
#5
#6
#7

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions