Account for fractional outcome sets from split through redemption

This commit is contained in:
2026-12-03 06:53:37 +08:00
parent 7b26767a97
commit 2c4179a64e
17 changed files with 492 additions and 108 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
WITH balances AS MATERIALIZED (
SELECT account,outcome,available+reserved AS size
FROM position_sizes WHERE market=?1
FROM position_units WHERE market=?1
), wallets AS (
SELECT account,
MAX(CASE WHEN outcome='YES' THEN size ELSE 0 END) AS yes,