Account for fractional outcome sets from split through redemption
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
WITH balances AS (
|
||||
SELECT market,outcome,available,reserved,available+reserved AS size,phase,payout_per_share
|
||||
FROM position_sizes WHERE account=?1 AND (?2 IS NULL OR market=?2)
|
||||
FROM position_units WHERE account=?1 AND (?2 IS NULL OR market=?2)
|
||||
), holdings AS (
|
||||
SELECT b.*,
|
||||
CASE WHEN b.phase<>'resolved' THEN MIN(b.size,COALESCE(other.size,0)) ELSE 0 END AS pairs,
|
||||
|
||||
Reference in New Issue
Block a user