Hunt prep
Before you test UXD Protocol
What 19 disclosed reports say about UXD Protocol: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 16 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Access control lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Inaccurate Perp debt calculation
The fix was to use Vault.getSettlementTokenValue() to determine the account's debt.
Disclosed
-
`rebalanceLite` should provide a slippage protection
The function was fixed by replacing sqrtPriceLimitX96 with a minimum output amount parameter and enforcing it as slippage protection.
Disclosed
-
PerpDepository#getPositionValue uses incorrect value for TWAP interval allowing more than intended funds to be extracted
The TWAP interval was corrected from 15 to 900.
Disclosed
-
RageTrade senior vault USDC deposits are subject to utilization caps which can lock deposits for long periods of time leading to UXD instability
The sponsor said it would not fix this during the audit; the recommendation was to monitor utilisation, keep part of the USDC outside the vault and add rebalancing functions.
Disclosed
-
PerpDespository#reblance and rebalanceLite can be called to drain funds from anyone who has approved PerpDepository
The fix was to use msg.sender instead of the account parameter, so the caller pays the shortfall.
Disclosed
-
Redeeming all UXD tokens is not possible if some have been minted via Perp quote minting
The internal accounting of `netAssetDeposits` should be changed to include `quoteToken` deposits.
Disclosed
-
PerpDepository#_rebalanceNegativePnlWithSwap fails to approve vault for quote deposit
The missing approval was added, and the issue was fixed.
Disclosed
-
Vulnerable GovernorVotesQuorumFraction version
The OpenZeppelin contracts version was updated to at least 4.7.2, as confirmed by the fix commit.
Disclosed
-
PerpDepository#_placePerpOrder miscalculates fees paid when shorting
The fee calculation was fixed so that _placePerpOrder uses openPositionFor, which returns the fee paid directly.
Disclosed
-
`PerpDepository._rebalanceNegativePnlWithSwap()` shouldn't use a `sqrtPriceLimitX96` twice
The fix was to apply `sqrtPriceLimitX96` only to the second swap, as confirmed in the discussion.
Disclosed
-
PerpDepository.netAssetDeposits variable can prevent users to withdraw with underflow error
The variable netAssetDeposits was removed and the contract now uses position size instead, as confirmed by the fix PR and review.
Disclosed
-
PerpDepository has no way to withdraw profits depriving stakers of profits owed
A function should be added to calculate and withdraw protocol profit so it can be awarded to stakers.
Disclosed
-
Price disparities between spot and perpetual pricing can heavily destabilize UXD
The report recommends pricing mints with a Chainlink spot oracle and capping the minted amount at the asset's spot value; the sponsor said oracle pricing may be added later but is not a current priority.
Disclosed
-
Rebalancing a negative Perp PnL via a Uniswap V3 token swap is broken due to the lack of token spending allowance
The issue was fixed by approving the SpotSwapper for the AssetToken before the swap.
Disclosed
-
Deposit and withdraw to the vault with the wrong decimals of amount in contract `PerpDepository`
The issue was fixed by converting the amount from 18 decimals to the token's decimals before calling vault.deposit and vault.withdraw.
Disclosed