Please describe your proposed solution.
Decentralized Finance (DeFi) has long sought to provide an alternative financial platform for the disenfranchised or underbanked peoples of the world. Although DeFi has come a long way, it still suffers from issues that mostly stem from the same critical tradeoff: permissioned actors.
<u>Availability/Resilience</u>
An alternative financial system will likely be perceived as a threat by those in positions of high (legacy) power, who may employ a variety of regulatory or cyber-offensive tactics to disrupt it. To resist such disruptions, DeFi protocols must strive to maintain rigorous security and availability guarantees, ideally as much as the underlying blockchain. Although many DeFi protocols offer reasonable security guarantees, the same cannot be said for availability:
- Most DeFi protocols rely on a permissioned set of batchers/arbitragers/aggregators for liquidity. Such actors are at a high risk of denial-of-service (DOS) attacks, and are thus single-points of failure. This is doubly true for protocols that rely on oracles for external price feeds, where DOS and oracle collusion/corruption are significant attack vectors.
- Governance of permissioned actors is a complex and nuanced topic: who decides who gets to be a batcher or oracle provider? How are they compensated? If the answer is DAOs and dApp tokens, the result is a pandora's box of technical, economic, and regulatory concerns. Decentralized governance is a messy topic, and should be simplified or minimized whenever possible.
This project solves the availability concern by forgoing reliance on off-chain information in favor of endogenous price discovery and NFT-mediated indexing.
<u>Custody and Composability</u>
Efficient use of (limited) transaction space is critical to scaling decentralized protocols. A key idea here is that simple pieces of logic can be composed with one another, resulting in complex and expressive protocols. The trick is in designing these simple pieces holistically, such that they do in fact compose well with each other. Unfortunately, this is not so easy in practice, and is largely a consequence of - you guessed it - permissioned actors.
Since most DeFi applications are designed by separate teams and usually rely on separate aggregators/batchers/LPs, the resulting protocols are not easily composable. There may be some instances where composition is achievable through hacky/low-level transaction building, but this is far from an optimal solution. Additionally, permissioned actors must be incentivized, and are mostly done so through extra fees. These "protocol" fees are usually about an order of magnitude higher than the underlying transaction fee, which is less than ideal.
This project achieves composability by taking a holistic approach to eUTxO-based DeFi. The requirements of an entire financial stack are considered, and are balanced with the constraints of a fully p2p architecture. A key feature is that delegation control is never sacrificed.
How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?
The P2P-DeFi Protocols project seeks to establish the basic building blocks of p2p finance on Cardano. it is a family of synergistically composable DeFi protocols with high security and availability guarantees. Currently, it is composed of four core protocols:
- Cardano-Swaps - a p2p-exchange protocol for swapping fungible tokens. It serves as the liquidity "base" for composition with the other three protocols.
- Cardano-Loans - a p2p-lending/borrowing protocol featuring trade-able "Bond" NFTs, on-chain loan term negotiations, and an on-chain credit history.
- Cardano-Options - a p2p-options protocol for writing, buying, and exercising (trade-able) American-style covered options contracts.
- Cardano-Secondary-Market - a p2p-aftermarket protocol for buying/selling NFTs, especially well suited for "Financial NFTs" (i.e. Bonds, Options, e.t.c.)
All four of these are already working prototypes. For more details on each protocol, please visit the respective Github repos linked above.
Here are some high-impact features shared by all four protocols:
-
Censorship Resistance - The protocols are fully peer-to-peer, 100% permissionless, and do not rely on any "specialized" oracle/batcher/indexing software. Since there are no special entities, there are no single points of failure, resulting in the lowest attack surface of any DeFi architecture. Assets are not only safe, but the protocols inherit the same availability guarantees as the Cardano blockchain itself.
-
Composability - The protocols are synergistic and highly composable with one another, especially from the buyer's perspective. For example, the output of a swap can be used as the input to purchase an (aftermarket) options contract, which itself can be used as an input to exercise the underlying option, all in one transaction. See here for a visual.
-
Full Custody - users always maintain complete spending and delegation control over their assets. The only exception is when locking is required to enforce protocol logic, which restricts spending (but never restricts staking). Since there are no special actors to incentivize, fees are about an order of magnitude lower than comparable protocols.
For a full list of features shared by all p2p-DeFi protocols, please refer to the broad overview document here. The scope of this proposal is to continue the development, documentation and peripheral support of the four protocols.
How do you intend to measure the success of your project?
Fee and Execution Benchmarking: The protocols' efficiency is measured by benchmarking transaction fees and CPU/memory usage. These metrics will be concisely tabulated for individual protocols, as well as for more complex compositions. Since transactions on Cardano have CPU/memory limits, lower resource utilization results in higher throughput and composability. Adding features while keeping resource usage at a minimum is a prime indicator of success.
Github Activity: Collectively, the four protocols already have 52 stars (and counting) on Github, and many accounts are following the development of the protocols. Some have even begun contributing to the project (i.e. Cardano-Loans Aiken reimplementation). An increasing number of engagements or collaborations on Github is an indicator of adoption and success.
Developer Adoption: This project has already inspired some developers to adopt/modify its design patterns for their own protocols (i.e. Val-U-Swap). As more outside projects make use of the protocols' design patterns, more developers will cooperate and coverage on best-practices or optimal design patterns. This too, is an indicator of adoption and success.
Community Feedback: Quantitative interest and qualitative feedback of the community is measurable on social channels like Twitter. Community feedback and support is key to the success of the project's vision.
Please describe your plans to share the outputs and results of your project?
Technical Documentation - As development proceeds, thorough technical documentation and changelogs for each of the four protocols will be continuously updated on Github. This will include:
- Written explanations & pseudocode
- Diagrams for visualizing control flow
- Detailed feature discussions
- Additional overarching documentation to discuss/standardize common design patterns shared by all four protocols.
Demos & Tutorials - User-friendly written and video tutorials will be created for each of the four protocols. They will start simple, where each protocol is used in isolation, and progress to more advanced demos where the protocols are composed with one another.
Design Standardization - Certain design patterns shared by all four protocols (i.e. Beacon Tokens) may be of independent interest to the broader community of eUTxO developers. Through further R&D, we may extract a generalizable pattern for such novel techniques and standardize them through the CIP process. These can also be published on existing developer repositories, such as the Cardano Developer Portal.
Social Media Outreach - Social media platforms like Twitter will be leveraged to announce progress updates, receive feedback, and engage with the community of users and developers.
In-Person Presentations - Presenting at Cardano-specific conferences or meetups is an excellent opportunity for real-time Q/A and feedback from a technical audience.