Socket
Socket
Sign inDemoInstall

@oasisdex/automation

Package Overview
Dependencies
Maintainers
7
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oasisdex/automation - npm Package Compare versions

Comparing version 1.6.5 to 1.6.6

168

lib/src/mapping.js

@@ -220,2 +220,73 @@ "use strict";

],
// Morpho
[types_1.CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'targetLtv',
'maxBuyPrice',
'deviation',
'maxBaseFeeInGwei',
],
[types_1.CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'executionLtv',
'targetLtv',
'minSellPrice',
'deviation',
'maxBaseFeeInGwei',
],
[types_1.CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'executionLtv',
'closeToCollateral',
],
[types_1.CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'executionLtv',
'targetLtv',
'executionPrice',
'deviation',
'withdrawToDebt',
],
[types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'collateralOracle',
'collateralAddedRoundId',
'debtOracle',
'debtAddedRoundId',
'trailingDistance',
'closeToCollateral',
],
};

@@ -233,2 +304,7 @@ exports.commandOffchainDataTypeJsonMapping = {

],
[types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'collateralMaxPriceRoundId',
'debtClosestPriceRoundId',
'debtNextPriceRoundId',
],
};

@@ -341,2 +417,18 @@ exports.commandAddressMapping = Object.fromEntries(Object.entries({

},
// TODO: Add addresses once deployed
'0x5800e875cf803aFb5f963faC40623548C27e342a': {
type: types_1.CommandContractType.DmaMorphoBlueBasicBuyCommandV2,
},
'0x1F6D1f30ccc00B5Df9b2f3ACeF26D555b8Efe69E': {
type: types_1.CommandContractType.DmaMorphoBlueBasicSellCommandV2,
},
'0x0DF4F9B2cAb35075677253eA15e424B97ABc7dEb': {
type: types_1.CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2,
},
'0xdEBd95B6fea8F2c39e0232358608Acfd7E557A5A': {
type: types_1.CommandContractType.DmaMorphoBlueStopLossCommandV2,
},
'0xCe72966Ea1a8777e0E2Fb60c476C6cA8D59bEfdd': {
type: types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2,
},
},

@@ -592,4 +684,75 @@ [types_1.EthereumNetwork.BASE]: {

'uint64',
'bool', // withdrawToDebt
],
// Morpho
[types_1.CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'address',
'uint16',
'uint256',
'address',
'address',
'bytes32',
'bytes32',
'uint8',
'uint8',
'uint256',
'uint256',
'uint256',
'uint64',
'uint32', // maxBaseFeeInGwei
],
[types_1.CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
'address',
'uint16',
'uint256',
'address',
'address',
'bytes32',
'bytes32',
'uint256',
'uint256',
'uint256',
'uint64',
'uint32', // maxBaseFeeInGwei
],
[types_1.CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
'address',
'uint16',
'uint256',
'address',
'address',
'bytes32',
'bytes32',
'uint256',
'bool', // closeToCollateral
],
[types_1.CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
'address',
'uint16',
'uint256',
'address',
'address',
'bytes32',
'bytes32',
'uint256',
'uint256',
'uint256',
'uint64',
'bool', // withdrawToDebt
],
[types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'address',
'uint16',
'uint256',
'address',
'address',
'bytes32',
'bytes32',
'address',
'uint80',
'address',
'uint80',
'uint256',
'bool', // closeToCollateral
],
};

@@ -607,2 +770,7 @@ exports.defaultCommandOffchainDataTypeMapping = {

],
[types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'uint80',
'uint80',
'uint80', // debtNextPriceRoundId
],
};

@@ -609,0 +777,0 @@ function getCommandAddresses(network) {

14

lib/src/types.d.ts

@@ -31,3 +31,8 @@ import { ethers } from 'ethers';

DmaAavePartialTakeProfitCommandV2 = "DmaAaveV3PartialTakeProfitCommandV2",
DmaSparkPartialTakeProfitCommandV2 = "DmaSparkPartialTakeProfitCommandV2"
DmaSparkPartialTakeProfitCommandV2 = "DmaSparkPartialTakeProfitCommandV2",
DmaMorphoBlueBasicBuyCommandV2 = "DmaMorphoBlueBasicBuyCommandV2",
DmaMorphoBlueBasicSellCommandV2 = "DmaMorphoBlueBasicSellCommandV2",
DmaMorphoBluePartialTakeProfitCommandV2 = "DmaMorphoBluePartialTakeProfitCommandV2",
DmaMorphoBlueStopLossCommandV2 = "DmaMorphoBlueStopLossCommandV2",
DmaMorphoBlueTrailingStopLossCommandV2 = "DmaMorphoBlueTrailingStopLossCommandV2"
}

@@ -65,3 +70,8 @@ export declare enum TriggerType {

DmaAaveTrailingStopLossV2 = 10006,
DmaSparkTrailingStopLossV2 = 10007
DmaSparkTrailingStopLossV2 = 10007,
DmaMorphoBlueBasicBuyV2 = 139,
DmaMorphoBlueBasicSellV2 = 140,
DmaMorphoBluePartialTakeProfitV2 = 141,
DmaMorphoBlueStopLossV2 = 142,
DmaMorphoBlueTrailingStopLossV2 = 10009
}

@@ -68,0 +78,0 @@ export declare const TrailingStopLossTriggers: TriggerType[];

@@ -36,2 +36,7 @@ "use strict";

CommandContractType["DmaSparkPartialTakeProfitCommandV2"] = "DmaSparkPartialTakeProfitCommandV2";
CommandContractType["DmaMorphoBlueBasicBuyCommandV2"] = "DmaMorphoBlueBasicBuyCommandV2";
CommandContractType["DmaMorphoBlueBasicSellCommandV2"] = "DmaMorphoBlueBasicSellCommandV2";
CommandContractType["DmaMorphoBluePartialTakeProfitCommandV2"] = "DmaMorphoBluePartialTakeProfitCommandV2";
CommandContractType["DmaMorphoBlueStopLossCommandV2"] = "DmaMorphoBlueStopLossCommandV2";
CommandContractType["DmaMorphoBlueTrailingStopLossCommandV2"] = "DmaMorphoBlueTrailingStopLossCommandV2";
})(CommandContractType = exports.CommandContractType || (exports.CommandContractType = {}));

@@ -71,4 +76,18 @@ var TriggerType;

TriggerType[TriggerType["DmaSparkTrailingStopLossV2"] = 10007] = "DmaSparkTrailingStopLossV2";
// DmaMorphoBlueBasicBuyV2 = 135,
// DmaMorphoBlueBasicSellV2 = 136,
// DmaMorphoBluePartialTakeProfitV2 = 137,
// DmaMorphoBlueStopLossV2 = 138,
// DmaMorphoBlueTrailingStopLossV2 = 10008,
TriggerType[TriggerType["DmaMorphoBlueBasicBuyV2"] = 139] = "DmaMorphoBlueBasicBuyV2";
TriggerType[TriggerType["DmaMorphoBlueBasicSellV2"] = 140] = "DmaMorphoBlueBasicSellV2";
TriggerType[TriggerType["DmaMorphoBluePartialTakeProfitV2"] = 141] = "DmaMorphoBluePartialTakeProfitV2";
TriggerType[TriggerType["DmaMorphoBlueStopLossV2"] = 142] = "DmaMorphoBlueStopLossV2";
TriggerType[TriggerType["DmaMorphoBlueTrailingStopLossV2"] = 10009] = "DmaMorphoBlueTrailingStopLossV2";
})(TriggerType = exports.TriggerType || (exports.TriggerType = {}));
exports.TrailingStopLossTriggers = [TriggerType.DmaAaveTrailingStopLossV2, TriggerType.DmaSparkTrailingStopLossV2];
exports.TrailingStopLossTriggers = [
TriggerType.DmaAaveTrailingStopLossV2,
TriggerType.DmaSparkTrailingStopLossV2,
TriggerType.DmaMorphoBlueTrailingStopLossV2,
];
exports.triggerTypeToCommandContractTypeMap = {

@@ -106,2 +125,7 @@ [TriggerType.StopLossToCollateral]: CommandContractType.CloseCommand,

[TriggerType.DmaSparkPartialTakeProfitV2]: CommandContractType.DmaSparkPartialTakeProfitCommandV2,
[TriggerType.DmaMorphoBlueBasicBuyV2]: CommandContractType.DmaMorphoBlueBasicBuyCommandV2,
[TriggerType.DmaMorphoBlueBasicSellV2]: CommandContractType.DmaMorphoBlueBasicSellCommandV2,
[TriggerType.DmaMorphoBluePartialTakeProfitV2]: CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2,
[TriggerType.DmaMorphoBlueStopLossV2]: CommandContractType.DmaMorphoBlueStopLossCommandV2,
[TriggerType.DmaMorphoBlueTrailingStopLossV2]: CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2,
};

@@ -108,0 +132,0 @@ var TriggerGroupType;

2

package.json
{
"name": "@oasisdex/automation",
"packageManager": "yarn@1.22.21",
"version": "1.6.5",
"version": "1.6.6",
"description": "The set of utilities for Oasis automation",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/OasisDEX/common#readme",

@@ -225,2 +225,74 @@ import {

],
// Morpho
[CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'targetLtv',
'maxBuyPrice',
'deviation',
'maxBaseFeeInGwei',
],
[CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'executionLtv',
'targetLtv',
'minSellPrice',
'deviation',
'maxBaseFeeInGwei',
],
[CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'executionLtv',
'closeToCollateral',
],
[CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'executionLtv',
'targetLtv',
'executionPrice',
'deviation',
'withdrawToDebt',
],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'poolId',
'collateralOracle',
'collateralAddedRoundId',
'debtOracle',
'debtAddedRoundId',
'trailingDistance',
'closeToCollateral',
],
};

