Cash Game Simple Ledger to Calculate Payments from Losers to Winners (2 Viewers)

TheLemursReturn

Straight
Site Vendor
Joined
Sep 16, 2022
Messages
939
Reaction score
1,312
Location
AZ
Please enjoy another quick-and-dirty web tool from a poker player who needed it to exist.

It's a poker buy-in ledger! Or bank tool. Or credit calculator. Or something. Haven't figured out the right name yet.

List your players. Log their buy-ins and their final stacks. Then the system will tell you how much each loser owes to which winner(s).

1758060383110.webp

This is not for the cash-is-king crowd (unless you have some use for the logging feature or the general in/out data).

Let me know if you find a bug or need a feature! I can't promise that I'll dump much more time into this, but it's possible.

I'll probably make this a real PCF resource at some point. But for now I'll let it sit here for feedback and cleanup.
 
Please enjoy another quick-and-dirty web tool from a poker player who needed it to exist.

It's a poker buy-in ledger! Or bank tool. Or credit calculator. Or something. Haven't figured out the right name yet.

List your players. Log their buy-ins and their final stacks. Then the system will tell you how much each loser owes to which winner(s).

View attachment 1566266

This is not for the cash-is-king crowd (unless you have some use for the logging feature or the general in/out data).

Let me know if you find a bug or need a feature! I can't promise that I'll dump much more time into this, but it's possible.

I'll probably make this a real PCF resource at some point. But for now I'll let it sit here for feedback and cleanup.
As a coder, I am curious about the algorithm that determine who should pay who in as few transactions as possible.

And yes, I am one of those "cash is king" guys, but I understand simplifying this removes a major pain point for those that want to make the jump to cashless.
 
Minor UX Suggestion: Player List Input Flow

When adding a new player, it would be helpful if the cursor automatically focused on the newly created input field. That way, users can immediately start typing the player’s name after clicking “Add Player.”

Current flow:
Click “Add” → Move mouse → Click input → Type name → Press Enter → Move mouse → Click “Add”

Proposed flow:
Click “Add” → Type name → Press Enter → Click “Add”

This small tweak would streamline the experience and make adding multiple players much faster and more intuitive.
 
It looks like with a little tweaking this could be used as a “staking tracking” tool. Keep track of how much is staked from each backer and the results so they easily know where they stand.
 
What the heck is wrong with these guys, making the ladies pay for everything!

IMG_8739.webp
 
As a coder, I am curious about the algorithm that determine who should pay who in as few transactions as possible.
Yes! What’s the Math/Logic behind this. Very cool.

I'm not sure if it's optimal. And I actually coded it months ago, so I might not remember perfectly, but I think it's this:

1. Calculate each player's net. If the nets don't sum to 0, use a dummy player named "Bank" with a net that makes everything net to zero.

2. Sort the nets from biggest losers to biggest winners.

3. Search for exact matches (someone who lost exactly $100 should pay someone who won exactly $100). Make the loser owe the winner and remove them from future iterations.

4. Make the biggest loser in the current list owe the biggest winner (with the amount being the smaller of the two net absolute values). Then properly adjust each player's net for the next iteration. One of the two players should now be net zero and should be removed from the list for future iterations.

5. Repeat from step 2 until all the players are removed from the list (are net zero)
 
Cool stuff....could you do a simple staking tool :cool

name backer
% stake
mount of $$'s
paid (yes/no)

name event 1 - 10 (max)
BI event
Payout total (event)
Payout (per backer, based on % stake)

Payout total (all events)
Payout (per backer, based on % stake)

CGPT gave (pyton)

import pandas as pd

# === Backers Data ===
backers_data = {
"Backer Name": ["Backer 1", "Backer 2", "Backer 3"],
"% Stake": [30, 50, 20], # Percentages
"Amount Paid ($)": [300, 500, 200],
"Paid? (Yes/No)": ["Yes", "Yes", "No"]
}
backers_df = pd.DataFrame(backers_data)

# === Events Data (Up to 10 Events) ===
events_data = {
"Event #": list(range(1, 11)),
"Event Name": [f"Event {i}" for i in range(1, 11)],
"Buy-in ($)": [500]*10, # Sample buy-in
"Payout Total ($)": [0]*10 # You can fill this in later
}
events_df = pd.DataFrame(events_data)

