Skip to content

Commit

Permalink
feat: Add shouldExit flag to CloseArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotucks committed Feb 19, 2024
1 parent 192e582 commit 103a611
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/dma-library/src/operations/spark/multiply/close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export type CloseArgs = WithCollateral &
WithProxy &
WithPositionAndLockedCollateral &
WithAaveLikeStrategyAddresses &
WithNetwork
WithNetwork & {
shouldExit: boolean
}

export type SparkCloseOperation = ({
collateral,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ export async function buildOperation(
},
addresses: dependencies.addresses,
network: dependencies.network,
/**
* This is a temporary solution in the AUTO variant of dma-library
* It uses the shouldCloseToCollateral flag to determine if the position
* should be closed to collateral AND EXITED from the protocol.
*
*/
shouldExit: Boolean(args.shouldCloseToCollateral),
}

return {
Expand Down

0 comments on commit 103a611

Please sign in to comment.