Skip to content

Release: multi-chain convert, slippage guard, live estimation - #118

Open
stackdapp-dev wants to merge 7 commits into
mainfrom
develop
Open

stackdapp-dev wants to merge 7 commits into
mainfrom
develop

Conversation

@stackdapp-dev

Copy link
Copy Markdown
Owner

Summary

  • Multi-chain convert page — network dropdown (Arbitrum One / Ethereum ERC20) with chain-specific tokens and balances
    • Arbitrum: WBTC, ETH, USDT | Ethereum: XAUT, USDT, ETH
  • Slippage guard — user-configurable max slippage (default 1.0%), rejects fresh quotes exceeding tolerance
  • Live slippage estimation — compares quote rate vs CoinGecko market prices, shown in exchange rate card
    • Green when within tolerance, red when exceeded
    • Button disabled with dull red "Try Lower Slippage" state when exceeded
  • Network auto-switch fix — wallet switches to correct chain matching dropdown selection
  • Fee display — 0.3% crossed out with FREE in green
  • Backend — swap API routes and 0x route now support Ethereum chainId and XAUT/ETH token addresses

Test plan

  • 1664 tests pass (104 test files)
  • 17 TDD unit tests for calculateQuoteSlippage (basic calc, XAUT/ETH, edge cases, UI wiring)
  • 17 TDD unit tests for validateSlippage (tolerance, exceeded, edge cases)
  • Verify network dropdown switches tokens and balances correctly
  • Verify slippage input disables button in real-time when exceeded
  • Verify Ethereum ERC20 swaps work end-to-end (XAUT/USDT)

🤖 Generated with Claude Code

stackdapp-dev and others added 5 commits March 26, 2026 14:01
- Add editable Max Slippage input (default 1.0%) in exchange rate card
- Change Fee display to show 0.3% crossed out with FREE in green

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- useGaslessSwap accepts maxSlippagePct param (default 1.0%)
- Before signing, compares fresh quote buyAmount against original quote
- Rejects swap if price moved beyond user's max slippage tolerance
- Convert page passes user-configured slippage to the hook

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract slippage validation into pure exported function for testability
- Add 17 unit tests covering: within tolerance, exceeds tolerance, edge cases
- Verify implementation wiring (hook accepts param, executeSwap calls validator, page passes value)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add calculateQuoteSlippage() pure function comparing quote rate vs market USD prices
- Show Est. Slippage in exchange rate card (red when exceeding max)
- Disable convert button with dull red "Try Lower Slippage" when slippage exceeded
- 17 TDD unit tests: basic calc, XAUT/ETH swaps, edge cases, UI integration verification
- Tests written first (red), then implementation (green), verified full suite

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stackd-web Ready Ready Preview, Comment Apr 23, 2026 9:57am

Integration tests were timing out locally because the skip condition only
applied in CI. Now skips whenever ETHEREUM_RPC_URL (or NEXT_PUBLIC_ETHEREUM_RPC_URL)
is not set, preventing flaky timeouts on public rate-limited endpoints.

Also updates CLAUDE.md with feature integration branch workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates all UI-facing strings, alt text, page title, web manifest,
and corresponding tests to reflect the ArCa brand name.

https://claude.ai/code/session_01F7b6onmvAupSp1hhqdLehM

Co-authored-by: stackdapp-dev <dev@stackdapp.co>
Co-authored-by: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — cd187935 Deployed Apr 23, 2026 by vercel[bot]
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