The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Unclear protocol design when considering TST usage

Description

One aspect of the current protocol design that is unclear relates to the use of TST as a staking token. The implementation of LiquidationPool::distributeFees suggests that it is used as an incentive token to earn a proportional share of the EURO fees; however, LiquidationPool::stake returns the minimum of the staked EURO and TST values, as shown below.

function stake(Position memory _position) private pure returns (uint256) {
return _position.TST > _position.EUROs ? _position.EUROs : _position.TST;
}

It is possible to stake only a single token in calls to LiquidationPool::increasePosition which has the implication that LiquidationPool::stake will return zero whenever this is the case. For zero EURO collateral, this makes sense since TST alone cannot be used to liquidate undercollateralized vaults; however, if the TST balance is zero, then the non-zero EURO stake will not be considered in the stake total sum in LiquidationPool::getStakeTotal.

function getStakeTotal() private view returns (uint256 _stakes) {
for (uint256 i = 0; i < holders.length; i++) {
Position memory _position = positions[holders[i]];
_stakes += stake(_position);
}
}

Here, it is not clear why TST and EURO balances are mixed between holders since it is likely that some will deposit more TST while others deposit more EURO, and LiquidationPool::stake returns the smaller of the two virtual balances. This has the implication that the liquidation portion calculations in LiquidationPool::distributeAssets are very likely incorrect and could lead to bad debt accruing in the protocol due to unhandled partial liquidations.

Impact

The impact of this finding is low due to an insufficient understanding of the protocol intentions.

Recommended Mitigation

Since only EURO can be used in the liquidation of undercollateralized vaults, it is recommended to only consider EURO balances when calculating the stake total.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.