This article is a follow-up to the last Liqwid roadmap update.
Since the last update the core development team has made great progress towards the v1 protocol launch; the validator logic in the market, governance, liquidation, oracle and LQ rewards contracts are all close to onchain feature completion. We have also gained significant ground on testing and documentation efforts for individual protocol components since the last update. The v1 governance contract is entering a security audit as the engineers sprint to complete the proposal effects functionality to enable parameter changes in the system. On the offchain side of development engineers have progressed with the liqwid-pab (Plutus Application Backend) setup including a signed transaction in the browser using Nami wallet.
We built the first version of the market contract with lending and borrowing functionality long before the Alonzo hard fork. After analyzing the current state of Plutus it became clear refactors and in some cases rewrites were needed to optimize Liqwid scripts to stay within transaction limits. With respect to the market contract we are completing a partial rewrite and refactoring since the PlutusTx compiler makes it difficult to optimize the market scripts to stay within current transaction limits. Refactors for portions of the governance mechanisms are also underway in parallel to the market refactor, both critical workstreams to reducing Liqwid script sizes.
The Liqwid Market system and subsystems power the main functionality of the protocol; managing the money markets participated in by Suppliers and Borrowers. Each Liqwid Market is managed onchain by a collection of associated Validator scripts in the Governance system and Monetary Policy scripts. To reduce UTXO contention between many users of a Market, we introduce the Escrow system, allowing users to submit actions to Escrow Queues, which will be later processed by the system in batches. The market system is currently undergoing refactors to implement this batching solution.
The following diagram gives an overview of how users may interact with the protocol via the Market Escrow system.
Market Escrow System
In Liqwid v1 users interacting with a Market submit actions to the Supply Escrow or Demand Escrow depending on the action type. Supply actions, such as Mint and Repay Borrow, are submitted to the Supply Escrow, which allows the user to receive the result of the action immediately, and is guaranteed to complete. Demand actions, such as Redeem and Borrow are submitted to the Borrow Escrow, and may not be completed if there is not sufficient liquidity to complete the order. At a set time-interval, all actions in the Escrows are processed by one or more Batch transactions, which fulfill orders by updating the MarketState and BorrowState UTXOs and distributing value to recipients.
The development efforts underway will help ensure the Liqwid v1 Market system scales from day one on mainnet. The market subsystems refactoring is currently underway with engineers extending the current market system to support the escrow queue and batching solution described above. Our core dev team is completing further analysis on defining the escrow queues with a few important considerations: transaction size limits, open vs. closed batching tradeoffs, action limits to avoid DDOS, queue limits, and handling Demand Escrow actions. The core devs have researched the latest UTXO scalability solutions and we are confident the market escrow system can easily be extended to support the SundaeSwap Scooper model. Our early ideas are to start with small finite queue sizes, with open batching and the Scooper model (or a variation of it) as an optional extension to be decided on by the community through governance proposals. The core devs are also exploring managing demand actions with ‘thread’ UTXOs which can have different max limits with varying priority and first in, first out (FIFO) ordering that prioritizes smallest actions first. Completing small actions first allows the system to process more actions successfully and increases the capacity for larger actions. We look forward to sharing more technical detail on this model as our core dev team advances on research & development.
Security, Testing & Tooling
The Governance system entering security audit from the MLabs audit team will help ensure safe proposal effects including parameter updates to existing Markets. The Governance system was developed by Liqwid Labs and will be utilized in other DeFi protocols including SundaeSwap and LiqwidX.
We have already open sourced our first library composed of useful functions and data structures for Plutus projects; plutus-extra and we have also included several additional plutus libraries:
plutus-extra, a collection of various data structures and functions
plutus-golden, a framework for testing serialized representation stability using golden testing
plutus-laws, a helper library for checking type class laws, similar to quickcheck-classes
plutus-numeric, a range of extensions to Plutus’s numerical hierarchy;
plutus-pretty, a collection of helpers for pretty-printing Plutus types; and
tasty-plutus, a testing framework for Plutus scripts.
quickcheck-plutus-instances, collection of instances for Plutus types to support general use of QuickCheck.
plutus-size-check,a tasty-based utility for checking the on-chain sizes of anything the Plutus compiler can compile.
Security, testing and tooling are the foundation of everything Liqwid Labs and MLabs engineers develop. Open sourcing the tooling that helps us verify security properties and test code is one of many ways our core dev team is creating early wins for the entire Cardano development ecosystem as we build v1.
The core dev team is making a strong push to complete these workstreams, as always with a mindset of highly functional and secure code as the only acceptable outcome. You can keep up with our core dev team’s latest development progress by following the weekly technical report. In a shift to exercise radical transparency from Agile development principles we are moving to a system of more frequent touch points with the community. As these workstreams and others near completion you can expect additional measures from our core team including:
- Public project board outlining open tasks across each workstream required to launch v1
- Bi-weekly product demos demonstrating recently developed features & functionality
- Bi-weekly community calls on Twitter Spaces
Liqwid v1 Protocol Launch: TBD (no dates yet!)
The core development team has gained strong momentum towards onchain feature completion for every v1 contract function but the refactor efforts and testing must be completed before the security audit phase. To better manage community expectations no mainnet launch timelines will be shared until the security audit has begun. We are preparing for an end to end scrupulous auditing phase that will demand resources and quick feedback from the core dev team for the entire duration.
Based on our current development pace we are anticipating our protocol updates to be in place during Q1 2022. At this time the entire v1 protocol will be deployed to Cardano mainnet. The v1 scope includes the DAO Treasury for managing revenue and LQ rewards distribution, the market system for lending and borrowing assets, the governance system for voting on protocol changes, the qToken staking system for earning LQ, the liquidation system, LQ staking in the Safety Pool and the oracle price feed system.
The MLabs Audit team has completed testing on several Liqwid components already with the governance system entering audit next. We are planning our v1 security audit and have begun the preliminary steps with the Tweag team based on our internal timeline to achieving audit readiness. The core dev team is driven to enter the Tweag audit with the GitHub commit hash we will go live with on mainnet (excluding fixes from audit findings).
Liqwid — DeFi Lending, Simplified
Liqwid is a non-custodial DeFi liquidity protocol for lending and borrowing Cardano native assets. Users can securely earn interest on deposits and borrow assets with ease while earning yield on ADA from multiple revenue streams.
Our mission is to build robust lending products on open source DeFi infrastructure accessible for anyone on the internet to earn yield on their assets and tap into liquidity. Liqwid allows users to securely earn interest for supplying assets to liquidity pools, open collateralized debt positions (CDP) to borrow assets, participate in governance, or earn LQ rewards via liquidity incentives built into the fair token distribution with ease. We are committed to providing Cardano users with the DeFi products they need to efficiently manage their crypto and empowering the Liqwid DAO Community members to innovate on the protocol’s open financial infrastructure.
~Your Friendly Liqwid Core Dev Team