How Chainlink Enables DMM to Bring Real World Assets On-Chain

Zachary Rynes
May 21, 2020 · 11 min read

With DeFi Money Market (DMM), users from anywhere in the world with a simple internet connection are now able to earn a stable permissionless yield on their savings backed by a decentralized money market of interest generating real world assets. Thanks to the wonders of the Ethereum blockchain, this process can be fully transparent and open to anyone. Ethereum also has the great property of composability, which enables multiple currently existing applications to be plugged together like “Money Legos,” creating another new layer of even more powerful applications. Because DMM tokenizes user deposits into transferable mTokens, these ERC20-compliant tokens can be easily used by other DeFi applications on Ethereum.

Bringing real world assets on-chain means DMM is helping grow Ethereum’s DeFi ecosystem as a whole. Unlike many other DeFi protocols, the yield DMM generates is not from cryptocurrency leverage traders, but from demand for real world assets that are used by billions of people all over the world everyday, including but not limited to automobiles, real estate, and aviation.

In order to bring these real world assets on-chain, DMM utilities a crucial piece of the DeFi technology stack: Oracles.

The Importance of a Oracles in the DeFi Ecosystem

Due to the nature of how consensus is achieved on a decentralized blockchain, smart contracts natively have no information about the real world outside of the transaction data stored on-chain in the ledger. This creates what is commonly referred to as the “oracle problem” and it is an issue for all blockchains. An oracle is a digital agent employed by the smart contract to fetch external data (off-chain) and deliver it onto the blockchain (on-chain). While it sounds like a simple task, if it’s not done correctly then the entire value proposition of smart contracts, namely its tamper-resistance and decentralization, is entirely lost. A decentralized smart contract with a centralized oracle solution introduces a single point of failure into the contract’s end-to-end security.

Oracles have already proven themselves to be a fundamental piece of the smart contract stack, as over 90% of the funds locked up into DeFi protocols today are in dApps that require an external oracle for off-chain data. Usage of oracles in DeFi is commonly required for the creation of price feeds; off-chain oracles fetch and aggregate the price data of a particular asset from all its liquid exchanges (decentralized and centralized) in order to value the cryptocurrency being used as collateral. Examples of such oracle usage in this fashion include DeFi titans such as Maker, Compound, Synthetix, Aave, and many more.

The need for external oracles is especially important for DeFi protocols that incorporate real world assets. The oracles determine both the valuation and existence of such assets, as the data to value these assets and their physical custody reside off-chain. In order to overcome this oracle problem, DMM has diligently worked with Chainlink, the industry leader in decentralized oracles, to create a solution that enables DMM smart contracts to calculate the valuation and active collateralization ratio of the entire DMM Ecosystem. This ensures that mTokens are sufficiently overcollateralized before anyone, including the DMM Foundation, is able to mint and issue more mTokens.

To explain how DMM utilizes Chainlink oracles today and how that will evolve into the future, we will analyze the end-to-end process from the perspective of an end user who wants to earn a stable 6.25% yield, yet track where their funds are in each stage of the process.

How DMM Uses Chainlink Oracles to Maintain a Fully Collateralized, Transparent, and Trust Minimized Money Market

The process begins with the user making an initial digital asset deposit into the DMM Ecosystem. This can be done on the DMM Swap page or in another DeFi application which is plugged into the DMM, hence the “Money Lego” nature of Ethereum and DeFi applications. In exchange, the user receives an equal value of mTokens (e.g. mUSDC for USDC, mDAI for DAI, and mETH for ETH). Because mTokens conform to the ERC20 standard, users can transfer these mTokens and use them in many DeFi applications and standard Ethereum wallets. mTokens continually generate interest over time and can be exchanged back to the original deposited asset along with any accrued interest.

The user’s deposited digital assets now sit within DMM’s smart contracts, with their value being added to the overall collateralization of the entire DMM Ecosystem. The value of a user’s mTokens (mUSDC, mDAI, mETH) can be determined by querying the mToken smart contract for the current exchange rate between that particular mToken and its underlying digital asset. For example, the valuation of a user’s mDAI can be easily found by querying the mDAI contract for the current exchange rate and multiplying that by how many mDAI tokens the user holds. This returns the valuation in DAI, but the USD valuation can easily be found by multiplying the resulting value by the price point given by Chainlink’s DAI/USD Reference Price feed.

