Solving
Exits and lines
The core idea of the API: one solve is one street, a street ends in exits, and the next street starts from one exit and one card.
In short
- One solve is one street, and one call.
- An exit is a line that ends the street with chips behind. A next street starts from one exit and one card.
- A line is a list of tokens.
cis check or call,fis fold, andb33is a bet or raise that puts 33 chips in on the street.
Exits
An exit is a line that ends the street with chips behind. Each exit has an id, its line, and the pot and the stack at the start of the next street.
GET /v1/solves/{id}/exits lists the exits of a finished flop or turn solve, in the order of the betting tree. A river solve has no exits.
curl -sS "$GECKO_API/v1/solves/$FLOP/exits" -H "Authorization: Bearer $GECKO_KEY"
The answer: the exits of the quick start flop
{
"data": [
{"exit_id": "n2", "line": ["c", "c"], "pot": 100, "stack": 300},
{"exit_id": "n5", "line": ["c", "b33", "c"], "pot": 166, "stack": 267},
{"exit_id": "n8", "line": ["c", "b33", "b199", "c"], "pot": 498, "stack": 101},
{"exit_id": "n17", "line": ["b33", "c"], "pot": 166, "stack": 267},
{"exit_id": "n20", "line": ["b33", "b199", "c"], "pot": 498, "stack": 101}
]
}
The next street starts from one exit and one card. The solver takes the ranges at the exit from the solved street: you do not send ranges again.
A live solve can list fewer exits than a test key
A real solve leaves out an exit that no hand of one of the players reaches. So a live solve can list fewer exits than the tree preview and a test key show. Read the exits of the solve itself before you continue from it.
Lines and their tokens
A line is the list of actions from the start of the street, in order, out of position first. The API writes each action as a short token.
| Token | Meaning | You can also write |
|---|---|---|
c | Check or call | check, call, x |
f | Fold | fold |
b33 | A bet or a raise. The number is the chips this player has put in on this street after the action. A raise to 199 in total is b199. | bet:33, raise:199 |
75% | The bet or raise the tree makes for this share of the pot | bet:75% |
Exits always use c, f and b with chips. A line copied from an exit always works. The share form is read against the betting tree of the street: ["check", "33%", "call"] is ["c", "b33", "c"] in a pot of 100.
More about lines: no all-in, exit ids and node ids, and where the friendly forms work
A line to a next street never holds an all-in: when an all-in is called, the hand ends and no card comes. In a result the all-in is a b token with the whole stack, such as b300.
Where a request takes a line, it also takes the exit id ("n5") or a node id ("r:0:c:b33:c"). A line that does not end the street with chips behind is refused with 422 no_such_line, also inside then and expand. The answer has lines: the lines that do.
The friendly forms are for lines only. path and actions in locks and node_actions take c, f and b with chips.
Next: the three ways to ask for the next street.
Look it up
One solve is one street
what a solve returns, and how a street ends
One solve is one street. You give a board of 3, 4 or 5 cards, the pot, the stack behind and two ranges. The solver returns the strategy for that street: every decision until the street ends or the hand ends.
One solve is one call. A call costs 1 credit, whatever the street. You buy calls, and the API counts them in fields named credits.
A street can end in three ways. A player folds: the hand ends. Both players are all-in or it is the river: the hand ends at showdown.
Or the betting closes with chips behind on the flop or the turn: a card comes. That last kind of ending is an exit.