Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Improve data fetching #156

@wnz99

Description

@wnz99

Mainnet is generally slow, therefore we need to find ways to improve the dapp responsiveness.

One part of the job is to optimize the number of calls to the back-end node (currently Infura).

At the moment the dapp gathers info by doing various calls to various methods. For example:

  let dragoData = poolApi.contract.drago.getData()
  let dragoTotalSupply = poolApi.contract.drago.totalSupply()
  let dragoETH = poolApi.contract.drago.getBalance()
  let dragoWETH = poolApi.contract.drago.getBalanceWETH()

It would be very helpful if that could be accomplished with a single call. The above is just an example, therefore we should review the protocol contracts to see what information can be centralized in a single proxy contract. The most, the better.

A further step could be to have the proxy to return an array of funds, so for example we could call the proxy and pass an array of pools' addresses, and the fund would return ad array of information (those previously suggested).

This would help a lot when we need to show information for many funds, for example in the home page:

image

In the above screen I would like to show the fund's prices, supply and so on. This means that dapp needs to make calls for each funds. A good solution would be to call the proxy funds with batches of 5 funds each time (or more if feasible), so that the dapp would only make 1 single call for each page.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions