Configuration
Every knob has a default. Driver-wide knobs go to
with_config, and per-chain ones go with the
chain to with_chain:
- Rust
- TypeScript
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()
},
)?;
const driver = new Driver(ctx, client, store)
.withConfig({ pollInterval: 5 })
.withChain(Chain.Bitcoin, esplora, { maxFeeRate: 50 });
Driver
| Knob | Default | Effect |
|---|---|---|
funding_timeout | 24 h | From creation, the latest a swap with nothing on chain is canceled. The invoice's expiry or the server's cancel ends it sooner. |
poll_interval | 15 s | The longest a swap goes unchecked without a server signal. |
server_timeout | 30 s | How long a server call may go unanswered before it counts as an outage. |
fee_conf_target | 3 blocks | The confirmation target of every fee estimate. |
fee_rate_cache_ttl | 30 s | How long a fee estimate is reused. Zero reads it every pass. |
refund_timeout | 1 h | How long an ended SwapIn is still watched for late deposits. |
max_htlc_hold | 1008 blocks | The longest a SwapOut's hold invoice may hold the payment. A swap whose invoice holds longer is refused at creation. |
Per chain
| Knob | Bitcoin | Liquid | Effect |
|---|---|---|---|
min_confs | 3 | 2 | The depth a SwapOut's funds reach before the preimage goes out, and a spend reaches before it ends a swap. |
claim_margin | 252 | 2520 | The CSV, in blocks, that must remain when a SwapOut's preimage goes out. |
max_refund_csv | 1008 | 10080 | The longest CSV accepted on a SwapIn deposit. A swap with a longer one is refused at creation. |
max_fee_rate | 100 | 1 | The highest fee rate any spend pays, in sat/vB. A SwapOut holds its preimage while the estimate is above it. |
block_time | 600 s | 60 s | The expected block interval, to compare a block deadline with a clock one. |