feat(exchange): add TRX and USDT-on-Tron to Chainflip#3341
Open
CumpsD wants to merge 1 commit into
Open
Conversation
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>
konstantinullrich
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Chainflip recently added Tron support — native TRX (asset id
trx.tron) and USDT on Tron (asset idusdt.tron). This enables both for swaps in the Chainflip provider.Tron needs explicit handling because Chainflip's network slug is
tron, while Cake uses theTRXtag (andnullfor native TRX), so the generictitle.tagnormalization can't produce the correct asset ids.Changes
All in
lib/exchange/provider/chainflip_exchange_provider.dart:_supported— addCryptoCurrency.trxandCryptoCurrency.usdttrc20_normalizeCurrency— special-casetrx→trx.tron,usdttrc20→usdt.tron_normalizeNetworkName— addTRON→Tron(status lookup infindTradeById)_toCurrency— reverse-maptrx.tron/usdt.tronfor trade resolutionNo new currency definitions needed —
trxandusdttrc20already exist incw_core.Testing
findTradeByIdresolves the currency correctly.