jmcore.bond_calc
jmcore.bond_calc
Fidelity bond value calculations.
Attributes
DEFAULT_BOND_VALUE_EXPONENT = 1.3
module-attribute
DEFAULT_INTEREST_RATE = 0.015
module-attribute
Functions
calculate_timelocked_fidelity_bond_value(utxo_value: int, confirmation_time: int, locktime: int, current_time: int | None = None, interest_rate: float = DEFAULT_INTEREST_RATE, exponent: float = DEFAULT_BOND_VALUE_EXPONENT) -> int
Calculate fidelity bond value using the timelocked bond formula.
Args: utxo_value: UTXO value in satoshis confirmation_time: UTXO confirmation timestamp (Unix seconds) locktime: Bond locktime (Unix seconds) current_time: Current time (Unix seconds), defaults to now interest_rate: Annual interest rate (default 0.015 = 1.5%) exponent: Bond value exponent (default 1.3)
Returns: Bond value as integer
Source code in jmcore/src/jmcore/bond_calc.py
14 15 16 17 18 19 20 21 22 23 24 25 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 | |