Submitted by 0xA5DF
Asset.lotPrice() has a fallback mechanism in case that tryPrice() fails - it uses the last saved price and multiplies its value by lotMultiplier (a variable that decreases as the time since the last saved price increase) and returns the results.
However, the tryPrice() might fail due to oracle timeout, in that case the last saved price might be older than the oracles price.
This can cause the backing manager to misestimate the value of the asset, trade it at a lower price, or do an unnecessary haircut.
In the PoC below:
Output:
Allow specifying a timeout to tryPrice(), in case that tryPrice() fails due to oracle timeout then call it again with priceTimeout as the timeout.
If the call succeeds the second time then use it as the most recent price for fallback calculations.
tbrent (Reserve) commented:
tbrent (Reserve) acknowledged
