osmosis-labs / isotonic

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

market: Research oracle price query optimization #98

Open uint opened 2 years ago

uint commented 2 years ago

This is supposed to unblock #22.

Research how to best handle caching price queries that go from the market contracts to oracles.

Definitely discuss with Osmosis folks.

Questions: Who pays for the caching? If some end user ends up paying more than others, is this legally OK?

Outcome

uint commented 2 years ago

@ethanfrey @kmw101 Do you have any thoughts here?

ethanfrey commented 2 years ago

This is totally optional and can be skipped.

Since the price returned from the real production oracle will not update more than once per block (on begin or end block), then we should be able to safely cache the price locally in the Market contract for multiple calls in the same block

I am not sure how much of a savings this will give, and definitely could be rolled out after a 1.0 version goes live on Osmosis.