Skip to content

Commit

Permalink
feat: update mappings for remaining Morpho triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotucks committed May 2, 2024
1 parent dc601c2 commit da45f80
Showing 1 changed file with 109 additions and 9 deletions.
118 changes: 109 additions & 9 deletions packages/automation/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,66 @@ export const commandTypeJsonMapping: Record<CommandContractType, string[]> = {
'maxBaseFeeInGwei',
],
[CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
// TODO
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'targetLtv',
'minSellPrice',
'deviation',
'maxBaseFeeInGwei',
],
[CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
// TODO
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'closeToCollateral'
],
[CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
// TODO
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'targetLtv',
'executionPrice',
'deviation',
'withdrawToDebt',
],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
// TODO
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'collateralOracle',
'collateralAddedRoundId',
'debtOracle',
'debtAddedRoundId',
'trailingDistance',
'closeToCollateral',
],
};
export const commandOffchainDataTypeJsonMapping: Partial<Record<CommandContractType, string[]>> = {
Expand Down Expand Up @@ -651,7 +701,7 @@ export const defaultCommandTypeMapping: Record<CommandContractType, ParamDefinit
'uint256', // targetLtv
'uint256', // excutionPrice
'uint64', // deviation
'bool', // closeToCollateral
'bool', // withdrawToDebt
],

// Morpho
Expand All @@ -672,16 +722,66 @@ export const defaultCommandTypeMapping: Record<CommandContractType, ParamDefinit
'uint32', // maxBaseFeeInGwei
],
[CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
// TODO
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'uint8', // quote decimals
'uint8', // collateral decimals
'uint256', // execLtv
'uint256', // targetLtv
'uint256', // minSellPrice
'uint64', // deviation
'uint32', // maxBaseFeeInGwei
],
[CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
// TODO
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'uint8', // quote decimals
'uint8', // collateral decimals
'uint256', // executionLTV
'bool', // closeToCollateral
],
[CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
// TODO
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'uint8', // quote decimals
'uint8', // collateral decimals
'uint256', // execLtv
'uint256', // targetLtv
'uint256', // executionPrice
'uint64', // deviation
'bool', // withdrawToDebt
],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
// TODO
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'collateralOracle',
'collateralAddedRoundId',
'debtOracle',
'debtAddedRoundId',
'trailingDistance',
'closeToCollateral',
],
} as const;

Expand Down

0 comments on commit da45f80

Please sign in to comment.