Skip to content

Reserve high fee when computing ramp sell max - #6260

Merged
j0ntz merged 1 commit into
developfrom
jon/paybis-max-sell-v2
Oct 16, 2026
Merged

j0ntz merged 1 commit into
developfrom
jon/paybis-max-sell-v2

Conversation

@j0ntz

@j0ntz j0ntz commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Selling the max ETH balance through a ramp could fail at the final send with "Insufficient ETH". Paybis, MoonPay and Banxa lock the deposit amount when the order is created, and the user sends it minutes later. The max was priced at the standard fee, leaving room for exactly one standard fee. A QA device log showed the base fee rising 9% across one 10 minute fee poll; when that happens between the quote and the send, the send cannot be paid for and the locked amount cannot be lowered.

getMaxSpendExchangeAmount prices the max at the high fee option. The send itself still pays the standard fee, so the difference stays in the wallet as dust. Token sells are unaffected, since their max is the token balance.

Asana: Max Sell v2 fix with real Paybis account

Testing: a second test account with Paybis KYC was funded with 0.0062 ETH. Sell ETH MAX quoted 0.00619671 ETH against a 0.00620017 ETH balance, reserving 3.46e-6 ETH (gas up to about 0.165 gwei, with the base fee at 0.116). The send scene charged the standard fee of 2.57e-6 ETH and the slide reached Transaction Success (tx 0xbdef0139222b83f512eee9283bd34d4cd613e585dce2b0197091824dba1fe3e2). Frames 1-6 are the pre-fix repro run; 7-12 are the fixed build.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Test evidence

cf44c8a
Reserve high fee when computing ramp sell max
2026-10-14

1. fund send armed

2. fund send success

3. paybis review max

5. repro send calculating fee

6. repro send armed

7. repro after slide

8. fund2 send armed

9. fund2 send success

10. fixed max quote

11. fixed paybis review

13. fixed send armed

14. fixed send success

Note

Low Risk
Small change to ramp sell max calculation only; slightly lower max quotes on native-coin sells with no impact on the actual send fee tier.

Overview
Fixes max sell on Paybis, MoonPay, and Banxa failing with insufficient funds when the network fee increases between quote and send.

Ramp sell orders lock the deposit amount at creation while the actual send happens later at the standard fee. getMaxSpendExchangeAmount in RampCreateScene now calls getMaxSpendable with networkFeeOption: 'high' so the quoted max reserves extra native balance for fee drift; the send still pays the standard fee and any difference stays as dust. Token max sells are unchanged.

Reviewed by Cursor Bugbot for commit 576b80e. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T21:47:17.860836Z cf44c8a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread src/components/scenes/RampCreateScene.tsx
Sell providers lock the deposit amount when the quote is created, and
the user sends it minutes later at the standard fee. The max was priced
at the standard fee, so any fee refresh in between left the locked
amount plus the new fee above the balance, and the locked amount could
not be lowered. Price the max at the high fee to keep a cushion; the
send itself still pays the standard fee.
@j0ntz
j0ntz force-pushed the jon/paybis-max-sell-v2 branch from cf44c8a to 576b80e Compare October 16, 2026 08:33
@j0ntz
j0ntz dismissed peachbits’s stale review October 16, 2026 16:05

The requested change (limit the high fee reserve to native sends) was answered on the resolved thread: token sells hit the same gap between the quoted fee and the fee at send time, so the reserve applies to them too. The land is approved through the task's Force Land field.

@j0ntz
j0ntz enabled auto-merge October 16, 2026 16:05
@j0ntz

j0ntz commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Landing this without a review.

  • Rationale: a one-line change to the network fee option used for max sells, verified end to end with a real Paybis sell
  • Authority: Force Land = Land Approved on the linked Asana task (1219516565532650)
  • Bypassed: the approving-review requirement only. Every required check is green on 576b80e3d425e47ca7469eb3e3332820565a728a.

@j0ntz
j0ntz merged commit 358aba0 into develop Oct 16, 2026
7 checks passed
@j0ntz
j0ntz deleted the jon/paybis-max-sell-v2 branch October 16, 2026 16:07
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.

2 participants