Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

feat(vendor-finance): Adds support for v2 ETH pools + swaps subgraph endpoints #2854

Merged
merged 4 commits into from Aug 2, 2023
Merged

Conversation

ForrestChew
Copy link
Contributor

Description

This PR contains two non-insignificant changes.

  1. Adds support for v2 pools on Ethereum
  2. Swaps subgraph URLs in favor of custom entity fetcher URL for all networks.

Checklist

  • I have followed the Contributing Guidelines
  • (optional) As a contributor, my Ethereum address/ENS is:
  • (optional) As a contributor, my Twitter handle is: @BossMcBara

How to test?

To see that the new entity fetcher URL works follow the below:

  1. Run pnpm dev
  2. Verify V2 on Ethereum: http://localhost:5001/apps/vendor-finance/balances?addresses%5B%5D=0xC6c48E582405BE32f25EdBa211CCaa820058Cb2f&network=ethereum
  3. Verify V2 on Arbitrum: http://localhost:5001/apps/vendor-finance/balances?addresses%5B%5D=0x2a6334c30f36d1eefd64689c590dd199d3475972&network=arbitrum
  4. Verify v1 on Ethereum: http://localhost:5001/apps/vendor-finance/balances?addresses%5B%5D=0x245cc372C84B3645Bf0Ffe6538620B04a217988B&network=ethereum
  5. Verify v1 on Arbitrum: http://localhost:5001/apps/vendor-finance/balances?addresses%5B%5D=0xD6587a974C7D3ecE23Fa53d5606da6B291311F6f&network=arbitrum

@wpoulin
Copy link
Contributor

wpoulin commented Jul 31, 2023

Is there something wrong with the current implementation fetching the balance onchain directly ? @ForrestChew
We don't want to rely on subgraph or any external API for balances

@ForrestChew
Copy link
Contributor Author

Is there something wrong with the current implementation fetching the balance onchain directly ? @ForrestChew We don't want to rely on subgraph or any external API for balances

Regarding the balances for both V2 ETH and V2 ARB, there have been no modifications, and they continue to be fetched from onchain as before. However, for fetching the actual pools, we must rely on an external API as there is no onchain method for tracking individual pools.

For both V1 ETH and V1 ARB balances, I'll try and find a way around using an external API. In regards to fetching the pools for V1, it is the same as V2.

@wpoulin wpoulin merged commit 7d5bd46 into Zapper-fi:main Aug 2, 2023
6 checks passed
@wpoulin
Copy link
Contributor

wpoulin commented Aug 2, 2023

I'm wondering if you have Eslint running when coding on studio ? @ForrestChew

@ForrestChew
Copy link
Contributor Author

So I get red linter errors for two things:

  1. @Inject(APP_TOOLKIT)
  2. @Inject(VendorFinanceContractFactory)

I ignored these issues however because everything was still working as intended. Also, upon checking other projects within the studio, I noticed the same code and linter errors, leading me to believe it wasn't a real problem.

@wpoulin
Copy link
Contributor

wpoulin commented Aug 2, 2023

ohh okok, it's fine. I'll do the linting + smol change, merge and deploy asap thanks !

@ForrestChew
Copy link
Contributor Author

ohh okok, it's fine. I'll do the linting + smol change, merge and deploy asap thanks !

Appreciated. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants