Learn how to optimize your DeFi swaps on Maya Protocol by understanding inbound/outbound gas fees, affiliate fees, slippage, and how to use Streaming Swaps.
Swapping assets in a DeFi setting is, to most, more than just a dull, transactional moment of exchange. For the attention to detail that many in the DeFi space give to this process, acquiring assets almost seems to resemble an art form, one that requires a near surgical level of precision to strike it the way you want it.
Among these deliberations that expert users attend to when making their swaps, what often seems to be at the top of the list is these transactions’ total cost—that is, the full expense of making a swap, from start-to-finish.
Keeping this final amount to a minimum while still operating within decentralized parameters can prove a challenge, but this is what takes a novice to an expert level of swapping precision.
Why is keeping costs down such a challenge in DeFi? Simply put, performing on-chain transactions often takes more than one type of fee to execute, and if you’re not careful, these can rack up quickly. This is one of the (very worthy) tradeoffs that users must accept when operating on-chain, and is why it tops the lists of many swappers’ priorities.
As for Maya Protocol, as it is an on-chain decentralized exchange, its transactions are just these types of fees. But that hardly means you should run back to a CEX instead of using it. In fact, because CEX swapping is so very far from “swapping like a pro” (for more reasons than this article has room for), despite their potential low number of total fees, this article doesn’t include this method in its discussion at all.
Instead, we intend to inform you about the customary fees on Maya Protocol in order to empower you to make more precise decisions, and level up your swapping game. For, by learning the purpose and dynamic of each of these fees, you’ll be better positioned to make smarter, more cost-effective choices.
Let’s now have a look at those fees:
When swapping on-chain, each transaction incurs an inbound gas fee that the user needs to pay for execution—these are paid in the gas token of the inbound asset. This is the case for swaps performed on Maya Protocol, as all its transactions both to and from are on-chain.
Let’s break it down with an example: Imagine you want to swap Bitcoin (on its own Bitcoin blockchain) for Ether (on Ethereum). When you do this through your favorite Maya Protocol front-end, that interface quietly builds a Bitcoin transaction for you in the background.
To send that transaction, you need to pay a small Bitcoin network fee from your wallet. This fee helps get your transaction confirmed (or “mined”) by Bitcoin miners. Only after that transaction is confirmed on the Bitcoin blockchain does Maya Protocol see it and begin the swap process.
And here’s the important part: the Bitcoin fee you paid is extra — it doesn’t count toward the amount you’re swapping. Also, that fee doesn’t go to Maya Protocol — it goes to the Bitcoin miners who include your transaction in a block.
The Maya Protocol front-ends may be charging an affiliate fee, as a payment for the convenience and service that they are offering to the users. This fee will be a percentage taken away from the swap amount.
Important: this affiliate fee is not paid to Maya Protocol.
For a list of the affiliate fees charged by Maya Protocol frontends, see THORChain University’s Medium Article.
Understanding this fee requires a bit of background knowledge in DEX design: Maya Protocol functions as an Automated Market Maker (AMM) via Liquidity Pools (LPs). The liquidity in LPs is deposited by users for yield, which comes from fees paid by swappers to utilize that LP liquidity (to make swaps). To put it another way, the swappers pay fees to use the LPs on Maya Protocol, and these fees are paid as yield to LP depositors. This fee is known as slippage, and is algorithmically determined based on the swap size vs the Liquidity Pool’s depth.
Very important here is that Maya Protocol considers a time component in determining the slippage fee, one that favors more patient swappers. For, if you intend to swap a large swap size, and you want this swap to be completed as quickly as possible, then, depending on the depth of the pool, you might be paying a high slippage fee.
If you are more patient, however, there is a far more cost-effective option than being automatically subjected to these potentially exorbitant fees.
Maya Protocol offers a special option for swappers who don’t mind waiting a bit: Streaming Swaps. Instead of swapping your full amount all at once, Maya automatically splits it into several smaller swaps. Some front-ends even let you customize how many sub-swaps you want and how many blocks to wait between each one.
Each of these smaller swaps happens one at a time, across different blocks. This pause between swaps gives arbitrage traders time to rebalance the liquidity pools, helping keep the protocol healthy and efficient.
Because the size of each sub-swap in Streaming Swaps is smaller, patient swappers will pay a smaller slippage. What this fee does is basically balance slippage against the time it takes to complete the swap.
Once the swap (or, in the case of a Streaming Swap, all the sub-swaps) is completed, Maya Protocol will send the outbound transaction on-chain to your recipient address. Using the same example above of a Bitcoin to Ether swap, Maya Protocol will send the Ether on the Ethereum blockchain to your Ethereum address. In this case, Maya Protocol will pay the Ether gas fee so that the transaction is validated on the blockchain. This fee is paid to the Ethereum validators, and is deducted by Maya Protocol from your swap outbound. This means that, as opposed to the inbound gas fee where you did need the gas token in your wallet for execution, you do not need to have any Ether in your receiving wallet to receive the transaction amount.
In time, fees in DeFi swapping may become more consolidated and simplified. For now, though, they are still part of the learning curve. But this is exactly what this article intended to help with: hopefully, by clarifying the purpose and design of each fee that tags along each swap, you might find yourself more knowledgeable in how to go about making a swap on Maya Protocol. For instance, now you know you don’t need to allocate gas for outbound transaction fees. Additionally, if you’re intending to make a large swap soon, you might do so sooner and leverage Maya’s Streaming Swap feature to lower your costs, rather than waiting until the last second and paying more.
And, while it may seem that making a swap on a centralized platform will have lesser fees, it’s worth accounting for the gas fees attendant with platform deposits and platform withdrawals. Also, at least on Maya Protocol, you have full custody of your funds on-chain the entire time, (save for the short in-progress swap period). This is something that CEXs will never be able to claim.
And now… you can swap like a pro on Maya Protocol!