Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Lending Vaults #631

Closed brozorec closed 9 months ago

brozorec commented 10 months ago

Main tasks

Issues

Captura de pantalla 2023-07-06 a la(s) 11 14 30

Known issues

https://github.com/Fujicracy/fuji-v2/assets/501915/99815b4c-7cd0-4c97-8875-b36b8054a6d4

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **fuji-v2-frontend** | ⬜️ Ignored ([Inspect](https://vercel.com/fuji-finance/fuji-v2-frontend/CBrbnNYm6ZLHC7TAvai8UimsL8tH)) | [Visit Preview](https://fuji-v2-frontend-git-frontend-lending-fuji-finance.vercel.app) | | Aug 2, 2023 10:41am |
ferostabio commented 10 months ago
ferostabio commented 10 months ago

I added a checklist item to the PR, focusing on what remains to be done. I’m sure some of the items marked as done might need some work and/or tweaks.

@NikolaiYurchenko , please start working on them top to bottom -and please let me know if you spot any issues or missing code in any of the check list items.

ferostabio commented 10 months ago

Want to leave the description for the main issues, so I'm adding a new list with issues @NikolaiYurchenko

ferostabio commented 10 months ago

Just removed an item from the checklist. While in order to fully develop both positions and managing position screens we do need to be able to make at least a deposit, a lot of work can be done before then having the borrowing counterpart as example.

ferostabio commented 10 months ago

Added a couple of issues to the list @NikolaiYurchenko !

@brozorec we're having a problem in which... 1 - We get lending markets with sdk.getAllLendingVaults(). 2 - User taps one. Tiggers changeAll, which calls await sdk.getLendingVaultsFor(collateral, account).

Vault returned in point 1 is not found on point 2.

Is this caused by not having the right vaults deployed or is there a problem with some of the functions? I haven't found a bug so far, but 2) uses batchLoad. We should deploy vaults as soon as possible.

ferostabio commented 10 months ago

@brozorec had to update the batchLoad function since it expected a chain argument, meaning we were only able to get availableVaults for a single chain, please have a look at the new multiBatchLoad function.

Also, the reason we're not showing a provider icon for Optimism's lending vault is becaue we just don't have the data, this is what we have the sdkin the allProviders property, in batchLoad. No name and no llamaKey, just depositAprBase for one of the elements.

[
  {
    "depositAprBase": 0.5913637758368
  },
  {
    "name": "Aave V3",
    "llamaKey": "aave-v3",
    "depositAprBase": 1.1658847850287968
  }
]
ferostabio commented 10 months ago

@NikolaiYurchenko please have a look!

Not adding issues to the main list anymore since it was getting out of control.

https://github.com/Fujicracy/fuji-v2/assets/501915/37f954ac-8f4c-40f0-9cd8-5f1a01669414

ferostabio commented 10 months ago

We have no way of knowing the current vault's chain when managing a lending position. We're not showing the icon as we do when borrowing. In this screenshot I'm attaching, I want to deposit from Optimism to a Polygon position. When creating the position we have the vault selection component at the top left, but now we don't (when managing a borrowing position, we show the icon above the input fields).

What should we do @Markoyw ?

Captura de pantalla 2023-07-18 a la(s) 11 03 12
Markoyw commented 10 months ago

Hey @ferostabio

Good point, I didn't take that into account.

At the moment, I can't think of anything better than to keep it consistent with how we are displaying on the borrowing panel.

Screenshot 2023-07-18 at 10 11 16 PM
ferostabio commented 10 months ago

Hey @ferostabio

Good point, I didn't take that into account.

At the moment, I can't think of anything better than to keep it consistent with how we are displaying on the borrowing panel.

Screenshot 2023-07-18 at 10 11 16 PM

I agree!

ferostabio commented 10 months ago

@brozorec about the

reverted transaction error while fetching `Error: missing revert data in call exception; Transaction reverted without a reason string... error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32017,\"message\":\"Timeout\",\"data\":\"Nethermind.JsonRpc.Modules.ModuleRentalTimeoutException: Unable to rent an instance of IEthRpcModule. Too many concurrent requests.

error we're getting a lot, no idea why we're getting it so many times, but it seems to be a known issue

brozorec commented 10 months ago

Here are some issues:

brozorec commented 10 months ago

@brozorec about the

reverted transaction error while fetching `Error: missing revert data in call exception; Transaction reverted without a reason string... error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32017,\"message\":\"Timeout\",\"data\":\"Nethermind.JsonRpc.Modules.ModuleRentalTimeoutException: Unable to rent an instance of IEthRpcModule. Too many concurrent requests.

error we're getting a lot, no idea why we're getting it so many times, but it seems to be a known issue

I switched from using infura to pokt and stopped getting this error. However, I occasionally get the multicall error. I'm digging into it to try to find out its source.

ferostabio commented 10 months ago

Here are some issues:

On it!

brozorec commented 10 months ago

Good job in pimping the UI according to the proposed design system. Here are several more issues/points:

brozorec commented 9 months ago

@ferostabio @NikolaiYurchenko I fixed the fetching issues for gnosis (was a dumb typo)

ferostabio commented 9 months ago

@ansteadm discovered a bug: we are only showing the right supply apy in the markets section. We're showing wrong values both in "All vaults" (inside the lending screen) and my positions list.

I already fixed a couple of issues on the positions screen and now it shows the right data, but we still have a couple of issues here on the lending screen

In the lending screen we use availableVaults to show data and here console.log(availableVaults.map((v) => v.activeProvider?.depositAprReward)); returns [0,0, undefined, null] -when two values do have rewards.