From 87bbfbfe7ad08286b78bd37a65b0e7750a4e7aca Mon Sep 17 00:00:00 2001 From: Jayant Krishnamurthy Date: Tue, 28 Jun 2022 12:46:19 -0700 Subject: [PATCH] Check exponent range --- program/src/oracle/oracle.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/program/src/oracle/oracle.h b/program/src/oracle/oracle.h index 80591c905..d17960a90 100644 --- a/program/src/oracle/oracle.h +++ b/program/src/oracle/oracle.h @@ -20,7 +20,9 @@ extern "C" { #define PC_PUBKEY_SIZE_64 (PC_PUBKEY_SIZE/sizeof(uint64_t)) #define PC_MAP_TABLE_SIZE 640 #define PC_COMP_SIZE 32 -#define PC_MAX_NUM_DECIMALS 16 +// Bound on the range of the exponent in price accounts. This number is set such that the +// PD-based EMA computation does not lose too much precision. +#define PC_MAX_NUM_DECIMALS 8 #define PC_PROD_ACC_SIZE 512 #define PC_EXP_DECAY -9 // If ci > price / PC_MAX_CI_DIVISOR, set publisher status to unknown.