Skip to content

Commit

Permalink
Merge pull request #10 from OasisDEX/jt/untracked/add-debt-coverage
Browse files Browse the repository at this point in the history
♻️ refactor(coverage): add debt coverage arg to adjust simulation
  • Loading branch information
zerotucks authored Feb 19, 2024
2 parents c8b35a3 + 4dbdf5c commit 8d4124c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export async function simulate(
)

const currentPosition = await resolveCurrentPositionForProtocol(args, dependencies)
if (!args.debtCoverage.isZero()) {
currentPosition.debt.amount = currentPosition.debt.amount.plus(args.debtCoverage)
}
const protocolData = await resolveProtocolData(
{
collateralTokenAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import BigNumber from 'bignumber.js'
export type AaveLikeAdjustArgs = StrategyParams.WithAaveLikeMultiplyStrategyArgs &
StrategyParams.WithMultiple &
StrategyParams.WithDeposit &
StrategyParams.WithDebtCoverage &
Partial<StrategyParams.WithFlashLoanArgs>

export type ExtendedAaveLikeAdjustArgs = AaveLikeAdjustArgs & StrategyParams.WithFlashLoanArgs
Expand Down
4 changes: 4 additions & 0 deletions packages/dma-library/src/types/strategy-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,7 @@ export type WithCollateralTokenAddress = {
export type WithDebtTokenAddress = {
debtTokenAddress: string
}

export type WithDebtCoverage = {
debtCoverage: BigNumber
}

0 comments on commit 8d4124c

Please sign in to comment.