The first trader in a market will have a wrong inflated fundingRate
When filling an order fundingRate
is calculated using perpMarket.getCurrentFundingRate()
, taking a look inside it
The fundingRate
clearly depends on what getProportionalElapsedSinceLastFunding
returns, taking a look inside it
For the first order being filled self.lastFundingTime
= 0, therefore getProportionalElapsedSinceLastFunding
will return a very large positive value, therefore
fundingFeePerUnit
is a value proportional to the fundingRate
The first trader in a market will have a wrong inflated fundingRate
will have wrong calculations anything to do with funding rate
Manual Review
initialize lastFundingTime
in PerpMarket.sol
to a reasonable value when the contract is deployed
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.