Technical Report 2022/03/02

MELD

Welcome to the first MELD technical report of 2022! It has been an aggressively progressive two months for us sprinting for the launch, the launch itself, production issues, UX improvements, and working towards the upcoming products.

While we have stumbled on quite a few production issues, it has been a great learning experience developing on a new frontier. Furthermore, going through the troubles together has significantly united the whole R&D department. We have transitioned from segmented teams (economics, blockchain, MELDapp, and UI/UX) with minimal communication to a tight division with many professional and personal common goals and laughter!

Let us review what the team has achieved in the last two months and look forward to what this tight unit can produce next.

Cardano

PAB

We needed several modifications but have launched and scaled PAB for our vesting and staking contracts on mainnet. We have then brainstormed on a better PAB architecture going forward that is way leaner and more efficient than the current one. We have proposed a high-level architecture to the Plutus team and planned to build the low-level building blocks ourselves.

Proposed PAB architecture

A few key takeaways are:

  • The current PAB architecture is overly bloated and inefficient.
  • We need a better balancing solution going forward. See input-output-hk/plutus-apps#249 for more details.
  • plutus-chain-index does not scale on the mainnet. It requires too much resource, leaks memory, sometimes syncs slower than block-production rate, and a utxosAt on mainnet could take hours to resolve, if not hanging forever. dApps should build their indexing solutions on plutus-chain-index-core or something equivalent to scale. The key is fully controlling one’s DB schema to fund the fastest possible queries.
  • Building transactions should not be a stateful process across multiple requests.
  • Overall, the Contract monad and EmulatorTrace are too far from a real-life setup to have much production value. We should build transactions in a stateless way and test them on a private network instead.
  • Building transactions with PAB endpoints & constraints is inflexible and does not share code with on-chain state machines when they are still unusably oversized. We should have more flexible low-level tooling to build arbitrary transactions.
  • We need a better testing framework for dApps, that is relevant to a real-life production setup.
  • The ecosystem needs and deserves a plutus-starter with full PAB support from a local development setup to mainnet deployment.

Hopefully, we will see a new PAB or something equivalent soon to aid the whole ecosystem in off-chain integration. We are in the game ourselves and hopefully will report on our progress soon.

Hydra

We continue to discuss potential contributions and building dApp demonstrations for Hydra with the Hydra team. The main goal is to identify and build practical use cases of Hydra, then a starter template with decent integration documentation for better developer experience and adoption.

We also have a P2P variant that might scale several (but not all) dApps in a non-custodial way that we want to prototype. The key is not to build the whole stack ourselves but to build the protocol on top of the Hydra team’s great core.

We also have a long overdue backlog to build isomorphic state channel demos on Nervos for better tooling hence quicker prototyping. Hopefully, we will soon allocate more resources to build two monsters on both chains and write dedicated technical reports about them.

Developer Experience

We continued to pitch about the importance of better developer experience to help Cardano developers progress faster and make it easier for projects to recruit and train. The main improvements would revolve around:

  • Better documentation.
  • Better dependency management.
  • Better tooling.

We have been discussing the problem with IOG and other players in the ecosystem, and it looks like improving the developer experience will be a gradual process. We have planned an internal knowledge base that could be adapted to a public one, dependency and tooling work both internally and for public contributions. Another critical effort is building a dApp starter template with everything included and optimized for local development and production deployment. The goal is to include Nami support, a new PAB architecture, Hydra integration with disciplined code, documentation, and tests.

We hope to push more public contributions and open-source more work in the upcoming months. Another interesting to do is to get more involved in the design and implementation of the CIPs, especially those critical to our dApp works like in CIP 30, 31, 32, and 33.

Hachi

Hachi is a security research effort on Cardano that MELD helps fund.

In the last two months, Hachi has been invited to give a presentation at an IOG seminar and a series of technical workshops on dApp certifications and auditing standards. The goal is to help push security research, standards and tooling on Cardano with the whole ecosystem.

On the other hand, after months of diverse research and experiments, Hachi has now focused solely on dApp-developer-friendly tooling for Plutus Core operations and analysis. Please follow their blog for more information.

ADAmatic

ADAmatic banner

We continued to sprint with Obsidian Systems towards a testnet launch this Q1. MELDapp integration has started, so it has been quite exciting on this end. We are putting more attention and resources (UX, economics, blockchain, product design, and MELDapp integration) into the project as it will be our next major release. Frequent announcements and articles will be posted to communicate progress towards launch, with a dedicated White Paper and technical reports here and there to make sure everyone is aligned.

For now, the short-term goal of ADAmatic is to bring more liquidity into Cardano, enable more utility for Cardano native tokens on either side of the bridge, and innovate dApp designs on the UTxO ledger. Longer-term goals include supporting more chains (for example, through RenVM) and enabling cross-chain contract interactions.

