Functions readMaxValue and readMinValue need to be implemented
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- solidity
- Domain
- blockchain
Research direction
Start by locating readMaxValue and readMinValue in the Solidity contracts, then read the existing value-submission and history logic. Confirm how N and gamma are represented before implementing the described historical traversal and update behavior; done means both functions return the highest or lowest value from the N most recent stored averages.
Written by the indexing model from the issue text.
Description
These two functions are important for protocols such as Djed Shu.
There are different ways in which we could implement them. Here is a reasonable and simple one:
-
We keep an array of historical average values.
-
When
readMaxValueis called, we traverse theNmost recent values from this array and return the highest average price found. -
When
readMinValueis called, we traverse theNmost recent values from this array and return the lowest average price found. -
Let
tbe the timestamp of the most recent entry in the history array. Whenever a new value is submitted at time at'andt' > t + gamma, the new average should be pushed into the history array.
The reason for having a minimal interval gamma is that we want the maximum and minimum value to be values over a significant period of time.
(I have a simple idea to optimize the traversals by caching some results. But let's implement the non-optimized version first, which traverses the history on every call to read...Value . Later we can discuss the caching optimization.)
- Dominant language
- Solidity
- Stars
- 3
- Forks
- 3
- Avg merge
- 15h 55m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StabilityNexus/OrbOracle-Solidity
-
[BUG]: Oracle with rewardBps above 1e5 can never accept a funded price submissionPossibly taken @kansalakshat claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
StabilityNexus/OrbOracle-Solidity#27 · 1 comment ·
-
[BUG]: Old prices stay in the feed after someone resubmits (decay is not multiplicative)Possibly taken @Deepak-negi11 claimed this 4 days ago. Openbug
Difficulty 5/5 Over a week Newbie friendliness 35/100
StabilityNexus/OrbOracle-Solidity#25 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 73/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
StabilityNexus/OrbOracle-Solidity#4 · 1 comment ·
All issues in StabilityNexus/OrbOracle-Solidity
Similar issues
-
Log filters reject `"fromBlock": null` (and `toBlock`/`blockHash`) instead of treating it as unsetOpenL1 rpc-api
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
lambdaclass/ethrex#7530 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LFDT-Lineth/lineth-monorepo#4442 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day