MELD Dev Diary 16

Charlierobertstad
MELD
Published in
2 min readDec 26, 2022

Borrowing & Lending

On-chain:

  • Transform hardcoded constants in interest rate model into variables configured per asset.
  • Restructure storage of asset data on-chain to avoid duplicate storage of asset class.
  • Rewrite LTV calculation and synchronize implementations between on-chain and off-chain.
  • Optimize cumulative interest rate calculation to reduce execution units.
  • Replace non-zero guarantee by positive guarantee when asserting outputs to avoid value normalization.
  • Optimize value checker for account outputs.

Off-chain and Testing:

  • Implement off-chain to support users repaying or withdrawing all token amounts per request.
  • Implement supply and borrow cap check for batching transaction.
  • Calculate the minimum Ada UTXO value according to the datum and value when building transaction updating manager and oracle UTXO.
  • Improve shutdown handling for services to better handle SIGTERM.
  • Implement off-chain API to build liquidation transaction.
  • Regroup APIs to avoid confusion.
  • Replace query param with capture for account status API and make hard-coded host in lending API docs configurable.
  • Implement mock API for oracle to query simulated asset prices.
  • Configure stake keys for account and pool contracts to stake locked Ada tokens.
  • Add erase-cabal-cache docker to clear corrupted cache.
  • Write integration tests for oracle service.
  • Write unit tests for liquidation logic on-chain.

MELDapp:

  • Implementation of wallet creation with web3auth.
  • Backend API specification for historical transactions and asset values with mock up responses.
  • FE integration work with landing and borrowing smart contract on Cardano.

Read more from the Dev Diary series here!

--

--