Context
Chainflip has added Tron support (native TRX and USDT-TRC20 as source assets), currently live on the Perseverance testnet. Add Tron as a Chainflip swap source in the swap provider layer.
Key difference from EVM
Tron vault swaps are not a Vault contract call (no xSwapNative / xSwapToken). Instead:
- Direct transfer of TRX/USDT to the Chainflip Vault address.
- Encoded swap parameters attached as the transaction note (the
data / memo field).
- No TRC-20 approval needed — it's a
transfer, not transferFrom.
- Cheaper: no protocol fetch tx, so no ingress fee. Recommended swap method on Tron.
Conceptually closer to the Bitcoin deposit-with-data model than the EVM contract-call model.
Flow
- Request encoding via
broker_request_swap_parameter_encoding with "chain": "Tron" in both source_asset and extra_parameters; refund address must be a valid Tron address.
- Response:
{ chain, calldata, value, to, note, source_token_address? }.
- Build tx → attach
note to the data field → sign → broadcast.
Tasks
⚠️ Do not hand-roll
Don't hand-encode the note / cfParameters — incorrectly encoded params can lose funds. Always use the broker RPC to produce it.
Links
Context
Chainflip has added Tron support (native TRX and USDT-TRC20 as source assets), currently live on the Perseverance testnet. Add Tron as a Chainflip swap source in the swap provider layer.
Key difference from EVM
Tron vault swaps are not a Vault contract call (no
xSwapNative/xSwapToken). Instead:data/ memo field).transfer, nottransferFrom.Conceptually closer to the Bitcoin deposit-with-data model than the EVM contract-call model.
Flow
broker_request_swap_parameter_encodingwith"chain": "Tron"in bothsource_assetandextra_parameters; refund address must be a valid Tron address.{ chain, calldata, value, to, note, source_token_address? }.noteto thedatafield → sign → broadcast.Tasks
broker_request_swap_parameter_encodingrequest forchain: Tronvalue,to,note,calldata,source_token_address)TransferContractto Vault,valuein sun, setnoteas txdataTriggerSmartContract→transfer(address,uint256)to Vault, setnoteas txdata(no approval step)T…↔ 21-byte0x41…hex) — RPC returnstoin hexg1) viabroker_commissionin the request → lands innotecfParametersDon't hand-encode the
note/ cfParameters — incorrectly encoded params can lose funds. Always use the broker RPC to produce it.Links