Skip to main content

Resolving in Cat-in-a-Box

Instructions

  1. 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

Cat-in-a-Box Resolve

  1. When event detected check owners resolve price by reading the function: resolvingPriceFeePerToken

Cat-in-a-Box Resolve

  1. 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.

Cat-in-a-Box Resolve

Check how much boxETH can be purchased with the Total Cost (stETH). Note: the lower the peg the less it will cost.

Cat-in-a-Box Resolve

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.

  1. To resolve the user write the function: stabilisePeg

Cat-in-a-Box Resolve

  1. Avoid being front-ran by using MEV tools