Resolving in Cat-in-a-Box
- Watch CDP contract, wait for any events that increase a borrower's loan-to-value (LTV). These are:
- Withdraw - by removing deposited funds the the borrower's LTV ratio increases
- Borrow (mint) - by taking on more debt the borrower's LTV increases
- When event detected check owners resolve price by reading the function: resolvingPriceFeePerToken
- Calculate opportunity: Calculate Resolve Amount by reading the function: Debt and divide by four (to get the maximum 25%)
Multiply Resolve Amount by resolveFeePerToken to calculate the Total Cost of resolving 25% of the users current debt.
Check how much boxETH can be purchased with the Total Cost (stETH). Note: the lower the peg the less it will cost.
If the extra amount of boxETH available compared to the Resolve Amount exceeds the resolve fee (+ gas fee) to resolve then a profit is available.
- To resolve the user write the function: stabilisePeg
- Avoid being front-ran by using MEV tools