A truly life-changing crit for me. Iโll never forget it.
Thank you @immunefi, and very special thanks to
@MaiaDAOEco for caring about security and handling the report so well.
Now I'm focused on perps security, hunting the next crits.
๐พ ๐ A new whitehat just joined the ranks of Elites through a critical report.
@0xfuje has just made $100,000 on his FIRST paid report on @Immunefi - that's better than 73.33% of Elites' first payments!
Truly phenomenal.
A truly life-changing crit for me. Iโll never forget it.
Thank you @immunefi, and very special thanks to
@MaiaDAOEco for caring about security and handling the report so well.
Now I'm focused on perps security, hunting the next crits.
๐พ ๐ A new whitehat just joined the ranks of Elites through a critical report.
@0xfuje has just made $100,000 on his FIRST paid report on @Immunefi - that's better than 73.33% of Elites' first payments!
Truly phenomenal.
1/ I recently found and reported a critical one-line math bug in a perp DEX. Anyone could pull fake profit out of the shared pool with minimal price risk (only cost is fees).
Here's how it worked: ๐งต
Not many security researchers know this but onchain price feeds can deviate above their deviation thresholds from real market prices for a short while during large and fast price spikes. MEV Arbitrageurs use this for long tail strats.
@4hm8d@TemplarProtocol@StellarOrg Great bug! good that you called them out.
I also had a similar experience with a huge critical, not yet sure if I will go public with it.
@moonshotqueen Thank you!
There are no stupid questions
By "units" I meant how many tokens the position represents (units = tokens, e.g. 10 ETH). USD is a unit too, my wording was just bit too loose. For example: $10k at a price of $100 represents 100 tokens.
Hope that clears it up :)
9/ Takeaway: if you store position size in USD, the entry price on every add must be total USD / total units. A simple weighted average of prices pays out profit that was never earned, and someone else's margin covers it.
8/ The fix: average by units, not by USD.
โ new entry = total USD / total units
= (sโ + sโ) / (sโ/pโ + sโ/pโ)
Each $ added at a lower price buys more units, so it must pull the average down more. The plain average misses that.