MELD Dev Diary 14

Charlierobertstad
MELD
Published in
2 min readDec 12, 2022

Borrowing and Lending

On-chain:

  • Updated validation to enable setting different values for maximum loan-to-value and liquidation threshold.
  • Revamped liquidation mechanism supporting full-liquidation.
  • Separated checks for unique and non-unique request types to optimize validation logics.
  • Supported repaying all remaining debt and withdrawing all deposited assets in order to close account.
  • Refactored some conditions in account update to prepare for account creation with preloaded requests.

Off-chain:

  • Implemented an API for querying latest account state.
  • Tested & fixed remaining errors of batcher chaining transactions.
  • Updated all services to query protocol parameters and era history periodically to be able to adapt protocol parameter updates.
  • Setup oracle provider service to fetch price periodically from an external source to update the oracle UTXO.
  • Refactor: Defined better type for price map in config and API.
  • Refactor: Reduced some Docker build layers.Replace AssocMap by Map off-chain to match sorted map guarantee on-chain.
  • Refactor: Made certain hard-coded variables configurable.

Testing

  • Supported incremental logging in functional tests.
  • Wrote unit test for cumulative interest rate calculation.
  • Added more simulation scenarios to functional tests.
  • Wrote unit tests for repay all remaining debt and withdraw all deposited assets.
  • Refactor: Use exe directly produced by lending-tests.
  • Refactor: Remove redundant test code.
  • Refactor: Avoid update account if no requests in functional tests.
  • Modified local config and functional test scenarios to run protocol with multi-asset pool.

Documentation

  • Updated sequence diagram, change specified deposit action to update account for more generalization.
  • Created some example data for API documentation server.
  • Prepared documents & presentation for internal Cardano demo meeting

Infrastructure

  • Prepared infrastructure for lending API docs (swagger) including AWS application load balancer and Fargate service.
  • Created subdomain for lending API docs on Cloudflare
  • Deployed terraform code for lending API docs.
  • Continued work on IT budgeting for next year.
  • Created architecture diagram for new MELDapp backend infrastructure.

Read more from the Dev Diary series here!

--

--