An initial exploration of a median price oracle that is more resistant to manipulation than TWAP. It includes an approximation algorithm where a running median can provide substantial gas efficiency on both read and write.
File explorer
Median Price Oracle - An initial exploration of a median price oracle that is more resistant to manipulation than TWAP. It includes an approximation algorithm where a running median can provide substantial gas efficiency on both read and write.
.github
workflows
test.yml0.5 kb
lib
forge-std0 kb
v4-periphery0 kb
src
lens
FrugalMedianLens.sol1.3 kb
MedianLens.sol1.3 kb
lib
FrugalMedianLibrary.sol1.8 kb
MedianLibrary.sol2.5 kb
RingBufferLibrary.sol0.8 kb
TickQuantisationLibrary.sol0.8 kb
EulerMedianOracle.sol9.3 kb
RunningFrugalMedianHook.sol2 kb
TickObserver.sol3.6 kb
test
implementation
EulerMedianOracleImplementation.sol0.6 kb
RunningFrugalMedianImplementation.sol0.7 kb
TickObserverImplementation.sol0.6 kb
median
FrugalMedianTest.t.sol1.1 kb
MedianLibrary.t.sol2.6 kb
utils
HookTest.sol3.3 kb
RingBuffer.t.sol0.6 kb
EulerMedianOracle.t.sol3.4 kb
FrugalMedianLens.t.sol3.4 kb
MedianLens.t.sol3.3 kb
RunningMedian.t.sol3 kb
TickObserver.t.sol2.8 kb
.gitignore0.1 kb
.gitmodules0.1 kb
LICENSE1 kb
README.md4.3 kb
foundry.toml0.2 kb
remappings.txt0.4 kb
File explorer
Median Price Oracle - An initial exploration of a median price oracle that is more resistant to manipulation than TWAP. It includes an approximation algorithm where a running median can provide substantial gas efficiency on both read and write.
Open a file
Select a file from the file explorer to view it's content.