User is not refunded fees when vault changes position ahead of the users transaction.
When depositing into the vault, there are two mechanisms to which the deposit serves, which is dependent on if the vault has a position opened on GMX or closed.
When the vault has a position open, it collects the deposit amount and fees and saves the next action as an increase action. But when it is closed, it simply mints shares to the depositing user. The challenge here is that the user depositing does not know what state the vault will be in at execution. It could be an open position or closed position.
The Gamma vault X is in openPosition state.
Bob sends a transaction to Gamma contracts, with deposit of 100 usdc and 5 avax to pay for execution of the transaction.
Since bob inputs an acceptable priority fee as is required in Avax dynamic fee model
The keeper sends out a transaction same time to close the position of vault X but this time with a higher priority fee, being that the keeper operations are more time sensitive (robots/automated) there is a chance that it would want as much urgency than an average investor.
The validators on avax process the keepers transaction first and the position on vault x is closed.
When Bobs transaction is processed, it means that the vaults position has been closed, so bob will just be minted a share instead for his 100usd. Since the no position is open on the vault, it means bob will also loose his 5 avax permanently, as there is no mechanism to either refund bob or admin move it out.
The mechanism for moving fees is only on GMXproxy and not on the vault, and bobs fees will not make it to the proxy.
User losses it fees for ever with no refund
manaul
Refund fees when the vault position is closed.
Likelihood: Low, send a deposit with execution fees but a “run” keeper is made just before to close the position. Impact: Low/Medium, no refund of the execution fee, althought they were no need for them.
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.