Users can be overcharged for order fees because it uses the protocol uses the wrong price to calculate the order fee.
Order fee is incorrectly calculated with markPrice instead of indexPrice as seen here.
Key definitions
skew: a measure of how far or close the price of a derivative is to the price of the underlying asset. The closer to zero the skew is, the closer to the derivative price is to the index price.
index price: the real price of the underlying asset. Zaros sources this from Chainlink and other off-chain oracles.
mark price: the price of the derivative in Zaros after the skew has been factored into the index price.
Mark price is used when settling orders and liquidation as they directly impact the open interest and skew of the protocol. This is important to keeping the derivatives assets price as close to the underlying asset's price as possible. The idea is to encourage selling activities when the derivative price has been pushed higher than the index price, and vice versa.
As stated before using mark price for trading activities that affect the derivative price movement makes sense, but outside of that, the index price is the right price to use for maintaining market fairness.
Zaros order fees do not impact the open interest or skew as they are not cut from the position or order size delta. These fees are charged directly to the account's margin balance and sent to the corresponding fee receipient. The tokens do not hit the market at any point. They do not affect the size delta, skew, or open interest.
Using mark price instead of index price to calculate order fee can cause the protocol to overcharge the users on order fees. Not only does this not conform to the standard for the perpetual market, but it can disincentivize users from entry trades that should help bring the skew closer to zero when it strays far from it. A further inconsistency is the use of index prices for settlement and liquidation fee calculations.
When the mark price is greater than the index price, the cost of entering the market increases, and the farther the skew strays from zero the more disincentivized traders are to enter the market, including counter traders needed to bring the price back down to the desired level. This means the fees paid by traders in the market are directly impacted by other traders' activities, and they can effectively cause them to pay a larger fee.
Manual
Use index price to calculate order fees.
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.