Need to find pot size on every street

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Need to find pot size on every street

Postby armor32 » Tue Aug 25, 2009 1:29 pm

Do we have pot size on every street stored anywhere in the DB, or is it calculated on the fly by the replayer? I do see 'holdem_hand_summary.amt_pot' field which is the total pot in the hand, but I also need pot size on individual streets. I see also amt_p|f|t|r_effective_stack, but these don't appear to be what I need.

thanks.
armor32
 
Posts: 41
Joined: Sun Aug 03, 2008 5:45 am

Re: Need to find pot size on every street

Postby kraada » Tue Aug 25, 2009 2:42 pm

The pot size on every street is not stored in the PT3 database at this point in time; the replayer calculates it on the fly. For what it's worth, I have found this omission somewhat frustrating myself so have requested these values be added though I don't know when they will be.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Need to find pot size on every street

Postby armor32 » Tue Aug 25, 2009 3:17 pm

If I would be interested only in pot size on the river (i.e. right before the last betting round) - is there an easy way to calculate it given the already known final pot size and fields in holdem_hand_player_detail (e.g. amt_bet_r etc')? It seems trivial, but I am afraid to make mistakes since I don't know exactly how to interpret all these fields.
armor32
 
Posts: 41
Joined: Sun Aug 03, 2008 5:45 am

Re: Need to find pot size on every street

Postby kraada » Tue Aug 25, 2009 3:46 pm

You can only manage this if you are putting it together for hands where you also saw the river. If you didn't see the river, there isn't enough data to build it with the custom statistics engine as it currently stands. If you want help putting it together even so, though, I'd be glad to help with that.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Need to find pot size on every street

Postby armor32 » Tue Aug 25, 2009 5:20 pm

Yes, I am only interested in hands where I saw river (and showdown, too). How do I interpret all kinds of relevant columns in hand_player_details ? I see there is lookup table lookup_actions, but I am not quite sure what BBC, CX, RRRR etc' codes mean.
So bottom line question is this: how to calculate amount of money on turn, when we saw river ?
armor32
 
Posts: 41
Joined: Sun Aug 03, 2008 5:45 am

Re: Need to find pot size on every street

Postby kraada » Tue Aug 25, 2009 5:52 pm

The actions string is going to be important, you are correct. B is bet, meaning the first betting action anybody took on the street. C is call, R is raise, F is fold and X is check.

I am going to presume also for the sake of simplicity we are filtering to deal with hands that we are heads up with someone else on the river. Multiway pots get awfully complicated. That will be achieved by adding "AND holdem_hand_summary.cnt_players_r = 2" to the initial if statement.

So we need to deal with several cases:
(1) Cases where the final pot is the pot on the river. This happens when:
(a) The river is checked through. This is easy: lookup_actions_r = 'X'.
(b) Everyone was all-in before the river. This is not too bad either: lookup_actions_r = '', as the only way there can be two people on the river and you not have an action is if you were both all in prior to the river.
(c) We make a bet and everyone folds. This is: lookup_actions_r = 'B' AND NOT(flg_showdown). As of course our bet is not added to the pot when it is not called.
(d) We faced a bet and folded. This is: lookup_actions_r = 'F'.
(2) Cases where the final pot minus a bet is the pot on the river. This happens when:
(a) We bet and get called. This is: lookup_actions_r = 'B' AND flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_bet_made (remember we bet and there was a call :).
(b) We face a bet and call. This is: lookup_actions_r = 'C' AND flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_bet_facing.
(c) We raise a bet and our opponent folds. This is: lookup_actions_r = 'R' AND NOT(flg_showdown). The pot on the river is then amt_pot - 2 * amt_r_bet_facing.
(d) Our opponent raises our bet and we fold. This is: lookup_actions_r = 'B' and NOT(flg_showdown). The pot on the river is then amt_pot - 2 * amt_r_bet_made.
(3) Cases where we get all-in on the river:
(a) This occurs when enum_allin = 'R' and the pot at the start of the river is amt_pot - amt_r_effective_stack.
(4) Cases where there are raises:
(a) We raise directly and are called: lookup_actions_r = 'R' and flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_raise_made.
(b) We bet and call a raise. lookup_actions_r = 'BC' and flg_showdown. The pot on the river is then amt_pot - 2 * amt_r_raise_facing.
(c) We 3-bet and our opponent folds: flg_r_3bet and not(flg_showdown) and not(flg_r_4bet_def_opp). The pot on the river is then amt_pot - 2 *amt_r_raise_facing.
(d) Our opponent 3-bets and we fold: flg_r_3bet_def_opp and not(flg_showdown) and not(flg_r_4bet_def_opp). The pot on the river is then amt_pot - 2 * amt_r_raise_made.

I can't imagine a spot where someone 3bet/folds on the river, but you should be able to figure that out if you'd like to add that in as well.

Then you basically build a big nested if[] statement testing for all of these cases. You can see why it's awfully tedious (and going back to the turn pot size is even worse!)
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Need to find pot size on every street

Postby WhiteRider » Wed Aug 26, 2009 5:31 am

Just a couple of nit-picking points to do with the action strings..

In (1d) the action string could also be 'XF' if you check/fold to a bet.
There are a couple more cases like this too:
(2b) could also be 'XC'.
(2d) is actually 'BF' not just 'B' (in which case you don't need to check for NOT(showdown).
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Need to find pot size on every street

Postby armor32 » Wed Aug 26, 2009 4:06 pm

Guys, thanks for comprehensive response. I found a WAY easier solution though (maybe it works for me only because I only play heads up).
I simply use this : (details.amt_bet_ttl - details.amt_bet_r)*2 - this is correct for all hands that saw showdown. I'm done with my little project now and it does wonders - thank you very much for your support.

If interested, here's a 2p2 thread that I started to discuss it: http://forumserver.twoplustwo.com/109/heads-up-limit/river-luck-analysis-project-569291/
armor32
 
Posts: 41
Joined: Sun Aug 03, 2008 5:45 am

Re: Need to find pot size on every street

Postby kraada » Wed Aug 26, 2009 4:13 pm

True that will work for all hands that reach showdown . . . I really should've read your parenthetical (and showdown, too) more carefully :)
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests