Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add service template #576

Open
wants to merge 2 commits into
base: feature/modius
Choose a base branch
from
Open
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 frontend/config/stakingPrograms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ export const DEFAULT_STAKING_PROGRAM_IDS: {
[EvmChainId.Gnosis]: StakingProgramId.PearlBeta,
// [EvmChainId.Optimism]: StakingProgramId.OptimusAlpha,
[EvmChainId.Base]: StakingProgramId.MemeBaseAlpha,
[EvmChainId.Mode]: StakingProgramId.ModiusAlpha,
[EvmChainId.Mode]: StakingProgramId.OptimusAlpha,
};
6 changes: 3 additions & 3 deletions frontend/config/stakingPrograms/mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import { StakingProgramMap } from '.';

export const MODE_STAKING_PROGRAMS_CONTRACT_ADDRESSES: Record<string, Address> =
{
[StakingProgramId.ModiusAlpha]:
[StakingProgramId.OptimusAlpha]:
'0x534c0a05b6d4d28d5f3630d6d74857b253cf8332',
};

export const MODE_STAKING_PROGRAMS: StakingProgramMap = {
[StakingProgramId.ModiusAlpha]: {
[StakingProgramId.OptimusAlpha]: {
chainId: EvmChainId.Mode,
name: 'Modius Alpha',
agentsSupported: [AgentType.Modius],
Expand All @@ -27,7 +27,7 @@ export const MODE_STAKING_PROGRAMS: StakingProgramMap = {
activityChecker:
ACTIVITY_CHECKERS[EvmChainId.Mode][ActivityCheckerType.Staking],
contract: new MulticallContract(
MODE_STAKING_PROGRAMS_CONTRACT_ADDRESSES[StakingProgramId.ModiusAlpha],
MODE_STAKING_PROGRAMS_CONTRACT_ADDRESSES[StakingProgramId.OptimusAlpha],
STAKING_TOKEN_PROXY_ABI,
),
},
Expand Down
129 changes: 121 additions & 8 deletions frontend/constants/serviceTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ export const SERVICE_TEMPLATES: ServiceTemplate[] = [
},
env_variables: {
BASE_LEDGER_RPC: {
name: "Base ledger RPC",
description: "",
value: "",
provision_type: EnvProvisionType.COMPUTED
name: 'Base ledger RPC',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
CELO_LEDGER_RPC: {
name: "Base ledger RPC",
description: "",
value: "",
provision_type: EnvProvisionType.COMPUTED
name: 'Base ledger RPC',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
TWIKIT_USERNAME: {
name: 'Twitter username',
Expand Down Expand Up @@ -256,6 +256,119 @@ export const SERVICE_TEMPLATES: ServiceTemplate[] = [
},
},
},
{
agentType: AgentType.Modius,
name: 'Optimus',
hash: 'bafybeihqho73he6mirkodg4ubom6ngf2nkgebhmxr435yxpsxgsthu5nvy',
description: 'Optimus',
image:
'https://gateway.autonolas.tech/ipfs/bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve',
service_version: 'v0.18.1',
home_chain: MiddlewareChain.MODE,
configurations: {
[MiddlewareChain.MODE]: {
staking_program_id: StakingProgramId.OptimusAlpha, // default, may be overwritten
nft: 'bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve',
rpc: 'http://localhost:8545', // overwritten
agent_id: 40,
threshold: 1,
use_staking: true,
cost_of_bond: 20000000000000000000,
monthly_gas_estimate: 5260000000000000,
fund_requirements: {
agent: 5000000000000000,
safe: 0,
},
},
},
env_variables: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing RPC variables (computed)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have added MODE_LEDGER_RPC but unsure if this is the one.

MODE_LEDGER_RPC: {
name: 'Mode ledger RPC',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
SAFE_CONTRACT_ADDRESSES: {
name: 'Safe contract address',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
TENDERLY_ACCESS_KEY: {
name: 'Tenderly access key',
description: '',
value: '',
provision_type: EnvProvisionType.USER,
},
TENDERLY_ACCOUNT_SLUG: {
name: 'Tenderly account slug',
description: '',
value: '',
provision_type: EnvProvisionType.USER,
},
TENDERLY_PROJECT_SLUG: {
name: 'Tenderly project slug',
description: '',
value: '',
provision_type: EnvProvisionType.USER,
},
STAKING_TOKEN_CONTRACT_ADDRESS: {
name: 'Staking token contract address',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
COINGECKO_API_KEY: {
name: 'Coingecko API key',
description: '',
value: '',
provision_type: EnvProvisionType.USER,
},
STAKING_CHAIN: {
name: 'Staking chain',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
STAKING_ACTIVITY_CHECKER_CONTRACT_ADDRESS: {
name: 'Staking activity checker contract address',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
MIN_SWAP_AMOUNT_THRESHOLD: {
name: 'Minimum swap amount threshold',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
ALLOWED_CHAINS: {
name: 'Allowed chains',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
TARGET_INVESTMENT_CHAINS: {
name: 'Target investment chains',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
INITIAL_ASSETS: {
name: 'Initial assets',
description: '',
value: '',
provision_type: EnvProvisionType.COMPUTED,
},
SELECTED_STRATEGIES: {
name: 'Selected strategies',
description: '',
value:
'["merkl_pools_search", "balancer_pools_search", "asset_lending"]',
provision_type: EnvProvisionType.FIXED,
},
},
},
] as const;

export const getServiceTemplates = (): ServiceTemplate[] => SERVICE_TEMPLATES;
Expand Down
3 changes: 2 additions & 1 deletion frontend/constants/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const REWARDS_HISTORY_SUBGRAPH_URLS_BY_EVM_CHAIN = {
'https://api.studio.thegraph.com/query/81371/gnosis-pearl-rewards-history/version/latest',
[EvmChainId.Base]:
'https://api.studio.thegraph.com/query/67875/olas-base-staking-rewards-history/version/latest',
[EvmChainId.Mode]: 'TBD',
[EvmChainId.Mode]:
'https://api.studio.thegraph.com/query/67875/olas-mode-staking-rewards-history/version/latest',
};

// discord
Expand Down
1 change: 0 additions & 1 deletion frontend/enums/StakingProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ export enum StakingProgramId {
PearlBetaMechMarketplace = 'pearl_beta_mech_marketplace',
OptimusAlpha = 'optimus_alpha',
MemeBaseAlpha = 'meme_base_alpha',
ModiusAlpha = 'modius_alpha',
}
1 change: 1 addition & 0 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const nextConfig = {
OPTIMISM_RPC: process.env.OPTIMISM_RPC,
BASE_RPC: process.env.BASE_RPC,
ETHEREUM_RPC: process.env.ETHEREUM_RPC,
MODE_RPC: process.env.MODE_RPC,
},
};

Expand Down
Loading