Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(explore): added compound tutorial #189

Merged
merged 3 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/compound/compound-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/compound/compound-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions docs/use-linea/explore/use-compound.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Use Compound
description: Perform deposit collateral, borrow and supply USDC
sidebar_position: 1
---

Compound has been deployed to showcase how Linea can be used to supply collateral and borrow tokens on L2, where users can benefit from cheaper gas fees. Compound has integrated those contracts in its website to let the user interact with the dapp on Linea.

This tutorial will can be done with either [Fluvi Wallet](https://chrome.google.com/webstore/detail/fluvi-wallet/mmmjbcfofconkannjonfmjjajpllddbg) or Metamask wallet to interact with Compound on Linea.

## How to borrow USDC on compound in one “Bulk transaction”

1. First you need some ETH, navigate to the faucet to get some: [Linea Faucet](https://faucet.goerli.linea.build/)
2. Once you have some ETH, navigate to [Compound Finance](https://app.compound.finance/?market=usdc-lineagoerli&testnet=)
3. Connect your wallet.

![Make](../../assets/compound/compound-1.png)

4. Make sure your wallet is connected to Linea Goerli and funded with ETH
5. Make sure that “Linea Goerli” is selected in the networks list on the top right

![Make](../../assets/compound/compound-2.png)

6. Click on the “+” sign next to the collateral “Ether”

![Make](../../assets/compound/compound-3.png)

7. Add the amount of ETH you want to deposit and then click on “Add Action”
8. Click on the purple button “Borrow USDC”
9. Add the amount of USDC you want to borrow and then click on “Add Action”
10. Click on “Submit Transaction”

![Make](../../assets/compound/compound-4.png)

11. In the popup click on “Confirm”

![Make](../../assets/compound/compound-5.png)

12. Wait for the transaction to be confirmed

![Make](../../assets/compound/compound-6.png)

13. Click on “Complete Transaction”

![Make](../../assets/compound/compound-7.png)

14. In the popup click on “Confirm”
15. Wait for the transaction to be confirmed
16. You now have borrowed USDC from compound!

## How to supply USDC on compound to earn interest

1. You first need to repay the amount of USDC you borrowed
2. Click on “Repay USDC”

![Make](../../assets/compound/compound-8.png)

3. Click on “Max” and “Approve & Add”
4. Click on “Submit Transaction”
5. In the popup click on “Use default”, “Next” and “Approve”

![Make](../../assets/compound/compound-9.png)

6. Wait for the transaction to be completed then click on “Submit Transaction” again
7. In the popup click on confirm
8. Wait for the transaction to be completed
9. You now need USDC to supply USDC, navigate to [Linea Faucet](https://faucet.goerli.linea.build/)
10. Get some USDC from the faucet
11. Come back to the compound website, you should see a USDC balance and a “Supply USDC” button

![Make](../../assets/compound/compound-10.png)

12. Click on “Supply USDC”

![Make](../../assets/compound/compound-11.png)

13. Enter the amount of USDC you want to supply and click on “Approve & Add”

![Make](../../assets/compound/compound-12.png)

14. Click on “Use default” then “Next” and “Approve”
15. Wait for the transaction to be completed
16. Click on “Submit Transaction”

![Make](../../assets/compound/compound-13.png)

17. In the popup click on “Confirm”
18. Wait for the transaction to be completed
19. You have supplied USDC in compound and are starting to earn interest!