Category: Business Logic
Inaccurate representation of negative prices
Low Impact
Low Severity
Low Likelihood
Description
The Astria sequencer treats the price as an unsigned integer:
// astria-core/src/sequencerblock/v1/block.rs
pub struct Price {
currency_pair: CurrencyPair,
price: crate::connect::types::v2::Price,
decimals: u64,
}
// astria-core/src/connect/types.rs
pub struct Price(u128);The price of real-world equities is sometimes negative. In the event this happens, when cast to an unsigned quantity, the protocol will instead assume it is very large, causing unintended behavior of the oracle.
Impact
This behavior might cause unintended actions within the oracle, such as an incorrect representation of market conditions or failure to update prices accurately.
Recommendations
Consider supporting signed integers for price representation to handle negative values correctly.
Remediation
This issue has been acknowledged by Astria, and a fix was implemented in PR 1991↗