3.0.4 • Published 27 days ago

@defisaver/automation-sdk v3.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
27 days ago

SDK for fetching DeFi Saver strategies data from the blockchain.

Fetch strategies data from the blockchain, and parse it into a readable format. Use one of the following classes to fetch data for strategies: EthereumStrategies, OptimismStrategies, or ArbitrumStrategies. Use one of the following classes to fetch data for legacy automation: LegacyMakerAutomation, LegacyAaveAutomation, or LegacyCompoundAutomation. Various services and constants also available for use.

Usage

const ethereumStrategies = new EthereumStrategies({
  provider: WEB3_PROVIDER_HERE,
});

const subscriptions = await ethereumStrategies.getSubscriptionsFor(
  // Pass one or multiple owner addresses, or use getSubscriptions method to fetch all subscriptions
  ['0x000000000000000000000000000000000000dEaD'],
  {
    fromBlock: 0,
    toBlock: 'latest',
    mergeSubs: true, // Used for merging subscriptions with same strategy ID (e.g. boost and repay)
    enabledOnly: true,
    unexpiredOnly: true, // Referring to exchange subscriptions
  }
);

// Do what you would like with subscriptions

Development - How to add new strategies?

  • Add strategy/bundle ID to ./src/types/enums.ts, and create Identifiers if needed
  • Add strategy/bundle info to ./src/constants/index.ts
  • Add encoding/decoding to the following files:
    • ./src/services/strategySubService.ts
    • ./src/services/subDataService.ts
    • ./src/services/triggerService.ts
  • Write parsing for the strategy in ./src/services/strategeiesService.ts and add assign it to const parsingMethodsMapping
  • Write tests for each method
  • Run tests with yarn test or yarn test fileName for a specific file (e.g. yarn test utils)
  • Congrats! 🥳
3.0.4

27 days ago

3.0.3

1 month ago

3.0.2

3 months ago

3.0.2-dev

3 months ago

3.0.1

4 months ago

3.0.0

4 months ago

2.1.6

4 months ago

2.1.5

4 months ago

2.1.4

4 months ago

2.1.3

4 months ago

2.1.2

5 months ago

2.1.1

5 months ago

2.0.3

7 months ago

2.0.2

8 months ago

2.0.5

7 months ago

2.0.4

7 months ago

2.0.6

7 months ago

2.0.9

6 months ago

2.0.8

6 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.2.27

10 months ago

1.2.28

9 months ago

2.1.0

6 months ago

1.2.29

9 months ago

1.2.30

9 months ago

1.2.31

9 months ago

1.2.32

9 months ago

1.2.33

8 months ago

1.2.26

1 year ago

1.2.18

1 year ago

1.2.19

1 year ago

1.2.20

1 year ago

1.2.23

1 year ago

1.2.24

1 year ago

1.2.21

1 year ago

1.2.22

1 year ago

1.2.25

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.9

1 year ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.10

1 year ago

1.2.11

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.12

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago