mamonet GitHub avatar

take-rate-controller

mamonet

A fast, deterministic controller that sets per-transaction commission (take rate) to hit an aggregate target while protecting counterparty on unattractive transactions.

Stars

5

7-day growth

No data

Forks

1

Open issues

0

License

No data

Last updated

2026-07-28

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It is a control loop, not a large model; deterministic, auditable, and money-safe, addressing the marketplace need for dynamic take rates without over-taxing low-value jobs.

Who it is for

  • Marketplace platform developers
  • Fintech engineers building payment/monetization systems
  • Operations teams managing commission strategies

Use cases

  • Dynamic commission setting for ride-hailing services
  • Per-transaction fees on delivery platforms
  • Freelance marketplace commission optimization
  • Any marketplace needing aggregate take rate convergence

Strengths

  • Money-safe: no floats, invariant checked, hard-clamped outputs
  • Deterministic fallback on timeout or failure
  • Anti-windup integral for smooth convergence after sustained clamping
  • Hot-reloadable per-segment config

Considerations

  • Reusable engine, not a full platform product
  • Requires integration with marketplace's transaction system
  • Signal modulation parameters may need tuning per domain

README quick start

take-rate-controller

A fast, deterministic controller that sets a per-transaction commission (take rate) to hit an aggregate target, while protecting the counterparty on the unattractive transactions.

Marketplaces usually want an overall take rate, say 20%, without charging the same percentage on every transaction. A flat rate is simple but crude: it over-taxes low-value or hard-to-serve jobs and leaves value on the table on attractive ones. take-rate-controller decides each transaction's commission inside configured bounds so that the running effective take rate converges on the target, lowering or zeroing commission on low-value or low-demand transactions to protect earnings, and taking a little more on high-demand ones.

It is a control and optimization problem, so it is built as a control loop, not a large model: each decision is arithmetic plus a bounded, explainable modulation, returned in microseconds, fully auditable, and safe for money.

Scope note: a generic marketplace take-rate engine (rides, delivery, services). Deterministic at inference, with no LLM anywhere in the money path. This is the reusable engine, not a clone of any one platform's product.


How it works

flowchart LR
    Req[amount, tax, segment] --> V[validate]
    V --> C[controller\ntarget vs current effective]
    C --> M[signal modulation\ndemand / supply / opportunity]
    M --> K[clamp to segment bounds]
    K --> D[decision: commission %, amount, payout]
    Done[completed txns] -. async .-> Agg[running aggregates] --> C
    D --> L[decision log]
    C -. timeout / failure .-> FB[safe fallback] --> D
  • Per-segment config: a zero-commission threshold, a minimum, a maximum, and a target, held in memory and hot-reloadable.
  • Closed-loop control: proportional and integral correction on the gap between the running effective take rate and the target, so the aggregate lands where it should over time.
  • Signal modulation: each decision is nudged by demand, supply, and opportunity scores, down to protect low-value or low-demand transactions, up on high-demand ones.
  • Money-safe by construction: minor units or decimals, never floats; commission taken on the amount after tax; the invariant commission + payout == amount_after_tax is checked; the result is hard-clamped so a payout can never go negative or out of bounds.

Description

Deterministic PI control loop that sets per-transaction marketplace commission to converge on an aggregate take-rate target, with integer money, hard bounds, and a guaranteed fallback.

Related repositories

Similar projects matched by category, topics, and programming language.

slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
jamesob
Featured
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

AI & Machine LearningLarge Language Models
1,660
makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958