Class ProbabilisticScoringParameters


  • public class ProbabilisticScoringParameters
    extends Object
    Parameters for configuring [`ProbabilisticScorer`].
    • Method Detail

      • get_liquidity_penalty_multiplier_msat

        public long get_liquidity_penalty_multiplier_msat()
        A multiplier used to determine the amount in msats willing to be paid to avoid routing through a channel, as per multiplying by the negative `log10` of the channel's success probability for a payment. The success probability is determined by the effective channel capacity, the payment amount, and knowledge learned from prior successful and unsuccessful payments. The lower bound of the success probability is 0.01, effectively limiting the penalty to the range `0..=2*liquidity_penalty_multiplier_msat`. The knowledge learned is decayed over time based on [`liquidity_offset_half_life`]. Default value: 10,000 msat [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
      • set_liquidity_penalty_multiplier_msat

        public void set_liquidity_penalty_multiplier_msat​(long val)
        A multiplier used to determine the amount in msats willing to be paid to avoid routing through a channel, as per multiplying by the negative `log10` of the channel's success probability for a payment. The success probability is determined by the effective channel capacity, the payment amount, and knowledge learned from prior successful and unsuccessful payments. The lower bound of the success probability is 0.01, effectively limiting the penalty to the range `0..=2*liquidity_penalty_multiplier_msat`. The knowledge learned is decayed over time based on [`liquidity_offset_half_life`]. Default value: 10,000 msat [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
      • get_liquidity_offset_half_life

        public long get_liquidity_offset_half_life()
        The time required to elapse before any knowledge learned about channel liquidity balances is cut in half. The bounds are defined in terms of offsets and are initially zero. Increasing the offsets gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases the certainty of the channel liquidity balance. Default value: 1 hour # Note When built with the `no-std` feature, time will never elapse. Therefore, the channel liquidity knowledge will never decay except when the bounds cross.
      • set_liquidity_offset_half_life

        public void set_liquidity_offset_half_life​(long val)
        The time required to elapse before any knowledge learned about channel liquidity balances is cut in half. The bounds are defined in terms of offsets and are initially zero. Increasing the offsets gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases the certainty of the channel liquidity balance. Default value: 1 hour # Note When built with the `no-std` feature, time will never elapse. Therefore, the channel liquidity knowledge will never decay except when the bounds cross.
      • of

        public static ProbabilisticScoringParameters of​(long liquidity_penalty_multiplier_msat_arg,
                                                        long liquidity_offset_half_life_arg)
        Constructs a new ProbabilisticScoringParameters given each field
      • write

        public byte[] write()
        Serialize the ProbabilisticScoringParameters object into a byte array which can be read by ProbabilisticScoringParameters_read
      • with_default

        public static ProbabilisticScoringParameters with_default()
        Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.