THORChain Dev Docs

Sending Transactions

Confirm you have:
  • Connected to Midgard or THORNode
  • Located the latest vault (and router) for the chain
  • Prepared the transaction details (and memo)
  • Checked the network is not halted for your transaction
You are ready to make the transaction and swap via THORChain.

UTXO Chains

  • Send the transaction with Asgard vault as VOUT0
  • Include the memo as an OP_RETURN in VOUT1
  • Pass all change back to the VIN0 address in VOUT3
  • Use a high enough gas_rate to be included
  • Do not send below the dust threshold (10k Sats BTC, BCH, LTC, 1m DOGE)
Memo limited to 80 bytes on BTC. Use abbreviated options and thornames where possible
Do not use HD wallets that forward the change to a new address, because THORChain IDs the user as the address in VIN0. The user must keep their VIN0 address funded for refunds.
Override randomised VOUT ordering; THORChain requires specific output ordering.

EVM Chains

depositWithExpiry(vault, asset, amount, memo, expiry)
  • If ERC20, approve the router to spend an allowance first
  • Send the transaction as a depositWithExpiry() on the router
  • Vault is the asgard, asset is the token to swap, memo as a string
  • Use an expiry which is +60mins on the current time (if the tx is delayed, it will get refunded)
  • Use a high enough gas_rate to be included, else the tx will get stuck
ETH is 0x0000000000000000000000000000000000000000
ETH is sent and received as an internal transaction. Your wallet may not be set to read internal balances and transactions

BFT Chains

  • Send the transaction to the Asgard vault
  • Include the memo
  • Only use the base asset as the choice for gas asset