Skip to main content

Configuration

Every knob has a default. Driver-wide knobs go to with_config, and per-chain ones go with the chain to with_chain:

let driver = Driver::new(ctx, client, store)
.with_config(Config {
poll_interval: Duration::from_secs(5),
..Config::default()
})
.with_chain(
Chain::Bitcoin,
esplora,
ChainConfig {
max_fee_rate: 50.0,
..ChainConfig::bitcoin()
},
)?;

Driver​

KnobDefaultEffect
funding_timeout24 hFrom creation, the latest a swap with nothing on chain is canceled. The invoice's expiry or the server's cancel ends it sooner.
poll_interval15 sThe longest a swap goes unchecked without a server signal.
server_timeout30 sHow long a server call may go unanswered before it counts as an outage.
fee_conf_target3 blocksThe confirmation target of every fee estimate.
fee_rate_cache_ttl30 sHow long a fee estimate is reused. Zero reads it every pass.
refund_timeout1 hHow long an ended SwapIn is still watched for late deposits.
max_htlc_hold1008 blocksThe longest a SwapOut's hold invoice may hold the payment. A swap whose invoice holds longer is refused at creation.

Per chain​

KnobBitcoinLiquidEffect
min_confs32The depth a SwapOut's funds reach before the preimage goes out, and a spend reaches before it ends a swap.
claim_margin2522520The CSV, in blocks, that must remain when a SwapOut's preimage goes out.
max_refund_csv100810080The longest CSV accepted on a SwapIn deposit. A swap with a longer one is refused at creation.
max_fee_rate1001The highest fee rate any spend pays, in sat/vB. A SwapOut holds its preimage while the estimate is above it.
block_time600 s60 sThe expected block interval, to compare a block deadline with a clock one.