Co-authored-by: Cursor <cursoragent@cursor.com>
11 KiB
Tezos USDtz Integration — Implementation Roadmap
Last Updated: 2026-02-01
Status: Active — Gap remediation and integration
Priority Overview
| Priority | Focus | Blockers Removed |
|---|---|---|
| P1 | Validation & bridge discovery | Production-ready route plans |
| P2 | Real quotes and fees | Accurate UX and routing |
| P3 | Execution path | End-to-end execution |
| P4 | Polish & hardening | Security and compliance |
P1 — Validation & Bridge Discovery (Critical Path)
P1-1: Verify USDtz contract on Tezos mainnet and document
Why first: Route targets an unverified contract; wrong address breaks delivery.
Steps:
- Query TzKT API:
GET https://api.tzkt.io/v1/contracts/KT1LN4LPSqTMS7Sd2CJw4bbDGR5Mv2t68Fy9 - Confirm FA1.2 interface (balanceOf, transfer entrypoints)
- Verify token metadata (symbol, decimals) via
GET .../bigmaps/... - Update TEZOS_TOKEN_REGISTRY.md with verified address and metadata
- Add optional runtime check in
tezos-dex-quote.service.ts(fetch token info on init)
P1-2: Research and add active ETH→Tezos bridge to capability matrix
Why: Without an active bridge, Route Class B cannot execute.
Steps:
- Check current status of:
- Wrap Protocol — wrap.xyz / Wrap
- Allbridge — allbridge.io
- Multichain — multichain.xyz (deprecated/inactive?)
- Plenty bridge — plenty defi ecosystem
- MVM Bridge — Tezos↔Ethereum (Chainspot)
- For each candidate:
- Confirm USDC/USDT support
- Note API/docs for quotes and execution
- Classify method (lock/mint, wrapped, custodial)
- Update bridge-capability-matrix.ts:
- Set
status: 'active'for verified bridges - Add
apiUrl,docsUrlif useful
- Set
- Add bridge-specific quote/execute adapters (new files per bridge)
P1-3: Replace TBD bridge provider in route-routes and route-planner
Why: Eliminates placeholder in route output.
Status: route-routes.ts uses constant ETH_TO_TEZOS_PROVIDER = 'Wrap Protocol' (no "TBD"). To make provider dynamic, use eth2tz[0]?.provider ?? 'Wrap Protocol' when loading from bridge-capability-matrix.
Steps:
- In route-routes.ts: Currently uses
ETH_TO_TEZOS_PROVIDERconstant; optional: replace witheth2tz[0]?.provider ?? 'Wrap Protocol'when matrix is queried - In route-planner.service.ts: Use
getCandidateBridgesForPlanning(already done) — verify it returns a provider when one is active - When no active bridge: return clear error, e.g.
"No active Ethereum→Tezos bridge; check bridge-capability-matrix"
P2 — Real Quotes and Fees (Accuracy)
P2-1: Integrate Tezos DEX quote APIs (Plenty/Quipuswap/SpicySwap)
Why: USDC/USDT→USDtz quotes are currently 1:1 stubs.
Steps:
- Identify DEX APIs:
- Plenty:
https://api.plenty.networkor equivalent - Quipuswap:
https://api.quipuswap.comor similar - SpicySwap: API docs
- Plenty:
- Add
TezosDexQuoteProviderinterface intezos-dex-quote.service.ts - Implement one provider (e.g. Plenty) first:
- Map USDC/USDT and USDtz token addresses
- Call swap quote endpoint
- Parse
amountOut,amountOutMin,priceImpact
- Add aggregator: call all providers, pick best quote
- Handle failures: fallback to next provider or 1:1 with warning
P2-2: Integrate Chain138 swap quotes (EnhancedSwapRouter/1inch) in route planner
Why: First-hop swap (asset→cUSDC) has no real quote.
Steps:
- In route planner, detect when
source_asset !== cUSDC(or cUSDT) - Call existing services:
- Option A: smom-dbis-138/orchestration/bridge/quote-service.ts — if it exposes swap quotes
- Option B: alltra-lifi-settlement — 1inch/ParaSwap/0x (Chain138 may need custom chain config)
- Option C: Direct 1inch API —
https://api.1inch.dev/swap/v5.2/138/quote
- Add
getChain138SwapQuote(sourceAsset, amount, targetAsset)in route planner or shared service - Populate hop 1
amount_out,min_amount_out,estimated_feesfrom quote - When source is already cUSDC: skip swap or use 1:1
P2-3: Integrate real CCIP fee estimation in route planner
Why: Bridge fees are currently "0".
Steps:
- Locate CCIP fee logic:
- smom-dbis-138/services/relay or CCIP router contract
- CCIP Router
getFee()or equivalent
- Add
getCCIPFee(sourceChain, destChain, token, amount)helper - In route planner hop 2 (CCIP): call helper, set
estimated_fees - Add to
totalEstimatedFeesaggregation
P3 — Execution Path (End-to-End)
P3-1: Implement Tezos sendTransaction (Taquito injection)
Why: TezosAdapter sendTransaction currently throws.
Steps:
- Add
@taquito/taquitoto multi-chain-execution - In adapter-tezos.ts:
- Accept signed operation bytes (hex or Uint8Array)
- Use
TezosToolkit+rpc.injectOperation(signedBytes)or directfetch('https://mainnet.api.tez.ie/injection/operation', { method: 'POST', body: ... })
- Return
{ hash, from, nonce }— Tezos op hash ashash - For MVP: support pre-signed payload from external signer; in-house signing can come later
P3-2: Map RoutePlan hops to TRPE/EO execution steps
Why: Route planner outputs 4 hops; TRPE/EO use 2-step message_send/receive.
Steps:
- Extend TRPE to accept optional
route_planin IntentRequest - When
route_planpresent:- Build
PlannedStep[]fromroute_plan.hops(one step per hop) - Set
step_typefrom hopaction(SWAP→swap, BRIDGE→bridge, etc.) - Set
chain_idfrom hopchain(CHAIN138→138, HUB_EVM→1, TEZOS→1729)
- Build
- EO: when executing, for each step call the appropriate adapter (138, 1, 1729)
- For BRIDGE steps: delegate to bridge-specific execution (CCIP, ETH→Tezos bridge) — may need
BridgeExecutorabstraction
P3-3: Add Tezos wallet signing (Taquito + Kukai/Material)
Why: Final Tezos swap/transfer requires a Tezos signer.
Steps:
- Add
@taquito/signeror use@taquito/walletfor browser integration - Create
TezosSignerinterface:signOperation(operation): Promise<SignedOperation> - Integrate with Kukai / Temple / Material wallet:
- Use
@taquito/beacon-walletor similar for dApp wallet connection - Or server-side:
InMemorySignerwith encrypted key (operational wallet)
- Use
- Wire into execution flow: when EO reaches Tezos step, use TezosSigner to sign before
adapter.sendTransaction
P4 — Polish & Hardening
P4-1: Populate TEZOS_TOKEN_REGISTRY intermediary stablecoins (USDC/USDT)
Steps:
- Query TzKT for USDC/USDT (or wrapped) contracts on Tezos mainnet
- Update TEZOS_TOKEN_REGISTRY.md with addresses, decimals, FA standard
- Add to
tezos-dex-quote.service.tstoken config for lookup
P4-2: Add dbis_core route API endpoint (optional)
Steps:
- Create dbis_core/.../tezos-usdtz.routes.ts — or similar path
- Implement
POST /api/v1/routes/chain138-to-usdtzcallingplanRoutesfrom route-planner.service - Register in app.ts
- Use when clients should hit dbis_core API instead of multi-chain-execution
P4-3: Implement security: allowlists, slippage caps, approval reuse prevention
Steps:
- Allowlists: Add config (JSON/env) of approved DEX routers, bridge contracts, token addresses
- Validate in route planner: all hop protocols/addresses must be allowlisted
- Slippage caps: Enforce
max_slippage_bpsin quotes; reject routes exceeding cap - Approval reuse: For ERC-20 approvals, use
approve(spender, amount)with exact amount; after swap/bridge, callapprove(spender, 0)or document pattern - Tezos FA verification: Before transfer, optionally verify USDtz contract has expected entrypoints via TzKT
P4-4: EO production env checks
Why: Placeholder wallet and placeholder tx hashes must not be used in production.
Steps:
- Set
WALLET_ADDRESSfor the operational hot wallet - Set
SIGNER_ENABLED=truewhen real signing is active — EO will throw ifWALLET_ADDRESSis unset - Replace placeholder tx hashes with real
adapter.sendTransactionwhen signer is integrated - See execution-orchestrator.ts for env usage
Dependency Graph
P1-1 (USDtz verify) ─────────────────────────────────────────────┐
│
P1-2 (ETH→Tezos bridge) ─── P1-3 (Replace TBD) │
│
P2-1 (Tezos DEX quotes) ─────────────────────────────────────────┤
P2-2 (Chain138 swap quotes) ─────────────────────────────────────┤
P2-3 (CCIP fees) ────────────────────────────────────────────────┼──> Production Route
│
P3-1 (Tezos sendTransaction) ────────────────────────────────────┤
P3-2 (RoutePlan→EO mapping) ─── P3-3 (Tezos wallet) ─────────────┤
│
P4-1 (Token registry) ───────────────────────────────────────────┘
P4-2 (dbis_core API) ─── optional
P4-3 (Security) ─── parallel to P3
Suggested Execution Order
- P1-1 → P1-2 → P1-3 (sequential)
- P2-1, P2-2, P2-3 (parallel where possible)
- P3-1 → P3-2 → P3-3 (P3-2 can start once RoutePlan shape is stable)
- P4-1 with P2; P4-2 when convenient; P4-3 in parallel with P3