joinmarket-webui / jam

Your sats. Your privacy. Your profit.
https://jamapp.org
MIT License
236 stars 48 forks source link

feat: adapt `merge_algorithm` setting #742

Open theborakompanioni opened 2 months ago

theborakompanioni commented 2 months ago

As a user, I want to adapt the merge_algorithm setting when starting the Maker service, in order to have more fine-grained control and the ability to use an already existing JM option.

See: https://github.com/joinmarket-webui/jam-docker/blob/master/standalone/default.cfg#L166-L170

Options:

default

Default coin selection algorithm.

https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/2a108992a8cd5395f036ba5ad1202b9f77e0a5b1/src/jmclient/support.py#L67C8-L68

gradual

UTXO selection algorithm for gradual dust reduction If possible, combines outputs, picking as few as possible of the largest utxos less than the target value; if the target value is larger than the sum of all smaller utxos, uses the smallest utxo larger than the value.

https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/2a108992a8cd5395f036ba5ad1202b9f77e0a5b1/src/jmclient/support.py#L86-L91

greedy

UTXO selection algorithm for greedy dust reduction, but leaves out extraneous utxos, preferring to keep multiple small ones

https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/2a108992a8cd5395f036ba5ad1202b9f77e0a5b1/src/jmclient/support.py#L113-L116

greediest

UTXO selection algorithm for speediest dust reduction Combines the shortest run of utxos (sorted by size, from smallest) which exceeds the target value; if the target value is larger than the sum of all smaller utxos, uses the smallest utxo larger than the target value.

https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/2a108992a8cd5395f036ba5ad1202b9f77e0a5b1/src/jmclient/support.py#L141-L146