pendulum-chain / pendulum-squids

The subsquid squids we use for Pendulum/Amplitude/Foucoco.
GNU General Public License v3.0
0 stars 0 forks source link

Improve price update events processing #46

Closed bogdanS98 closed 5 months ago

bogdanS98 commented 5 months ago

Context

At the moment, prices are updated only after finishing syncing from archive so old price info is lost and processing of swap events does not have access to the price of our native token.

Requirement

Update prices every CATCHUP_PRICE_UPDATE_PERIOD blocks when syncing from archive so that we maintain a fairly accurate price history, where CATCHUP_PRICE_UPDATE_PERIOD is an environment variable that defines how often (in blocks) the price info should be updated.