Skip to content

Make Stocks costs clearer with expandable fee summaries - #1465

Merged
ebma merged 5 commits into
stagingfrom
codex/stocks-clear-fee-summary
Nov 17, 2026
Merged

ebma merged 5 commits into
stagingfrom
codex/stocks-clear-fee-summary

Conversation

@ebma

@ebma ebma commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Stocks currently leads with provider/chain names in its cost breakdown and mixes retained ETH with spent fees. Replace that presentation with the approved compact summary and a native expandable breakdown directly on the fee-total row, in Portuguese and English.

  • Group individual costs by payment/conversion, token trading/delivery and the Vortex service. Base USDC uses only its relevant trading, network and service categories.
  • Keep provider names as secondary explanations, clearly distinguish retained ETH, localize amounts and preserve meaningful USDC precision.
  • Share the presentation across the anonymous estimate and Pix/Base-USDC buy/sell reviews. Estimates remain explicitly illustrative.
  • Preserve unknown costs as unknown. Count embedded price effects once, explain already-applied discounts without deducting them again, and avoid claiming a complete cost when the breakdown is partial.
  • Treat a fully itemized quote as complete within the same one-cent (or one micro-USDC) rounding gap the quote validator accepts. The API rounds each fee line separately and the total once.
  • On a sell, the gross is the payout plus the cost total shown, so gross minus costs equals the payout. Sell percentages use that gross.
  • In the anonymous estimate, the retained ETH sits inside the cost card, between the costs and the amount used for the tokens, so the card adds up. The reserve note says the amount comes out of the payment.

The executable quote, funding amounts, payment/signature controls and recovery paths are unchanged. No new dependencies or platform configuration are required.

Validation: 440 Stocks tests pass, including fee accounting, the one-cent rounding case, a sell whose costs include price effects, the reserve's place in the estimate card, localized native disclosure interaction and checkout reserve regressions. Repository lint and demo/live builds pass. scripts/verify-pilot-ui.mjs and scripts/verify-usdc-ui.mjs now check the new summary, including that a sell's gross minus costs equals its payout, and both pass at 1440, 390 and 320 px on a local demo. Browser checks cover compact/expanded states, keyboard controls, the narrow stock-detail purchase panel, mobile layouts and simulated checkout reviews. Browser checks used no-money demo mode; no real Pix/USDC transfer or wallet signature was performed.

Draft against staging for review by @ebma.

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vrtx-dashboard canceled.

Name Link
🔨 Latest commit 9629300
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6afc040465e6fbfbdc617b83

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 9629300
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6afc04049f195f249a0fa58c
😎 Deploy Preview https://deploy-preview-1465--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 9629300
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6afc04043221412ea891a932
😎 Deploy Preview https://deploy-preview-1465--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

ebma added 4 commits November 17, 2026 08:36
… fee breakdown

The API rounds each fee line on its own and totalFeeFiat once, so a fully
itemized quote often lands one cent (or one micro-USDC) off its total.
providerCostProblem already accepts that gap, but groupedFees demanded an
exact match, so those quotes showed "Taxas informadas" with the partial
note and left their price effects out of the headline. groupedFees now
uses the same one-unit allowance.
With a complete breakdown the cost headline also counts the price effects
already inside the payout, but "Valor bruto" stayed brlAmount + fees, so
gross minus costs no longer equalled "Você recebe no Pix". sellGross adds
the headline to the payout; the Pix sell review and the sell percentage
bases (Pix and Base USDC) use it.
… card

The estimate's "Valor usado para comprar seus tokens" is the payment minus
the fees and the ETH kept for network fees, but the reserve sat below the
card, so its rows did not add up. It now sits in the card between the
costs and that amount, and the reserve note says it comes out of the
payment in both languages.
verify-pilot-ui and verify-usdc-ui still looked for the removed provider
cost table. They now check the fee groups, each cost line, the
no-surcharge note and the separate reserve inside the open sheet, and the
pilot check confirms that a sell's gross minus costs equals its payout.
verify-usdc-ui also waited for an English hero heading that an earlier
hero change replaced. Both pass at 1440, 390 and 320 px on a local demo.
@ebma
ebma marked this pull request as ready for review November 17, 2026 07:48
@ebma
ebma merged commit 067bd67 into staging Nov 17, 2026
6 checks passed
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