Skip to content

Commit

Permalink
chore: move DPM flag to multiply on deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotucks committed Aug 29, 2023
1 parent b7e5e1d commit 971c205
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@dma-library/types'
import { WithV2Protocol, WithV3Protocol } from '@dma-library/types/aave/protocol'
import {
WithAaveStrategyDependencies,
WithAaveMultiplyStrategyDependencies,
WithDebug,
WithSwap,
} from '@dma-library/types/strategy-params'
Expand All @@ -18,7 +18,7 @@ import BigNumber from 'bignumber.js'

export type AaveAdjustArgs = IPositionTransitionArgs<AAVETokens> & WithPositionType
export type ExtendedAaveAdjustArgs = AaveAdjustArgs & WithFlashloanToken
export type AaveAdjustSharedDependencies = WithAaveStrategyDependencies &
export type AaveAdjustSharedDependencies = WithAaveMultiplyStrategyDependencies &
WithSwap &
Partial<WithDebug>
export type AaveV2AdjustDependencies = AaveAdjustSharedDependencies & WithV2Protocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AAVETokens, PositionType } from '@dma-library/types'
import { WithV2Protocol, WithV3Protocol } from '@dma-library/types/aave/protocol'
import { WithAaveStrategyDependencies, WithSwap } from '@dma-library/types/strategy-params'
import { WithAaveMultiplyStrategyDependencies, WithSwap } from '@dma-library/types/strategy-params'
import { IRiskRatio } from '@domain'
import BigNumber from 'bignumber.js'

Expand All @@ -16,10 +16,10 @@ export interface AaveOpenArgs {
debtToken: { symbol: AAVETokens; precision?: number }
}

export type AaveV2OpenDependencies = Omit<WithAaveStrategyDependencies, 'currentPosition'> &
export type AaveV2OpenDependencies = Omit<WithAaveMultiplyStrategyDependencies, 'currentPosition'> &
WithV2Protocol &
WithSwap
export type AaveV3OpenDependencies = Omit<WithAaveStrategyDependencies, 'currentPosition'> &
export type AaveV3OpenDependencies = Omit<WithAaveMultiplyStrategyDependencies, 'currentPosition'> &
WithV3Protocol &
WithSwap
export type AaveOpenDependencies = AaveV2OpenDependencies | AaveV3OpenDependencies
9 changes: 8 additions & 1 deletion packages/dma-library/src/types/strategy-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,24 @@ type SharedStrategyDependencies = {
currentPosition: IPosition
proxy: Address
user: Address
isDPMProxy: boolean
network: Network
}

export type WithAaveStrategyDependencies = {
addresses: AaveLikeStrategyAddresses
} & SharedStrategyDependencies

export type WithAaveMultiplyStrategyDependencies = WithAaveStrategyDependencies & WithDPMFlag

export type WithAaveLikeStrategyDependencies = {
addresses: AaveLikeStrategyAddresses
} & SharedStrategyDependencies &
WithAaveLikeProtocolType

export type WithDPMFlag = {
isDPMProxy: boolean
}

export type WithSwap = {
getSwapData: (
fromToken: string,
Expand Down

0 comments on commit 971c205

Please sign in to comment.