Streaming Swaps And Refunds
THORChain swaps are not just a formula. A real swap depends on a fresh quote, a current inbound address, a valid memo, enough amount to clear dust and fee thresholds, live chain/trading/signing state, pool availability, and the outbound path.
This article explains how to reason about streaming swaps and refunds without turning the wiki into a wallet, quote aggregator, or transaction builder.
What To Check First
When a user asks "why did my swap refund?", start with the most current evidence:
- Check
/network#network-diagnosticsfor route-level halts, chain blockers, source warnings, and quote-probe behavior. - Check the latest THORNode quote response for the route, amount, expected output, fees, recommended minimum input, expiry, and warning text.
- Check whether the inbound address, router, memo, and quote expiry came from the same fresh quote flow.
- Check whether the amount was above
recommended_min_amount_inand above the inbound chain dust threshold. - Check the transaction hash, memo, source chain, destination chain, and any refund transaction before assigning a reason.
The Network diagnostics route checker now includes a refund/failed-swap triage panel that separates current quote evidence from missing transaction evidence. Use it as a checklist, not as a wallet instruction or support verdict.
The one-hash transaction lookup can explicitly read up to five related Midgard actions. It keeps the raw memo separate from a bounded local syntax interpretation and shows indexer time, THORChain index height, inputs, outbounds and reported network fees with their units. Provider status remains a processing report: source-chain confirmation and destination settlement are unknown without independent receipts. The request disclosure names both fixed providers before a hash is sent; the wiki does not retain a lookup history.
If those pieces are missing, the honest answer is "insufficient evidence", not a guessed refund cause.
Swap Lifecycle
A normal base-layer swap moves through a few evidence points:
- The interface requests a THORNode swap quote for a route and amount.
- The quote returns route context such as expected output, fee fields, expiry, inbound timing, outbound timing, warning text, recommended minimum input, and a memo.
- The user signs an inbound transaction on the source chain.
- Bifrost observers report that inbound transaction to THORChain.
- THORChain validates the memo, chain state, pool state, price limits, halt controls, and fee economics.
- If execution is valid and signing is available, nodes sign the outbound transaction. If execution is invalid or impossible, the protocol can refund according to the available source-chain path.
The CLP formula explains pricing. It does not prove that the specific route, memo, amount, quote, or outbound path is currently executable.
Dated Transaction Examples
These records show how a Bitcoin source-chain transaction and a Midgard action can describe different stages. The refund example remains pending because its captured response has no refund outbound.
Bitcoin inbound with a Midgard-reported TRON swap output
A confirmed Bitcoin inbound is paired with a successful Midgard swap action. The destination output remains provider-reported evidence.
Example evidence reviewed .
Original memo evidence
Bitcoin OP_RETURN payload
=:tr:TMMcoyunsxpMad5BbbT6BodSDBMw4Pfzya:0/1/0The pinned THORNode memo map treats = as swap. The original string, shorthand, destination and trailing tuple are preserved without expanding the tuple into extra claims.
What each source reports
Source-chain blocks and THORChain indexer heights belong to separate layers.
Bitcoin transaction
- Evidence layer
- Source-chain record
- Reported status
- confirmed
- Record time
- Source-chain block
969681·0000000000000000000117ce66fe52ea9dcd22d47f2b7ff905b21f79a567ab56· · Bitcoin block 969681- Transaction ID
d9e6621125467b58b6ebe424cd83a179d78f4c6e5fac16e17f39c1516cb0322f- Evidence source
- Bitcoin swap transaction d9e662…0322f · captured 2026-10-03
Midgard action
- Evidence layer
- THORChain indexer record
- Action or role
swap- Reported status
- success
- Record time
- THORChain indexer height
28081155- Transaction ID
D9E6621125467B58B6EBE424CD83A179D78F4C6E5FAC16E17F39C1516CB0322F- Reported output height
28081160- Reported output transaction ID
C9B90A7C09BAA06E3CED8F17EE39A19A4D1F97399811D6908AA3956C7C65444A- Reported input amount
10180BTC.BTC (raw THORChain base units (1e8))- Reported output amount
2422777500TRON.TRX (raw THORChain base units (1e8))- Evidence source
- Midgard swap action for the Bitcoin inbound · captured 2026-10-03
What remains unknown
- TRON destination-chain inclusion was not independently verified; recipient ownership and user receipt are unknown.
- Midgard status=success is that provider record, not independent settlement proof.
Sources, capture dates, and response hashes
- Bitcoin swap transaction d9e662…0322f · captured 2026-10-03
Captured mempool.space transaction API body at https://mempool.space/api/tx/d9e6621125467b58b6ebe424cd83a179d78f4c6e5fac16e17f39c1516cb0322f; SHA-256 d6156db728543c4eb7292dbc3afa40143db10a6a9f769dc5bcdb1294e524448d. Bitcoin-side inbound transaction and OP_RETURN bytes; no recipient-ownership claim.
- Bitcoin block 969681 · captured 2026-10-03
mempool.space reports block 969681 with hash 0000000000000000000117ce66fe52ea9dcd22d47f2b7ff905b21f79a567ab56 at 2026-10-03T05:38:13Z. This establishes Bitcoin-side inclusion only.
- Midgard swap action for the Bitcoin inbound · captured 2026-10-03
Captured response SHA-256 0cfd9b659cb450d7915af928743a8450eda4c1298d1994c5d96148d0ffdc57fb. Midgard reports a successful swap action and an outbound record; this does not independently verify TRON destination inclusion, ownership, or user receipt.
- THORNode v3.20.3 memo type map · captured 2026-10-03
Pinned official source for memo action interpretation: = and s map to swap, OUT maps to outbound, refund maps to refund, and MIGRATE maps to migrate. The original memo text remains separate from this interpretation.
- THORChain developer memo documentation · captured 2026-10-03
Official developer memo reference. Its migration example is not used as a real migration fixture; the example record below is a separately captured Ethereum transaction.
Pending refund record with no refund outbound
Midgard records a pending refund action for a token-asset input. The captured response contains no outbound entry.
Example evidence reviewed .
Original memo evidence
Original swap memo retained in Midgard refund metadata
=:TRON~USDT-TR7NHQJEKQXGTCI8Q8ZY4PL8OTSZGJLJ6T:thor17hwqt302e5f2xm4h95ma8wuggqkvfzgvsnh5z9:4575592086/1/1This is the swap intent associated with the refund record, not a source-chain refund transaction. ETH~USDC uses THORChain Trade-asset notation (~); it is not native ETH.
What each source reports
Source-chain blocks and THORChain indexer heights belong to separate layers.
Midgard refund action
- Evidence layer
- THORChain indexer record
- Action or role
refund- Reported status
- pending
- Record time
- THORChain indexer height
28081517- Transaction ID
C573218772AAA37B72F45C220B874BDDED6ED755250596307C28C08E80D10F91- Reported input amount
4571427086ETH~USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48 (trade asset) (raw THORChain base units (1e8))- Reported outputs
- No outbound entries in this response.
- Midgard reason (provider-reported)
- emit asset 4573885300 less than price limit 4575592086; this is not a current halt cause
- Evidence source
- Midgard pending refund action · captured 2026-10-03
What remains unknown
- The source-chain block, refund outbound transaction, destination-chain inclusion, and refund settlement are unknown.
Sources, capture dates, and response hashes
- Midgard pending refund action · captured 2026-10-03
Captured response SHA-256 79e36f9bd8be79647cbc72270506288f71bc57fa5311023b5fc4780d4d3ff06a. Midgard reports status pending and no outbound entries. Its reason is a provider-reported explanation, not a current halt cause; source-chain inclusion and refund settlement were not observed.
- THORNode v3.20.3 memo type map · captured 2026-10-03
Pinned official source for memo action interpretation: = and s map to swap, OUT maps to outbound, refund maps to refund, and MIGRATE maps to migrate. The original memo text remains separate from this interpretation.
- THORChain developer memo documentation · captured 2026-10-03
Official developer memo reference. Its migration example is not used as a real migration fixture; the example record below is a separately captured Ethereum transaction.
Streaming Swaps
Streaming swaps split a trade into sub-swaps over THORChain blocks. The goal is to reduce slip fees by letting arbitrage and pool rebalancing happen between slices.
The important fields are:
streaming_interval: how many THORChain blocks sit between sub-swaps.streaming_quantity: how many sub-swaps to execute; when omitted or set to0, THORNode can calculate the quantity.max_streaming_quantity,streaming_swap_blocks,streaming_swap_seconds, andtotal_swap_seconds: quote fields that explain how long the route may take.StreamingSwapPause: a live Mimir control that can make streaming behavior unavailable even when ordinary swap concepts still exist.
Streaming is usually a price-quality tool, not a guarantee of execution. A longer streaming path can reduce slip but also creates more time for live state, halts, pools, gas, and quote assumptions to change.
Interval 0 permits rapid execution with multiple iterations in a block; intervals of 1 or more space iterations across blocks. Rapid execution does not mean instantaneous inbound confirmation, outbound signing, or destination settlement. Keep quantity, interval, affiliate fields, quote duration, and executed memo aligned; a lower fee floor with automatically calculated quantity can also mean many more slices and a longer stream.
September 25-26 integrator reports described a roughly one-hour quote versus a roughly fifteen-hour stream in a 1-bps/automatic-quantity/one-block-spacing context. This is an unreproduced mismatch report, not proof of a particular quote bug or a universal reason to change memos to /0/0. Investigate the exact inputs and executed transaction before attributing the delay to ADR-026; historical fixed-5-bps examples are not substitutes for fresh route-specific fee evidence.
Why Refunds Happen
Refunds are a symptom, not one root cause. Common evidence families include:
- Stale quote or inbound address: the quote expired, the inbound address changed, or the transaction used stale route data.
- Memo problem: malformed memo, memo too long for the source chain, wrong function, wrong asset notation, invalid destination, invalid affiliate fields, or unsupported shortened fields.
- Price-limit problem: the trade output would violate the memo limit or quote tolerance.
- Amount problem: amount below dust threshold, below
recommended_min_amount_in, or too small after fees. - Route or pool problem: pool unavailable, asset not found, halted trading, halted signing, halted chain, or source-warning state that prevents a clean claim.
- Fee economics: inbound, liquidity, affiliate, or outbound costs make the practical output invalid or uneconomic.
- Outbound problem: the destination path cannot be signed or delivered under current state.
Do not describe every refund as "slippage" or "the pool formula failed". Most refund investigations need the exact quote, memo, transaction, and current network state.
Memos, Limits, And Refund Addresses
Memos are user intent. They tell THORChain what action to attempt and include route-specific fields such as target asset, destination, limits, streaming parameters, affiliates, and optional refund address.
The risk surface is bigger than the visible route:
- Memos have size limits, and UTXO chains have tighter practical constraints.
- A memo handler can remain in developer documentation after the related product or action is deprecated. Documented syntax proves a message shape, not current feature availability.
- Dust thresholds can cause tiny inbound transactions to be ignored.
- A custom refund address must be valid for the inbound asset.
liquidity_tolerance_bpsis preferred for user-facing price protection because it accounts for swap and outbound fees; older or narrower tolerance fields can cause avoidable failures.- Multiple affiliates and affiliate bps values must be aligned with protocol rules and memo length constraints.
For real transactions, use a fresh official quote flow or interface implementation, and re-fetch the inbound address rather than caching or reusing it across churns. Do not copy a memo example from the wiki into a wallet.
Evidence Ladder
Use, in order of strength: the current exact-route quote and its error body; Network diagnostics for route/signing/source state; the actual inbound memo, chains, and refund hash; labeled pool and fee data; then static docs for design meaning alone. They do not prove a past refund's specific cause or a future swap's success.
This triage map cannot prove route availability, interface correctness, copied-value safety, or signing behavior. Streaming swaps also do not remove slip, refund, delay, or execution risk; assign a refund cause only from matching transaction evidence.
Bitcoin Memo Archive Pointer
The curated OP_RETURN source entry links to recorded Bitcoin payload bytes, transaction/block references and Bitcoin-side history. Reviewed 3 October 2026 as a third-party discovery pointer, it covers Bitcoin rather than all THORChain activity. Reconcile the original bytes with primary chain evidence before interpreting the memo.
An archive's THORChain classification, confirmation label, ticker count or address grouping does not prove memo validation, THORChain processing, successful cross-chain execution or destination settlement. Use the network diagnostics for current operational evidence and keep any transaction lifecycle gaps explicit.