Convert NO positions and conserve collateral across fixed negative-risk groups

This commit is contained in:
2026-12-03 04:41:35 +08:00
parent dd3e563a48
commit b2b7fc4610
12 changed files with 329 additions and 5 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ WITH reserved AS (
WHEN 'MERGEABLE' THEN pairs>0
END
)
SELECT market,outcome,size,available,reserved,row_status,payout_per_share,pairs,free_pairs,sort_key
FROM filtered
SELECT market,outcome,size,available,reserved,row_status,payout_per_share,pairs,free_pairs,sort_key,n.group_id
FROM filtered LEFT JOIN neg_risk_members n USING(market)
WHERE ?4 IS NULL OR (sort_key,market,outcome)>(?4,?5,?6)
ORDER BY sort_key,market,outcome LIMIT ?7