# ALL Mainnet Routing Engine — AlltraAdapter & AlltraCustomBridge Documents how **AlltraAdapter** and **AlltraCustomBridge** fit into the cross-chain routing engine for ALL Mainnet (651940) → Tezos USDtz flows. ## Overview - **ALL Mainnet** (chainId 651940): EVM blockchain, RPC `https://mainnet-rpc.alltra.global` - **AlltraAdapter**: Solidity contract bridging 651940 ↔ Ethereum (1) - **AlltraCustomBridge**: On-chain bridge component used when CCIP/LiFi do not support 651940 ## Routing Engine Integration ### Bridge Capability Matrix The `dbis_core` bridge capability matrix (`bridge-capability-matrix.ts`) includes: | Provider | Source | Destination | Assets | Status | |-----------------|------------|-------------|---------------------------|---------| | AlltraAdapter | 651940 | 1 | USDC, USDT, AUSDC, AUSDT, WETH | active | | AlltraAdapter | 1 | 651940 | USDC, USDT, WETH | active | ### Route Planner (ALL Mainnet → Tezos USDtz) The route planner supports `source_chain_id=651940` with this 4-hop path: 1. **ALL_MAINNET SWAP** — source asset → AUSDC (`0xa95EeD79f84E6A0151eaEb9d441F9Ffd50e8e881`) via AlltraDEX / EnhancedSwapRouter 2. **ALL_MAINNET BRIDGE** — AlltraAdapter: AUSDC → USDC on Ethereum 3. **HUB_EVM BRIDGE** — Wrap Protocol (or Allbridge): USDC → Tezos 4. **TEZOS SWAP** — USDC → USDtz via Plenty ### Chain Label Mapping (TRPE / EO) The Transaction Router + Policy Engine maps chain labels to IDs: | Label | Chain ID | |-------------|----------| | CHAIN138 | 138 | | ALL_MAINNET | 651940 | | HUB_EVM | 1 | | TEZOS | 1729 | | SOLANA | non-EVM (planned hops) | | TRON | non-EVM (planned hops) | | XRPL | non-EVM (planned hops) | ## Contract References - **AlltraAdapter**: `smom-dbis-138/contracts/bridge/adapters/evm/AlltraAdapter.sol` - **Chain Registry**: Uses chain type "EVM", identifier "ALL-Mainnet" for 651940 ## API Endpoints Structural route plans (multi-hop through Ethereum hub) are implemented in **multi-chain-execution** and mirrored in **dbis_core** under `/api/v1/routes`. | Method | Path | Service | Purpose | |--------|------|---------|---------| | POST | `/v1/routes/chain138-to-usdtz` | multi-chain-execution | Tezos USDtz path; `source_chain_id` **138** or **651940** | | GET | `/v1/routes/non-evm-families` | multi-chain-execution | Lists `tezos_usdtz`, `solana_usdc`, `tron_usdt`, `xrpl_usdc` metadata | | POST | `/v1/routes/plan-non-evm` | multi-chain-execution | Non-EVM multi-hop plan + `quote_hints`; body `destination_family` + `destination_address` | | POST | `/api/v1/routes/chain138-to-usdtz` | dbis_core | Same as above with optional `async_quotes` (CCIP / Plenty enrichment) | | GET | `/api/v1/routes/non-evm-families` | dbis_core | Same listing as multi-chain-execution | | POST | `/api/v1/routes/plan-non-evm` | dbis_core | Same planner + protocol **allowlist**; `async_quotes` supported for `tezos_usdtz` only | Canonical planner source: `multi-chain-execution/src/lib/non-evm-route-planner.ts` — keep `dbis_core/src/core/defi/tezos-usdtz/non-evm-route-planner.ts` in sync when editing hops. ## Related Docs - [TEZOS_NETWORK_CONFIG_ENV_MATRIX](../07-ccip/TEZOS_NETWORK_CONFIG_ENV_MATRIX.md) — RPC and bridge env vars - [ALL_MAINNET_TOKEN_ADDRESSES.md](ALL_MAINNET_TOKEN_ADDRESSES.md) — token addresses; [MASTER_INDEX.md](../MASTER_INDEX.md) — doc index; [11-references/CROSS_CHECK_SUMMARY_CCIP_9_CHAINS_AND_MAINNET.md](CROSS_CHECK_SUMMARY_CCIP_9_CHAINS_AND_MAINNET.md) — CCIP / Mainnet cross-check