Skip to content

lsps2 fee and channel configuration#4

Open
johncantrell97 wants to merge 1 commit intomainfrom
lsps2-config
Open

lsps2 fee and channel configuration#4
johncantrell97 wants to merge 1 commit intomainfrom
lsps2-config

Conversation

@johncantrell97
Copy link
Copy Markdown
Collaborator

Allows LSP user to configure fee and channel parameters with sane defaults.

  • Set fees based on a multiple of the current fee rates based on their fee estimator.
  • Set min/max payment sizes
  • Set min/max channel sizes
  • Set forwarding fees on JIT channels opened
  • Set channel size based on payment size
/// How many times the current funding tx fee rates should charge for a channel.
pub funding_tx_fee_multiplier: f32,
/// What fee rate estimate to use when calculating opening fee.
pub funding_tx_fee_multiplier_source_rate: ConfirmationTarget,
/// A minimum fee you will charge regardless of current fee rates.
pub minimum_min_fee_msat: u64,
/// How many millisatoshis to charge for every million millisatoshis received
/// in the initial payment of a JIT channel.
pub proportional_fee: u32,
/// How many minutes the offer we present to the client is valid for.
pub fee_valid_for_minutes: i64,
/// How many blocks we guarantee we will keep the channel open for.
pub min_lifetime_blocks: u32,
/// Maximum number of blocks the client can set our to_self_delay to.
/// How long we would have to wait to get our funds back if we need to force close the channel.
pub max_client_to_self_delay_blocks: u32,
/// The minimum payment size above our minimum fee we will allow.
pub min_payment_size_buffer_msats: u64,
/// The maximum payment size we will allow a user to receive during the JIT channel opening flow.
pub max_payment_size_msats: u64,
/// The cltv_expiry_delta the client sets on the invoice to be paid by payer.
/// How long we have to claim HTLC-encumbered balances when channel is force-closed.
pub client_invoice_cltv_expiry_delta: u32,
/// What channel size we should open based on the incoming payment size.
pub channel_size_factor: f64,
/// The minimum channel size we will open regardless of payment size.
pub min_channel_size_sats: u64,
/// The base fee in msats for forwarding htlcs over the channel once open.
pub forwarding_fee_base_msat: u32,
/// The fee in sats per million satoshis being forwarded over the channel once open.
pub forwarding_fee_proportional_millionths: u32,

use std::time::Duration;

const LIQUIDITY_REQUEST_TIMEOUT_SECS: u64 = 5;
const AVERAGE_OPENING_TX_WEIGHT: f32 = 616.0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you arrive at this value? Could you add a comment?

Copy link
Copy Markdown
Owner

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is great, but I'm a bit unsure if we should just keep the "no-limits" LSP mode for now to reduce friction for the demo as much as possible?

@johncantrell97
Copy link
Copy Markdown
Collaborator Author

I think this is great, but I'm a bit unsure if we should just keep the "no-limits" LSP mode for now to reduce friction for the demo as much as possible?

Yeah, seems reasonable to wait until post hack week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants