diff --git a/package.json b/package.json index 8a80342..ffb49ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stabilitydao/stability", - "version": "0.59.0", + "version": "0.59.1", "description": "Stability Operating System Library", "main": "out/index.js", "types": "out/index.d.ts", diff --git a/src/activity/index.ts b/src/activity/index.ts new file mode 100644 index 0000000..72063fd --- /dev/null +++ b/src/activity/index.ts @@ -0,0 +1,34 @@ +import { UnitType } from "../os"; + +/** Organization activities supported by OS. */ +export enum Activity { + /** Owner of Decentralized Finance protocols */ + DEFI = "DEFI", + /** Owner of Maximum Extractable Value tools */ + MEV = "MEV", + /** BUILDER is a team of engineers managed by DAOs. */ + BUILDER = "BUILDER", + /** Owner of Software as a Service business */ + //SAAS_OPERATOR = "SAAS_OPERATOR", +} + +export const activities: { + [activity in Activity]: { + title: string; + unitTypes: UnitType[]; + description?: string; + }; +} = { + [Activity.DEFI]: { + title: "Decentralized Finance Protocol Operator", + unitTypes: [UnitType.DEFI_PROTOCOL], + }, + [Activity.MEV]: { + title: "Maximum Extractable Value tools", + unitTypes: [UnitType.MEV_SEARCHER], + }, + [Activity.BUILDER]: { + title: "Team of engineers with multisig wallet.", + unitTypes: [], + }, +}; diff --git a/src/daos.ts b/src/daos.ts index 090b30b..5d0c5a6 100644 --- a/src/daos.ts +++ b/src/daos.ts @@ -1,5 +1,4 @@ import { - Activity, FundingType, IDAO, IUnit, @@ -13,6 +12,7 @@ import { ChainName } from "./chains"; import { LendingEngine } from "./lending"; import { AgentRole, emptyRuntime } from "./agents"; import { ArtifactType } from "./activity/builder"; +import { Activity } from "./activity"; export function getUnitById(unitId: string): IUnit | undefined { for (const dao of daos) { @@ -30,7 +30,7 @@ export const daos: IDAO[] = [ name: "Host Dev", symbol: "HOST", socials: ["https://t.me/dao_host"], - activity: [Activity.BUILDER, Activity.DEFI_PROTOCOL_OPERATOR], + activity: [Activity.BUILDER, Activity.DEFI], images: { token: "/builder.png", }, @@ -44,6 +44,12 @@ export const daos: IDAO[] = [ type: UnitType.DEFI_PROTOCOL, components: {}, emoji: "🍀", + ui: [ + { + href: "https://dao.host", + title: "dao.host", + }, + ], }, ], agents: [ @@ -60,7 +66,7 @@ export const daos: IDAO[] = [ pvpFee: 100, }, tokenomics: { - initialChain: ChainName.PLASMA, + initialChain: ChainName.ETHEREUM, funding: [ { type: FundingType.SEED, @@ -351,7 +357,7 @@ export const daos: IDAO[] = [ "https://discord.com/invite/R3nnetWzC9", "https://t.me/stabilitydao", ], - activity: [Activity.DEFI_PROTOCOL_OPERATOR], + activity: [Activity.DEFI], images: { token: "/stbl.svg", xToken: "/xstbl.png", @@ -435,7 +441,10 @@ export const daos: IDAO[] = [ revenueShare: 25, type: UnitType.DEFI_PROTOCOL, components: { - [UnitComponentCategory.ENGINE_SUPPORT]: [LendingEngine.AAVE_3_0_2], + [UnitComponentCategory.ENGINE_SUPPORT]: [ + LendingEngine.AAVE_3_0_2, + LendingEngine.AAVE_3_5, + ], }, emoji: "🏦", ui: [ @@ -511,7 +520,7 @@ export const daos: IDAO[] = [ name: "MEV Fighter", symbol: "MEVBOT", socials: [], - activity: [Activity.BUILDER, Activity.MEV_SEARCHER], + activity: [Activity.BUILDER, Activity.MEV], images: { token: "/mevbot.jpg", }, @@ -522,7 +531,7 @@ export const daos: IDAO[] = [ name: "Liquidator", status: UnitStatus.RESEARCH, revenueShare: 100, - type: UnitType.MEV, + type: UnitType.MEV_SEARCHER, components: { [UnitComponentCategory.MEV_STRATEGY]: [], }, @@ -533,7 +542,7 @@ export const daos: IDAO[] = [ name: "Arbitrager", status: UnitStatus.RESEARCH, revenueShare: 100, - type: UnitType.MEV, + type: UnitType.MEV_SEARCHER, components: { [UnitComponentCategory.MEV_STRATEGY]: [], }, diff --git a/src/index.ts b/src/index.ts index 399595f..e6e422e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import { IConveyor, IGithubIssue } from "./activity/builder"; import { deployments, Deployment } from "./deployments"; import { chains, @@ -65,9 +66,18 @@ import { AssetOracle, assetOracles, vaultOracles } from "./oracles"; import { IlDetails, getIL } from "./risk"; import { Severity, status } from "./status"; import { AgentRole, IAgent } from "./agents"; -import { IDAO, OS, STABILITY_OS_DESCRIPTION, UnitStatus, UnitType } from "./os"; +import { + IDAO, + IUnit, + LifecyclePhase, + OS, + STABILITY_OS_DESCRIPTION, + UnitStatus, + UnitType, +} from "./os"; import { ILendingMarket, IReserve, lendingMarkets } from "./lending"; import { daos, getUnitById } from "./daos"; +import { Activity } from "./activity"; export { deployments, @@ -144,4 +154,9 @@ export { getUnitById, STABILITY_OS_DESCRIPTION, OS, + Activity, + IConveyor, + IGithubIssue, + IUnit, + LifecyclePhase, }; diff --git a/src/os.ts b/src/os.ts index 716a764..681e7bb 100644 --- a/src/os.ts +++ b/src/os.ts @@ -8,6 +8,7 @@ import { StrategyShortId } from "./strategies"; import { LendingEngine } from "./lending"; import { IBuilderActivity, IBuildersMemory } from "./activity/builder"; import { Prices, RevenueChart } from "./api.types"; +import { Activity } from "./activity"; export const STABILITY_OS_DESCRIPTION = "Operating System of Self-developing DAOs"; @@ -78,18 +79,6 @@ export interface IDAO { builderActivity?: IBuilderActivity; } -/** Organization activities supported by OS. */ -export enum Activity { - /** Owner of Decentralized Finance protocols */ - DEFI_PROTOCOL_OPERATOR = "DEFI_PROTOCOL_OPERATOR", - /** Owner of Software as a Service business */ - SAAS_OPERATOR = "SAAS_OPERATOR", - /** Searching of Maximum Extractable Value opportunities and submitting it to block builders. */ - MEV_SEARCHER = "MEV_SEARCHER", - /** BUILDER is a team of engineers managed by DAOs. */ - BUILDER = "BUILDER", -} - /** Images of tokens. Absolute or relative from stabilitydao/.github repo /os/ folder. */ export interface IDAOImages { seedToken?: string; @@ -250,10 +239,10 @@ export enum UnitType { PVP = "PVP", /** Decentralized finance protocol */ DEFI_PROTOCOL = "DEFI_PROTOCOL", + /** Maximum Extractable Value opportunities searcher and submitter. */ + MEV_SEARCHER = "MEV_SEARCHER", /** Software as a Service business */ - SAAS = "SAAS", - /** Maximum Extractable Value tool */ - MEV = "MEV", + //SAAS = "SAAS", } /** Unit status can be changed automatically on DAO lifecycle phase changes or manually by DAO holders */ diff --git a/tests/os.test.ts b/tests/os.test.ts index 87c3d5d..2c775c3 100644 --- a/tests/os.test.ts +++ b/tests/os.test.ts @@ -1,11 +1,7 @@ import { daos, getUnitById, OS, UnitStatus, UnitType } from "../src"; -import { - Activity, - FundingType, - IFunding, - IVesting, - LifecyclePhase, -} from "../src/os"; +import { FundingType, IFunding, IVesting } from "../src/os"; +import { Activity, LifecyclePhase } from "../src"; +import { activities } from "../src/activity"; describe("testing OS", () => { test("Lifecycle", () => { @@ -25,7 +21,7 @@ describe("testing OS", () => { const daoAliens = os56.createDAO( "Aliens Community", "ALIENS", - [Activity.BUILDER, Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.BUILDER, Activity.DEFI], { vePeriod: 365, pvpFee: 100, @@ -303,7 +299,7 @@ describe("testing OS", () => { const daoApes = os1.createDAO( "Apes Syndicate", "APES", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 30, pvpFee: 90, @@ -375,7 +371,7 @@ describe("testing OS", () => { const daoMachines = os10.createDAO( "Machines Cartel", "MACHINE", - [Activity.MEV_SEARCHER], + [Activity.MEV], { vePeriod: 14, pvpFee: 99, @@ -395,7 +391,7 @@ describe("testing OS", () => { unitId: "MACHINES:MEVBOT", name: "MEV searcher", status: UnitStatus.LIVE, - type: UnitType.MEV, + type: UnitType.MEV_SEARCHER, revenueShare: 100, ui: [], api: [], @@ -494,7 +490,7 @@ describe("testing OS", () => { os.createDAO( "SpaceSwap_000000000000000000", "SPACE", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365, pvpFee: 90, @@ -511,7 +507,7 @@ describe("testing OS", () => { os.createDAO( "SpaceSwap", "SPACESWAP", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365, pvpFee: 90, @@ -528,7 +524,7 @@ describe("testing OS", () => { os.createDAO( "SpaceSwap", "SPACE", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365, pvpFee: 90, @@ -545,7 +541,7 @@ describe("testing OS", () => { os.createDAO( "SpaceSwap", "SPACE1", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365 * 5, pvpFee: 100, @@ -562,7 +558,7 @@ describe("testing OS", () => { os.createDAO( "SpaceSwap", "SPACE1", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365, pvpFee: 101, @@ -579,7 +575,7 @@ describe("testing OS", () => { os.createDAO( "SpaceSwap", "SPACE1", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365, pvpFee: 90, @@ -672,12 +668,17 @@ describe("testing OS", () => { expect(OS.isLiveDAO(LifecyclePhase.TGE)).toBe(false); }); + test("activities", () => { + const defiActivity = activities[Activity.DEFI]; + expect(defiActivity.unitTypes[0]).toBe(UnitType.DEFI_PROTOCOL); + }); + const _createDAO = (os: OS) => { const funding = [_generateSeedFunding(os)]; return os.createDAO( "SpaceSwap", "SPACE", - [Activity.DEFI_PROTOCOL_OPERATOR], + [Activity.DEFI], { vePeriod: 365, pvpFee: 90, diff --git a/tools/overview.ts b/tools/overview.ts index 9e37e03..ab52f2b 100644 --- a/tools/overview.ts +++ b/tools/overview.ts @@ -42,16 +42,13 @@ ${daos ? `\n * UI: ${unit.ui.map((ui) => `[${ui.title}](${ui.href})`).join(", ")}` : ""; const unitStr = ` * Unit ${unit.emoji ? `${unit.emoji} ` : ""}**${unit.name}** [${unit.status}]${uis}`; + const defiStratsBeingDeveloped = Object.keys(strategies).filter( + (shortId) => + strategies[shortId as StrategyShortId].state === + StrategyState.DEVELOPMENT, + ); const defiStrategies = !!unit.components?.DEFI_STRATEGY?.length - ? `\n * DeFi Strategies: ${unit.components.DEFI_STRATEGY.length}. Being developed: ${Object.keys( - strategies, - ) - .filter( - (shortId) => - strategies[shortId as StrategyShortId].state === - StrategyState.DEVELOPMENT, - ) - .join(", ")}.` + ? `\n * DeFi Strategies: ${unit.components.DEFI_STRATEGY.length}.${defiStratsBeingDeveloped.length > 0 ? ` Being developed: ${defiStratsBeingDeveloped.join(", ")}.` : ""}` : ""; const lendingEngines = !!unit.components?.ENGINE_SUPPORT?.length ? `\n * Engines: ${unit.components.ENGINE_SUPPORT.join(", ")}.`