Skip to content

Invert utility max to cost minimization#11

Open
arminsabouri wants to merge 7 commits intomasterfrom
cost-min
Open

Invert utility max to cost minimization#11
arminsabouri wants to merge 7 commits intomasterfrom
cost-min

Conversation

@arminsabouri
Copy link
Collaborator

Shifted action evaluation from utility maximization to cost minimization inverted outcome scoring.
Switched wallet selection to min_by_key to pick the lowest cost.

@arminsabouri arminsabouri requested a review from nothingmuch March 5, 2026 14:21
@arminsabouri arminsabouri marked this pull request as draft March 5, 2026 14:36
@arminsabouri
Copy link
Collaborator Author

Latest changes include

  • Instead of a util maximization problem it is a cost minimization problem each wallet is solving
  • New consolidation strategies. For each payment obligation the wallet will spend all available UTXOs
  • After a sim run we will save and record some stats about the simulation run as well as the config used to generate it and the tx graph.

Shifted action evaluation from utility maximization to cost minimization
inverted outcome scoring.
Switched wallet selection to `min_by_key` to pick the lowest cost.

Additionally, Mp Payjoin actions should have 0 cost.
This is test scaffolding for now and a WIP.
Base cost = amount handled + fee_paid
This strategy will always prefer to consolidate
their UTXOs for each payment. This is their most prefered
action at 0 cost.
@arminsabouri arminsabouri marked this pull request as ready for review March 6, 2026 20:52
Comment on lines +39 to +40
/// Weight applied to UTXO consolidation utility
pub consolidation_weight: f64,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this is not used. Probably best to remove it for now

new_multi_party_payjoins: Vec<(BulletinBoardId, MessageId)>,
current_timestep: TimeStep,
wallet_id: WalletId,
spendable_utxos_count: usize,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also did not end up being used since consolidating is represented as a 0 cost action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant