The Lendroid Protocol V1 is Now Complete

Vii Sundaram
Lendroid
Published in
3 min readApr 21, 2019

--

Includes simple crypto lending for ERC20 tokens, and the introduction of the Wrangler.

https://soundcloud.com/user-685218616/the-lendroid-protocol-v1-is-now-complete

Lendroid’s journey has been a microcosm of the larger crypto ecosystem resembling that of a roller coaster to say the least. We’ve now set a logical marker on the dev work — the close of V1 of the Lendroid Protocol.

The V1 contract

V1 is a single contract that enables simple crypto lending with the following features:

  1. Order fill + cancel
  2. Loan approval
  3. Fixed interest
  4. Loan pre-closure
  5. Position topup + liquidation
  6. Non-custodial token transfers
  7. Support for ERC20 tokens. Currently DAI, WETH, DGD, and USDC are enabled
  8. Support for wranglers. Currently Lendroid’s simple wrangler at ETH address 0x0f02a30cA336EC791Ac8Cb40816e4Fc5aeB57E38 is enabled.

Decisions to add more ERC20 tokens and Wrangler addresses will be made based on requests from the community.

V1 is proof that the entire loan process can be encapsulated in a single vyper contract, with a compiled bytecode length of 23155 bytes (within the 24kb limit).

The contract is deployed on Kovan at the following address : 0xba229b9E2e1C9a3427320B25fc3D194C4B9A3F30

V1 is price-feed agnostic, and relies on the margin level / prices set by the wranglers, who are free to choose price feed oracles that work for them.

Gratitude

“Growth doesn’t happen by mere chance. It is a result of forces coming together.”
— James Cash Penney

The awesome team at Richard Ma’s Quantstamp was engaged to audit our smart contract. Their audit report can be found here. It is important to note that, subsequent to Quantstamp’s audit, the following modifications were done to the code base:

  1. Signature support for old and new versions of web3 (JS and Python)
  2. Making interest calculation a public function used by the wrangler while signing a loan request
  3. Effective non-reentrant lock for a position

Special thanks to our friends from the Vyper core development team who were instrumental in providing valuable pointers. Ryuya Nakamura’s elegant EC verification solution, his Vyper plugin for the Remix IDE (which was used to deploy the contract), and his views on static analysis tools for Vyper could not have come at a better time. nuclearjoker’s non-reentrant implementation, tips and tricks to solve `stack underflow errors`, and his views on Vyper test suites were impeccable.

The way forward

Development of V2 is already under way, and we look forward to sharing progress regularly. We also look forward to branching off a few series of discovery, to talk about some elements of our architecture; how you the user can deploy some of these elements yourself, and some alternative use cases as well. Broadly, here are a couple of directions we’re looking at -

  1. The Relayer Series: How you can spin up your own Relayer. This is not just about filling order books, but an effort towards designing actual UX. The relayer would interact with the protocol behind the scenes. You could set your own relayer address, you have the freedom to support ERC20 tokens of your choice. You could even explore how meta transactions can be enabled. The first post on the Relayer series will describe Reloanr, a secondary market for ERC20 tokens and a first use case dApp for the protocol.
  2. The Wrangler Series: In V1, we’ve got the Simple Wrangler enabled, whose client code is available on Github. The client is currently written in Python, and can be deployed to a server of your choosing. The series will also explore how the Wrangler can be deployed in multiple environments. In v1 of the Simple Wrangler, one can
    1. Approve a loan request
    2. Monitor loan health
    3. Liquidate defaulted loans
    4. Set margin levels
    5. Decide which price feed oracle to use for the supported tokens

Once again, we’re happy to officially float V1 of the Lendroid Protocol and look forward to bringing you some amazing developments in V2.

--

--

#Libertarian, #Blockchain enthusiast, #Smart Contract Engineer, #Full-stack Web Engineer, #CelebratorOfLife