Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2.32 KB

083.md

File metadata and controls

74 lines (52 loc) · 2.32 KB

Melodic Mocha Aardvark

High

Loan Stacking and Liquidity Manipulation through Refinancing and Order Filling

Summary

Bob could potentially manipulate the market liquidity and stack loans in a way that creates an unfair advantage, leveraging the interaction between loan creation, refinancing, and the CTF exchange.

Step by Step

  • Step 1: Bob uses acceptLoanOfferAndFillOrder to create a loan while simultaneously filling an order on the CTF exchange.
function acceptLoanOfferAndFillOrder(
   Order calldata exchangeOrder,
   Proposal calldata proposal
) external nonReentrant whenNotPaused {
   // ... checks ...
   _fillOrder(exchangeOrder, _selectExchangeForQuestionType(proposal.questionType));
   // ... create the  loan ...
}
  • Step 2: By filling specific orders, bob can potentially manipulate the liquidity on the CTF exchange for particular positions.
  • Step 3: bob then refinances the loan with more favorable terms due to the manipulated market conditions.
function refinance(Refinancing calldata refinancing) external nonReentrant whenNotPaused {
    // ... refinancing the loan ...
}
  • Step 4: Using the matchProposals function, bob creates additional loans, taking advantage of the altered market conditions.
function matchProposals(
    Proposal calldata borrowRequest,
    Proposal calldata loanOffer
) external nonReentrant whenNotPaused {
    // ... matching proposal...
}
  • Step 5: bob then repeats this process, potentially scaling up his position and further manipulating market liquidity.

Root Cause

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L214

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L320

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L500

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

  • This will create artificial liquidity in certain positions on the CTF exchange
  • it could lead to unfairly advantageous loan terms for bob.
  • Repeated use of this strategy could significantly distort the market for certain prediction outcomes

PoC

No response

Mitigation

No response