Skip to content

Commit

Permalink
refactor: add debt coverage arg to adjust simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotucks committed Feb 19, 2024
1 parent 8599d03 commit 4dbdf5c
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 4dbdf5c

Please sign in to comment.