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

[WEB-1325-216] Add exporter pricing service #216

Open
jstashh opened this issue Feb 4, 2022 · 3 comments
Open

[WEB-1325-216] Add exporter pricing service #216

jstashh opened this issue Feb 4, 2022 · 3 comments

Comments

@jstashh
Copy link
Contributor

jstashh commented Feb 4, 2022

export WEB3_PROVIDER=...
export EXPLORER=...
export FTM_WEB3_PROVIDER=...
export FTM_EXPLORER=...
  • run make bb-up
  • wait for the bridge to finish starting up
  • curl -X POST -H 'Content-Type: application/json' http://localhost:4004/v2/1/prices?type=json -d '["0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e"]'

This endpoint fetches prices from yearn-exporter, it will eventually be hosted somewhere but it can be run locally for now for testing purposes. In this example we fetch the price just for YFI, but an array of tokens can be passed in.

A new service should be added to the SDK that fetches prices for all yearn tokens, caches the response for 3 minutes, and provides a function to fetch all prices, and one for individual prices. All yearn tokens can be found from the registry adapter's assetsTokensAddresses function - https://etherscan.io/address/0x240315db938d44bb124ae619f5fd0269a02d1271#readContract

@yearn-linear-gh-sync yearn-linear-gh-sync bot changed the title Add exporter pricing service [WEB-1325-216] Add exporter pricing service Feb 4, 2022
@yearn-linear-gh-sync
Copy link

Linear reply from marius:
there's now an even simpler solution to this with yrpc:

Follow the above description and instead of curling the api endpoint at 4004 use this instead:

npm install https://github.com/mariuspod/yrpc.git

sample js client:

https://github.com/mariuspod/yrpc/blob/main/sample_client.js

@yearn-linear-gh-sync
Copy link

Linear reply from marius:
yearn/yearn-exporter#229

@pmdaly
Copy link
Contributor

pmdaly commented Apr 2, 2022

Working on this.

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

No branches or pull requests

2 participants