This process enables users and applications to know the valuation of their mTokens in USD. However, the metric most crucial for the health of the overall DMM system is the active collateralization ratio. In a healthy system, this value should be greater than 100% to ensure every mToken issued has an equal or greater than valuation of the collateral backing it. This collateralization ratio is found by dividing the aggregate value of all collateral within the DMM ecosystem (a mixture of digital assets, real world assets, and intermediate fiat currency) by the aggregate value of all currently circulating mTokens, including interest due. Finding this collateralization ratio requires using three separate price metrics fed from Chainlink’s decentralized oracle networks.

Calculating the Value of Digital Assets Held on Reserve

While a large portion of the deposited digital assets will be sold for interest-generating real world assets, a portion will remain statically held as digital assets in the contract to enable liquidity for user withdrawals. This is known as the reserve ratio which is set at 50% although it’s currently residing at above 100% to support the growth of an initial liquidity pool.

In order to continually determine the collective valuation of these digital assets, DMM’s smart contracts fetch price data by pulling from Chainlink’s Data Reference Networks. For example, to find the value of ETH deposited and held within the ecosystem, DMM’s smart contracts query Chainlink’s ETH/USD Price Reference Contract, which aggregates the ETH/USD price delivered from 21 security reviewed, sybil-resistant Chainlink nodes. Each of these nodes source data from premium data providers such as BraveNewCoin, CoinMarketCap, Kaiko, and more. Instead of aggregating a static set of exchange APIs, these data providers aggregate their price data across all liquid exchanges. Chainlink’s ETH/USD Price Reference contract is updated every 0.5% deviation in price, with a time-based update (heartbeat) at least every three hours.

DMM also uses Chainlink’s DAI/USD and USDC/USD price feeds for the mDAI and mUSDC tokens respectively. Note that the USDC/USD feed was created by multiplying the USDC/ETH feed by the ETH/USD price feed. Any future digital assets added to the DMM Ecosystem (e.g. USDT, sUSD, PAX) will also use Chainlink Data Reference Networks to query the current market-wide price of a digital asset.

Calculating the Value of Interest-Generating Real World Assets

Another one of the most important metrics to calculating the collateralization ratio of the DMM ecosystem is the valuation of the interest-generating real world assets that enable depositing users to earn a stable interest rate. This currently includes car equity loans, where car owners (who fully own their car) borrow money from the DMM using their car as collateral. The DMM Foundation (eventually DMM DAO) holds a first lien senior-secured position on the vehicles, where the vehicle can be repossessed by DMM’s third party servicers and liquidated if the borrower defaults. Since mTokens are overcollateralized in both value and interest paid, the funds recovered from a liquidation covers both the principal and interest due to mToken holders.

In order to determine the total valuation of these vehicles used as collateral, price data on the aggregate value of all vehicles is pulled and calculated by a network of five independent Chainlink nodes that query the industry standard for valuation metrics of each individual vehicle. The response from each oracle is recorded on-chain and the median value is taken and delivered to DMM’s smart contracts to be used in the active collateralization calculation. This collateralization ratio determines how many new mTokens can be minted, keeping the system equal or greater than 100%, and provides transparency to depositors to the exact valuation of the collateral backing their deposits.

While DMM currently offers depositors interest generated from $8.5M in car equity loans backed by vehicles within the United States, this can be grown over time to include a more diverse array of automobiles and even expanded into more asset classes. Similar to car equity loans, where borrowers put up their vehicles as collateral for cash loans, property owners can put up their real estate as collateral for a cash loan. This process would entail a similar first lien senior-secured position, where the DMM Foundation (eventually DMM DAO) owns the full contractual rights to the property, and where third party servicers can evict and liquidate the property in the case of a borrower defaulting.

DMM also natively supports different collateral models beyond equity loans. The DMM Foundation (eventually DMM DAO) can utilize user deposits to purchase a property outright, commercial or residential, such as office space or an apartment building, and rent it out in order to generate a steady stream of income from tenants to mToken holders. In this case, there is no equity loan and the asset is directly being used as collateral in the DMM ecosystem.

This model works not only for real estate, but for other real world assets as well, such as aviation. For instance, a commercial G4 jet can be purchased and put into a charter to generate steady revenue for any amount of time. Private aviation has been growing in demand driven from the Covid19 pandemic. Afterwards, the asset can be sold and the funds allocated elsewhere. While international tax law is a complex matter and varies from case to case, there are often tax advantages to making these asset transfers in international territory that could further benefit this structure. This model also has the advantage of scaling much higher as anything that can be rented can be supported by the DMM collateral ecosystem, compared to equity loans which are backed by assets that the borrower fully owns and wants to borrow against. For example, there are more residential renters than those who wish to borrow against their homes.