More public announcements will begin soon. Hang tight!

Economics

The economics team has been in better shape with better management and a new engineer helping with software tasks. We now have a live token to take care of, with clearer product visions to design the economics models for.

Market Marking

We need to create a market for the MELD tokens. The near future goal is to provide liquidity to the exchanges for people to trade on and encourage traffic to get the MELD token to more significant exchanges. We can stop the effort once the MELD markets are stable and carry on themselves.

We have conducted in-depth studies on market-making solutions available on the market, especially Hummingbot, a leading software in the crypto world. Few independent functionalities and strategies have been added to Hummingbot for future usage.

We then proposed several market-making algorithms that potentially work well in a high-frequency trading environment with a backtesting framework for the algorithms’ out-of-sample performance. On top of that, we have been working on a marketing making, more generally, a trading framework with early support for BiTrue and FMFW. Most works are still experimental, but we are confident of hitting production by April. Until now, another consultant has been operating on a microscopic scale on the initial exchanges.

Finally, we have built and maintained a real-time database for the MELD tokens’ transaction data for different analytical purposes.

Buyback

We have been monitoring the MELD token’s price and have two buyback strategies in certain conditions to relieve investors and restock MELD for future liquidity and reward programs. These buyback algorithms are built upon careful statistical analytics on the price-dropping rate and recovery rate of similar DeFi protocol tokens.

Hopefully, the proposals stay shelved and untouched forever, with the tokens growing organically with the whole ecosystem. Regardless of the circumstances, it is always nice to have a backup plan.

Quantitative Investment

We have built a database on trading prices and the volume of almost every token for investment research purposes. We have also conducted and implemented several quantitative trading algorithms, including trend-following, mean reversals, trend-segmentation, and backtested performance. The key is to utilize the project’s capital to enable constant expansion, and MELD is here to stay through all market conditions.

Economic Modelling

We have reviewed many research papers and protocols in-depth, including stablecoin design models, lending protocols, blockchain protocols and cross-chain bridges. This critical effort boosts our understanding of the space to plan better economic models and products.

The current scope includes:

  • Economics forecasting for ADAmatic.
  • Protocol fees for ADAmatic and MELD’s upcoming dApps.
  • ADAmatic and MELD tokenomics for governance.
  • Economic models for MELDed Fiat and Lending.

On top of that, the team has proposed brand new ideas like partially collateralized stablecoin, limit-order-book-like lending models, and liquidity bridge.

MELD Smart Contracts

Pre-launch, the Blockchain team focused on dApp integration, scaling off-chain infrastructure for the vesting & staking smart contracts, and delivering production duties with the successful airdrop and contract launch. It took an extra week post-launch to scale PAB as it got prolonged as the mainnet data grew.

After that, we are polishing the codebases for better structure, documentation, and tooling. More importantly, we have many off-chain ideas to explore and implement, like better PAB, better indexing solutions and transactions builders, better scalability, a realistic and more robust testing framework, and more. The quest to refine the infrastructure and code bases live on as we perfect the foundation to deliver the more complex products.

Finally, we put tremendous effort into contract design on Cardano. We expect to design more pleasing contracts with the highly anticipated CIPs in 31, 32, and 33. For that, we have had regular, almost daily technical workshops to propose new ideas, debate, generalize building blocks, and formalize ideas into concrete design documents.

The current scope is massive:

  • Highly generic and composable design patterns.
  • On-chain migration.
  • ADAmatic smart contracts.
  • Variable staking.
  • MELD governance with staked voting.
  • MELDed Fiat.
  • A sample dApp for a starter template.

We will start to open-source different code bases as we refine them and add documentation. We have a lot to share and hope to contribute upstream more to the whole ecosystem.

MELDapp

MELDapp

The MELDapp team was highly instrumental in the launch. We completed the first release of the MELDapp with Nami integration and glued everything together to launch several infrastructure environments for staging, production, Cardano testnet and mainnet.

It took extra time to scale and stabilize post-launch, but things have gone well with many critical lessons learned. The operational lesson for creating vesting positions with all the wallet miscommunication and mismatches was worth mentioning.

Much effort is also put into improving error messages, user notifications, responsive layouts, and UX, our top priority only behind security. We have also formed an in-house UX club to further research and improve going forward.

Similar to the Blockchain team, we are polishing the infrastructure and code bases for better structure, documentation, and performance to extend the products and deploy more complex ones on top of. Further works include supporting more wallets (CCVault, Yoroi, the builtin MELDwallet) and ADAmatic integration!

We have many more designs and prototypes for ADAmatic and future MELD products and cannot wait to release everything soon. Here is a quick ADAmatic mock for now!

ADAmatic mock

Conclusion

The whole MELD R&D department has significantly evolved in the last two months. We cannot wait to perfect our current setups and deliver many more products to the market. Hang tight. ADAmatic will soar next!