Skip to content

Invert utility max to cost minimization#11

Merged
arminsabouri merged 7 commits intomasterfrom
cost-min
Mar 26, 2026
Merged

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

Conversation

@arminsabouri
Copy link
Copy Markdown
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
Comment thread src/actions.rs Outdated
@arminsabouri
Copy link
Copy Markdown
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.

@arminsabouri arminsabouri force-pushed the cost-min branch 2 times, most recently from 9eee746 to 65825c2 Compare March 6, 2026 20:23
@arminsabouri arminsabouri marked this pull request as ready for review March 6, 2026 20:52
Comment thread src/config.rs Outdated
Comment thread src/actions.rs Outdated
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
Copy link
Copy Markdown
Collaborator Author

this PR ended up doing more than it was suppose to (PR title). Going forward these will be split into smaller PRs

@arminsabouri arminsabouri merged commit f8197f1 into master Mar 26, 2026
1 check passed
@arminsabouri arminsabouri deleted the cost-min branch March 26, 2026 16:32
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