For any real world assets supported in the DMM, valuation of such assets can be pulled from any number of data sources through Chainlink’s decentralized network of security reviewed node operators. The data can be relayed on-chain to DMM’s smart contract to be used in the collateralization process. Which data source is queried will depend on the asset type and ultimately will need to be chosen beforehand by the DMM DAO.

Calculating the Value of Fiat Currency Held by the DMM Foundation

The last off-chain metric needed for calculating the collateralization ratio of the entire DMM Ecosystem is the valuation of the fiat currency held by the DMM Foundation (eventually DMM DAO). Currently this module in DMM’s smart contracts returns null data as we haven’t yet begun to withdraw any deposited funds. This is primarily because we have already seeded the ecosystem with $8.5M in real world assets. However, once we do, we will need to bring transparency to the location and valuation of intermediary fiat currency that is held by the DMM DAO after selling the deposited digital assets, but before purchasing new real world assets. This intermediary period is needed as the traditional financial system can be notoriously slow and it will take time to purchase real world assets or provide real world asset backed loans. This feature is still being developed, but our design will incorporate transparency using Chainlink oracle attestations of both the valuation of the fiat currency and the custodian holding it.

All three of these metrics are crucial to a well functioning DMM Ecosystem that is always adequately collateralized to protect depositors. While we are initially using Chainlink primarily for the price feeds that power our ecosystem, we are also researching ways to use Chainlink in new interesting ways.

For example, we are working with entities with specialized knowledge of the DeFi ecosystem in order to design and build an ongoing verification scheme which will provide an independent attestestation of asset ownership in the DMM Ecosystem. We are looking into how we can leverage the Chainlink protocol to bridge these ongoing attestation reports on-chain. A decentralized network of Chainlink nodes could compare off-chain the third party attestation reports versus what the DMM Foundation / DMM DAO claims to own and post any differences on-chain. If there are no resulting discrepancies, it is business as usual. If discrepancies are reported, then a series of events take place on-chain that may include but are not limited to revoking the ability for the DMM Foundation / DMM DAO to issue new mTokens or withdrawing the underlying digital assets deposited. End-user withdrawals and transfers would be unaffected in this regard. Full functionality of the DMM system would only be restored once Chainlink nodes confirm there is no longer a discrepancy and the system is properly collateralized.

Chainlink’s oracles are critical for the proper smooth operation of the DMM Ecosystem today through its hardened price feeds, but in the future it could play an even larger role in helping bring transparency and trust to the forefront in a decentralized and trust-minimized maner. We are very interested in exploring more ways that DMM could leverage Chainlink to build an ecosystem that can scale to potentially billions of dollars from users all over the world earning a stable interest, backed by real world assets, through the power of the Ethereum blockchain. This brings yield to those who need it most.

The DeFi Money Market ecosystem is currently operating live on Ethereum Mainnet and continually paying 6.25% APY on user’s ETH, DAI, and USDC. You can find out more information by checking out our Website, Swap app, Explorer page, and if you have any questions feel free to drop into our social media channels such as Discord and Telegram.

About Chainlink

If you’re a developer and want to connect your smart contract to existing data and infrastructure outside the underlying blockchain, reach out to us here! We can help you quickly, yet securely launch your data-enabled application or Chainlink Price Reference Data Contract on mainnet today. You can also visit the developer documentation or join the technical discussion on Discord. Learn more by visiting the Chainlink website or follow us on Twitter or Reddit.

Chainlink is a decentralized oracle network that enables smart contracts to securely access off-chain data feeds, web APIs, and traditional bank payments. It is well known for providing highly secure and reliable oracles to large enterprises (Google, Oracle, and SWIFT) and leading smart contract development teams such as Polkadot/Substrate, Synthetix, Loopring, Aave, OpenLaw, Etherisc, Conflux, and many others.

About DMM

DeFi Money Market (DMM) is an ecosystem built on the Ethereum blockchain that bridges interest-generating real world assets into the Decentralized Finance (DeFi) ecosystem in a transparent, trust-minimized, overcollateralized, and permissionless manner.

Website | mTokens | Explorer | Twitter | Discord | Telegram | Github | White Paper | Contact


DeFi Money Market DAO

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store