Socket
Socket
Sign inDemoInstall

@oasisdex/automation

Package Overview
Dependencies
Maintainers
9
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.4-alpha.3 to 1.6.5-morpho.0

84

lib/src/mapping.js

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

],
// Morpho
[types_1.CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'id',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'targetLtv',
'maxBuyPrice',
'deviation',
'maxBaseFeeInGwei',
],
[types_1.CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
// TODO
],
[types_1.CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
// TODO
],
[types_1.CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
// TODO
],
[types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
// TODO
],
};

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

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

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

},
// TODO: Add addresses once deployed
'0xUpdateMe': {
type: types_1.CommandContractType.DmaMorphoBlueBasicBuyCommandV2,
},
'0xUpdateMe2': {
type: types_1.CommandContractType.DmaMorphoBlueBasicSellCommandV2,
},
'0xUpdateMe3': {
type: types_1.CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2,
},
'0xUpdateMe4': {
type: types_1.CommandContractType.DmaMorphoBlueStopLossCommandV2,
},
'0xUpdateMe5': {
type: types_1.CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2,
},
},

@@ -594,2 +644,31 @@ [types_1.EthereumNetwork.BASE]: {

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

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

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

@@ -609,0 +693,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 = 135,
DmaMorphoBlueBasicSellV2 = 136,
DmaMorphoBluePartialTakeProfitV2 = 137,
DmaMorphoBlueStopLossV2 = 138,
DmaMorphoBlueTrailingStopLossV2 = 10008
}

@@ -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,13 @@ var TriggerType;

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

@@ -106,2 +120,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 +127,0 @@ var TriggerGroupType;

2

package.json
{
"name": "@oasisdex/automation",
"packageManager": "yarn@1.22.21",
"version": "1.6.4-alpha.3",
"version": "1.6.5-morpho.0",
"description": "The set of utilities for Oasis automation",

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

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

],
// Morpho
[CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'positionAddress',
'triggerType',
'maxCoverage',
'debtToken',
'collateralToken',
'operationName',
'id',
'quoteDecimals',
'collateralDecimals',
'executionLtv',
'targetLtv',
'maxBuyPrice',
'deviation',
'maxBaseFeeInGwei',
],
[CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
// TODO
],
[CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
// TODO
],
[CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
// TODO
],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
// TODO
],
};

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

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

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

},
// TODO: Add addresses once deployed
'0xUpdateMe': {
type: CommandContractType.DmaMorphoBlueBasicBuyCommandV2,
},
'0xUpdateMe2': {
type: CommandContractType.DmaMorphoBlueBasicSellCommandV2,
},
'0xUpdateMe3': {
type: CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2,
},
'0xUpdateMe4': {
type: CommandContractType.DmaMorphoBlueStopLossCommandV2,
},
'0xUpdateMe5': {
type: CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2,
},
},

@@ -607,2 +659,32 @@ [EthereumNetwork.BASE]: {

],
// Morpho
[CommandContractType.DmaMorphoBlueBasicBuyCommandV2]: [
'address', //positionAddress
'uint16', // triggerType
'uint256', // maxCoverage
'address', // debtToken
'address', // collateralToken
'bytes32', // operationName
'bytes32', // Id
'uint8', // quoteDecimals
'uint8', // collateralDecimals
'uint256', // execLtv
'uint256', // targetLtv
'uint256', // maxBuyPrice
'uint64', // deviation
'uint32', // maxBaseFeeInGwei
],
[CommandContractType.DmaMorphoBlueBasicSellCommandV2]: [
// TODO
],
[CommandContractType.DmaMorphoBlueStopLossCommandV2]: [
// TODO
],
[CommandContractType.DmaMorphoBluePartialTakeProfitCommandV2]: [
// TODO
],
[CommandContractType.DmaMorphoBlueTrailingStopLossCommandV2]: [
// TODO
],
} as const;

@@ -624,2 +706,7 @@

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

@@ -626,0 +713,0 @@

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

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

@@ -69,5 +75,14 @@

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

@@ -106,2 +121,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 +131,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