osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

Market: Price ratio helper refactored #59

Closed ueco-jb closed 2 years ago

ueco-jb commented 2 years ago

closes https://github.com/confio/lendex/issues/58

Couple points: 1) Because of exposing price_market_per_common as a Market's query, I had to include getting Config in that function, so for couple calls in Market it doubles CONFIG loads. 2) Because ltoken_balance and btoken_balance helpers are crucial in this change, they return Coin type now. This means, that in those "crucial" 2 or 3 places implementation actually makes use of that type, where in most others I had to add extra .amount. Bit annoying, but don't see any "nice" way around it.