Skip to content

Add --min-rate to alw swap now - #733

Closed
LandynDev wants to merge 1 commit into
testfrom
feat/swap-min-rate
Closed

LandynDev wants to merge 1 commit into
testfrom
feat/swap-min-rate

Conversation

@LandynDev

Copy link
Copy Markdown
Collaborator

alw swap now reserves the miner's current quote and sends at once. A miner that re-quotes between the preview and the bid gets its lower rate pinned, and the deposit still goes out.

  • New optional --min-rate <float>: directional, what the taker receives per 1 sent (the rate the CLI prints).
  • After the reservation is live and before any send (auto-send or manual print), the CLI re-reads the reservation on chain and derives its pinned rate with rate_display_from_fixed + directional_rate.
  • Under the floor: Reservation rate X below --min-rate Y; not sending, exit 1.
  • Read fails, not our reservation, or rate not derivable: Reservation unreadable; not sending: <why>, exit 1.
  • Without the flag nothing changes: no extra read.

An aborted reservation costs only the reservation fee, already paid at the bid. It expires at reserved_until, and the miner is free again.

Branched from 183ae17 (the rev optimal-allways-miner pins) so the miner can pin this commit directly.

Tests: tests/test_swap_now_min_rate.py (decision helper + swap now CLI harness).

@LandynDev LandynDev closed this Sep 14, 2026
@LandynDev
LandynDev deleted the feat/swap-min-rate branch September 14, 2026 22:17
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