From 35df2351088848a0663ae543f59672b8d7b8986d Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Tue, 3 Sep 2024 10:30:12 +0530 Subject: [PATCH 1/3] 'WIP' --- src/constants.ts | 10 ++++++++++ src/store/strategies.atoms.ts | 10 ++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 402e9bd6..b9c6b078 100755 --- a/src/constants.ts +++ b/src/constants.ts @@ -54,6 +54,8 @@ const CONSTANTS = { '0x04937b58e05a3a2477402d1f74e66686f58a61a5070fcc6f694fb9a0b3bae422', DeltaNeutralMMSTRKETH: '0x20d5fc4c9df4f943ebb36078e703369c04176ed00accf290e8295b659d2cea6', + DeltaNeutralMMETHUSDC: + '0x04937b58e05a3a2477402d1f74e66686f58a61a5070fcc6f694fb9a0b3bae422', }, MOBILE_MSG: 'Desktop/Tablet only', }; @@ -166,6 +168,14 @@ export const NFTS: NFTInfo[] = [ mainTokenName: 'STRK', }, }, + { + name: 'frmDNMMETHUSDC', + address: CONSTANTS.CONTRACTS.DeltaNeutralMMETHUSDC, + logo: CONSTANTS.LOGOS.ETH, + config: { + mainTokenName: 'ETH', + }, + }, ]; export const LATEST_TNC_DOC_VERSION = '1.0'; diff --git a/src/store/strategies.atoms.ts b/src/store/strategies.atoms.ts index 6cfb6d93..8f712fdf 100755 --- a/src/store/strategies.atoms.ts +++ b/src/store/strategies.atoms.ts @@ -58,12 +58,11 @@ export function getStrategies() { 'ETH Sensei', Mustache.render(DNMMDescription, { token1: 'ETH', token2: 'USDC' }), 'USDC', - // ! change this later - CONSTANTS.CONTRACTS.DeltaNeutralMMUSDCETH, - [1, 0.608, 1, 0.552509, 0.552509], // precomputed factors based on strategy math - StrategyLiveStatus.COMING_SOON, + CONSTANTS.CONTRACTS.DeltaNeutralMMETHUSDC, + [1, 0.609886, 1, 0.920975, 0.510078], // precomputed factors based on strategy math + StrategyLiveStatus.NEW, { - maxTVL: 50000, + maxTVL: 20, }, ); const deltaNeutralMMSTRKETH = new DeltaNeutralMM( @@ -71,7 +70,6 @@ export function getStrategies() { 'STRK Sensei', Mustache.render(DNMMDescription, { token1: 'STRK', token2: 'ETH' }), 'ETH', - // ! change this later CONSTANTS.CONTRACTS.DeltaNeutralMMSTRKETH, [1, 0.384615, 1, 0.492308, 0.233276], // precomputed factors based on strategy math, last is the excess deposit1 that is happening StrategyLiveStatus.NEW, From e469d28507c5c4dc85d6f844b00182ba30733081 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Thu, 5 Sep 2024 17:35:01 +0530 Subject: [PATCH 2/3] Configure ETH Sensei --- src/abi/deltraNeutral.abi.json | 610 +++++++++++++++++++---------- src/components/Deposit.tsx | 2 +- src/constants.ts | 13 +- src/store/strategies.atoms.ts | 2 +- src/strategies/delta_neutral_mm.ts | 1 + 5 files changed, 428 insertions(+), 200 deletions(-) diff --git a/src/abi/deltraNeutral.abi.json b/src/abi/deltraNeutral.abi.json index 1b7df5dd..e742e0c1 100755 --- a/src/abi/deltraNeutral.abi.json +++ b/src/abi/deltraNeutral.abi.json @@ -1,12 +1,12 @@ [ { - "name": "LockerImpl", "type": "impl", + "name": "LockerImpl", "interface_name": "ekubo::interfaces::core::ILocker" }, { - "name": "core::array::Span::", "type": "struct", + "name": "core::array::Span::", "members": [ { "name": "snapshot", @@ -15,12 +15,12 @@ ] }, { - "name": "ekubo::interfaces::core::ILocker", "type": "interface", + "name": "ekubo::interfaces::core::ILocker", "items": [ { - "name": "locked", "type": "function", + "name": "locked", "inputs": [ { "name": "id", @@ -41,13 +41,13 @@ ] }, { - "name": "StrategyImpl", "type": "impl", + "name": "StrategyImpl", "interface_name": "strkfarm::interfaces::ERC721Strategy::IStrategy" }, { - "name": "strkfarm::interfaces::IEkuboDistributor::Claim", "type": "struct", + "name": "strkfarm::interfaces::IEkuboDistributor::Claim", "members": [ { "name": "id", @@ -64,8 +64,8 @@ ] }, { - "name": "core::integer::u256", "type": "struct", + "name": "core::integer::u256", "members": [ { "name": "low", @@ -78,8 +78,8 @@ ] }, { - "name": "strkfarm::components::swap::Route", "type": "struct", + "name": "strkfarm::components::swap::Route", "members": [ { "name": "token_from", @@ -104,8 +104,8 @@ ] }, { - "name": "strkfarm::components::swap::AvnuMultiRouteSwap", "type": "struct", + "name": "strkfarm::components::swap::AvnuMultiRouteSwap", "members": [ { "name": "token_from_address", @@ -146,8 +146,8 @@ ] }, { - "name": "core::bool", "type": "enum", + "name": "core::bool", "variants": [ { "name": "False", @@ -160,8 +160,8 @@ ] }, { - "name": "strkfarm::interfaces::ERC721Strategy::Position", "type": "struct", + "name": "strkfarm::interfaces::ERC721Strategy::Position", "members": [ { "name": "acc1_supply_shares", @@ -182,8 +182,8 @@ ] }, { - "name": "strkfarm::interfaces::ERC721Strategy::PositionDescription", "type": "struct", + "name": "strkfarm::interfaces::ERC721Strategy::PositionDescription", "members": [ { "name": "estimated_size", @@ -208,8 +208,8 @@ ] }, { - "name": "strkfarm::interfaces::ERC721Strategy::StrategyConfig", "type": "struct", + "name": "strkfarm::interfaces::ERC721Strategy::StrategyConfig", "members": [ { "name": "main_token", @@ -230,8 +230,8 @@ ] }, { - "name": "strkfarm::interfaces::ERC721Strategy::Settings", "type": "struct", + "name": "strkfarm::interfaces::ERC721Strategy::Settings", "members": [ { "name": "fee_percent", @@ -260,12 +260,12 @@ ] }, { - "name": "strkfarm::interfaces::ERC721Strategy::IStrategy", "type": "interface", + "name": "strkfarm::interfaces::ERC721Strategy::IStrategy", "items": [ { - "name": "harvest", "type": "function", + "name": "harvest", "inputs": [ { "name": "protocol1_rewards_contract", @@ -300,8 +300,8 @@ "state_mutability": "external" }, { - "name": "deposit", "type": "function", + "name": "deposit", "inputs": [ { "name": "amount", @@ -320,8 +320,8 @@ "state_mutability": "external" }, { - "name": "withdraw", "type": "function", + "name": "withdraw", "inputs": [ { "name": "amount", @@ -330,14 +330,18 @@ { "name": "receiver", "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "max_slippage_bps", + "type": "core::integer::u32" } ], "outputs": [], "state_mutability": "external" }, { - "name": "rebalance", "type": "function", + "name": "rebalance", "inputs": [ { "name": "amount", @@ -352,8 +356,8 @@ "state_mutability": "external" }, { - "name": "describe_position", "type": "function", + "name": "describe_position", "inputs": [ { "name": "token_id", @@ -368,8 +372,19 @@ "state_mutability": "view" }, { - "name": "config", "type": "function", + "name": "get_all_shares", + "inputs": [], + "outputs": [ + { + "type": "strkfarm::interfaces::ERC721Strategy::Position" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "config", "inputs": [], "outputs": [ { @@ -379,8 +394,8 @@ "state_mutability": "view" }, { - "name": "get_settings", "type": "function", + "name": "get_settings", "inputs": [], "outputs": [ { @@ -390,8 +405,8 @@ "state_mutability": "view" }, { - "name": "set_settings", "type": "function", + "name": "set_settings", "inputs": [ { "name": "settings", @@ -402,8 +417,8 @@ "state_mutability": "external" }, { - "name": "health_factors", "type": "function", + "name": "health_factors", "inputs": [], "outputs": [ { @@ -415,13 +430,13 @@ ] }, { - "name": "ERC721MixinImpl", "type": "impl", + "name": "ERC721MixinImpl", "interface_name": "openzeppelin::token::erc721::interface::ERC721ABI" }, { - "name": "core::byte_array::ByteArray", "type": "struct", + "name": "core::byte_array::ByteArray", "members": [ { "name": "data", @@ -438,12 +453,12 @@ ] }, { - "name": "openzeppelin::token::erc721::interface::ERC721ABI", "type": "interface", + "name": "openzeppelin::token::erc721::interface::ERC721ABI", "items": [ { - "name": "balance_of", "type": "function", + "name": "balance_of", "inputs": [ { "name": "account", @@ -458,8 +473,8 @@ "state_mutability": "view" }, { - "name": "owner_of", "type": "function", + "name": "owner_of", "inputs": [ { "name": "token_id", @@ -474,8 +489,8 @@ "state_mutability": "view" }, { - "name": "safe_transfer_from", "type": "function", + "name": "safe_transfer_from", "inputs": [ { "name": "from", @@ -498,8 +513,8 @@ "state_mutability": "external" }, { - "name": "transfer_from", "type": "function", + "name": "transfer_from", "inputs": [ { "name": "from", @@ -518,8 +533,8 @@ "state_mutability": "external" }, { - "name": "approve", "type": "function", + "name": "approve", "inputs": [ { "name": "to", @@ -534,8 +549,8 @@ "state_mutability": "external" }, { - "name": "set_approval_for_all", "type": "function", + "name": "set_approval_for_all", "inputs": [ { "name": "operator", @@ -550,8 +565,8 @@ "state_mutability": "external" }, { - "name": "get_approved", "type": "function", + "name": "get_approved", "inputs": [ { "name": "token_id", @@ -566,8 +581,8 @@ "state_mutability": "view" }, { - "name": "is_approved_for_all", "type": "function", + "name": "is_approved_for_all", "inputs": [ { "name": "owner", @@ -586,8 +601,8 @@ "state_mutability": "view" }, { - "name": "supports_interface", "type": "function", + "name": "supports_interface", "inputs": [ { "name": "interface_id", @@ -602,8 +617,8 @@ "state_mutability": "view" }, { - "name": "name", "type": "function", + "name": "name", "inputs": [], "outputs": [ { @@ -613,8 +628,8 @@ "state_mutability": "view" }, { - "name": "symbol", "type": "function", + "name": "symbol", "inputs": [], "outputs": [ { @@ -624,8 +639,8 @@ "state_mutability": "view" }, { - "name": "token_uri", "type": "function", + "name": "token_uri", "inputs": [ { "name": "token_id", @@ -640,8 +655,8 @@ "state_mutability": "view" }, { - "name": "balanceOf", "type": "function", + "name": "balanceOf", "inputs": [ { "name": "account", @@ -656,8 +671,8 @@ "state_mutability": "view" }, { - "name": "ownerOf", "type": "function", + "name": "ownerOf", "inputs": [ { "name": "tokenId", @@ -672,8 +687,8 @@ "state_mutability": "view" }, { - "name": "safeTransferFrom", "type": "function", + "name": "safeTransferFrom", "inputs": [ { "name": "from", @@ -696,8 +711,8 @@ "state_mutability": "external" }, { - "name": "transferFrom", "type": "function", + "name": "transferFrom", "inputs": [ { "name": "from", @@ -716,8 +731,8 @@ "state_mutability": "external" }, { - "name": "setApprovalForAll", "type": "function", + "name": "setApprovalForAll", "inputs": [ { "name": "operator", @@ -732,8 +747,8 @@ "state_mutability": "external" }, { - "name": "getApproved", "type": "function", + "name": "getApproved", "inputs": [ { "name": "tokenId", @@ -748,8 +763,8 @@ "state_mutability": "view" }, { - "name": "isApprovedForAll", "type": "function", + "name": "isApprovedForAll", "inputs": [ { "name": "owner", @@ -768,8 +783,8 @@ "state_mutability": "view" }, { - "name": "tokenURI", "type": "function", + "name": "tokenURI", "inputs": [ { "name": "tokenId", @@ -786,17 +801,142 @@ ] }, { - "name": "CommonCompImpl", "type": "impl", + "name": "RewardShareImpl", + "interface_name": "strkfarm::components::harvester::reward_shares::IRewardShare" + }, + { + "type": "struct", + "name": "strkfarm::components::harvester::reward_shares::UserRewardsInfo", + "members": [ + { + "name": "pending_round_points", + "type": "core::integer::u256" + }, + { + "name": "shares_owned", + "type": "core::integer::u256" + }, + { + "name": "block_number", + "type": "core::integer::u64" + }, + { + "name": "index", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "strkfarm::components::harvester::reward_shares::RewardsInfo", + "members": [ + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "shares", + "type": "core::integer::u256" + }, + { + "name": "total_round_points", + "type": "core::integer::u256" + }, + { + "name": "block_number", + "type": "core::integer::u64" + } + ] + }, + { + "type": "interface", + "name": "strkfarm::components::harvester::reward_shares::IRewardShare", + "items": [ + { + "type": "function", + "name": "get_user_reward_info", + "inputs": [ + { + "name": "user", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "strkfarm::components::harvester::reward_shares::UserRewardsInfo" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_rewards_info", + "inputs": [ + { + "name": "index", + "type": "core::integer::u32" + } + ], + "outputs": [ + { + "type": "strkfarm::components::harvester::reward_shares::RewardsInfo" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_total_rewards", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_total_unminted_shares", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_additional_shares", + "inputs": [ + { + "name": "user", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "(core::integer::u256, core::integer::u64, core::integer::u256)" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "CommonCompImpl", "interface_name": "strkfarm::interfaces::common::ICommon" }, { - "name": "strkfarm::interfaces::common::ICommon", "type": "interface", + "name": "strkfarm::interfaces::common::ICommon", "items": [ { - "name": "upgrade", "type": "function", + "name": "upgrade", "inputs": [ { "name": "new_class", @@ -807,22 +947,22 @@ "state_mutability": "external" }, { - "name": "pause", "type": "function", + "name": "pause", "inputs": [], "outputs": [], "state_mutability": "external" }, { - "name": "unpause", "type": "function", + "name": "unpause", "inputs": [], "outputs": [], "state_mutability": "external" }, { - "name": "is_paused", "type": "function", + "name": "is_paused", "inputs": [], "outputs": [ { @@ -832,8 +972,8 @@ "state_mutability": "view" }, { - "name": "owner", "type": "function", + "name": "owner", "inputs": [], "outputs": [ { @@ -843,8 +983,8 @@ "state_mutability": "view" }, { - "name": "transfer_ownership", "type": "function", + "name": "transfer_ownership", "inputs": [ { "name": "new_owner", @@ -855,8 +995,8 @@ "state_mutability": "external" }, { - "name": "renounce_ownership", "type": "function", + "name": "renounce_ownership", "inputs": [], "outputs": [], "state_mutability": "external" @@ -864,8 +1004,8 @@ ] }, { - "name": "strkfarm::interfaces::zkLend::IZkLendMarketDispatcher", "type": "struct", + "name": "strkfarm::interfaces::zkLend::IZkLendMarketDispatcher", "members": [ { "name": "contract_address", @@ -874,8 +1014,8 @@ ] }, { - "name": "strkfarm::interfaces::oracle::IPriceOracleDispatcher", "type": "struct", + "name": "strkfarm::interfaces::oracle::IPriceOracleDispatcher", "members": [ { "name": "contract_address", @@ -884,8 +1024,8 @@ ] }, { - "name": "strkfarm::components::zkLend::zkLendStruct", "type": "struct", + "name": "strkfarm::components::zkLend::zkLendStruct", "members": [ { "name": "zkLendRouter", @@ -898,8 +1038,8 @@ ] }, { - "name": "strkfarm::components::nostra::nostraStruct", "type": "struct", + "name": "strkfarm::components::nostra::nostraStruct", "members": [ { "name": "nostraInterestBearing", @@ -920,8 +1060,8 @@ ] }, { - "name": "strkfarm::interfaces::nostra::INostraRouterDispatcher", "type": "struct", + "name": "strkfarm::interfaces::nostra::INostraRouterDispatcher", "members": [ { "name": "contract_address", @@ -930,8 +1070,8 @@ ] }, { - "name": "strkfarm::components::nostraSwap::NostraSwapStruct", "type": "struct", + "name": "strkfarm::components::nostraSwap::NostraSwapStruct", "members": [ { "name": "router", @@ -944,8 +1084,8 @@ ] }, { - "name": "constructor", "type": "constructor", + "name": "constructor", "inputs": [ { "name": "name", @@ -1002,373 +1142,449 @@ ] }, { - "kind": "struct", - "name": "openzeppelin::token::erc721::erc721::ERC721Component::Transfer", "type": "event", + "name": "openzeppelin::token::erc721::erc721::ERC721Component::Transfer", + "kind": "struct", "members": [ { - "kind": "key", "name": "from", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "to", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "token_id", - "type": "core::integer::u256" + "type": "core::integer::u256", + "kind": "key" } ] }, { - "kind": "struct", - "name": "openzeppelin::token::erc721::erc721::ERC721Component::Approval", "type": "event", + "name": "openzeppelin::token::erc721::erc721::ERC721Component::Approval", + "kind": "struct", "members": [ { - "kind": "key", "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "approved", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "token_id", - "type": "core::integer::u256" + "type": "core::integer::u256", + "kind": "key" } ] }, { - "kind": "struct", - "name": "openzeppelin::token::erc721::erc721::ERC721Component::ApprovalForAll", "type": "event", + "name": "openzeppelin::token::erc721::erc721::ERC721Component::ApprovalForAll", + "kind": "struct", "members": [ { - "kind": "key", "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "operator", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "data", "name": "approved", - "type": "core::bool" + "type": "core::bool", + "kind": "data" } ] }, { - "kind": "enum", - "name": "openzeppelin::token::erc721::erc721::ERC721Component::Event", "type": "event", + "name": "openzeppelin::token::erc721::erc721::ERC721Component::Event", + "kind": "enum", "variants": [ { - "kind": "nested", "name": "Transfer", - "type": "openzeppelin::token::erc721::erc721::ERC721Component::Transfer" + "type": "openzeppelin::token::erc721::erc721::ERC721Component::Transfer", + "kind": "nested" }, { - "kind": "nested", "name": "Approval", - "type": "openzeppelin::token::erc721::erc721::ERC721Component::Approval" + "type": "openzeppelin::token::erc721::erc721::ERC721Component::Approval", + "kind": "nested" }, { - "kind": "nested", "name": "ApprovalForAll", - "type": "openzeppelin::token::erc721::erc721::ERC721Component::ApprovalForAll" + "type": "openzeppelin::token::erc721::erc721::ERC721Component::ApprovalForAll", + "kind": "nested" } ] }, { - "kind": "enum", - "name": "openzeppelin::introspection::src5::SRC5Component::Event", "type": "event", + "name": "openzeppelin::introspection::src5::SRC5Component::Event", + "kind": "enum", "variants": [] }, { - "kind": "struct", - "name": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded", "type": "event", + "name": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded", + "kind": "struct", "members": [ { - "kind": "data", "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" } ] }, { - "kind": "enum", - "name": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event", "type": "event", + "name": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event", + "kind": "enum", "variants": [ { - "kind": "nested", "name": "Upgraded", - "type": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded" + "type": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded", + "kind": "nested" } ] }, { - "kind": "struct", - "name": "openzeppelin::security::pausable::PausableComponent::Paused", "type": "event", + "name": "openzeppelin::security::pausable::PausableComponent::Paused", + "kind": "struct", "members": [ { - "kind": "data", "name": "account", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" } ] }, { - "kind": "struct", - "name": "openzeppelin::security::pausable::PausableComponent::Unpaused", "type": "event", + "name": "openzeppelin::security::pausable::PausableComponent::Unpaused", + "kind": "struct", "members": [ { - "kind": "data", "name": "account", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" } ] }, { - "kind": "enum", - "name": "openzeppelin::security::pausable::PausableComponent::Event", "type": "event", + "name": "openzeppelin::security::pausable::PausableComponent::Event", + "kind": "enum", "variants": [ { - "kind": "nested", "name": "Paused", - "type": "openzeppelin::security::pausable::PausableComponent::Paused" + "type": "openzeppelin::security::pausable::PausableComponent::Paused", + "kind": "nested" }, { - "kind": "nested", "name": "Unpaused", - "type": "openzeppelin::security::pausable::PausableComponent::Unpaused" + "type": "openzeppelin::security::pausable::PausableComponent::Unpaused", + "kind": "nested" } ] }, { - "kind": "enum", - "name": "openzeppelin::security::reentrancyguard::ReentrancyGuardComponent::Event", "type": "event", + "name": "openzeppelin::security::reentrancyguard::ReentrancyGuardComponent::Event", + "kind": "enum", "variants": [] }, { - "kind": "struct", - "name": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred", "type": "event", + "name": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred", + "kind": "struct", "members": [ { - "kind": "key", "name": "previous_owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "new_owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" } ] }, { - "kind": "struct", - "name": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", "type": "event", + "name": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", + "kind": "struct", "members": [ { - "kind": "key", "name": "previous_owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "new_owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" } ] }, { - "kind": "enum", - "name": "openzeppelin::access::ownable::ownable::OwnableComponent::Event", "type": "event", + "name": "openzeppelin::access::ownable::ownable::OwnableComponent::Event", + "kind": "enum", "variants": [ { - "kind": "nested", "name": "OwnershipTransferred", - "type": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred" + "type": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferred", + "kind": "nested" }, { - "kind": "nested", "name": "OwnershipTransferStarted", - "type": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted" + "type": "openzeppelin::access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", + "kind": "nested" } ] }, { - "kind": "enum", - "name": "strkfarm::components::common::CommonComp::Event", "type": "event", + "name": "strkfarm::components::common::CommonComp::Event", + "kind": "enum", "variants": [] }, { + "type": "event", + "name": "strkfarm::components::harvester::reward_shares::RewardShareComponent::Rewards", "kind": "struct", - "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Deposit", + "members": [ + { + "name": "index", + "type": "core::integer::u32", + "kind": "data" + }, + { + "name": "info", + "type": "strkfarm::components::harvester::reward_shares::RewardsInfo", + "kind": "data" + }, + { + "name": "total_reward_shares", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "strkfarm::components::harvester::reward_shares::RewardShareComponent::UserRewards", + "kind": "struct", + "members": [ + { + "name": "user", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "info", + "type": "strkfarm::components::harvester::reward_shares::UserRewardsInfo", + "kind": "data" + }, + { + "name": "total_reward_shares", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "strkfarm::components::harvester::reward_shares::RewardShareComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "Rewards", + "type": "strkfarm::components::harvester::reward_shares::RewardShareComponent::Rewards", + "kind": "nested" + }, + { + "name": "UserRewards", + "type": "strkfarm::components::harvester::reward_shares::RewardShareComponent::UserRewards", + "kind": "nested" + } + ] + }, + { "type": "event", + "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Deposit", + "kind": "struct", "members": [ { - "kind": "key", "name": "sender", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "data", "name": "assets", - "type": "core::integer::u256" + "type": "core::integer::u256", + "kind": "data" }, { - "kind": "data", "name": "net_position", - "type": "strkfarm::interfaces::ERC721Strategy::Position" + "type": "strkfarm::interfaces::ERC721Strategy::Position", + "kind": "data" } ] }, { - "kind": "struct", - "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Withdraw", "type": "event", + "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Withdraw", + "kind": "struct", "members": [ { - "kind": "key", "name": "sender", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "receiver", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "key", "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "data", "name": "assets", - "type": "core::integer::u256" + "type": "core::integer::u256", + "kind": "data" }, { - "kind": "data", "name": "net_position", - "type": "strkfarm::interfaces::ERC721Strategy::Position" + "type": "strkfarm::interfaces::ERC721Strategy::Position", + "kind": "data" } ] }, { - "kind": "struct", - "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Rebalance", "type": "event", + "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Rebalance", + "kind": "struct", "members": [ { - "kind": "key", "name": "caller", - "type": "core::starknet::contract_address::ContractAddress" + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" }, { - "kind": "data", "name": "amount", - "type": "core::integer::u256" + "type": "core::integer::u256", + "kind": "data" }, { - "kind": "data", "name": "shouldRepay", - "type": "core::bool" + "type": "core::bool", + "kind": "data" }, { - "kind": "data", "name": "hf1", - "type": "core::integer::u32" + "type": "core::integer::u32", + "kind": "data" }, { - "kind": "data", "name": "hf2", - "type": "core::integer::u32" + "type": "core::integer::u32", + "kind": "data" } ] }, { - "kind": "enum", - "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Event", "type": "event", + "name": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Event", + "kind": "enum", "variants": [ { - "kind": "flat", "name": "ERC721Event", - "type": "openzeppelin::token::erc721::erc721::ERC721Component::Event" + "type": "openzeppelin::token::erc721::erc721::ERC721Component::Event", + "kind": "flat" }, { - "kind": "flat", "name": "SRC5Event", - "type": "openzeppelin::introspection::src5::SRC5Component::Event" + "type": "openzeppelin::introspection::src5::SRC5Component::Event", + "kind": "flat" }, { - "kind": "flat", "name": "UpgradeableEvent", - "type": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event" + "type": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event", + "kind": "flat" }, { - "kind": "flat", "name": "PausableEvent", - "type": "openzeppelin::security::pausable::PausableComponent::Event" + "type": "openzeppelin::security::pausable::PausableComponent::Event", + "kind": "flat" }, { - "kind": "flat", "name": "ReentrancyGuardEvent", - "type": "openzeppelin::security::reentrancyguard::ReentrancyGuardComponent::Event" + "type": "openzeppelin::security::reentrancyguard::ReentrancyGuardComponent::Event", + "kind": "flat" }, { - "kind": "flat", "name": "OwnableEvent", - "type": "openzeppelin::access::ownable::ownable::OwnableComponent::Event" + "type": "openzeppelin::access::ownable::ownable::OwnableComponent::Event", + "kind": "flat" }, { - "kind": "flat", "name": "CommonCompEvent", - "type": "strkfarm::components::common::CommonComp::Event" + "type": "strkfarm::components::common::CommonComp::Event", + "kind": "flat" + }, + { + "name": "RewardShareEvent", + "type": "strkfarm::components::harvester::reward_shares::RewardShareComponent::Event", + "kind": "flat" }, { - "kind": "nested", "name": "Deposit", - "type": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Deposit" + "type": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Deposit", + "kind": "nested" }, { - "kind": "nested", "name": "Withdraw", - "type": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Withdraw" + "type": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Withdraw", + "kind": "nested" }, { - "kind": "nested", "name": "Rebalance", - "type": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Rebalance" + "type": "strkfarm::strats::delta_neutral_looping::DeltaNeutralLooping::Rebalance", + "kind": "nested" } ] } -] +] \ No newline at end of file diff --git a/src/components/Deposit.tsx b/src/components/Deposit.tsx index e4bc57d0..a318098a 100755 --- a/src/components/Deposit.tsx +++ b/src/components/Deposit.tsx @@ -331,7 +331,7 @@ export default function Deposit(props: DepositProps) { {!tvlInfo || !tvlInfo?.data ? ( ) : ( - Number(tvlInfo.data?.amount.toFixedStr(0)).toLocaleString() + Number(tvlInfo.data?.amount.toFixedStr(2)).toLocaleString() )} {' / '} {props.strategy.settings.maxTVL.toLocaleString()}{' '} diff --git a/src/constants.ts b/src/constants.ts index b9c6b078..cbebc8bd 100755 --- a/src/constants.ts +++ b/src/constants.ts @@ -55,7 +55,7 @@ const CONSTANTS = { DeltaNeutralMMSTRKETH: '0x20d5fc4c9df4f943ebb36078e703369c04176ed00accf290e8295b659d2cea6', DeltaNeutralMMETHUSDC: - '0x04937b58e05a3a2477402d1f74e66686f58a61a5070fcc6f694fb9a0b3bae422', + '0x9d23d9b1fa0db8c9d75a1df924c3820e594fc4ab1475695889286f3f6df250', }, MOBILE_MSG: 'Desktop/Tablet only', }; @@ -94,6 +94,17 @@ export const TOKENS: TokenInfo[] = [ stepAmount: MyNumber.fromEther('10', 18), isERC4626: false, }, + { + token: '0x1b5bd713e72fdc5d63ffd83762f81297f6175a5e0a4771cdadbc1dd5fe72cb1', + name: 'zETH', + decimals: 18, + displayDecimals: 2, + logo: CONSTANTS.LOGOS.ETH, + minAmount: MyNumber.fromEther('0.001', 18), + maxAmount: MyNumber.fromEther('10000', 18), + stepAmount: MyNumber.fromEther('0.0001', 18), + isERC4626: false, + }, { token: CONSTANTS.CONTRACTS.AutoStrkFarm, name: 'frmzSTRK', diff --git a/src/store/strategies.atoms.ts b/src/store/strategies.atoms.ts index 8f712fdf..21c1774d 100755 --- a/src/store/strategies.atoms.ts +++ b/src/store/strategies.atoms.ts @@ -62,7 +62,7 @@ export function getStrategies() { [1, 0.609886, 1, 0.920975, 0.510078], // precomputed factors based on strategy math StrategyLiveStatus.NEW, { - maxTVL: 20, + maxTVL: 100, }, ); const deltaNeutralMMSTRKETH = new DeltaNeutralMM( diff --git a/src/strategies/delta_neutral_mm.ts b/src/strategies/delta_neutral_mm.ts index 4dcd46ed..2b9b490f 100755 --- a/src/strategies/delta_neutral_mm.ts +++ b/src/strategies/delta_neutral_mm.ts @@ -375,6 +375,7 @@ export class DeltaNeutralMM extends IStrategy { const call = strategyContract.populate('withdraw', [ uint256.bnToUint256(amount.toString()), address, + 500, // 5% max slippage ]); const calls: Call[] = [call]; From ec3919e7d0fedb83adea28f21f7c3a31abf316d2 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Thu, 5 Sep 2024 17:45:40 +0530 Subject: [PATCH 3/3] build fix --- next.config.mjs | 6 +++--- src/abi/deltraNeutral.abi.json | 2 +- src/components/Strategies.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 0c0fa0a5..c7615d24 100755 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,9 +2,9 @@ const nextConfig = { // output: 'export', compiler: { - // removeConsole: { - // exclude: ['error'], - // }, + removeConsole: { + exclude: ['error'], + }, }, async rewrites() { return [ diff --git a/src/abi/deltraNeutral.abi.json b/src/abi/deltraNeutral.abi.json index e742e0c1..3d889c7e 100755 --- a/src/abi/deltraNeutral.abi.json +++ b/src/abi/deltraNeutral.abi.json @@ -1587,4 +1587,4 @@ } ] } -] \ No newline at end of file +] diff --git a/src/components/Strategies.tsx b/src/components/Strategies.tsx index f7129358..b215f901 100755 --- a/src/components/Strategies.tsx +++ b/src/components/Strategies.tsx @@ -353,7 +353,7 @@ export default function Strategies() { )} {!strat.isLive() && -} - {getStrategyWiseInfo(strat.id) !== 0 && strat.isLive() && ( + {strat.isLive() && (