0.37.1 • Published 1 month ago

@stabilitydao/stability v0.37.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

📦 Stability Integration Library

GitHub package.json version GitHub package.json version NPM Version GitHub Tag

GitHub code size in bytes npm bundle size NPM Unpacked Size

codecov

This is library for integrating Stability Platform into Node.js applications.

npm.io npm.io

🔌 Usage

Add npm package to your js/ts project:

yarn add @stabilitydao/stability

📡 API

Up-to-date and pre-processed data for integrations with Stability can be obtained in a single API response, which is always available at any working node of the private p2p network Stability. This library contains addresses of seed nodes.

import axios from "axios";
import { type ApiMainReply, seeds } from "@stabilitydao/stability";

const response = await axios.get(seeds[0]);
const apiReply = response.data as ApiMainReply;

💲 Strategies

Comprehensive information about platform strategies for managing DeFi assets. Includes developed strategies and those currently in development or awaiting development.

Types

  • Strategy

Enums

  • const enum StrategyShortId
  • enum StrategyState
  • enum BaseStrategy

Constants

  • strategies: {[shortId in StrategyShortId]:Strategy}
  • strategyStateDescription: {[state in StrategyState]: string}
  • baseStrategyContracts: {[baseStrategy in BaseStrategy]: string}

Methods

  • getMerklStrategies()
  • getALMStrategies()
  • getStrategyShortId(id: string): StrategyShortId|undefined
  • getStrategiesTotals(): {[state in StrategyState]: number}
  • getStrategyProtocols(shortId: StrategyShortId): DeFiProtocol[]
  • getChainStrategies(chainName: ChainName): Strategy[]

#️⃣ Deployments

Core contracts deployment addresses and subgraph API endpoints.

import { deployments } from "@stabilitydao/stability";

console.log("Platform address on Polygon", deployments["137"].core.platform);

Types

  • Deployment

Constants

  • deployments: {[chainId:string]:Deployment}

⛓️ Chains

Blockchains known to the platform and their integration statuses. Each chain has link to image in stabilitydao/.github repo chains/ folder.

Types

  • Chain
  • ChainStatusInfo

Enums

  • const enum ChainName
  • const enum ChainStatus

Constants

  • chains: { [chainId: string]: Chain }
  • chainStatusInfo: {[status in ChainStatus]: ChainStatusInfo}

Methods

  • getSupportedChainNames(): ChainName[]
  • getChainsTotals(): {[status in ChainStatus]: number}
  • getChainByName(chainName: ChainName): Chain

🌐 Integrations

DeFi organizations, protocols, their integration statuses, usage and other information. Each organization has link to image in stabilitydao/.github repo assets/ folder.

Types

  • DeFiOrganization
  • DeFiProtocol

Enums

  • const enum IntegrationStatus
  • enum DefiCategory

Constants

  • integrations: { [org: string]: DeFiOrganization }

Methods

  • getIntegrationStatus(p: DeFiProtocol): IntegrationStatus
  • getChainProtocols(chainId: string): DeFiProtocol[]

📌 Addresses

Third-party addresses.

import { almFactories } from "@stabilitydao/stability";

🪙 Assets

Asset addresses, description, website, color.

Types

  • Asset
  • TokenData

Constants

  • assets: Asset[]
  • sonicWhitelistedAssets: { [addrLc: 0x${string}]: number; }

Methods

  • getAsset(chainId: string, tokenAddress: 0x${string}): Asset|undefined
  • getTokenData(address: 0x${string}): TokenData|undefined

📜 Tokenlist

import { tokenlist } from "@stabilitydao/stability";

🌉 Bridges

Types

  • Bridge

Enums

  • const enum BridgeName

Constants

  • bridges: Bridge[]

Methods

  • getChainBridges(chainName: ChainName): Bridge[]

🏆 Contests

Types

  • YieldContest
  • Reward

Constants

  • contests: { [contestId: string]: YieldContest }

Enums

  • enum RewardType

Methods

  • getContestReward = (contest: YieldContest, rewardType: RewardType): Reward | undefined
  • getContestGemsReward = (contest: YieldContest): Reward | undefined

Oracles

Types

  • AssetOracle

