Coin Selection Strategy¶
-
enum cardano_selection_strategy_t¶
Indicates how much of each asset the random improve selector attempts to select, relative to the minimum amount necessary to cover the target.
The optimal strategy attempts to select around twice the minimum possible amount of each asset, making it possible to generate change outputs that are roughly the same sizes and shapes as the user-specified outputs. This is the recommended default: it helps a wallet’s UTXO distribution evolve over time to resemble the distribution of the payments it makes.
The minimal strategy selects just enough of each asset to meet the minimum amount, producing selections with fewer inputs (and therefore smaller, cheaper transactions) at the cost of change outputs that are much smaller than the user-specified outputs.
Note
Because the selector upholds an exact local balance and acquires additional ada whenever change construction requires it, a selection that fails with the optimal strategy will also fail with the minimal strategy; no automatic fallback between strategies is performed.
Values:
-
enumerator CARDANO_SELECTION_STRATEGY_MINIMAL¶
Selects just enough of each asset to meet the minimum amount.
-
enumerator CARDANO_SELECTION_STRATEGY_OPTIMAL¶
Attempts to select around twice the minimum amount of each asset.
-
enumerator CARDANO_SELECTION_STRATEGY_MINIMAL¶