We could query the database directly but I would prefer to just call price-oracle via API. So I would make a separate package in api-server/lib and call it poclient.
DoD:
[ ] create a package api-server/lib/poclient
[ ] this package should expose a method for retrieving the price of a certain denom
[ ] cache the price-oracle response for some time (5-10 seconds?), an in-memory cache is sufficient
[ ] unit test the package, maybe mocking the real price-oracle
For this issue https://app.zenhub.com/workspaces/emeris-back-end-619cd009cc778000112d6259/issues/emerishq/demeris-backend/472 we need to fetch prices from the api-server.
We could query the database directly but I would prefer to just call price-oracle via API. So I would make a separate package in
api-server/lib
and call itpoclient
.DoD:
api-server/lib/poclient