# === Payout Sheet (initialized to 0) ===
payout_data = {
"Backer Name": backers_data["Backer Name"]
}
for i in range(1, 11):
payout_data[f"Payout Event {i}"] = [0]*len(backers_df)

# Total payout column
payout_data["Total Payout ($)"] = [0]*len(backers_df)
payout_df = pd.DataFrame(payout_data)

# === Save to Excel ===
with pd.ExcelWriter("Poker_Staking_Tracker.xlsx", engine='xlsxwriter') as writer:
backers_df.to_excel(writer, sheet_name="Backers", index=False)
events_df.to_excel(writer, sheet_name="Events", index=False)
payout_df.to_excel(writer, sheet_name="Payouts", index=False)

print("Poker_Staking_Tracker.xlsx has been created!")

Online would be much nicer vs Excel...something I can keep up to date and share in my trip reports.
 
I thought about an algorithm a few years ago, but gave up. Losers pay biggest winner; other winners request from biggest winner. Everyone only does at most one transaction; biggest winner initiates none and only tap "accept" money request. Not 100% optimized, but the logic is easy to understand at the end of a long poker session.

So for your example:
Alice requests $208 from Carol
Bob pays $100.50 to Carol
Carol accepts all requests (in this example, only Alice's)
David pays $200 to Carol
Edward pays $59.75 to Carol
Frank pays $132.75 to Carol
 
Cool stuff....could you do a simple staking tool :cool

name backer
% stake
mount of $$'s
paid (yes/no)

name event 1 - 10 (max)
BI event
Payout total (event)
Payout (per backer, based on % stake)

Payout total (all events)
Payout (per backer, based on % stake)

CGPT gave (pyton)

import pandas as pd

# === Backers Data ===
backers_data = {
"Backer Name": ["Backer 1", "Backer 2", "Backer 3"],
"% Stake": [30, 50, 20], # Percentages
"Amount Paid ($)": [300, 500, 200],
"Paid? (Yes/No)": ["Yes", "Yes", "No"]
}
backers_df = pd.DataFrame(backers_data)

# === Events Data (Up to 10 Events) ===
events_data = {
"Event #": list(range(1, 11)),
"Event Name": [f"Event {i}" for i in range(1, 11)],
"Buy-in ($)": [500]*10, # Sample buy-in
"Payout Total ($)": [0]*10 # You can fill this in later
}
events_df = pd.DataFrame(events_data)

# === Payout Sheet (initialized to 0) ===
payout_data = {
"Backer Name": backers_data["Backer Name"]
}
for i in range(1, 11):
payout_data[f"Payout Event {i}"] = [0]*len(backers_df)

# Total payout column
payout_data["Total Payout ($)"] = [0]*len(backers_df)
payout_df = pd.DataFrame(payout_data)

# === Save to Excel ===
with pd.ExcelWriter("Poker_Staking_Tracker.xlsx", engine='xlsxwriter') as writer:
backers_df.to_excel(writer, sheet_name="Backers", index=False)
events_df.to_excel(writer, sheet_name="Events", index=False)
payout_df.to_excel(writer, sheet_name="Payouts", index=False)

print("Poker_Staking_Tracker.xlsx has been created!")

Online would be much nicer vs Excel...something I can keep up to date and share in my trip reports.

I'm totally open to building something if it would really help. But if you already have a spreadsheet built, it sounds like you just need to upload it to Google Sheets and you're done. Then you can just share the link to whoever needs to see it.

You can also share the link to the "web" version of the sheet, if you want it to look a little cleaner to the viewers.
 
Unrelated to coding but there is a big risk that the losers do not pay if everything is settled at the end. I'm sure you know but wanted to raise this point in case it is not clear. With a system like this the big loser could "go to the washroom" or "go for a smoke" and never come back.
 
Unrelated to coding but there is a big risk that the losers do not pay if everything is settled at the end. I'm sure you know but wanted to raise this point in case it is not clear. With a system like this the big loser could "go to the washroom" or "go for a smoke" and never come back.
Oh plenty of digital ink on PCF has been spilled on this topic, plenty of other places to have this debate. The original post seemed to have a pretty clear preference this thread shouldn't become one of those.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account and join our community. It's easy!

Log in

Already have an account? Log in here.

Back
Top Bottom
Cart