The Gotchi Gram

Share this post

Aave's Interest-Bearing aTokens on Matic Network

aavegotchi.substack.com

Aave's Interest-Bearing aTokens on Matic Network

A quick guide by Pixelcraft Studios CTO Nick Mudge

Coderdan
Jan 25, 2021
5
3
Share this post

Aave's Interest-Bearing aTokens on Matic Network

aavegotchi.substack.com
maUSDC

We recently implemented a custom Ethereum|Matic bridge that moves Aave's aTokens from Ethereum to Matic Network.

When aTokens are sent to Matic Network they are converted into a derivative token called maToken. The m in maToken is for Matic. maTokens work differently than aTokens.

aTokens increase in quantity over time. For example if you have $10 aUSDC it becomes $10.01 over time and continues to increase in quantity.

maTokens don't increase in quantity. Instead they increase in value over time. For example at this moment 9.88 maUSDC is worth $10 USDC. After some time your balance continues to be 9.88 maToken, but you can now sell it for $10.01 USDC in Quickswap. Or you can transfer your maUSDC to Ethereum (and pay Ethereum gas fee) and get 10.01 aUSDC.

aTokens can be transferred from Ethereum to Matic Network using the Aavegotchi bridge website.

You might want to know the USD or aToken value of maTokens. If you have a maToken balance this can be seen on the Aavegotchi bridge website by selecting a maToken. The nature of Quickswap will also reflect the increasing value of maTokens.

The aToken bridge contract has two read-only functions for converting aToken values to maToken values and vice versa. This can be used by UIs to show the increasing aToken values of maTokens.

maTokens can be put in Quickswap pools to earn QUICK rewards, trading fees and Aave interest, all at the same time. maTokens will be used to create and collateralize Aavegotchis, making Aavegotchis grow in value over time. Unlike aTokens, maTokens do not lose interest gains when put in exhanges like Uniswap or Quickswap.

Here's a more technical description of how the aToken bridge works:

When aTokens are sent to Matic, the aTokens are locked in the bridging contract on Ethereum. The corresponding maTokens are minted on Matic Network and transferred to the owner. The aTokens sit in the bridging contract accumulating interest. When/if the maTokens are sent back from Matic to Ethereum then the maTokens are burned on Matic Network and the maToken amount is converted back to the original aToken amount PLUS interest and transferred to the owner.

Twitter avatar for @mudgen
Nick Mudge 💎 aavegotchi @mudgen
When you send @AaveAave's interest bearing aTokens to @maticnetwork they get converted into maTokens. maTokens increase in value, not in quantity. When you send maTokens to Ethereum they get converted into the original aTokens + interest.
8:20 PM ∙ Jan 20, 2021
10Likes2Retweets

The maTokens continuously increase in value on Matic Network because they are backed by the increasing aTokens amounts locked in the bridge contract on Ethereum. The maTokens can be converted back to aTokens + interest.

The logos/icons for maTokens use a square outline to distinguish them from the circle outline of aTokens. The maTokens have two outlines around them. One is the blue color of Matic and the other is the red-purple color of Aave.

Learn more about Aave to Matic bridge in the recent Cointelegraph article:

Twitter avatar for @Cointelegraph
Cointelegraph @Cointelegraph
Developer Nick Mudge was trying to make his Aavegotchi NFT game run faster and cheaper when he came up with the idea.
cointelegraph.comClever Aave to Matic bridge keeps track of yieldsMatic Network is quickly becoming one of the go-to L2 solutions for smart contract developers like Nick Mudge from Aavegotchi.
4:33 AM ∙ Jan 22, 2021
139Likes46Retweets

Smart contract details about maTokens and the bridge can be found in documentation here: https://docs.aavegotchi.com/overview/matokens

Follow Nick on Twitter @mudgen for more updates!

3
Share this post

Aave's Interest-Bearing aTokens on Matic Network

aavegotchi.substack.com
3 Comments
JJ
Jan 28, 2021

Nice work! When I heard you did it, I thought you might have done it in this manner (a bit like protocols like yearn etc where token represent value of underlying pool of assets) as opposed to the tricky increase in supply.

Question for people building on matic and wanting their protocols to generate yield, its possible to swap mDAI (matic DAI?) for maDAI on quickswap I guess, but I can imagine the demand would quickly make this not feasible. If you have mDAI and you want to lend it out on matic, we are still looking for a good solution to this problem right? Since for these dollars to be put to actual work they need to be lent out on the mainnet?

Expand full comment
Reply
1 reply
MindNova
May 8, 2021

Can I use this ATokens on a Dex without risking my deposite on AAVE?

Expand full comment
Reply
1 more comment…
TopNewCommunity

No posts

Ready for more?

© 2023 Aavegotchi
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing