Repository navigation
Conversation
933389e to
4534819
Compare
72fa8fa to
e41aada
Compare
e41aada to
bfa823a
Compare
36698b6 to
6ce8bd8
Compare
Pull Request is not mergeable
Pull Request is not mergeable
jakubfilinger-b
left a comment
There was a problem hiding this comment.
No blockers. Two points to decide before this is enabled:
-
promo_rank_round_wagergets an upsert in every bet's transaction and a row for every staked round, also under the defaultflatbasis and for ineligible products, and rows leave only when a round is fully reversed. That is the hottest table in the feature, and it grows with play for operators who never usemargin. Could the round rows be written only underbasis: 'margin'(the period counter margin can stay counted under both), or could the retention decision get a deadline? -
The "rakeback and the bonus percents of a tier add up to at most 100" check reads as a guarantee that the payout stays inside the house edge. The ADR says that holds only while rakeback runs on its
marginbasis with no streak boost, and a null cap is uncapped. With rakeback on turnover or a streak boost, the same ladder can pay more than the margin. Either say so in the error text and admin docs, or tie the check to the rakeback basis.
This sits on #365, so it lands after it.
9b3895a to
f881dd7
Compare
|
f881dd7 to
90e0531
Compare
90e0531 to
40041ca
Compare
jakubfilinger-b
left a comment
There was a problem hiding this comment.
Re-reviewed after f881dd7. The rakeback-plus-bonus limit is now sound: the boost is trimmed on the margin basis and the docs say the stake basis can exceed the edge. Thanks.
One gap left in the round-row retention:
pruneSettledRoundWagers (rank-payout.service.ts) returns 0 until all three kinds (daily, weekly, monthly) have a paidThrough watermark. Only markPaid sets one, and settingsFor returns null, so markPaid never runs, for a kind without rewards[kind]. The seed does not set rewards. So an operator that does not configure all three periodic rewards, or whose payout job is not running, never prunes promo_rank_round_wager, while every staked round still upserts a row in the bet's transaction, also under flat. That is the unbounded growth from my first comment, just for the common default case. Could rows be pruned by age alone for kinds with no terms (or the row only be written under basis: 'margin')?
Smaller, non-blocking:
- The prune is one
DELETE ... RETURNING id; returning only a count avoids loading every id of a busy day into memory. - ADR-0049 here clashes with
0049-per-process-job-worker-selection.mdin #298. Whichever lands second needs a renumber.
b922384 to
51e2533
Compare
promo.rankPeriodic.basis 'margin' pays each tier's daily, weekly and monthly bonus percent of the period's own-money stake x (1 - rtp), capped by the tier's flat amount; the default 'flat' is unchanged. - recordWager counts the margin on the period counter under both bases and keeps each round's stake and converted margin in promo_rank_round_wager, so a rollback removes its proportional share. - A ladder save is refused when rakeback and the three bonus percents of a tier total more than 100, in the input and by a database check. - The ladder, the player's rank, promo.rank.changed and its notification params carry the percents and periodicBasis. - ADR-0047 records the decision.
51e2533 to
1f5fe0b
Compare
Summary
min(own-money stake × (1 − rtp) × percent / 100, tier cap), behindpromo.rankPeriodic.basis: 'margin'. The defaultflatis unchanged. The edge is priced by the sharedhouseEdgefrom feat(gamification): rakeback on the house edge and claimable rakeback #365, so a missing, zero or malformed rtp adds nothing.dailyBonusPercent,weeklyBonusPercentandmonthlyBonusPercent, set through the rank ladder admin.marginrakeback basis a streak boost is trimmed so rakeback, the boost and themarginbonuses pay at most the bet's edge.promo.rank.changedand its notification params carry the percents andperiodicBasis.Why
A flat periodic bonus costs the operator the same whatever the player gave up to the house, so it is hard to price on low-edge games. Rakeback already pays on the edge (ADR-0048); the periodic bonus now can too. ADR-0049 records the decision.
Diagram
Alternatives considered
margincolumn in the same upsert instead.Risks
0022_rank_periodic_margin: new nullable percent columns, amargincolumn defaulting to 0, thepromo_rank_round_wagertable with acreated_atindex, and CHECKs. An existing tier whose percents already total more than 100 cannot exist yet, since the percents are new.promo_rank_round_wagergets a row for every staked round under either basis. The daily prune deletes rows created more than 35 days ago, whether or not any periodic payout has run, and a rollback of a pruned round takes no margin back.margina provider that reports no rtp earns its players no periodic bonus.marginbasis. Onstakerakeback is a share of turnover and can exceed the edge.devafter it merges.