Skip to content

Commit

Permalink
Merge pull request #206 from stabilitydao/dev
Browse files Browse the repository at this point in the history
0.29.0 collector
  • Loading branch information
a17 authored Jan 30, 2025
2 parents 879d93e + 89e540a commit 122a91d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ currently in development or awaiting development.
#### Methods

- `getMerklStrategies()`
- `getALMStrategies()`
- `getStrategyShortId(id: string): StrategyShortId|undefined`
- `getStrategiesTotals(): {[state in StrategyState]: number}`
- `getStrategyProtocols(shortId: StrategyShortId): DeFiProtocol[]`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stabilitydao/stability",
"version": "0.28.1",
"version": "0.29.0",
"description": "Stability Integration Library",
"main": "out/index.js",
"types": "out/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type Deployment = {
};
periphery: {
frontend: `0x${string}`;
rebalanceHelper?: `0x${string}`;
};
tokenomics: {
merkleDistributor?: `0x${string}`;
Expand Down Expand Up @@ -51,6 +52,7 @@ export const deployments: { [chainId: string]: Deployment } = {
},
periphery: {
frontend: "0x15487495cce9210795f9C2E0e1A7238E336dFc32",
rebalanceHelper: "0xF95C1E9fb9c7d357CAF969B741a2354630f7aEcD",
},
tokenomics: {
merkleDistributor: "0x0391aBDCFaB86947d93f9dd032955733B639416b",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
baseStrategyContracts,
getStrategyProtocols,
getChainStrategies,
getALMStrategies,
} from "./strategies";
import {
integrations,
Expand Down Expand Up @@ -99,4 +100,5 @@ export {
AssetOracle,
assetOracles,
vaultOracles,
getALMStrategies,
};
12 changes: 11 additions & 1 deletion src/strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ export const strategies: { [shortId in StrategyShortId]: Strategy } = {
[StrategyShortId.ASF]: {
id: "ALM Shadow Farm",
shortId: StrategyShortId.ASF,
state: StrategyState.AWAITING,
state: StrategyState.LIVE,
contractGithubId: 213,
color: "#411fa8",
bgColor: "#000000",
Expand All @@ -531,6 +531,16 @@ export const getMerklStrategies = (): string[] => {
});
};

export const getALMStrategies = (): string[] => {
return Object.keys(strategies)
.filter((shortId) =>
strategies[shortId as StrategyShortId].baseStrategies.includes(
BaseStrategy.ALM,
),
)
.map((shortId) => strategies[shortId as StrategyShortId].id);
};

export const getStrategyShortId = (
strategyId: string,
): StrategyShortId | undefined => {
Expand Down
9 changes: 9 additions & 0 deletions tests/strategies.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {
baseStrategyContracts,
ChainName,
getALMStrategies,
getChainStrategies,
getMerklStrategies,
getStrategiesTotals,
getStrategyProtocols,
getStrategyShortId,
strategies,
StrategyShortId,
} from "../src";
import { BaseStrategy } from "../src/strategies";
Expand Down Expand Up @@ -38,4 +40,11 @@ describe("testing strategies", () => {
const realStrategies = getChainStrategies(ChainName.REAL);
expect(realStrategies.length).toBeGreaterThan(3);
});
test("get alm strategies", () => {
const almStrategies = getALMStrategies();
expect(almStrategies.length).toBeGreaterThan(0);
expect(almStrategies.includes(strategies[StrategyShortId.ASF].id)).toEqual(
true,
);
});
});

0 comments on commit 122a91d

Please sign in to comment.