Skip to content

Commit

Permalink
Fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
jahooma committed Jun 26, 2024
1 parent 5de63a2 commit c966303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/api/src/on-create-bet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const debouncedContractUpdates = (contract: Contract) => {
(select sum(abs(amount)) from contract_bets where contract_id = $1) as volume,
(select max(created_time) from contract_bets where contract_id = $1) as time,
(select count(distinct user_id)::numeric from contract_bets where contract_id = $1) as count,
(select count(distinct user_id)::numeric from contract_bets where contract_id = $1 and created_time > now() - interval '1 day') and is_redemption = false as count_day,
(select count(distinct user_id)::numeric from contract_bets where contract_id = $1 and created_time > now() - interval '1 day' and is_redemption = false) as count_day,
(select sum((data->'fees'->>'creatorFee')::numeric) from contract_bets where contract_id = $1) as creator_fee,
(select sum((data->'fees'->>'platformFee')::numeric) from contract_bets where contract_id = $1) as platform_fee,
(select sum((data->'fees'->>'liquidityFee')::numeric) from contract_bets where contract_id = $1) as liquidity_fee
Expand Down

0 comments on commit c966303

Please sign in to comment.