question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Exchange.sol] make bucket updates from Oracle data more predictable

See original GitHub issue

Currently there is no easy way to tell if gold and stable token buckets will or will not get updated in next block.

When you call getBuyAndSellBuckets it might think that there won’t be a bucket update from oracle data because it can’t know what the now timestamp will be in next block.

This can lead to a confusion when getBuyAndSellBuckets returns incorrect buckets compared to what will actually be used in the next block.

It would be great if these updates can be made more predictable. Instead of updating buckets in the same block when calling ‘updateBucketsIfNecessary’, it could first just mark the buckets for updating for next block. This would simplify getBuyAndSellBuckets because it would only need to check that marker, instead of running the whole shouldUpdateBuckets logic, and this would also remove the dependency on now timestamp in that code path.

This type of change would make it predictable to know what the starting [gold, stable] buckets will be in next block, instead of current setup where there is no way to know if oracle update will or will not be applied in next block.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
zviadmcommented, Sep 21, 2020

Thinking about this some more, my initial thought might have been incorrect and the “re-enabling” event probably doesn’t increase risk that significantly. While it would be nice if oracle updates were more predictable, there are other risk factors (like someone else making a huge single trade when “on-chain” price is significantly off), that it probably wouldn’t change overall risk of slippage significantly anyways.

1reaction
zviadmcommented, Sep 21, 2020

@tkporter fyi, this issue is even more relevant now that Oracle circuit breaker has triggered twice. The “re-enabling” of oracles, after they have been down, is basically a completely unpredictable event right now that puts arbitrageurs at a risk. Re-enabling oracles event can cause a large unpredictable change in exchange rate within a block, and there is no way to predict or observe that it is about to happen. So it creates a large risk for one sided arbitrage trades to happen because of it.

In general, safer arbitrage ==> more efficient protocol, so if changes can be made that makes arbitrage safer it will only help protocol be more efficient overall.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Oracle Database Backup Cloud Service
This document provides guidance and best practices for Backup and Restore of on-premises Oracle Databases to and from the Oracle Database Backup Cloud ......
Read more >
Using Retention Rules to Preserve Data - Oracle Help Center
Open the navigation menu and click Storage. Under Object Storage, click Buckets. Ensure that the correct region is selected from the regions ...
Read more >
FUNCTIONAL DESIGN - Oracle
The purpose of this document is to facilitate planning for an ARM implementation and to explain how a typical ARM customer would configure...
Read more >
Putting Data into Object Storage - Oracle Help Center
Oracle Cloud Infrastructure Object Storage uses buckets to organize your files. Learn to create a bucket and add data files.
Read more >
Using Object Versioning - Oracle Help Center
Each Object Storage bucket has object versioning status of disabled, ... If you create more restrictive policies that grant individual ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found