Please describe your proposed solution.
The aim is to research the viability of Hydra as a general DeFi platform, following a B2B design pattern where protocols (DEXes, lending platforms, oracles etc) are represented in the head as participants.
The main output of the research will be a white paper which will
- Outlining the design
- Educating on how Hydra works
- Contributing new ways to thinking about how to structure systems around Hydra
- Proposed "B2B" design (protocol-to-protocol is perhaps more accurate)
- User interaction, how to deal with B2C
- How to deal with main net interactions without closing the head
- Incremental settlements
- Deposit contracts
- Main net congestion
- Malicious or compromised participant
- Evaluate performance and limitations
- Throughput
- Number of participants and impact on performance
- Number of UTxOs and impact on performance
- Outline some best practices to maintain performance
- Highlighting notable benefits and feature adds
- Flash loans and associated liquidation and arbitrage improvements
- Possibility for low/no fees increasing capital efficiency
- Larger script sizes, enabling more sophisticated smart contracts and protocols
In addition to the white paper, the targeted deliverables comprise of an MVP of how Hydra can be used as a B2B platform, with a showcase of how B2C relations can be handled through wallet authentication and indexing. Instead of reinventing the entire DeFi stack, the MVP will focus on the B2B design pattern and associated B2C interaction through a simple, creative application similar in function to the Reddit experiment from 2017 r/Place.
Finally I will seek to make a list of memorandum of understandings (MOUs) from relevant DeFi projects interested in exploring further and possibly being a contributor to a full DeFi head solution.
How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?
The solution will principally aim to achieve four goals:
- Show the wider community a useful way of thinking about Hydra in applications
- Bootstrap the collaborative work that is required to explore Hydra as a general DeFi platform, work that would otherwise be very hard to coordinate and align incentives for between competing projects
- Find a solution to the issues facing Cardano DeFi at present, in particular
- Congestion
- Batchers
- Script memory capacity
- Efficiency
- Contribute to lowering the congestion on the main chain through funneling a lot of traffic into Hydra applications
Let’s dig a bit more into each one:
Show a useful way of thinking about Hydra applications
Hydra as a technology stack is a flexible and useful tool, however the applications that are built using it depends on the way people understand it. As a “mini layer 2”, a “session specific side channel”, and other previously mentioned ways of thinking about Hydra, the proposed applications are very niche and limited; however these are by no means the only ways of understanding which role Hydra can play.
Hydra can for example also be thought of as an extension of the existing smart contracts, allowing more complex interactions such as providing the infrastructure for flash loans, or simple improvements like exceeding the memory and computational limits.
Another way of thinking about how to use Hydra is through B2B platforms. In particular if representatives from multiple DEXes, lending platforms, oracles and professional market makers collaborate inside a Hydra head in a B2B manner, a whole slew of new products can be built with negligible risk of congestion, no hard limits to transaction complexities and with no/trivial transaction fees. This in turn will enable much needed new features to Cardano DeFi users such as flash loans, automated yield harvesting, more capital efficient arbitrage, liquidations, possibly leverage trading and more.
Bootstrap the Hydra DeFi work
An important issue currently standing in the way of Hydra being explored as a B2B solution for DeFi at the moment is the competitive nature of the potential participants. Hydra is not ideally suited for DeFi as an application specific platform, for example the benefits for a DEX of using Hydra on its own is likely marginal or very complex. On the other hand, the benefit of 2 DEXes sharing a head, facilitating more efficient arbitrage is immediately obvious; however this is an unlikely spontaneous marriage since the initial work would require collaboration between competing firms.
This is why it is useful to bootstrap the design pattern and analysis, and present it as a public white paper. The potential participants can read up on the proposal and evaluate whether it is a direction they want to push their own development.
Find a solution to the issues facing Cardano DeFi
There are a number of problems facing Cardano DeFi at present, with secondary and undesirable effects.
- Congestion
DeFi suffers tremendously from, and contributes a lot to congestion on the main network. This not only makes for a bad user experience when trades take hours to complete, but it makes applications that rely on time sensitive transaction like liquidations and short-duration oracle feeds inherently unsafe to use and operate. The secondary effects of this is that either those protocols take the risk and operate unsafely, possibly putting users' assets at risk, or they simply don't launch at all, making the Cardano ecosystem all the poorer for it.
- Batchers
Batching scripts were introduced as a design concept to attempt to deal with global states like the exchange rate in an AMM style DEX or dynamic interest rates in pooled lending protocols. Batchers suffer from some inherent issues, the primary of which is the tradeoff between permission and security.
Having fully permissionless batchers opens the protocol up to "dusting" or other types of spam attacks where external parties run the batching script without actually contributing to the protocol operation.
Creating a "partially permissioned" or even just completely permissioned system where the protocol development team operates the batching scripts exposes the protocol and its' users to a host of issues.
- Script memory capacity
The current transaction size restrictions are permissive for a lot of applications, but for transactions requiring a lot of data, such as a many-to-many relational check, the transaction size limitations are quite strict which limits the complexity of the features that can be implemented.
- Efficiency
Hydra allows for a few novel things to be done that will improve DeFi dramatically in terms of efficiency and capital efficiency. Lowering/removing transaction fees could be an option due to the "B2B" nature of the proposed solution, but leveraging the technology in particular the fast finality and the snapshot mechanism, features such as flash loans might be possible to implement.
Flash loans are an interesting blockchain innovation that makes certain transactions and markets much more capital efficient and accessible. Flash loans make actions like liquidations, arbitrage, collateral swaps etc either much more efficient or possible in the first place.
Lowering the congestion by funneling traffic into Hydra
By moving some of the DeFi trading traffic into a Hydra layer, and removing some of the extraneous traffic generated by batching scripts, this solution could improve the congestion of the main network. It won't be a one-stop-fix-all solution, but paired with other developments and future improvements like input endorsers, it will certainly help improve the usability of Cardano at scale.
How do you intend to measure the success of your project?
The success criteria of the MVP and white paper are quite different.
White paper
The ultimate success of the white paper is the deployment of a Hydra DeFi platform based on the work, however intermediary goals can be measured through engagement through public metrics like citations and social media coverage, and business metrics such as approvals and commitments by key operational contributors that show interest in participating/adopting the design. Towards this purpose a list of MOUs from relevant projects will be started, and getting one representative from each vertical (DEX, lending, oracle, trading/market making/liquidations) would be considered an initial success, getting multiple participants, for a more competitive environment would be a more solid intermediary success.
MVP
A successful deployment of the MVP will be measured through user engagement with the actual dApp, but also GitHub engagement such as forks. If few people engage with the dApp, but there is a lot of traffic in the GitHub repo, the MVP is considered a success. If there is a lot of engagement with the dApp but few interactions with the GitHub repo, marketing efforts (funded by the dApp revenue) will be spent to bring focus to the open source components.
Please describe your plans to share the outputs and results of your project?
Once the white paper is finished and published, it will be shared in a few ways.
The first is through writing highlights, simplified breakdowns and explainers to be shared on social media, hosting AMAs and when invited doing interviews.
The projects signing the MOUs for the white paper deliverable will also be asked to share links to the white paper on their social media channels to bring attention to it.
A collaboration with the Hydra team for the white paper is in talks, and a possible co-authoring and publication on IOG’s website will bring a lot of attention to it, however no firm commitments have been made.
The dApp built on the MVP is specifically designed to be quickly deliverable and to attract a lot of interactions, i.e. ideally to become “viral” within the Cardano community. This will in turn bring attention back onto the Hydra fundamentals underlying the product. In addition to the social elements of the dApp itself, there will be a “tps counter” that shows the max tps reached. This plays into the “1 million tps” meme that surrounds Hydra, but an initial benchmark shows that the application should be able to reach at least 1,000 tps, which if hit will hopefully make some wider waves bringing attention to the dApp, Hydra and Cardano as a whole.
A simplified breakdown of both the MVP architecture and the white paper will be hosted on the dApp website, making the outputs of the work more approachable for non-developers.