interlay / interbtc-squid

Subquid GraphQL schema and indexer for the Interlay and Kintsugi networks
Apache License 2.0
4 stars 7 forks source link

Refactor currency conversations to use Monetary lib #107

Closed jtfirek closed 1 year ago

jtfirek commented 1 year ago

Right now our in loans.ts we are using custom logic to convert currencies, but we have our standard why of doing so just our Monetary lib! We could refactor this file to use Monetary lib Exchange Rate type to convert types of currencies. https://github.com/interlay/interbtc-squid/blob/030ad2f3a61d10abba518aa8c1dca5c770085dd6/src/mappings/event/loans.ts