Files
proxmox/docs/GALATIC_SUMMARY.md

237 lines
12 KiB
Markdown
Raw Normal View History

# Galatic Summary — Chain 138 Ecosystem, Routing, and Integrations
**Audience:** Galatic
**Last Updated:** 2026-03-01
**Purpose:** Single reference for what is built, all available routing (DEX and aggregators), On-Ramp/Off-Ramp, Fireblocks, and other integrations.
---
## 1. What Is Built Here
### 1.1 Core Network: Chain 138 (DeFi Oracle Meta Mainnet)
- **Chain ID:** 138
- **Name:** Defi Oracle Meta Mainnet (D-BIS)
- **Consensus:** Besu (EVM); validator set and RPC nodes on Proxmox/LAN.
- **Public RPCs:**
- `https://rpc-http-pub.d-bis.org`, `https://rpc.d-bis.org`, `https://rpc2.d-bis.org`
- `https://rpc.defi-oracle.io`, `https://138.rpc.thirdweb.com`
- **Explorer:** **Blockscout** — https://explorer.d-bis.org
- **Chainlist:** https://chainlist.org/chain/138
**Protocol/wallet acceptance:** Ledger App-Ethereum (in firmware), Chainlist, thirdweb (chain + bridge), MetaMask (custom network / Chainlist), Blockscout, ethers.js compatible.
---
### 1.2 On-Chain Contracts (Chain 138)
| Area | Component | Status | Address / Note |
|------|-----------|--------|----------------|
| **Compliance & tokens** | ComplianceRegistry, TokenFactory, DebtRegistry, PolicyManager | Deployed | See CONTRACT_ADDRESSES_REFERENCE |
| **Stablecoins** | Compliant cUSDT, cUSDC | Deployed | cUSDT, cUSDC; optional cEURC, cEURT, cGBP*, cAUDC, cJPYC, cCHFC, cCADC, cXAU* |
| **Bridges** | Bridge Vault (multi-chain stablecoin) | Deployed | `0x31884f84555210FFB36a19D2471b8eBc7372d0A8` |
| **CCIP** | CCIP WETH9/WETH10 bridges (138 ↔ Ethereum L2s) | Deployed | Deterministic addresses; LINK-funded |
| **PMM / DEX** | DODOPMMIntegration (Mock DVM) | Deployed | `0x79cdbaFBaA0FdF9F55D26F360F54cddE5c743F7D` |
| **PMM pools** | cUSDT/cUSDC, cUSDT/USDT, cUSDC/USDC | Created | Pool addresses in LIQUIDITY_POOLS_MASTER_MAP |
| **PMM routing** | DODOPMMProvider | Deployed | `0x8EF6657D2a86c569F6ffc337EE6b4260Bd2e59d0`; all three pools registered |
| **Registry** | ChainRegistry (UUPS proxy) | Deployed | `0x6949137625CA923A4e9C80D5bc7DF673f9bbb84F`; EVM + non-EVM chain registry |
| **Truth Network** | TruthNetworkAdapter (non-EVM) | Deployed | `0x7880Ef14887a0567807AcF785eC92553D014930f`; Truth registered in ChainRegistry |
| **Trustless bridge** | Lockbox138 | Deployed | `0xFce6f50B312B3D936Ea9693C5C9531CF92a3324c` |
| **Multi-provider DEX router** | EnhancedSwapRouter | Not deployed | For Uniswap/Balancer/Curve/1inch when pools exist on 138 |
| **Swapbridgeswap** | SwapBridgeSwapCoordinator | Script exists | Deploy when E2E swap+bridge+swap flow is needed |
**References:**
- [CONTRACT_ADDRESSES_REFERENCE](11-references/CONTRACT_ADDRESSES_REFERENCE.md)
- [LIQUIDITY_POOLS_MASTER_MAP](11-references/LIQUIDITY_POOLS_MASTER_MAP.md)
- [PMM_DEX_ROUTING_STATUS](11-references/PMM_DEX_ROUTING_STATUS.md)
---
### 1.3 Services & APIs
| Service | Purpose | API / Location |
|---------|---------|----------------|
| **Token-aggregation** | Token/pool index; single-hop DEX quotes; bridge routes; token mapping | `GET /api/v1/quote`, `/api/v1/tokens`, `/api/v1/bridge/routes`, `/api/v1/token-mapping`; see REST_API_REFERENCE |
| **Bridge quote (orchestration)** | Swap + bridge + swap quotes | `POST /api/bridge/quote` (source/dest swap optional) |
| **Ramp API** (metamask-integration) | On-ramp / off-ramp session creation | `POST /ramps/on-ramp/session`, `POST /ramps/off-ramp/session`, `GET /ramps/quote`, `GET /ramps/providers` |
| **Crypto.com OTC** (dbis_core) | Institutional OTC, RFQ, settle-later | `/api/v1/crypto-com-otc` (dbis-api.d-bis.org) |
| **Exchange Registry** (dbis_core) | Multi-exchange price aggregation | `/api/v1/exchange` (Binance, Kraken, Oanda, FXCM) |
| **Explorer backend** | Bridge aggregator (Li.Fi, Socket, Squid, etc.) | Bridge routes; not on-chain DEX on 138 |
---
## 2. DEX and Aggregator Routing — Whats Available
### 2.1 On-Chain Routing (Chain 138)
- **Live today:**
- **DODO-style PMM** via **DODOPMMIntegration** and **DODOPMMProvider**.
- **Three pools:** cUSDT/cUSDC, cUSDT/USDT, cUSDC/USDC.
- Swaps: use pool address + `swapCUSDTForUSDC`, `swapCUSDTForUSDT`, `swapCUSDCForUSDC`, etc., with approval on the integration contract.
- **Designed, not deployed:**
- **EnhancedSwapRouter** — size/slippage/liquidity-based routing across Uniswap V3, Dodoex PMM, Balancer, Curve, 1inch. To be used when Uniswap/Balancer/Curve pools exist on 138.
**Routing logic (when EnhancedSwapRouter is deployed):**
- By size: small (<$10k) → Uniswap V3 / Dodoex; medium ($10k$100k) → Dodoex → Balancer → Uniswap V3; large (>$100k) → Dodoex → Curve → Balancer.
- By slippage/liquidity: low slippage → Dodoex (PMM); medium → Balancer; high → Curve.
**References:**
- [PMM_DEX_ROUTING_STATUS](11-references/PMM_DEX_ROUTING_STATUS.md)
- [DEX_AND_AGGREGATORS_CHAIN138_EXPLAINER](04-configuration/DEX_AND_AGGREGATORS_CHAIN138_EXPLAINER.md)
---
### 2.2 Token-Aggregation API (Off-Chain Quotes)
- **Single-hop quote:** `GET /api/v1/quote?chainId=138&tokenIn=&tokenOut=&amountIn=` → best direct-pool quote from indexed DODO (and Uniswap if configured).
- **Token/pool discovery:** `GET /api/v1/tokens?chainId=138`, `/api/v1/tokens/:address/pools`, `/api/v1/report/token-list`.
- **Bridge:** `GET /api/v1/bridge/routes`, `/api/v1/token-mapping?fromChain=138&toChain=1`.
- **Limitation:** Single-hop only; no N-hop pathfinding.
---
### 2.3 SwapBridgeSwap (Cross-Chain)
- **Orchestration:** `POST /api/bridge/quote` — can return optional **sourceSwapQuote** and **destinationSwapQuote** in addition to bridge route.
- **On-chain (optional):** **SwapBridgeSwapCoordinator** — deploy when a single tx “swap (source) → bridge → swap (destination)” is required.
---
### 2.4 External DEX Aggregators (1inch, ParaSwap, 0x, Li.Fi)
- **1inch, ParaSwap, 0x:** Integrated in **alltra-lifi-settlement** for quotes on supported chains. **Chain 138 is not supported** by these aggregators unless they add it; to use them with 138, they would need to add the chain and index DODO PMM (and any other DEX on 138).
- **Li.Fi:** Cross-chain routing; **Chain 138 not supported**. Use **CCIP** for 138 ↔ Ethereum/L2.
- **Explorer bridge aggregator:** Uses Li.Fi, Socket, Squid, Symbiosis, Relay, Stargate for **bridge routes**, not for on-chain DEX on 138.
**Practical today:** Use **token-aggregation** for quotes and **DODOPMMIntegration** (or DODOPMMProvider) for execution on Chain 138.
---
### 2.5 Routing Summary Table
| Capability | Available | Where |
|------------|------------|--------|
| Single-hop quote (API) | Yes | `GET /api/v1/quote` |
| DODO PMM on-chain swaps | Yes | DODOPMMIntegration + three pools; DODOPMMProvider |
| Multi-provider one-leg routing | No (router not deployed) | Would be EnhancedSwapRouter |
| N-hop path (A→B→C on one chain) | No | No graph-based multi-hop API |
| Swapbridgeswap (cross-chain) | Yes (orchestration) | QuoteService + optional SwapBridgeSwapCoordinator |
| 1inch / ParaSwap / 0x on 138 | No | Aggregators do not support Chain 138 yet |
---
## 3. On-Ramp and Off-Ramp
### 3.1 Ramp Providers (Implemented)
- **MoonPay** — On-ramp + Off-ramp
- **Ramp Network** — On-ramp + Off-ramp
- **Onramper** — Aggregator (on-ramp + quotes)
- **Transak** — On-ramp + Off-ramp
- **Banxa** — On-ramp + Off-ramp
- **Coinbase Ramps** — On-ramp + Off-ramp
- **Stripe Crypto** — On-ramp
- **Cybrid** — On-ramp + Off-ramp
- **Sardine** — On-ramp
- **HoneyCoin** — Off-ramp
**API:** `POST /ramps/on-ramp/session`, `POST /ramps/off-ramp/session`, `GET /ramps/quote`, `GET /ramps/providers` (metamask-integration).
**API keys:** See MASTER_SECRETS_INVENTORY, API_KEYS_REQUIRED (e.g. MOONPAY_API_KEY, RAMP_NETWORK_API_KEY, ONRAMPER_API_KEY).
---
### 3.2 User Flows (Chain 138)
- **On-ramp (fiat → crypto on 138):**
1. User chooses **Buy** in companion/dApp.
2. Selects a ramp-supported chain (e.g. **Ethereum Mainnet**).
3. Completes purchase via ramp (MoonPay, Ramp, etc.) → funds on mainnet.
4. Uses **Bridge** to send assets **Mainnet → Chain 138**.
5. Assets on 138 for gas, swaps, dApps.
- **Off-ramp (crypto on 138 → fiat):**
1. User uses **Bridge** to send **Chain 138 → Ethereum Mainnet**.
2. After confirmation, opens companion/dApp **Sell** (off-ramp).
3. Selects **Ethereum Mainnet** and completes sale via ramp provider.
4. Fiat to linked bank/payment per provider terms.
**Note:** Ramps today target supported public chains (e.g. mainnet). Chain 138 native on-ramp/off-ramp would require ramp providers to add 138 (see ON_RAMP_INTEGRATION_GUIDE, CONSENSYS_OUTREACH_PACKAGE).
**References:**
- [MAINNET_RAMP_USER_FLOWS](04-configuration/MAINNET_RAMP_USER_FLOWS.md)
- [MAINNET_LIQUIDITY_AND_RAMPS_PRIORITY](00-meta/MAINNET_LIQUIDITY_AND_RAMPS_PRIORITY.md)
- [METAMASK_BRIDGE_SWAP](../../smom-dbis-138/docs/operations/integrations/METAMASK_BRIDGE_SWAP.md)
---
## 4. Fireblocks
- **Purpose:** Institutional custody and Web3 operations on Chain 138.
- **Dedicated RPC (Chain 138):** One node is reserved for Fireblocks so traffic is isolated from public and other tenant RPCs.
- **VMID:** 2301 (besu-rpc-private-1).
- **LAN:** `http://192.168.11.232:8545`, `ws://192.168.11.232:8546`.
- **Public:** `https://rpc-fireblocks.d-bis.org`, `wss://ws.rpc-fireblocks.d-bis.org`.
- **Fireblocks Console:** Add custom network with RPC URL above, Chain ID **138**, optional WebSocket URL.
- **Fireblocks Web3 Provider (SDK):** Use `rpcUrl: "https://rpc-fireblocks.d-bis.org"` (or env `RPC_URL_138_FIREBLOCKS`) with `@fireblocks/fireblocks-web3-provider`.
- **REST API:** Use Chain ID **138** for Create Transaction etc.; backend uses custom network config for 138.
- **Optional:** Fireblocks Network Link / IP allowlisting — restrict to the Fireblocks-dedicated node (2301) only.
**References:**
- [FIREBLOCKS_WEB3_INTEGRATION](04-configuration/FIREBLOCKS_WEB3_INTEGRATION.md)
- [RPC_ENDPOINTS_MASTER](04-configuration/RPC_ENDPOINTS_MASTER.md)
- fireblocks-integration submodule (Gitea: d-bis/fireblocks-integration)
---
## 5. Other Integrations
### 5.1 Bridges
| Bridge | Scope | Tokens | Notes |
|--------|--------|--------|--------|
| **CCIP** | 138 ↔ Ethereum, Optimism, Polygon, Arbitrum, Base, BSC, Avalanche; Gnosis, Celo, Wemix config-ready | WETH, WETH10, cUSDT, cUSDC, LINK | Fees in LINK; deterministic receiver addresses |
| **Bridge Vault** | Multi-chain stablecoin (Ethereum, Polygon, BNB) | cUSDT, cUSDC | Vault: `0x31884f84555210FFB36a19D2471b8eBc7372d0A8` |
| **Truth Network** | Ethereum ↔ Truth (Substrate); adapter on 138 | TRUU (lift/burn) | TruthNetworkAdapter on 138; Truth registered in ChainRegistry |
| **AlltraAdapter** | ALL Mainnet (651940) | Custom | CCIP/Li.Fi not supported on 651940 |
**References:**
- [CHAINS_AND_PROTOCOLS_BRIDGE_INTEGRATION](11-references/CHAINS_AND_PROTOCOLS_BRIDGE_INTEGRATION.md)
- [CCIP_CHAIN_SELECTORS](11-references/CCIP_CHAIN_SELECTORS.md)
- docs/07-ccip (Truth, config-ready chains, runbooks)
---
### 5.2 Wallets & Discovery
- **Ledger:** Chain 138 in App-Ethereum (Defi Oracle Meta, ticker ETH).
- **MetaMask:** Add via Chainlist or custom RPC; defi-oracle-metamask-sdk for `addOrSwitchNetwork()`. Native Swaps/Bridge do not support 138 yet.
- **thirdweb:** Chain 138 listed; bridge to/from Defi Oracle Meta; RPC and explorer (blockscout.defi-oracle.io).
- **Token list:** Dual-chain token list (e.g. DUAL_CHAIN_TOKEN_LIST) for MetaMask; token-aggregation report endpoint for Chain 138.
---
### 5.3 Infrastructure & Ops
- **Blockscout:** https://explorer.d-bis.org (verification, contracts, txs).
- **Cloudflare:** DNS, SSL, Tunnels.
- **Proxmox:** Host and VM/container management for validators, RPC, explorer, services.
- **NPMplus:** Reverse proxy (e.g. rpc-fireblocks.d-bis.org, explorer).
---
## 6. Quick Reference
| Need | Where |
|------|--------|
| Contract addresses (138) | CONTRACT_ADDRESSES_REFERENCE, LIQUIDITY_POOLS_MASTER_MAP |
| DEX routing status | PMM_DEX_ROUTING_STATUS, DEX_AND_AGGREGATORS_CHAIN138_EXPLAINER |
| Quote API | token-aggregation: GET /api/v1/quote, POST /api/bridge/quote |
| On/off-ramp | MAINNET_RAMP_USER_FLOWS, INTEGRATIONS_QUICK_REFERENCE |
| Fireblocks | FIREBLOCKS_WEB3_INTEGRATION, RPC_ENDPOINTS_MASTER |
| Bridges & chains | CHAINS_AND_PROTOCOLS_BRIDGE_INTEGRATION, CCIP_CHAIN_SELECTORS |
| Integrations list | INTEGRATIONS_QUICK_REFERENCE (root) |
---
*This summary is maintained in the proxmox/docs repo. For contract addresses and deployment details, always confirm against CONTRACT_ADDRESSES_REFERENCE and runbooks.*