Preview market sweeps and execute protected share sales

This commit is contained in:
2026-12-03 04:31:07 +08:00
parent c0b8a0f229
commit ea6383f089
10 changed files with 278 additions and 7 deletions
+3 -1
View File
@@ -141,6 +141,7 @@ impl Listing {
#[derive(Deserialize)]
#[serde(tag = "op", rename_all = "snake_case", deny_unknown_fields)]
pub(crate) enum Query {
Estimate(crate::estimate::Request),
Resolution {
market: String,
},
@@ -172,8 +173,9 @@ pub(crate) enum Query {
},
}
impl Query {
pub fn read(self, db: &Connection) -> Result<Value> {
pub fn read(self, db: &Transaction, books: &mut crate::resident::Books) -> Result<Value> {
match self {
Self::Estimate(request) => request.read(db, books),
Self::Resolution { market } => crate::resolution::read(db, &market),
Self::Assets { market } => assets::market_assets(db, &market),
Self::Positions(filter) => filter.read(db),