otomato-sdk 2.0.75 → 2.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,6 +35,10 @@ const createETHFearAndGreedBuy = async () => {
35
35
  const edge = new Edge({ source: trigger, target: odosAction });
36
36
  return new Workflow('Buy ETH when the market sentiment is extremely fearful', [trigger, odosAction], [edge]);
37
37
  };
38
+ const createDCAFearAndGreed = async () => {
39
+ // created with examples/UseCases/FearAndGreedDCA
40
+ return Workflow.fromJSON({ "id": null, "name": "Fear and Greed Workflow", "state": "inactive", "dateCreated": null, "dateModified": null, "executionId": null, "nodes": [{ "id": null, "ref": "1", "blockId": 18, "type": "trigger", "state": "inactive", "parameters": { "period": 86400000, "timeout": null, "limit": null }, "frontendHelpers": {}, "position": { "x": 400, "y": 120 } }, { "id": null, "ref": "2", "blockId": 100015, "type": "action", "state": "inactive", "parameters": {}, "frontendHelpers": {}, "position": { "x": 400, "y": 240 } }, { "id": null, "ref": "3", "blockId": 100016, "type": "action", "state": "inactive", "parameters": { "logic": "or", "groups": [{ "logic": "and", "checks": [{ "value1": "{{external.functions.btcFearAndGreed()}}", "condition": "gt", "value2": "80" }] }] }, "frontendHelpers": {}, "position": { "x": 150, "y": 360 } }, { "id": null, "ref": "4", "blockId": 100013, "type": "action", "state": "inactive", "parameters": { "chainId": 8453, "tokenIn": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "tokenOut": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "amount": 0.0001, "slippage": 0.1 }, "frontendHelpers": { "output": { "amountIn": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenIn}}", "chainId": "{{parameters.chainId}}" } }, "amountOut": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenOut}}", "chainId": "{{parameters.chainId}}" } } } }, "position": { "x": 150, "y": 480 } }, { "id": null, "ref": "5", "blockId": 100016, "type": "action", "state": "inactive", "parameters": { "logic": "or", "groups": [{ "logic": "and", "checks": [{ "value1": "{{external.functions.btcFearAndGreed()}}", "condition": "lt", "value2": "20" }] }] }, "frontendHelpers": {}, "position": { "x": 650, "y": 360 } }, { "id": null, "ref": "6", "blockId": 100013, "type": "action", "state": "inactive", "parameters": { "chainId": 8453, "tokenIn": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "tokenOut": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "amount": 10, "slippage": 0.3 }, "frontendHelpers": { "output": { "amountIn": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenIn}}", "chainId": "{{parameters.chainId}}" } }, "amountOut": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenOut}}", "chainId": "{{parameters.chainId}}" } } } }, "position": { "x": 650, "y": 480 } }], "edges": [{ "id": null, "source": "1", "target": "2" }, { "id": null, "source": "2", "target": "3" }, { "id": null, "source": "3", "target": "4", "label": "true", "value": "true" }, { "id": null, "source": "2", "target": "5" }, { "id": null, "source": "5", "target": "6", "label": "true", "value": "true" }], "notes": [] });
41
+ };
38
42
  const createETHFearAndGreedCapitalEfficientBuy = async () => {
39
43
  const trigger = new Trigger(TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX);
40
44
  trigger.setCondition('lt');
@@ -188,6 +192,17 @@ export const WORKFLOW_TEMPLATES = [
188
192
  ],
189
193
  createWorkflow: dailyYieldEmail
190
194
  },
195
+ {
196
+ 'name': 'Daily Fear & Greed-Based cbBTC Trading',
197
+ 'description': 'Automatically trade cbBTC daily based on the Fear & Greed Index—buy when low, sell when high.',
198
+ 'tags': [WORKFLOW_TEMPLATES_TAGS.TRADING, WORKFLOW_TEMPLATES_TAGS.SOCIALS],
199
+ 'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/dcaFearAndGreed.png',
200
+ 'image': [
201
+ TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.image,
202
+ ACTIONS.CORE.SWAP.SWAP.image
203
+ ],
204
+ createWorkflow: createDCAFearAndGreed
205
+ },
191
206
  {
192
207
  'name': 'Buy ETH when the market sentiment is extremely fearful - capital efficient',
193
208
  'description': 'Buy ETH when the Bitcoin Fear and Greed Index is below 45. The idle funds are generating yield on Ionic.',
@@ -235,7 +250,7 @@ export const WORKFLOW_TEMPLATES = [
235
250
  ],
236
251
  createWorkflow: createModeTransferNotificationWorkflow
237
252
  },
238
- {
253
+ /*{
239
254
  'name': 'Buy ETH when the market sentiment is extremely fearful',
240
255
  'description': 'Buy ETH when the Bitcoin Fear and Greed Index is below 30',
241
256
  'tags': [WORKFLOW_TEMPLATES_TAGS.TRADING, WORKFLOW_TEMPLATES_TAGS.SOCIALS],
@@ -245,7 +260,7 @@ export const WORKFLOW_TEMPLATES = [
245
260
  ACTIONS.SWAP.ODOS.SWAP.image
246
261
  ],
247
262
  createWorkflow: createETHFearAndGreedBuy
248
- },
263
+ },*/
249
264
  /*{
250
265
  'name': 'Copy-trade the trades done on Odos by vitalik.eth',
251
266
  'description': 'Buy 100$ of each token that vitalik.eth buys using Odos',
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = '2.0.75';
1
+ export const SDK_VERSION = '2.0.76';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.75";
1
+ export declare const SDK_VERSION = "2.0.76";
2
2
  export declare function compareVersions(v1: string, v2: string): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "2.0.75",
3
+ "version": "2.0.76",
4
4
  "description": "An SDK for building and managing automations on Otomato",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/types/src/index.d.ts",