feat: SHEEP CHOICE routing, cross-chain deposits, and any-token ZAP

One commit because the pieces do not compile apart: the shared copy, the tab
shell and the data layer all changed together, and splitting them further would
mean inventing intermediate states that never existed.

SHEEP CHOICE — the terminal's own swap. Quotes come from a solver that splits
one trade across several pools instead of forcing it down a single path, and
returns a ready-to-sign Settler transaction; the UI draws the split leg by leg
and scores every venue against one shared fee-free baseline, so the card that
says it pays most actually does. The Kyber transaction path is gone — Kyber is
read-only USD valuation now, and there is no Kyber calldata to sign.

BRIDGE — deposits from other chains over Relay, Across and the native portal,
priced side by side and sorted by what actually reaches you. No fee on any of
them. In-flight transfers get a countdown and survive a reload.

ZAP — add liquidity holding neither side of the pair; whatever needs swapping
is done in the same flow, with an optional stake-after step. Uniswap V2
liquidity now shows up under POSITIONS.

Swaps in flight are persisted, so a refresh mid-swap no longer loses the
transaction. Pair labels copy their token and pool addresses, and jump to
DexScreener.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
labrinyang
2026-07-23 00:01:52 +08:00
co-authored by Claude Opus 4.8
parent d73eaf873a
commit bca538e7e3
100 changed files with 10658 additions and 1638 deletions
+5 -1
View File
@@ -1,6 +1,8 @@
import type { Address } from 'viem'
// All addresses verified against Blockscout's verified source (compiler 0.8.19).
export const NATIVE = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' as Address
// All addresses verified on Blockscout — see docs/up33-contract-map.md at repo root.
export const ADDR = {
UP: '0x57C0E45cB534413D1C20A4240955d6bB250BB4F1',
VE_UP: '0x5d321dE36F0bf98D92b291280514F3878582B7B6',
@@ -27,6 +29,8 @@ export const ADDR = {
export const UNI = {
V3_FACTORY: '0x1f7d7550B1b028f7571E69A784071F0205FD2EfA',
V3_NPM: '0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3',
V3_QUOTER: '0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7',
V3_SWAP_ROUTER: '0xcaf681a66d020601342297493863e78c959e5cb2',
V2_FACTORY: '0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f',
V2_ROUTER: '0x89e5DB8B5aA49aA85AC63f691524311AEB649eba',
} as const satisfies Record<string, Address>