Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.59.0",
"version": "0.59.1",
"description": "Stability Operating System Library",
"main": "out/index.js",
"types": "out/index.d.ts",
Expand Down
34 changes: 34 additions & 0 deletions src/activity/index.ts
Original file line number Diff line number Diff line change
@@ -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: [],
},
};
25 changes: 17 additions & 8 deletions src/daos.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
Activity,
FundingType,
IDAO,
IUnit,
Expand All @@ -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) {
Expand All @@ -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",
},
Expand All @@ -44,6 +44,12 @@ export const daos: IDAO[] = [
type: UnitType.DEFI_PROTOCOL,
components: {},
emoji: "🍀",
ui: [
{
href: "https://dao.host",
title: "dao.host",
},
],
},
],
agents: [
Expand All @@ -60,7 +66,7 @@ export const daos: IDAO[] = [
pvpFee: 100,
},
tokenomics: {
initialChain: ChainName.PLASMA,
initialChain: ChainName.ETHEREUM,
funding: [
{
type: FundingType.SEED,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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",
},
Expand All @@ -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]: [],
},
Expand All @@ -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]: [],
},
Expand Down
17 changes: 16 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IConveyor, IGithubIssue } from "./activity/builder";
import { deployments, Deployment } from "./deployments";
import {
chains,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -144,4 +154,9 @@ export {
getUnitById,
STABILITY_OS_DESCRIPTION,
OS,
Activity,
IConveyor,
IGithubIssue,
IUnit,
LifecyclePhase,
};
19 changes: 4 additions & 15 deletions src/os.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
37 changes: 19 additions & 18 deletions tests/os.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand All @@ -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,
Expand Down Expand Up @@ -303,7 +299,7 @@ describe("testing OS", () => {
const daoApes = os1.createDAO(
"Apes Syndicate",
"APES",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 30,
pvpFee: 90,
Expand Down Expand Up @@ -375,7 +371,7 @@ describe("testing OS", () => {
const daoMachines = os10.createDAO(
"Machines Cartel",
"MACHINE",
[Activity.MEV_SEARCHER],
[Activity.MEV],
{
vePeriod: 14,
pvpFee: 99,
Expand All @@ -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: [],
Expand Down Expand Up @@ -494,7 +490,7 @@ describe("testing OS", () => {
os.createDAO(
"SpaceSwap_000000000000000000",
"SPACE",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 365,
pvpFee: 90,
Expand All @@ -511,7 +507,7 @@ describe("testing OS", () => {
os.createDAO(
"SpaceSwap",
"SPACESWAP",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 365,
pvpFee: 90,
Expand All @@ -528,7 +524,7 @@ describe("testing OS", () => {
os.createDAO(
"SpaceSwap",
"SPACE",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 365,
pvpFee: 90,
Expand All @@ -545,7 +541,7 @@ describe("testing OS", () => {
os.createDAO(
"SpaceSwap",
"SPACE1",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 365 * 5,
pvpFee: 100,
Expand All @@ -562,7 +558,7 @@ describe("testing OS", () => {
os.createDAO(
"SpaceSwap",
"SPACE1",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 365,
pvpFee: 101,
Expand All @@ -579,7 +575,7 @@ describe("testing OS", () => {
os.createDAO(
"SpaceSwap",
"SPACE1",
[Activity.DEFI_PROTOCOL_OPERATOR],
[Activity.DEFI],
{
vePeriod: 365,
pvpFee: 90,
Expand Down Expand Up @@ -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,
Expand Down
15 changes: 6 additions & 9 deletions tools/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(", ")}.`
Expand Down