Skip to content

Commit

Permalink
Merge pull request #100 from OasisDEX/piter/sc-11805/update-common-an…
Browse files Browse the repository at this point in the history
…d-borrow-to-add-spark-stop

Added types for new trigger and command for spark stop loss
  • Loading branch information
piotrwitek authored Sep 8, 2023
2 parents 2f4ae85 + 547b66c commit 0c1d70e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/automation/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ export const commandTypeJsonMapping: Record<CommandContractType, string[]> = {
'collateralToken',
'ltv',
],
[CommandContractType.SparkStopLossCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'ltv',
],
[CommandContractType.MakerStopLossCommandV2]: [
'cdpId',
'triggerType',
Expand Down Expand Up @@ -200,6 +208,14 @@ export const defaultCommandTypeMapping = {
'address',
'uint256',
],
[CommandContractType.SparkStopLossCommandV2]: [
'address',
'uint16',
'uint256',
'address',
'address',
'uint256',
],
[CommandContractType.MakerStopLossCommandV2]: ['uint256', 'uint16', 'uint256', 'uint256'],
[CommandContractType.MakerAutoTakeProfitCommandV2]: ['uint256', 'uint16', 'uint256', 'uint32'],
[CommandContractType.MakerBasicBuyCommandV2]: [
Expand Down
3 changes: 3 additions & 0 deletions packages/automation/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum CommandContractType {
MakerAutoTakeProfitCommandV2 = 'MakerAutoTakeProfitCommandV2',
MakerBasicBuyCommandV2 = 'MakerBasicBuyCommandV2',
MakerBasicSellCommandV2 = 'MakerBasicSellCommandV2',
SparkStopLossCommandV2 = 'SparkStopLossCommandV2',
}

export enum TriggerType {
Expand All @@ -42,6 +43,8 @@ export enum TriggerType {
// AaveStopLossToDebtV2 = 110,
AaveStopLossToCollateralV2 = 111,
AaveStopLossToDebtV2 = 112,
SparkStopLossToCollateralV2 = 113,
SparkStopLossToDebtV2 = 114,
}

export enum TriggerGroupType {
Expand Down

0 comments on commit 0c1d70e

Please sign in to comment.