maker.offer_math
maker.offer_math
Pure liquidity calculations shared by maker offer creation and filling.
Attributes
Classes
Functions:
max_fillable_cj_amount(offer: Offer, max_balance: int) -> int | None
Return the greatest valid CoinJoin amount fillable by max_balance.
Relative fees use the exact Decimal half-even rounding used at fill time.
Bitcoin's MAX_MONEY bounds otherwise unbounded high-fee offers.
Source code in maker/src/maker/offer_math.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
required_maker_input(offer: Offer, cj_amount: int) -> int
Return the maker input value needed for a CoinJoin amount.
The result includes the maker's transaction fee contribution and reserves
DUST_THRESHOLD + 1 sats for the mandatory maker change output.
Source code in maker/src/maker/offer_math.py
11 12 13 14 15 16 17 18 19 20 21 22 23 | |