Inspiration

There are several defi lending protocols available in radix, but I wanted to build a P2P marketplace where lenders and borrowers can browse through open loan/borrow proposals , negotiate on interest rates/collaterals/tenurs and agree later.

It will save time for both lenders and borrowers and help them find someone who is willing to lend/borrow at their terms.

Borrowers can withdraw the funds once the loan target amount is met. They can also repay partially. A single loan proposal can be funded by several lenders who are willing for those terms.

What it does

Full stack Radix peer lending marketplace where lenders and borrowers connect and get to choose their interest rates, tenure/ collateral ratio & negotiate terms.

How we built it

It contains several scrypto blueprints for various lending related functionalities. The contracts are written using Scrypto. Tech stack

  • Radix, Scrypto
  • Radix dapp kit
  • Node.js
  • Radix Android wallet
  • Radix connector chrome extension
  • Tailwind CSS

Challenges we ran into

  • Initially wrote the contracts in Radix 0.4..1 version - and had to upgrade to 0.8.1 and ran into issues with rust compatibility
  • Initially ran into issues with connecting to the android wallet and test faucet, which I fixed later

Accomplishments that we're proud of

  • One of its kind lending marketplace connecting lenders and borrowers and enabling them to negotiate the loan proposals on their own terms.
  • UI where users can view exisitng open loan proposals and interact with them.

What we learned

  • Learned about variou Defi lending protocols
  • Learnt rust and scrypto to create the smart contracts.

What's next for Peer Lend - Scrypto lending marketplace

  • There are only basic UI functionalities for the marketplace right now, and I would like to add all the features available in the scripto blueprints
  • Complete the UI with various lending functionalities including contract negotiation, partial withdrawal etc

Screenshots

Screenshot 2023-03-25 at 3 01 25 AM

1

2

3

4

5

6

7

8

Usage Instructions

Pre-requisites

  1. Node >= 12.17.0
  2. The Betanet wallet & Radix-connector browser extenstion installed. Instructions here
  3. Scrypto v0.8.0. Instructions to install here and update here

Building the Scrypto code

  1. Enter the scrypto directory in a terminal: cd scrypto
  2. Build the code: scrypto build
  3. Two important files (scryptlend.abi and scryptlend.wasm) will be generated in scrypto/target/wasm32-unknown-unknown/release/. You will need them for the next step.

Deploy the package to Betanet

  1. Go to the Betanet Dashboard Website
  2. Connect the Wallet Via the Connect Button
  3. Navigate to Deploy Package & choose an account and badge or have one created for you if you don't have one yet using the link below. (Which appears once you have selected an account)
  4. Upload both scryptlend.abi and scryptlend.wasm
  5. Click on "publish package"
  6. The wallet should open up and ask you to approve the transaction
  7. On the wallet click on "sign transaction"
  8. The deployed package address should get displayed. You will need it for the next step.

Interacting with package

  1. In a terminal go back to the root of this project (scrypto-lend-marketplace)
  2. Install the npm dependencies: npm install
  3. Start the local server with npm start
  4. Open up your browser at the provided url if it doesn't open automatically.
  5. Make sure you created an account on the wallet and added funds via the faucet by clicking on account name and then the three dots a button to get XRD from faucet should open.
  6. Click on the connect button to fetch your wallet address. You should see your address appearing
  7. Fill the package address you got in the previous section and "instantiate "
  8. Your wallet will again open up. Click on "sign transaction". You should now see the instantiated component address and resource address on the page.
  9. Fill in the loan details and submit proposal by clicking on "Submit proposal"
  10. Your wallet will open up. Click on "sign transaction". The transaction receipt will get displayed on the page.

Built With

Share this project:

Updates

Submission history