Comment on page
Understanding Transaction Memo In Detail
Transactions to THORChain pass user intent with the
MEMOfield on their respective chains. THORChain inspects the transaction object and the
MEMOin order to process the transaction, so care must be taken to ensure the
MEMOand the transaction are both valid. If not, THORChain will automatically refund the assets. All memos are listed here.
All memos follow the format:
The function is invoked by a string, which in turn calls a particular handler in the state machine. The state machine parses the memo looking for the parameters which it simply decodes from human-readable strings.
In addition, some parameters are optional. Simply leave them blank, but retain the
The following functions can be put into a memo:
Perform a swap.
SWAP:ASSET:DESTADDR:LIMswap with trade limit
SWAP:ASSET:DESTADDR:LIM/1/1swap with limit, do not stream swap
SWAP:ASSET:DESTADDR:LIM/3/0swap with limit, optimise swap amount, every 3 blocks
SWAP:ASSET:DESTADDR:LIM/1/0:AFFILIATE:FEEswap with limit, optimised and affiliate fee
SWAP:ETH.ETH:0xe6a30f4f3bad978910e2cbb4d97581f5b5a0ade0- swap to Ether, send output to the specified address.
SWAP:ETH.ETH:0xe6a30f4f3bad978910e2cbb4d97581f5b5a0ade0:10000000,same as above except the Ether output should be more than 0.1 Ether else refund.
SWAP:ETH.ETH:0xe6a30f4f3bad978910e2cbb4d97581f5b5a0ade0:10000000/1/1,same as above except explicitly stated, do not stream the swap.
SWAP:ETH.ETH:0xe6a30f4f3bad978910e2cbb4d97581f5b5a0ade0:10000000/3/0,same as above except told to allow streaming swap, mini swap every 3 blocks and THORChain to work out the number of swaps required to achieve optimal price efficiency.
=:r:thor1el4ufmhll3yw7zxzszvfakrk66j7fx0tvcslym:19779138111- swap to at least 197.79 RUNE
=:BNB/BUSD-BD1:thor15s4apx9ap7lazpsct42nmvf0t6am4r3w0r64f2:628197586176 -Swap to at least 6281.9 Synthetic BUSD.
=:BNB.BNB:bnb108n64knfm38f0mm23nkreqqmpc7rpcw89sqqw5:544e6/2/6- swap to at least 5.4 BNB, using streaming swaps, six swaps, every two blocks.
Depositing savers can work without a memo; however, memos are recommended to be explicit about the transaction intent.
+:BTC/BTCadd to the BTC Savings Vault
a:ETH/ETHadd to the ETH Savings Vault
+:BTC/BTC::t:10Deposit with a 10 basis points affiliate
-:BTC/BTC:10000Withdraw 100% from BTC Savers
w:ETH/ETH:5000Withdraw 50% from ETH Savers
Affiliate and Affiliate Fee yet to be implemented
$+:BNB.BUSD:bnb177kuwn6n9fv83txq04y2tkcsp97s4yclz9k7dh- Open a loan with BUSD as the debt asset
$+:ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48:0x1c7b17362c84287bd1184447e6dfeaf920c31bbe:10400000000Open a loan where the debt is at least 104 USDT.
LOAN-:BTC.BTC:bc1qp2t4hl4jr6wjfzv28tsdyjysw7p5armf7px55wRepay BTC loan owned by owner bc1qp2t4hl4jr6wjfzv28tsdyjysw7p5armf7px55w.
LOAN-:ETH.ETH:0xe9973cb51ee04446a54ffca73446d33f133d2f49:404204059. Repay ETH loan owned by
0xe9973cb51ee04446a54ffca73446d33f133d2f49and receive at least 4.04 ETH collateral back, else send back a refund.
ADD:POOLsingle-sided add liquidity. If this is a position's first add, liquidity can only be withdrawn to the same address.
+:POOL:PAIREDADDRadd on both sides.
+:POOL:PAIREDADDR:AFFILIATE:FEEadd with affiliate
Withdraw liquidity from a pool. A withdrawal can be either dual-sided (withdrawn based on pool's price) or entirely single-sided (converted to one side and sent out).
WITHDRAW:POOL:10000dual-sided 100% withdraw liquidity. If a single-address position, this withdraws single-sidedly instead.
-:POOL:1000dual-sided 10% withdraw liquidity.
wd:POOL:5000:ASSETwithdraw 50% liquidity as the asset specified while the rest stays in the pool, eg:
Donate to a pool or the RESERVE.
DONATE:ETH.ETH- Donate to the ETH pool.
Internal memo type used to mark migration transactions between a retiring vault and a new Asgard vault during churn. Special THORChain triggered outbound tx without a related inbound tx.
Dev-centric functions to fix THORChain state. Caution: may cause loss of funds if not done exactly right at the right time.
The following are the conditions for refunds:
Refunds cost fees to prevent Denial of Service attacks. The user will pay the correct outbound fee for that chain.
donate- add funds to a pool (example:
consolidate- consolidate UTXO transactions
ragnarok- only used to delist pools.
yggdrasilreturn- no longer used as yggdrasil vaults are not longer used (ADR 002)
switch- no longer used as killswich has ended
reserve- no longer used.