Constants

  • assetOracles: {[chainId: string]: { [assetAddress: 0x${string}]: AssetOracle }; }
  • vaultOracles: {[chainId: string]: { [vaultAddress: 0x${string}]: 0x${string} }; }

🚦 Risk

Types

  • IlDetails

Methods

  • getIL = (strategyShortId: StrategyShortId, specific: string, assets: 0x${string}[]): IlDetails | undefined

👷 Develop

How to

yarn overview
yarn overview-full
yarn draw-chains
yarn draw-integrations
yarn contests-maker
yarn test
yarn coverage
yarn prettier . --check
yarn prettier . --write

Branch structure

BranchDescription
mainProduction. Accepts only PRs from dev.
devAccumulator of changes for the release
developer-devDeveloper's changes

Commit/PR prefix

ChangesPrefix
Collector📦
Strategies💲
Assets, tokenlist🪙
Sync state, etc♻️️
Content generators🎇
Bridge🌉
Risk🚦
Prettier#️⃣
Docs📙
Adapters🔌
AI🤖
Chains⛓️
API📡
Contests🏆
0.36.1

2 months ago

0.36.0

2 months ago

0.32.2

4 months ago

0.32.1

4 months ago

0.32.0

4 months ago

0.29.0

6 months ago

0.25.0

6 months ago

0.21.3

8 months ago

0.21.2

9 months ago

0.29.3

5 months ago

0.29.2

6 months ago

0.29.1

6 months ago

0.24.21

6 months ago

0.24.20

6 months ago

0.37.1

1 month ago

0.24.23

6 months ago

0.37.0

1 month ago

0.24.22

6 months ago

0.33.2

3 months ago

0.33.1

3 months ago

0.33.0

3 months ago

0.24.18

6 months ago

0.24.17

6 months ago

0.24.19

6 months ago

0.24.14

6 months ago

0.24.13

6 months ago

0.24.16

6 months ago

0.24.15

6 months ago

0.24.10

6 months ago

0.26.1

6 months ago

0.24.12

6 months ago

0.26.0

6 months ago

0.24.11

6 months ago

0.22.0

8 months ago

0.34.3

2 months ago

0.30.7

4 months ago

0.34.2

2 months ago

0.30.6

4 months ago

0.34.1

2 months ago

0.30.5

4 months ago

0.34.0

2 months ago

0.30.4

4 months ago

0.30.3

5 months ago

0.30.2

5 months ago

0.30.1

5 months ago

0.30.0

5 months ago

0.27.2

6 months ago

0.27.1

6 months ago

0.27.0

6 months ago

0.23.4

7 months ago

0.23.3

7 months ago

0.23.1

8 months ago

0.23.0

8 months ago

0.27.3

6 months ago

0.35.1

2 months ago

0.35.0

2 months ago

0.31.0

4 months ago

0.28.1

6 months ago

0.24.5

7 months ago

0.28.0

6 months ago

0.24.4

7 months ago

0.24.3

7 months ago

0.24.2

7 months ago

0.24.1

7 months ago

0.24.0

7 months ago

0.24.9

6 months ago

0.24.8

6 months ago

0.24.7

6 months ago

0.24.6

7 months ago

0.21.1

9 months ago

0.21.0

9 months ago

0.20.1

9 months ago

0.19.0

9 months ago

0.19.1

9 months ago

0.18.2

9 months ago

0.18.3

9 months ago

0.18.1

9 months ago

0.18.0

9 months ago

0.15.0

10 months ago

0.16.0

9 months ago

0.15.1

10 months ago

0.17.0

9 months ago

0.16.1

9 months ago

0.15.2

9 months ago

0.17.1

9 months ago

0.15.3

9 months ago

0.14.3

10 months ago

0.14.2

10 months ago

0.14.1

10 months ago

0.14.0

10 months ago

0.13.8

10 months ago

0.13.7

10 months ago

0.13.6

10 months ago

0.13.5

10 months ago

0.13.4

10 months ago

0.13.3

10 months ago

0.13.2

10 months ago

0.13.1

10 months ago

0.12.3

10 months ago

0.12.2

10 months ago

0.12.1

10 months ago

0.11.0

10 months ago

0.10.0

12 months ago

0.9.1

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago