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

Pre-generated related asset index #6169

Closed
woodenfurniture opened this issue Feb 8, 2024 · 0 comments · Fixed by #6171
Closed

Pre-generated related asset index #6169

woodenfurniture opened this issue Feb 8, 2024 · 0 comments · Fixed by #6171
Assignees

Comments

@woodenfurniture
Copy link
Contributor

Overview

Our asset inventory is a precompiled list that receives updates at regular intervals. When identifying assets related to a specific asset, we dynamically query the Zerion API. However, due to rising API usage costs, we are considering aligning our Zerion API requests with the update schedule of our asset list. This means we would only query the Zerion API during the asset list compilation process, eliminating the need for real-time API calls during application use.

References and additional details

src/state/apis/zerion/zerionApi.ts

  • Asset list is generated as normal
  • Using the asset list and zerion api, create an index from assetId (derived from zerion fungible ID) to relatedAssetId: AssetId[]. Be sure to dedupe requests by looking up the asset id in the index before firing a request - this should reduce requests by a factor of ~6.
  • Then for each asset in the asset list, convert the zerion fungible ID to a CAIP AssetId, and attach this to the asset as relatedAssetKey
  • Now you'll be able to pull the related asset index into the app via the AssetService and perform lookups instead of fetching from zerion.

Acceptance Criteria

No requests to zerion are made during app run-time.

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant