Copyright | © 2018-2024 Intersect MBO |
---|---|
License | Apache-2.0 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Submodules of this module provide implementations of coin selection algorithms.
Algorithms can be divided into two categories:
Algorithms that implement the general
CoinSelectionAlgorithm
interface.Algorithms that provide functionality suited to specialized purposes.
Generalized Algorithms
The following algorithms implement the general
CoinSelectionAlgorithm
interface:
Cardano.CoinSelection.Algorithm.LargestFirst
Provides an implementation of the Largest-First algorithm.
When selecting inputs from a given set of UTxO entries, this algorithm always selects the largest entries first.
Cardano.CoinSelection.Algorithm.RandomImprove
Provides an implementation of the Random-Improve algorithm.
When selecting inputs from a given set of UTxO entries, this algorithm always selects entries at random.
Once selections have been made, a second phase attempts to improve on each of the existing selections in order to optimize change outputs.
For guidance on choosing an algorithm that's appropriate for your scenario, please consult the following article:
https://iohk.io/en/blog/posts/2018/07/03/self-organisation-in-coin-selection/
Specialized Algorithms
The following algorithms provide functionality suited to specialized purposes:
Cardano.CoinSelection.Algorithm.Migration
Provides an algorithm for migrating all funds from one wallet to another.