Serve time-bucketed token prices and point-in-time settlement history

This commit is contained in:
2026-12-03 04:56:05 +08:00
parent 9a411d5146
commit e397f21321
9 changed files with 334 additions and 1 deletions
+2
View File
@@ -235,6 +235,7 @@ impl Listing {
#[serde(tag = "op", rename_all = "snake_case", deny_unknown_fields)]
pub(crate) enum Query {
Estimate(crate::estimate::Request),
PricesHistory(crate::prices_history::Request),
Resolution {
market: String,
},
@@ -275,6 +276,7 @@ pub(crate) enum Query {
impl Query {
pub fn read(self, db: &Transaction, books: &mut crate::resident::Books) -> Result<Value> {
match self {
Self::PricesHistory(request) => request.read(db),
Self::Estimate(request) => request.read(db, books),
Self::Resolution { market } => crate::resolution::read(db, &market),
Self::Assets { market } => assets::market_assets(db, &market),