MELD Dev Diary 10
Published in
2 min readNov 14, 2022
Lending & Borrowing
On-chain:
- Restructured contract files with separate files for each redeemer to optimize team productivity and enable parallel working.
- Implemented a simple Oracle contract for testing purposes.
- Updated & refactored pool and account contract data types and validation logic.
- Changed data types: Account Datum and Request.
- Rewrote Pool contract with more rules for deposit & withdraw.
- Added validation rules for withdraw and borrow event.
- Removed redundant checks in account contract.
- Moved some checks to more appropriate place between account and pool contracts.
- Integrated the new oracle contract to pool contract.
- Implemented Loan-To-Value function, added logic checking LTV to pool and account contract.
- Tagged numerical values to enforce type safety, make the calculation formulas more clear and avoid potential calculation mistakes.
- Changed manager contract validation logic to use auth token to authenticate protocol operator instead of using fixed PKH, enabling operator migration to future DAO governance.
- Integrated Ply to export Plutarch parameterized scripts and potentially export important on-chain functions to be evaluated off-chain.
Off-chain & tests:
- Updated contract exporter, deployer, API, and integration tests to be compatible with new contract validation logic.
- Wrote off-chain components for oracle contract.
- Updated deployer to deploy oracle contract.
- Implemented API to build oracle update transaction.
- Wrote integration tests for oracle API.
- Added new trace config to allow contract trace when running unit test and integration test, making it easier to debug.
- Updated input and output order when building batcher transaction.
- Bumped dependencies version (Plutarch-extra & Cardano-api).
- Wrote logging function to display transaction size & execution unit when running integration test.
- Created pool deposit use cases doc and sequence diagrams.
Infrastructure
- Continued work on Terraform code for lending and borrowing AWS infrastructure.
- Finished Fargate task definition for lending API.
- Created new repository for Discord managing bots.
- Migrated Discord chat cleaner bot from Google cloud platform to AWS Fargate, and dockerized bot.
- Migrated Discord join guard bot from Google cloud platform to AWS Fargate, and dockerized bot.
- Deployed and configured development virtual machine instance into AWS.
Read more from the Dev Diary series here!