funded
P2P-DeFi Protocols: Continued Development
Current Project Status
In Progress
Amount
Received
₳36,960
Amount
Requested
₳154,000
Percentage
Received
24.00%
Solution

A family of radically permissionless and composable p2p-DeFi protocols that forgo reliance on permissioned off-chain software, in favor of p2p-driven liquidity and price discovery.

Problem

Current DeFi protocols lack composability and rely on a variety of centralized actors (i.e. oracles, batchers). Such resilience/availability risks are unsuitable for an alternative financial system.

Team

2 members

P2P-DeFi Protocols: Continued Development

Please describe your proposed solution.

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:

  1. Cardano-Swaps - a p2p-exchange protocol for swapping fungible tokens. Featuring one-way swaps for normal users and two-way swaps for market makers, it doubles as the liquidity "base" for composition with the other three protocols.
  2. Cardano-Loans - a p2p-lending/borrowing protocol featuring trade-able "Bond" NFTs, fixed or compounding interest, on-chain loan term negotiations, and an on-chain credit history. Enables the formation of a Cardano-native credit/debt market.
  3. Cardano-Options - a p2p-options protocol for writing, buying, and exercising (trade-able) American-style covered options contracts.
  4. 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.

  • Native 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.

  • Endogenous Liquidity - There are no "DEX" Tokens, hence no way to artificially incentivize liquidity (i.e. yield farming). Instead, liquidity arises solely from the natural incentive to compose profitable strategies. This is feasible thanks to low fees and high composability.

  • 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.

Please define the positive impact your project will have on the wider Cardano community.

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: enshrined 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 byzantine fault tolerance (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:

  1. Most DeFi protocols rely on an enshrined 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.
  2. Governance of such enshrined 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. Many of these concerns are true even for permissionless enshrined actors. Decentralized governance is a messy topic, and should be simplified or minimized wherever 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 enshrined 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, enshrined 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.

What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?

<u>Capability</u>

Despite previously not receiving funding, we've largely adhered to the roadmap set forth in our Fund10 proposal. Since then, we've gotten up to about the first milestone (Cardano-Swaps refinement). The plan is to continue moving forward along this direction. We've received significant positive feedback from the community regarding our progress so far; a testament to our ability to deliver.

<u>Feasibility</u>

Each of the four protocols are already working prototypes, and have demonstrated technical feasibility, as well as community interest. Some protocols are further along the development pipeline than others (Cardano-Swaps is the furthest along, thus far).

All four protocols will continue to be refined/optimized, the specifics of which are discussed in the milestone section, below. The chief focus of our R&D efforts is:

  • Lowering the protocols' CPU/memory utilization, thereby increasing throughput/composability
  • Minimizing minUTxO fees, thereby "bridging the gap" between shrimps and whales
  • Increasing querying "expressiveness" of Beacon Tokens, making it easier to filter on-chain data
  • Implementing new features, and balancing their effects with the imperative of the previous three points

Feasibility is also validated through rigorous benchmarking of deposit and transaction fees, CPU/memory utilization, and number of Beacon queries. Here is an example of benchmarking for Cardano-Swaps.

<u>Documentation & Support</u>

Architectural decision-making and protocols' logic will be thoroughly documented to foster collaboration with a wider community of developers. Written and video tutorials will be created to help establish a user base. The feasibility of our approach will be validated by feedback from users and developers.

What are the key milestones you need to achieve in order to complete your project successfully?

Cardano-Swaps (~3 weeks)

As the first milestone on our Fund10 roadmap, this phase is furthest along in development and has already reached beta. See the changelog here. In addition to the original roadmap items, we've added a "two-way" swap feature that enables market makers to provide bidirectional liquidity.

The next few weeks will be spent further optimizing/refining throughput, and associated benchmarking. This phase will likely be completed prior to the start of Fund11 voting.

>Cardano-Loans (~10 weeks)

  • Rearchitect the protocol to improve the expressiveness of beacon querying
  • Implement features/optimizations, which are outlined here
  • Provide benchmarks for transactions involving the protocol
  • Update documentation to reflect changes
  • Create written and video tutorials to demonstrate use

>Cardano-Options (~8 weeks)

  • Refactor the protocol from PlutusTx to Aiken
  • Implement features/optimizations, outlined here
  • Generate benchmarks for transactions involving the protocol
  • Update relevant documentation
  • Create written and video tutorials to demonstrate use

>Cardano-Aftermarket (~6 weeks)

  • Refactor the protocol from PlutusTx to Aiken
  • Implement features/optimizations, outlined here
  • Provide benchmarks for transactions involving the protocol
  • Update relevant documentation
  • Create written and video tutorials to demonstrate use

>Unified CLI Program (~1 week)

A terminal-based interface will be developed to interact with the four protocols, and will serve as the minimum viable UI for early adopters. It will support using each protocol individually, composing transactions with multiple protocols, and querying beacon tokens via a pluggable API.

  • Write a single CLI program that unifies the four protocols into one terminal-based interface.
  • Provide written & video tutorials to demonstrate use, plus advanced composition.
  • Provide benchmarks for complex transactions that compose multiple protocols

Who is in the project team and what are their roles?

Currently, we are a two-man team based in the US:

fallen-icarus: Protocol Architect and Lead Developer

After over two years' experience with PlutusTx and Aiken, fallen-icarus has developed a deep understanding of Cardano's eUTxO model. As a pioneer of the Beacon Token design pattern, he has a proven ability to think outside the box and develop novel asset-oriented programming techniques.

zhekson: Technical Writer and Community Advisor

A longtime member of the community, zhekson has demonstrated his commitment and technical expertise in Cardano. He is passionate about distilling high-impact technical concepts for the masses, and doing so in an easily digestible manner. He actively engages with the community on Twitter, is a top contributor to the Cardano Stack Exchange, and operates a productive stake pool.

Please provide a cost breakdown of the proposed work and resources.

Total Budget: $61,600 / 154,000 ADA (@ $0.40 per ADA) / 7 months

Note: 9 months includes 2 months between proposal submission and voting results, plus 7 months after voting results. The team will treat the two month interim as if they are funded, proceeding with and sharing their work accordingly.

Breakdown:

Full-time Protocol Architect & Developer: $45/hr x 1120 hours = $50,400

Part-Time Technical Writer & Admin - $20/hr x 560 hours = $11,200

How does the cost of the project represent value for money for the Cardano ecosystem?

We see a clear path towards truly resilient, sustainable, and equitable peer-to-peer finance. For the first time ever, humans will have the tools to forge an uncensorable, endogenous economy on the Cardano blockchain. One that is decoupled from the whims of the legacy financial system, and is secure, available, and 100% permissionless.

The team is based in the US, and has priced their time accordingly. This proposal offers excellent value for money, in our humble opinion.

close

Playlist

  • EP2: epoch_length

    Authored by: Darlington Kofa

    3m 24s
    Darlington Kofa
  • EP1: 'd' parameter

    Authored by: Darlington Kofa

    4m 3s
    Darlington Kofa
  • EP3: key_deposit

    Authored by: Darlington Kofa

    3m 48s
    Darlington Kofa
  • EP4: epoch_no

    Authored by: Darlington Kofa

    2m 16s
    Darlington Kofa
  • EP5: max_block_size

    Authored by: Darlington Kofa

    3m 14s
    Darlington Kofa
  • EP6: pool_deposit

    Authored by: Darlington Kofa

    3m 19s
    Darlington Kofa
  • EP7: max_tx_size

    Authored by: Darlington Kofa

    4m 59s
    Darlington Kofa
0:00
/
~0:00