consensusnetworks / casimir

🌊 Decentralized staking and asset management
https://casimir.co
Other
6 stars 3 forks source link

Create price composable and add method to get input ETH amount x exchange rate #206

Closed shanejearley closed 1 year ago

shanejearley commented 1 year ago

We need exchange rate data to serve the exchange rate of various ETH amounts in a few places here. Have @ccali11 walk you through our basic composable setup. Create a price composable (can keep anything related to external prices here) and add a getExchangeRate method that accepts an input amount and returns the exchange rate (the current rate at the time of querying) of that amount. This will be something we can use either in the template directly or in other composables (but most likely just directly like a display filter).

Take advantage of your existing exchange rate code for the crawler and you might be able to extract some common code to put in a common TS package that is used in both places.

shanejearley commented 1 year ago

Imagining there are some neat and productive ways of caching results here.