Files
proxmox/docs/04-configuration/PRICE_FEED_CHAIN138_METAMASK_AND_WALLETS.md

121 lines
5.8 KiB
Markdown
Raw Permalink Normal View History

# Price Feed for Chain 138 — MetaMask and All Wallets
**Last Updated:** 2026-02-28
**Purpose:** Single reference for adding Chain 138 USD price feeds to MetaMask and other wallets
---
## 1. Current State
| Wallet / Platform | Chain 138 USD Display | Cause |
|-------------------|------------------------|-------|
| **MetaMask** | ❌ $0.00 / "No conversion rate available" | MetaMask uses **CoinGecko API** (primary) and **LavaPack** for prices; Chain 138 is not in their supported chains |
| **Trust Wallet** | ❌ Likely no USD | Trust Wallet also pulls from CoinGecko/CMC |
| **Ledger Live** | ❌ Awaiting integration | Ledger form submitted; awaiting response |
| **Other wallets** | ❌ Most use CoinGecko/CMC | Chain 138 not listed |
**Important:** MetaMask does **not** query on-chain oracle contracts for USD display. Even with a working ETH/USD oracle on Chain 138 (`0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6`), MetaMask will not show native USD until Chain 138 and tokens are listed on CoinGecko (or MetaMasks provider adds support).
---
## 2. Paths to Add Price Feeds
### 2.1 CoinGecko (Primary — MetaMask and many wallets)
**Why:** MetaMasks primary price source is CoinGecko. CoinGecko is also used by Trust Wallet, DeFi dashboards, and many other wallets.
**Steps:**
1. **Chain submission (if applicable):** Request Chain 138 (DeFi Oracle Meta Mainnet) be added as a supported blockchain.
2. **Token submission:** Submit each token (cUSDT, cUSDC, WETH, ETH, etc.) with contract address, chain ID 138, decimals, logo.
3. **Form:** https://www.coingecko.com/en/request or https://www.coingecko.com/en/coins/new
**Docs:** [COINGECKO_SUBMISSION_GUIDE](coingecko/COINGECKO_SUBMISSION_GUIDE.md), [COINGECKO_SUBMISSION_PACKAGE](coingecko/COINGECKO_SUBMISSION_PACKAGE.md), [CMC_COINGECKO_SUBMISSION_RUNBOOK](coingecko/CMC_COINGECKO_SUBMISSION_RUNBOOK.md)
**Export data:** Use token-aggregation report API:
```bash
curl "https://<your-api>/api/v1/report/coingecko?chainId=138" -o report-coingecko-138.json
```
---
### 2.2 CoinMarketCap (CMC)
**Why:** Some wallets and aggregators use CMC as a fallback or primary source.
**Steps:** Same process as CoinGecko — submit chain and tokens via CMCs listing forms.
**Export:** `GET /api/v1/report/cmc?chainId=138`
---
### 2.3 Consensys / MetaMask Direct Outreach
**Why:** MetaMask may add Chain 138 to their native price feed if Consensys approves.
**Steps:**
1. Contact: **business@consensys.io**
2. Request: Add Chain 138 (DeFi Oracle Meta Mainnet) to MetaMasks price feed provider.
3. Provide: Chain ID 138, RPC URLs, explorer, token list, oracle contract address if relevant.
**Status:** Outreach form submitted; awaiting response. No public PR repo for Swaps/Bridge/price feed.
**Ref:** [REPOSITORIES_AND_PRS_CHAIN138](../../00-meta/REPOSITORIES_AND_PRS_CHAIN138.md)
---
### 2.4 On-Chain Oracle (dApps, not meta-wallet)
**For dApps and custom UIs:** You can query the Chain 138 ETH/USD oracle directly:
| Property | Value |
|----------|-------|
| **Oracle Proxy** | `0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6` |
| **RPC** | `https://rpc-http-pub.d-bis.org` |
| **Method** | `latestRoundData()` → answer in 8 decimals |
**Docs:** [ORACLE_PRICE_FEED_SETUP](metamask/ORACLE_PRICE_FEED_SETUP.md)
---
### 2.5 Chain 138 Snap (Workaround)
**For MetaMask users:** The Chain 138 Snap provides market data via the token-aggregation API. Users can:
- Open the Snap companion site (e.g. https://explorer.d-bis.org/snap/)
- Use **"Show market data"** or **"Fetch market summary"** to see USD prices
This does **not** change MetaMasks native balance display; it is a separate UX flow.
---
## 3. Action Checklist
| # | Action | Owner | Doc |
|---|--------|-------|-----|
| 1 | Submit Chain 138 to CoinGecko (chain listing) | You | [COINGECKO_SUBMISSION_PACKAGE](coingecko/COINGECKO_SUBMISSION_PACKAGE.md) |
| 2 | Submit tokens (cUSDT, cUSDC, WETH, etc.) to CoinGecko | You | [COINGECKO_SUBMISSION_GUIDE](coingecko/COINGECKO_SUBMISSION_GUIDE.md) |
| 3 | Submit Chain 138 and tokens to CoinMarketCap | You | [CMC_COINGECKO_SUBMISSION_RUNBOOK](coingecko/CMC_COINGECKO_SUBMISSION_RUNBOOK.md) |
| 4 | Follow up Consensys outreach | You | [REPOSITORIES_AND_PRS_CHAIN138](../../00-meta/REPOSITORIES_AND_PRS_CHAIN138.md) |
| 5 | Ensure token-aggregation report API is reachable | Ops | [TOKEN_AGGREGATION_REPORT_API_RUNBOOK](TOKEN_AGGREGATION_REPORT_API_RUNBOOK.md) |
| 6 | Prepare 512×512 PNG logos for each token | You | [prepare-token-logos-512x512.sh](coingecko/scripts/prepare-token-logos-512x512.sh) or [COINGECKO_SUBMISSION_GUIDE](coingecko/COINGECKO_SUBMISSION_GUIDE.md) §Step 1 |
---
## 4. Prerequisites
- **Token-aggregation API:** Running and reachable; `GET /api/v1/report/coingecko?chainId=138` and `GET /api/v1/report/cmc?chainId=138` return valid JSON.
- **Token logos:** 512×512 PNG for each token you submit.
- **Chain details:** Chain name, Chain ID 138, RPC URLs, explorer, native currency (see [COINGECKO_SUBMISSION_PACKAGE](coingecko/COINGECKO_SUBMISSION_PACKAGE.md)).
**Note:** CoinGecko and CMC may not list ChainID 138 or 651940 until they add the chain. The report API remains the source of truth; submit when ready and keep the runbook for when platforms add support.
---
## 5. Related Docs
- [TOKEN_AGGREGATION_REPORT_API_RUNBOOK](TOKEN_AGGREGATION_REPORT_API_RUNBOOK.md) — Ensure report API is reachable
- [ORACLE_PRICE_FEED_SETUP](metamask/ORACLE_PRICE_FEED_SETUP.md) — On-chain oracle, MetaMask limitation
- [CHAIN138_SNAP_TROUBLESHOOTING](../../../metamask-integration/chain138-snap/docs/CHAIN138_SNAP_TROUBLESHOOTING.md) — Main balance USD display
- [REPOSITORIES_AND_PRS_CHAIN138](../../00-meta/REPOSITORIES_AND_PRS_CHAIN138.md) — Ledger, Trust, Consensys, CoinGecko/CMC
- [CMC_COINGECKO_REPORTING](../../../smom-dbis-138/services/token-aggregation/docs/CMC_COINGECKO_REPORTING.md) — Report API reference