@@ -238,2 +310,7 @@ export const commandOffchainDataTypeJsonMapping: Partial<Record<CommandContractType, string[]>> = {

],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'collateralMaxPriceRoundId',
'debtClosestPriceRoundId',
'debtNextPriceRoundId',
],
};

@@ -350,2 +427,19 @@ export const commandAddressMapping: Record<

},
// TODO: Add addresses once deployed
'0x5800e875cf803aFb5f963faC40623548C27e342a': {
type: CommandContractType.DmaMorphoBlueBasicBuyCommandV2,
},
'0x1F6D1f30ccc00B5Df9b2f3ACeF26D555b8Efe69E': {
type: CommandContractType.DmaMorphoBlueBasicSellCommandV2,
},
'0x0DF4F9B2cAb35075677253eA15e424B97ABc7dEb': {
type: CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2,
},
'0xdEBd95B6fea8F2c39e0232358608Acfd7E557A5A': {
type: CommandContractType.DmaMorphoBlueStopLossCommandV2,
},
'0xCe72966Ea1a8777e0E2Fb60c476C6cA8D59bEfdd': {
type: CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2,
},
},

@@ -605,4 +699,76 @@ [EthereumNetwork.BASE]: {

'uint64', // deviation
'bool', // withdrawToDebt
],
// Morpho
[CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'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', // maxBuyPrice
'uint64', // deviation
'uint32', // maxBaseFeeInGwei
],
[CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'uint256', // execLtv
'uint256', // targetLtv
'uint256', // minSellPrice
'uint64', // deviation
'uint32', // maxBaseFeeInGwei
],
[CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'uint256', // executionLTV
'bool', // closeToCollateral
],
[CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'uint256', // execLtv
'uint256', // targetLtv
'uint256', // executionPrice
'uint64', // deviation
'bool', // withdrawToDebt
],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // marketId
'address', // collateralOracle
'uint80', // collateralAddedRoundId
'address', // debtOracle
'uint80', // debtAddedRoundId
'uint256', // trailingDistance
'bool', // closeToCollateral
],
} as const;

@@ -624,2 +790,7 @@

],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
'uint80', // collateralMaxPriceRoundId
'uint80', // debtClosestPriceRoundId
'uint80', // debtNextPriceRoundId
],
} as const;

@@ -626,0 +797,0 @@

@@ -34,2 +34,8 @@ import { ethers } from 'ethers';

DmaSparkPartialTakeProfitCommandV2 = 'DmaSparkPartialTakeProfitCommandV2',
DmaMorphoBlueBasicBuyCommandV2 = 'DmaMorphoBlueBasicBuyCommandV2',
DmaMorphoBlueBasicSellCommandV2 = 'DmaMorphoBlueBasicSellCommandV2',
DmaMorphoBluePartialTakeProfitCommandV2 = 'DmaMorphoBluePartialTakeProfitCommandV2',
DmaMorphoBlueStopLossCommandV2 = 'DmaMorphoBlueStopLossCommandV2',
DmaMorphoBlueTrailingStopLossCommandV2 = 'DmaMorphoBlueTrailingStopLossCommandV2',
}

@@ -69,5 +75,19 @@

DmaSparkTrailingStopLossV2 = 10007,
// DmaMorphoBlueBasicBuyV2 = 135,
// DmaMorphoBlueBasicSellV2 = 136,
// DmaMorphoBluePartialTakeProfitV2 = 137,
// DmaMorphoBlueStopLossV2 = 138,
// DmaMorphoBlueTrailingStopLossV2 = 10008,
DmaMorphoBlueBasicBuyV2 = 139,
DmaMorphoBlueBasicSellV2 = 140,
DmaMorphoBluePartialTakeProfitV2 = 141,
DmaMorphoBlueStopLossV2 = 142,
DmaMorphoBlueTrailingStopLossV2 = 10009,
}
export const TrailingStopLossTriggers = [TriggerType.DmaAaveTrailingStopLossV2, TriggerType.DmaSparkTrailingStopLossV2];
export const TrailingStopLossTriggers = [
TriggerType.DmaAaveTrailingStopLossV2,
TriggerType.DmaSparkTrailingStopLossV2,
TriggerType.DmaMorphoBlueTrailingStopLossV2,
];

@@ -106,2 +126,10 @@ export const triggerTypeToCommandContractTypeMap: Record<TriggerType, CommandContractType> = {

[TriggerType.DmaSparkPartialTakeProfitV2]: CommandContractType.DmaSparkPartialTakeProfitCommandV2,
[TriggerType.DmaMorphoBlueBasicBuyV2]: CommandContractType.DmaMorphoBlueBasicBuyCommandV2,
[TriggerType.DmaMorphoBlueBasicSellV2]: CommandContractType.DmaMorphoBlueBasicSellCommandV2,
[TriggerType.DmaMorphoBluePartialTakeProfitV2]:
CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2,
[TriggerType.DmaMorphoBlueStopLossV2]: CommandContractType.DmaMorphoBlueStopLossCommandV2,
[TriggerType.DmaMorphoBlueTrailingStopLossV2]:
CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2,
};

@@ -108,0 +136,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc