Auto-Compounding via XCM

Mangata
5 min readMar 9, 2023

Getting excited yet?

Once again, Mangata is serving novel technologies to its users, hand in hand with the frens from OAK Network. Auto-compounding is not the novelty in itself, but the unique approach lies in how it is built! Fully autonomous, trustless, and without additional smart contracts and external actors. The utilization of the XCM protocol for purposes other than token transfers is a significant achievement!

Keep reading to learn about the concept of auto-compounding, current problems and risks associated with it, and how the Mangata and OAK partnership solves these problems by leveraging the power of Substrate!

What is Compounding?

Compounding refers to adding earnings to the principal balance, thereby increasing the total amount to maximize returns. This enables the new rewards to apply to the accumulated amount. The idea of repurposing the earnings shifts the rewards chart from linear to exponential and results in significantly greater returns over long time periods.

Let’s put it into a practical example in a traditional finance context. Alice puts $100 in a savings account, and she earns 10% of her balance every year. After the first year, Alice earned $10, and her total balance is now $110. If Alice leaves the extra $10 in the account and continues to earn 10% rewards each year, she will earn rewards not only on the original $100 but also on the $10 that she earned previously. After the second year, Alice will have earned $11, bringing her total balance to $121.

Alice’s portfolio is growing faster, because she’s getting rewards for not only her original $100 but the accumulated amount of $110. This is the power of compounding.

Auto-Compounding

Just like in traditional finance, it is also possible to compound rewards on the blockchain. While it is possible to do it manually, users generally prefer to automate the process to avoid the repetitive task of compounding rewards on a regular basis, as well as to maximize their returns.

⚠️ It is important to understand that liquidity provision is not the same as holding stables. Holding LP tokens represents a share of a pool of assets that can fluctuate in value based on supply and demand. This means that the risks and rewards of holding liquidity are unique and should be carefully considered before making a decision.

Auto-compounding is common in the blockchain. But it generally relies on a semi or complete custodial solution. For example, EVM chains are typically making auto-compounding via smart contracts. This requires users to send their assets to a smart contract that compounds their staked assets over time. So even if the users do not have to hold their assets on a centralized authority, it still carries the risk of a smart contract, which can be hacked or used as a mechanism to steal user funds.

Trustless Automation

The solution to the custody problem of auto-compounding lies in the mechanism of trustless automation. Thanks to the technology provided by Polkadot Network, Mangata is able to provide the auto-compounding feature to its users by utilizing the automation solutions of Turing Network, the canary of OAK Network on Kusama.

Basically, what happens is that Turing Network sends an XCM message to Mangata X. The XCM message includes the following extrinsic calls:

  • Claim rewards (from already existing LP position)
  • Sell half of the rewards for the other token (so that 50% balance can be preserved)
  • Add new tokens to the existing LP position

To automate the compounding task, Turing Parachain schedules these extrinsic calls to be submitted and executed on Mangata X Parachain.

Is This Secure?

You might be wondering about the security issues with providing authorization to an external Parachain to sign transactions for you. So how come XCM automation differs from the smart contracts approach in terms of security?

Parachains are black boxes and they do not trust each other. So one chain cannot perform any action on behalf of a user on another chain. Instead, XCM messages are sent and interpreted when they arrive. So each chain can decide on what to allow.

In this case, Mangata has built a proxy pallet specifically for auto-compounding via OAK. So basically, users will be creating a proxy account on Mangata, and Turing Network is only allowed to perform a single transaction on behalf of the user: compounding.

Fulfilling the Promise of Polkadot

This is the very first time in the Polkadot ecosystem that two Parachains utilize the XCM protocol other than token transfers. It is a very important milestone for Mangata, OAK Network, and the Polkadot ecosystem as a whole!

Even though it’s a highly technical process now, a much easy-to-use UI that will allow Mangata X users to auto-compound with one click is on the way.

Mangata’s partnership with OAK Network does not end with this feature. We cannot wait to build and provide you with other cross-chain use cases such as time and price triggers which will enable user-focused strategies such as stable cost averaging and on-chain limit orders.

Join us on our journey and let’s embrace the harsh winds together!

Ivan Aivazovsky — Ship “Twelve Apostles”

Further Insights

Stay Informed**!**

Follow Mangata Finance to get updated on all our latest developments:

  1. Follow us on Twitter @MangataFinance
  2. Join the Telegram
  3. Subscribe to our YouTube channel
  4. Join the Mangata X Newsletter at x.mangata.finance
  5. Join the Discord channel

About OAK Network

OAK Network is a layer one blockchain that enables multi-chain applications to automate single or recurring transactions using a simple ‘if this’ trigger condition and ‘then that’ transaction instruction. As the web3 hub for cross-chain automation, OAK unlocks a diverse range of rich DeFi user experiences including scheduled and recurring payments, stable-cost-averaging, stop loss and limit orders, and non-custodial copy trading.

About Mangata

Mangata is on a mission to become the #1 DEX on Polkadot, offering traders and liquidity providers the best platform to access unique tokens and earn rewards.

We believe that everyone should have the opportunity to participate in the decentralized economy and benefit from the power of blockchain technology. That’s why we’re creating a user-friendly platform that makes it easy for users to trade, provide liquidity, and earn from multiple passive income streams through double staking rewards, even if they’re new to crypto.

Mangata will offer access to the widest array of Polkadot tokens, better prices for traders by mitigating MEV, and the ability to trade without gas.

At Mangata, we’re dedicated to building a fair and transparent platform that puts the needs of users first, offering the lowest fees for traders and the highest rewards for stakers. We’re committed to continuously improving our platform and offering new features that provide even more value to our users.

Join us on our mission to become the #1 DEX on Polkadot and unlock the full potential of the decentralized economy.

--

--

Mangata

Our mission is to bring fair rules for traders: a guarantee of low fixed-fees and reliable orders.