Expose account holdings across reservation and redemption states

This commit is contained in:
2026-12-03 04:01:23 +08:00
parent 4a9b696644
commit 3bff1c0bc3
7 changed files with 207 additions and 2 deletions
+2
View File
@@ -141,6 +141,7 @@ impl Listing {
#[derive(Deserialize)]
#[serde(tag = "op", rename_all = "snake_case", deny_unknown_fields)]
pub(crate) enum Query {
Positions(crate::portfolio::Filter),
OpenOrders(crate::account_orders::Filter),
Book {
market: String,
@@ -166,6 +167,7 @@ pub(crate) enum Query {
impl Query {
pub fn read(self, db: &Connection) -> Result<Value> {
match self {
Self::Positions(filter) => filter.read(db),
Self::OpenOrders(filter) => filter.read(db),
Self::Book { market, outcome } => {
let phase = market_phase(db, &market, &outcome)?;