Transaction Memo Details
Transactions to THORChain pass user-intent with the
MEMOfield on their respective chains. THORChain inspects the transaction object as well as 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.
Different chains have different ways of adding state to a transaction. Long assets can be shortened using Asset abbreviations (below) as well as THORNames to reduce the size of destination/affiliate addresses.
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 is simply decodes from human-readable strings.
In addition, some parameters are optional. Simply leave them blank, but retain the
The following memos are permitted:
- 2.ADD Liquidity
- 3.WITHDRAW Liquidity
- 4.BOND, UNBOND & LEAVE
- 5.DONATE & RESERVE
Perform a swap.
=:ASSET:DESTADDR:LIMswap with limit
s:ASSET:DESTADDR:LIM:AFFILIATE:FEEswap with limit and affiliate
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.
a:POOL:PAIREDADDR:AFFILIATE:FEEadd with affiliate
Withdraw liquidity from a pool. A withdrawal can be either dual-sided (wtihdrawn 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.
Perform node maintenance features.
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.
The following is the notation for Assets in THORChain's system:
Assets can be abbreviated using fuzzy logic. The following will all be matched appropriately. If there are conflicts then the deepest pool is matched. (To prevent attacks).
Each chain will have a unique way of adding state to a transaction. Long assets can be shortened using Asset abbreviations (below) as well as THORNames to reduce the size of destination/affiliate addresses.