8

The bounty policy includes a provision that the question asker may manually award their bounty. However there is also a set of defaults for a bounty whereby, in the event the question asker fails to award the bounty, either something happens or nothing happens.

What percent of bounties are awarded manually? What percent of bounties are awarded to the "accepted answer" by default? What percent of bounties are awarded at half-value due to upvotes? What percent of bounties simply vanish?

11
  • something with votetypeid 8 and 9 in the votes table here: data.stackexchange.com/stackoverflow/query/new, not sure how manually versus automatic can be detected
    – rene
    Aug 7, 2019 at 13:21
  • 1
    @rene since we remove the UserId from the Votes table it'd be basically impossible to pull this from SEDE. We'd have to pull this from the database directly.
    – Taryn
    Aug 7, 2019 at 14:05
  • @Taryn, would be fun to add those back for a week or so. Lets find out who secretly downvoted me ;)
    – Luuklag
    Aug 7, 2019 at 14:10
  • 4
    @Luuklag Maybe fun for you, but not for me. I'd like to keep my job here.
    – Taryn
    Aug 7, 2019 at 14:11
  • @Taryn do we need userid here (oh wait, question asker probably)? And votetypeid=8 does have its userid populated (as does votetypeid=5 but that is favorite) in the public instance.
    – rene
    Aug 7, 2019 at 14:16
  • @rene We only include UserId for VoteTypeId 5 and 8, but not 9 which is the BountyClose. If you don't have the userId for that one, then you can't separate the ones awarded by the community user.
    – Taryn
    Aug 7, 2019 at 14:18
  • 2
    Hmm, let me see ... challenge accepted @Taryn ....
    – rene
    Aug 7, 2019 at 14:20
  • @rene Go for it. :)
    – Taryn
    Aug 7, 2019 at 14:21
  • @rene, Perhaps you can deduce something from: A. the time a bounty was awarded, B the amount of bounty awarded, C the time a given bounty expired (since non-acceptence leads to a sort of time-out). D the amount awarded (half for auto awarded bounties)
    – Luuklag
    Aug 7, 2019 at 14:43
  • Not a SQL guy myself, so cant think of any way to put that in SEDE. cc @Taryn
    – Luuklag
    Aug 7, 2019 at 14:43
  • 2
    @Luuklag yeah, I'm currently working my way down that rabbit hole ...
    – rene
    Aug 7, 2019 at 14:46

1 Answer 1

9

This are the statistics for bounties that are started by users on their own question:

all    Community Ended User Ended Awarded Half Awarded Not Awarded 
------ --------------- ---------- ------- ------------ ----------- 
161727 84315           77381      108430  27734        53297   

As stated in the comments by Taryn it wasn't possible to get these numbers from the public SEDE because the Votes table is sanitized for VoteTypeId 9 (Bounty Awarded). Votetypeid 8 does come with a userid so it is possible to determine who started a bounty.

Besides votes there is also a PostHistory table. This table holds events 33 and 34 (Notice added and Notice removed) and does record a userid. It turns out that if the Community user ends the bounty a row with Posthistorytypeid = 34 and userid = -1 is stored. If we join with PostNotices we know for sure the record Notice removed event is for a bounty.

With that joined up correctly you can sum the results.

Here is the SEDE Query

;with Askerbounties as 
(
   select p.id
        , v.creationdate
        , v.bountyamount
   from posts p
   inner join votes v on v.postid = p.id
   where p.posttypeid = 1
   and v.votetypeid = 8 
   and v.userid = p.owneruserid
)
, 
AnswerWithBounties as
(
 select p.parentid id
        , v.creationdate
        , v.bountyamount as [awarded]
   from posts p
   inner join votes v on v.postid = p.id
   inner join askerbounties a on a.id = p.parentid
   where p.posttypeid = 2
   and v.votetypeid = 9
) 

select count(*) [all ]  
     , sum(case when userid = -1 then 1 else 0 end) [Community Ended]
     , sum(case when userid <> -1 then 1 else 0 end) [User Ended]
     , sum(case when awarded is not null then 1 else 0 end) [Awarded]
     , sum(case when awarded is not null 
                         and awarded < bountyamount then 1 else 0 end) [Half Awarded] 
     , sum(case when awarded is null then 1 else 0 end) [Not Awarded]
from askerbounties ab
left outer join AnswerWithBounties ans on ab.id = ans.id
inner join posthistory ph on ph.postid = ab.id
inner join postnotices pn on pn.postid = ph.postid
inner join postnoticetypes pt on pt.id = pn.postnoticetypeid
where ph.posthistorytypeid = 34 -- notice removed. 
and pt.classid = 2 -- bounty notice
and pn.deletiondate = ph.creationdate
and (ans.creationdate is null 
  or ans.creationdate < dateadd(d, 9, ab.creationdate)  -- 7 days + 24 hours graceperiod and rounding]
    )

SEDE is updated on Sunday, 03:00 UTC. Do try the tutorial and say 'Hi!' in the SEDE chat room.

2
  • Nice Job rene as always
    – Luuklag
    Aug 8, 2019 at 4:50
  • Impressive rabbit hole digging.
    – Taryn
    Aug 8, 2019 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .