You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Store value of previous price aggregate if the status is trading (#152)
* Only update value of previous aggregate price if it was trading
* Remove redundant usage of drv1_ field.
This is always 1 for all currently deployed price accounts which have had upd_ema
ran once, which covers all accounts. Therefore the condition inside upd_ema will always
be true. We can therefore remove the usage of drv1_, freeing it up to be used for
other 64-bit data in the future.
* Store current and previous aggregate price timestamps
* Use the pub_slot of the previous aggregate as the value of prev_slot,
for consistency.
This effectively makes prev_slot_, prev_price_ and prev_conf_ a cache of the
ptr->agg_ fields.
* Add tests for storing previous aggregate price
* Add test showing that the prev_* fields don't update if the aggregate status is UNKNOWN
0 commit comments