Skip to content

feat(exchange): add TRX and USDT-on-Tron to Chainflip#3341

Open
CumpsD wants to merge 1 commit into
cake-tech:devfrom
CumpsD:chainflip_trx
Open

feat(exchange): add TRX and USDT-on-Tron to Chainflip#3341
CumpsD wants to merge 1 commit into
cake-tech:devfrom
CumpsD:chainflip_trx

Conversation

@CumpsD

@CumpsD CumpsD commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Description

Chainflip recently added Tron support — native TRX (asset id trx.tron) and USDT on Tron (asset id usdt.tron). This enables both for swaps in the Chainflip provider.

Tron needs explicit handling because Chainflip's network slug is tron, while Cake uses the TRX tag (and null for native TRX), so the generic title.tag normalization can't produce the correct asset ids.

Changes

All in lib/exchange/provider/chainflip_exchange_provider.dart:

  • _supported — add CryptoCurrency.trx and CryptoCurrency.usdttrc20
  • _normalizeCurrency — special-case trxtrx.tron, usdttrc20usdt.tron
  • _normalizeNetworkName — add TRONTron (status lookup in findTradeById)
  • _toCurrency — reverse-map trx.tron / usdt.tron for trade resolution

No new currency definitions needed — trx and usdttrc20 already exist in cw_core.

Testing

  • Select Chainflip in the swap screen; confirm TRX and USDT (Tron) appear as from/to assets.
  • Quote small swaps (e.g. BTC → USDT(Tron), TRX → ETH) — confirm non-zero rate and min limit.
  • Create a Tron trade and reopen it — confirm findTradeById resolves the currency correctly.

Chainflip added Tron support with asset ids trx.tron and usdt.tron.
Enable both for swaps in the Chainflip provider.

Tron needs explicit handling because Chainflip's network slug is
'tron', while Cake uses the 'TRX' tag (and null for native TRX), so
the generic title.tag normalization can't produce the right ids:
- _supported: add trx, usdttrc20
- _normalizeCurrency: map trx -> trx.tron, usdttrc20 -> usdt.tron
- _normalizeNetworkName: TRON -> Tron (status lookup in findTradeById)
- _toCurrency: reverse-map trx.tron/usdt.tron for trade resolution

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants