Cardano and the Need for Economic Security

Alignment & Design of Incentives Make Safe Protocols

Miguel Saldana
Cardano Token Engineering Lab
8 min readMar 29, 2024

--

Navigating the Challenges DeFi Landscape with Token Engineering Lighting the way

Economic exploits in DeFi have cost blockchain users over $6.5 billion since 2018 and taking a deeper look at 2023, 2/3 of the exploits are economic-based largely driven by price manipulation and smart contract exploits. The burgeoning Cardano ecosystem although with a much smaller TVL than more established chains, is equally vulnerable to these types of attacks. There is an opportunity to learn from most of the hacks that have happened largely in Ethereum and to focus on ways to engineer protocols safely and sustainably.

The Call for Economic Security

The Cardano Ecosystem is no different than other blockchains where the chain runs through consensus. Facilitating and validating transactions that meet specified rules. A desperate need in the Cardano space as dapp development grows and DeFi and other use cases are taking off revolve around token engineering with a specific call towards economic security. Economic security is the ability of a protocol to function as designed while minimizing the risk of being economically exploited. Another way of putting this is that protocols that are designed without a global look at how the entire system interacts as a whole, can be ways that malicious actors take advantage of a protocol to exploit it financially.

Token and Mechanism Design At A Glance

The root of good economic security for a protocol can be based on the mechanisms that comprise how tokens allow participants to interact with each other or the protocol itself. Good token engineering or tokenomics cannot turn any protocol into a financial success, rather it can be the catalyst that stimulates success or drives the death spiral. Token Engineering can be thought of as a cubic function. In the image below, an exploit that has economic security implications can sink a protocol into a financial hole that it may not be able to recover from. Conversely, good mechanisms can help encourage interactions with a protocol, growing it and attracting users and liquidity.

Cubic functions have both positive and negative exponential growth properties

Economic Security Issues In Cardano

Liqwid Oracle Faulty Oracle Transaction

Incorrect Price feed for iUSD during the time of the incident for Liqwid

At the beginning of this year, Liqwid Finance was exposed to a faulty price feed for assets that are utilized on the protocol. A necessary enabler for any DeFi protocol is to be able to accurately find out the prices of the assets that they are utilizing. Oracle protocols are designed to help facilitate this process by bridging off-chain data, like prices in open markets, on-chain to be utilized by DeFi protocols. In the case of Liqwid, the protocol uses a Coin Gecko API feed generated from the WingRiders DEX team. The problem was that the API feed from WingRiders to CoinGecko failed causing incorrect price data to be fed to Liqwid. The immediate financial impact of this issue was small, ~$7,000 USD of assets were liquidated due to the incorrect price feed. Users were made whole by the DAO due to the issue, but this is only a small example of protocol designs that can have far-reaching implications for protocol users. The Liqwid team is currently using Charli3 oracle price feeds for ADA, DJED, iUSD, and SHEN markets, with plans to expand price ceilings and floors around oracle feeds to improve the protocols response to adverse issues relating to asset values coming through oracles. A full post-mortem by the Liqwid team can be found here.

Economic Exploit Vectors:

Price Manipulation via Oracles — Either through manipulating the on-chain price of a token, a failure in the oracle, or other related issues, oracles play a pivotal role in economic security. Having a robust design around how prices are updated or calculated helps minimize the type of exploits that can happen.

Lenfi v2 Interest Rate Parameters

In the recently launched v2 of Lenfi they utilize a 2 rate borrowing model. Where the borrowing interest rate is up past the kink point (or break where the interest rates significantly increase based on utilization). Lenfi v2 is designed so that loans have a fixed interest rate along the duration of the loan, which for those who borrow early, at a lower utilization rate, can carry a significantly smaller interest rate. This is compared to a user who takes a loan at say ~60% utilization they would be paying a 51% interest rate on the life of their loan, compared to someone who borrowed earlier and received a 9.4% loan. Managing risk and costs to lenders/borrowers in a system is critical and a function of the parameters in-play of the protocol. This could create a situation where a user could effectively supply, then subsequently borrow against it, and secure a low rate in a market that has high utilization. This is a by-product of the fixed interest rate and high borrowing rate post the kink point. Again, this creates a situation that makes it unappealing for borrowers to utilize the protocol if they are put into a high-interest rate position by default and would be forced to shop elsewhere for better borrowing conditions. The Lenfi DAO has already made proposals to adjust the lending rate during high utilization as in the graphic below. Consideration of the various mechanisms and how they work is critical to design protocols that protect the capital in play and users who interact with the protocol from those who may try to exploit it.

Economic Exploit Vectors:

Parameter Design/Risk Management — This is the hard part of any protocol, the principal-agent problem, where a principal performs actions to supply capital, and agents then proceed to utilize it. The key thing is making sure that principals can pay agents (via incentives) and the agents can selfishly look to maximizing their payoff in an equilibrium state. Getting to that equilibrium state is a function of the parameters and if poorly designed can tip the scale where principals are not incentivized to pay agents or agents won’t be able to maximally seek gains with the capital, essentially making a protocol not valuable. In addition, bad debt (debt that is taken out of a protocol and loses value below the underlying, original debt) is a factor that could play out for the fixed lower interest rates. This could create situations where malicious actors could tie up lenders' assets, while potentially draining the value of the lending market.

The Value Depeg of Synthetic Assets

Indigo Labs launched the first synthetics-based DeFi platforms in Cardano and is currently one of the biggest, measuring by TVL in the protocol. The protocol allows users to take a debt position, or a CDP (Collateralized Debt Position), and mint synthetic assets to have exposure to their price. In the Indigo platform, a user locks their ADA up as collateral and mints one of the three synthetic asset options right now, iBTC, iETh, and iUSD. In designing a protocol where expected behaviors are outputs and incentives are the inputs, sometimes this can cause issues with how the protocol runs. In this case, in the v1 of the Indigo protocol, users attempting to maximize their payout have seemingly taken the synthetic assets and swapped them back to ADA, effectively taking a long ADA position. In doing this one a large scale, it has caused assets to not track the price of the underlying synthetic. The most prominent one is iUSD, which after a couple of months of staying around the price of $1 USD, began to depeg down in the $0.72–$0.75 cent range at its lowest. A key reason for this imbalance, notably affecting the price, is that there are no demand-side pressures to owning iUSD. A redemption mechanism would instantly create arbitrage opportunities for people to buy the low-valued assets and then redeem them for the value of the actual base value that the synthetic is created around. The Indigo team already has plans to help address these concerns in the v2 of their protocol, which should be launching soon.

Economic Exploit Vectors:

Design imbalances — Understanding how a synthetic asset should retain or track the value of it’s original asset should be a factor in the way a protocol is designed. As already stated, mechanism design in this space is incredibly difficult. Trying to solve and balance the principal-agent problem is a design problem that all DeFi projects should focus on building around. Mechanism Design is the inverse of Game Theory, where game theory takes a game and develops optimal strategies. Mechanism design involves designing and optimizing strategies to build a game where the principal-agent problem is played out.

Building a Better and Sustainable Future

The effort and point around Token Engineering is to look at both successful and unsuccessful cases of designs, patterns, and systems that work to make protocols attractive, profitable, and sustainable. Work is being done by groups like Token Dynamics, amongst many, to build fluency, analyze, and understand when actions need to be taken to protect protocols and their users. The goal of the Cardano Token Engineering Labs is to build out these capabilities in the Cardano Ecosystem.

Reach out to learn more:

X/Twitter: @cardanotokenlab

Website: https://thetokenlab.xyz (Slowing coming up to speed)

Catalyst Proposal: The details of the original Catalyst Proposal that is bootstrapping this effort

Token Dynamics: A trusted and knowledgeable group in the Economic Security and Token Design space.

Sources:

--

--

Miguel Saldana
Cardano Token Engineering Lab

Engineer trying to implement technology for a positive impact