From 7d9d870fd6bb64ce20bb6a35b7c6b936bb4d4b41 Mon Sep 17 00:00:00 2001 From: immasandwich Date: Wed, 22 Jun 2022 08:40:47 -0400 Subject: [PATCH] feat(arrakis): Extract Gelato from Zapper API, rename to Arrakis, and support Polygon/Ethereum (#713) --- .../aelin.farm.contract-position-fetcher.ts | 3 +- src/apps/arrakis/arrakis.definition.ts | 43 + src/apps/arrakis/arrakis.module.ts | 33 + .../contracts/abis/arrakis-gelato-pool.json | 515 ++++++ .../arrakis/contracts/abis/arrakis-pool.json | 1127 +++++++++++++ .../contracts/ethers/ArrakisGelatoPool.ts | 1402 +++++++++++++++++ .../arrakis/contracts/ethers/ArrakisPool.ts | 1364 ++++++++++++++++ src/apps/arrakis/contracts/ethers/common.ts | 30 + .../factories/ArrakisGelatoPool__factory.ts | 1168 ++++++++++++++ .../ethers/factories/ArrakisPool__factory.ts | 1145 ++++++++++++++ .../contracts/ethers/factories/index.ts | 5 + src/apps/arrakis/contracts/ethers/index.ts | 8 + src/apps/arrakis/contracts/index.ts | 28 + .../ethereum/arrakis.balance-fetcher.ts | 36 + .../ethereum/arrakis.pool.token-fetcher.ts | 25 + .../helpers/arrakis.pool.token-helper.ts | 143 ++ .../optimism/arrakis.balance-fetcher.ts | 36 + .../optimism/arrakis.pool.token-fetcher.ts | 25 + .../polygon/arrakis.balance-fetcher.ts | 36 + .../polygon/arrakis.pool.token-fetcher.ts | 25 + ...valon.staking.contract-position-fetcher.ts | 3 +- .../thales.pool2.contract-position-fetcher.ts | 8 +- 22 files changed, 7205 insertions(+), 3 deletions(-) create mode 100644 src/apps/arrakis/arrakis.definition.ts create mode 100644 src/apps/arrakis/arrakis.module.ts create mode 100644 src/apps/arrakis/contracts/abis/arrakis-gelato-pool.json create mode 100644 src/apps/arrakis/contracts/abis/arrakis-pool.json create mode 100644 src/apps/arrakis/contracts/ethers/ArrakisGelatoPool.ts create mode 100644 src/apps/arrakis/contracts/ethers/ArrakisPool.ts create mode 100644 src/apps/arrakis/contracts/ethers/common.ts create mode 100644 src/apps/arrakis/contracts/ethers/factories/ArrakisGelatoPool__factory.ts create mode 100644 src/apps/arrakis/contracts/ethers/factories/ArrakisPool__factory.ts create mode 100644 src/apps/arrakis/contracts/ethers/factories/index.ts create mode 100644 src/apps/arrakis/contracts/ethers/index.ts create mode 100644 src/apps/arrakis/contracts/index.ts create mode 100644 src/apps/arrakis/ethereum/arrakis.balance-fetcher.ts create mode 100644 src/apps/arrakis/ethereum/arrakis.pool.token-fetcher.ts create mode 100644 src/apps/arrakis/helpers/arrakis.pool.token-helper.ts create mode 100644 src/apps/arrakis/optimism/arrakis.balance-fetcher.ts create mode 100644 src/apps/arrakis/optimism/arrakis.pool.token-fetcher.ts create mode 100644 src/apps/arrakis/polygon/arrakis.balance-fetcher.ts create mode 100644 src/apps/arrakis/polygon/arrakis.pool.token-fetcher.ts diff --git a/src/apps/aelin/optimism/aelin.farm.contract-position-fetcher.ts b/src/apps/aelin/optimism/aelin.farm.contract-position-fetcher.ts index 163a83851..c7682a80d 100644 --- a/src/apps/aelin/optimism/aelin.farm.contract-position-fetcher.ts +++ b/src/apps/aelin/optimism/aelin.farm.contract-position-fetcher.ts @@ -1,6 +1,7 @@ import { Inject } from '@nestjs/common'; import { Register } from '~app-toolkit/decorators'; +import { ARRAKIS_DEFINITION } from '~apps/arrakis/arrakis.definition'; import { SynthetixSingleStakingFarmContractPositionHelper } from '~apps/synthetix/helpers/synthetix.single-staking-farm-contract-position-helper'; import { PositionFetcher } from '~position/position-fetcher.interface'; import { ContractPosition } from '~position/position.interface'; @@ -37,7 +38,7 @@ export class OptimismAelinFarmContractPositionFetcher implements PositionFetcher appId, groupId, network, - dependencies: [{ appId: 'sorbet', groupIds: ['pool'], network }], + dependencies: [{ appId: ARRAKIS_DEFINITION.id, groupIds: [ARRAKIS_DEFINITION.groups.pool.id], network }], farmDefinitions: FARMS, }); } diff --git a/src/apps/arrakis/arrakis.definition.ts b/src/apps/arrakis/arrakis.definition.ts new file mode 100644 index 000000000..79b27df6a --- /dev/null +++ b/src/apps/arrakis/arrakis.definition.ts @@ -0,0 +1,43 @@ +import { Register } from '~app-toolkit/decorators'; +import { AppDefinition, appDefinition } from '~app/app.definition'; +import { AppAction, AppTag, GroupType } from '~app/app.interface'; +import { Network } from '~types/network.interface'; + +export const ARRAKIS_DEFINITION = appDefinition({ + id: 'arrakis', + name: 'Arrakis Finance', + description: `Arrakis is a protocol that specializes in concentrated & active management. By creating a curated strategies.`, + url: 'https://arrakis.finance/', + + groups: { + pool: { + id: 'pool', + type: GroupType.TOKEN, + label: 'Pools', + }, + }, + + tags: [AppTag.LIQUIDITY_POOL], + keywords: [], + + links: { + discord: 'https://discord.gg/arrakisfinance', + github: 'https://github.com/arrakisfinance', + medium: 'https://medium.com/arrakis-finance', + telegram: 'https://t.me/arrakisfinance', + twitter: 'https://twitter.com/ArrakisFinance', + }, + + supportedNetworks: { + [Network.ETHEREUM_MAINNET]: [AppAction.VIEW], + [Network.OPTIMISM_MAINNET]: [AppAction.VIEW], + [Network.POLYGON_MAINNET]: [AppAction.VIEW], + }, +}); + +@Register.AppDefinition(ARRAKIS_DEFINITION.id) +export class ArrakisAppDefinition extends AppDefinition { + constructor() { + super(ARRAKIS_DEFINITION); + } +} diff --git a/src/apps/arrakis/arrakis.module.ts b/src/apps/arrakis/arrakis.module.ts new file mode 100644 index 000000000..54f2b6b9a --- /dev/null +++ b/src/apps/arrakis/arrakis.module.ts @@ -0,0 +1,33 @@ +import { Register } from '~app-toolkit/decorators'; +import { AbstractApp } from '~app/app.dynamic-module'; +import { UniswapV2AppModule } from '~apps/uniswap-v2'; + +import { ArrakisAppDefinition, ARRAKIS_DEFINITION } from './arrakis.definition'; +import { ArrakisContractFactory } from './contracts'; +import { EthereumArrakisBalanceFetcher } from './ethereum/arrakis.balance-fetcher'; +import { EthereumArrakisPoolTokenFetcher } from './ethereum/arrakis.pool.token-fetcher'; +import { ArrakisPoolTokenHelper } from './helpers/arrakis.pool.token-helper'; +import { OptimismArrakisBalanceFetcher } from './optimism/arrakis.balance-fetcher'; +import { OptimismArrakisPoolTokenFetcher } from './optimism/arrakis.pool.token-fetcher'; +import { PolygonArrakisBalanceFetcher } from './polygon/arrakis.balance-fetcher'; +import { PolygonArrakisPoolTokenFetcher } from './polygon/arrakis.pool.token-fetcher'; + +@Register.AppModule({ + appId: ARRAKIS_DEFINITION.id, + imports: [UniswapV2AppModule], + providers: [ + ArrakisAppDefinition, + ArrakisContractFactory, + ArrakisPoolTokenHelper, + // Ethereum + EthereumArrakisPoolTokenFetcher, + EthereumArrakisBalanceFetcher, + // Optimism + OptimismArrakisPoolTokenFetcher, + OptimismArrakisBalanceFetcher, + // Polygon + PolygonArrakisPoolTokenFetcher, + PolygonArrakisBalanceFetcher, + ], +}) +export class ArrakisAppModule extends AbstractApp() {} diff --git a/src/apps/arrakis/contracts/abis/arrakis-gelato-pool.json b/src/apps/arrakis/contracts/abis/arrakis-gelato-pool.json new file mode 100644 index 000000000..91a6d73c2 --- /dev/null +++ b/src/apps/arrakis/contracts/abis/arrakis-gelato-pool.json @@ -0,0 +1,515 @@ +[ + { + "inputs": [{ "internalType": "address payable", "name": "_gelato", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "burnAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "amount0Out", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "amount1Out", "type": "uint256" }, + { "indexed": false, "internalType": "uint128", "name": "liquidityBurned", "type": "uint128" } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "feesEarned0", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "feesEarned1", "type": "uint256" } + ], + "name": "FeesEarned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "mintAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "amount0In", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "amount1In", "type": "uint256" }, + { "indexed": false, "internalType": "uint128", "name": "liquidityMinted", "type": "uint128" } + ], + "name": "Minted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousManager", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newManager", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "int24", "name": "lowerTick_", "type": "int24" }, + { "indexed": false, "internalType": "int24", "name": "upperTick_", "type": "int24" }, + { "indexed": false, "internalType": "uint128", "name": "liquidityBefore", "type": "uint128" }, + { "indexed": false, "internalType": "uint128", "name": "liquidityAfter", "type": "uint128" } + ], + "name": "Rebalance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint16", "name": "managerFee", "type": "uint16" }], + "name": "SetManagerFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAdminTreasury", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAdminTreasury", "type": "address" } + ], + "name": "UpdateAdminTreasury", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "gelatoRebalanceBPS", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "gelatoWithdrawBPS", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "gelatoSlippageBPS", "type": "uint16" }, + { "indexed": false, "internalType": "uint32", "name": "gelatoSlippageInterval", "type": "uint32" } + ], + "name": "UpdateGelatoParams", + "type": "event" + }, + { + "inputs": [], + "name": "GELATO", + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "burnAmount", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" } + ], + "name": "burn", + "outputs": [ + { "internalType": "uint256", "name": "amount0", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1", "type": "uint256" }, + { "internalType": "uint128", "name": "liquidityBurned", "type": "uint128" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "int24", "name": "newLowerTick", "type": "int24" }, + { "internalType": "int24", "name": "newUpperTick", "type": "int24" }, + { "internalType": "uint160", "name": "swapThresholdPrice", "type": "uint160" }, + { "internalType": "uint256", "name": "swapAmountBPS", "type": "uint256" }, + { "internalType": "bool", "name": "zeroForOne", "type": "bool" } + ], + "name": "executiveRebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoBalance0", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoBalance1", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoFeeBPS", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoRebalanceBPS", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoSlippageBPS", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoSlippageInterval", + "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoWithdrawBPS", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount0Max", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1Max", "type": "uint256" } + ], + "name": "getMintAmounts", + "outputs": [ + { "internalType": "uint256", "name": "amount0", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1", "type": "uint256" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPositionID", + "outputs": [{ "internalType": "bytes32", "name": "positionID", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUnderlyingBalances", + "outputs": [ + { "internalType": "uint256", "name": "amount0Current", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1Current", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint160", "name": "sqrtRatioX96", "type": "uint160" }], + "name": "getUnderlyingBalancesAtPrice", + "outputs": [ + { "internalType": "uint256", "name": "amount0Current", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1Current", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "_name", "type": "string" }, + { "internalType": "string", "name": "_symbol", "type": "string" }, + { "internalType": "address", "name": "_pool", "type": "address" }, + { "internalType": "uint16", "name": "_managerFeeBPS", "type": "uint16" }, + { "internalType": "int24", "name": "_lowerTick", "type": "int24" }, + { "internalType": "int24", "name": "_upperTick", "type": "int24" }, + { "internalType": "address", "name": "_manager_", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_managerFeeBPS", "type": "uint16" }], + "name": "initializeManagerFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lowerTick", + "outputs": [{ "internalType": "int24", "name": "", "type": "int24" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerBalance0", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerBalance1", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerFeeBPS", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerTreasury", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" } + ], + "name": "mint", + "outputs": [ + { "internalType": "uint256", "name": "amount0", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1", "type": "uint256" }, + { "internalType": "uint128", "name": "liquidityMinted", "type": "uint128" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [{ "internalType": "contract IUniswapV3Pool", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint160", "name": "swapThresholdPrice", "type": "uint160" }, + { "internalType": "uint256", "name": "swapAmountBPS", "type": "uint256" }, + { "internalType": "bool", "name": "zeroForOne", "type": "bool" }, + { "internalType": "uint256", "name": "feeAmount", "type": "uint256" }, + { "internalType": "address", "name": "paymentToken", "type": "address" } + ], + "name": "rebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token0", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token1", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount0Owed", "type": "uint256" }, + { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "uniswapV3MintCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "int256", "name": "amount0Delta", "type": "int256" }, + { "internalType": "int256", "name": "amount1Delta", "type": "int256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "uniswapV3SwapCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "newRebalanceBPS", "type": "uint16" }, + { "internalType": "uint16", "name": "newWithdrawBPS", "type": "uint16" }, + { "internalType": "uint16", "name": "newSlippageBPS", "type": "uint16" }, + { "internalType": "uint32", "name": "newSlippageInterval", "type": "uint32" }, + { "internalType": "address", "name": "newTreasury", "type": "address" } + ], + "name": "updateGelatoParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "upperTick", + "outputs": [{ "internalType": "int24", "name": "", "type": "int24" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "feeAmount", "type": "uint256" }, + { "internalType": "address", "name": "feeToken", "type": "address" } + ], + "name": "withdrawGelatoBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "feeAmount", "type": "uint256" }, + { "internalType": "address", "name": "feeToken", "type": "address" } + ], + "name": "withdrawManagerBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/arrakis/contracts/abis/arrakis-pool.json b/src/apps/arrakis/contracts/abis/arrakis-pool.json new file mode 100644 index 000000000..fdb83f042 --- /dev/null +++ b/src/apps/arrakis/contracts/abis/arrakis-pool.json @@ -0,0 +1,1127 @@ +[ + { + "inputs": [ + { + "internalType": "address payable", + "name": "_gelato", + "type": "address" + }, + { + "internalType": "address", + "name": "_arrakisTreasury", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "burnAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidityBurned", + "type": "uint128" + } + ], + "name": "Burned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "feesEarned0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feesEarned1", + "type": "uint256" + } + ], + "name": "FeesEarned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidityMinted", + "type": "uint128" + } + ], + "name": "Minted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newManager", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "int24", + "name": "lowerTick_", + "type": "int24" + }, + { + "indexed": false, + "internalType": "int24", + "name": "upperTick_", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidityBefore", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidityAfter", + "type": "uint128" + } + ], + "name": "Rebalance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "managerFeeBPS", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "address", + "name": "managerTreasury", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "gelatoRebalanceBPS", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "gelatoSlippageBPS", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gelatoSlippageInterval", + "type": "uint32" + } + ], + "name": "UpdateManagerParams", + "type": "event" + }, + { + "inputs": [], + "name": "GELATO", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESTRICTED_MINT_ENABLED", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "arrakisBalance0", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arrakisBalance1", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arrakisFeeBPS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arrakisTreasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "burnAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "liquidityBurned", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int24", + "name": "newLowerTick", + "type": "int24" + }, + { + "internalType": "int24", + "name": "newUpperTick", + "type": "int24" + }, + { + "internalType": "uint160", + "name": "swapThresholdPrice", + "type": "uint160" + }, + { + "internalType": "uint256", + "name": "swapAmountBPS", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "zeroForOne", + "type": "bool" + } + ], + "name": "executiveRebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoRebalanceBPS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoSlippageBPS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gelatoSlippageInterval", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount0Max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Max", + "type": "uint256" + } + ], + "name": "getMintAmounts", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPositionID", + "outputs": [ + { + "internalType": "bytes32", + "name": "positionID", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUnderlyingBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0Current", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Current", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint160", + "name": "sqrtRatioX96", + "type": "uint160" + } + ], + "name": "getUnderlyingBalancesAtPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0Current", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Current", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "_pool", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_managerFeeBPS", + "type": "uint16" + }, + { + "internalType": "int24", + "name": "_lowerTick", + "type": "int24" + }, + { + "internalType": "int24", + "name": "_upperTick", + "type": "int24" + }, + { + "internalType": "address", + "name": "_manager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lowerTick", + "outputs": [ + { + "internalType": "int24", + "name": "", + "type": "int24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerBalance0", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerBalance1", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerFeeBPS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerTreasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "liquidityMinted", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [ + { + "internalType": "contract IUniswapV3Pool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint160", + "name": "swapThresholdPrice", + "type": "uint160" + }, + { + "internalType": "uint256", + "name": "swapAmountBPS", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "zeroForOne", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "paymentToken", + "type": "address" + } + ], + "name": "rebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "restrictedMintToggle", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "toggleRestrictMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token0", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token1", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount0Owed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Owed", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "uniswapV3MintCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amount0Delta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "amount1Delta", + "type": "int256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "uniswapV3SwapCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int16", + "name": "newManagerFeeBPS", + "type": "int16" + }, + { + "internalType": "address", + "name": "newManagerTreasury", + "type": "address" + }, + { + "internalType": "int16", + "name": "newRebalanceBPS", + "type": "int16" + }, + { + "internalType": "int16", + "name": "newSlippageBPS", + "type": "int16" + }, + { + "internalType": "int32", + "name": "newSlippageInterval", + "type": "int32" + } + ], + "name": "updateManagerParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "upperTick", + "outputs": [ + { + "internalType": "int24", + "name": "", + "type": "int24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawArrakisBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawManagerBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/arrakis/contracts/ethers/ArrakisGelatoPool.ts b/src/apps/arrakis/contracts/ethers/ArrakisGelatoPool.ts new file mode 100644 index 000000000..94ab1f9a7 --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/ArrakisGelatoPool.ts @@ -0,0 +1,1402 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export interface ArrakisGelatoPoolInterface extends utils.Interface { + functions: { + 'GELATO()': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(uint256,address)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'executiveRebalance(int24,int24,uint160,uint256,bool)': FunctionFragment; + 'gelatoBalance0()': FunctionFragment; + 'gelatoBalance1()': FunctionFragment; + 'gelatoFeeBPS()': FunctionFragment; + 'gelatoRebalanceBPS()': FunctionFragment; + 'gelatoSlippageBPS()': FunctionFragment; + 'gelatoSlippageInterval()': FunctionFragment; + 'gelatoWithdrawBPS()': FunctionFragment; + 'getMintAmounts(uint256,uint256)': FunctionFragment; + 'getPositionID()': FunctionFragment; + 'getUnderlyingBalances()': FunctionFragment; + 'getUnderlyingBalancesAtPrice(uint160)': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'initialize(string,string,address,uint16,int24,int24,address)': FunctionFragment; + 'initializeManagerFee(uint16)': FunctionFragment; + 'lowerTick()': FunctionFragment; + 'manager()': FunctionFragment; + 'managerBalance0()': FunctionFragment; + 'managerBalance1()': FunctionFragment; + 'managerFeeBPS()': FunctionFragment; + 'managerTreasury()': FunctionFragment; + 'mint(uint256,address)': FunctionFragment; + 'name()': FunctionFragment; + 'pool()': FunctionFragment; + 'rebalance(uint160,uint256,bool,uint256,address)': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'symbol()': FunctionFragment; + 'token0()': FunctionFragment; + 'token1()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + 'uniswapV3MintCallback(uint256,uint256,bytes)': FunctionFragment; + 'uniswapV3SwapCallback(int256,int256,bytes)': FunctionFragment; + 'updateGelatoParams(uint16,uint16,uint16,uint32,address)': FunctionFragment; + 'upperTick()': FunctionFragment; + 'version()': FunctionFragment; + 'withdrawGelatoBalance(uint256,address)': FunctionFragment; + 'withdrawManagerBalance(uint256,address)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'GELATO' + | 'allowance' + | 'approve' + | 'balanceOf' + | 'burn' + | 'decimals' + | 'decreaseAllowance' + | 'executiveRebalance' + | 'gelatoBalance0' + | 'gelatoBalance1' + | 'gelatoFeeBPS' + | 'gelatoRebalanceBPS' + | 'gelatoSlippageBPS' + | 'gelatoSlippageInterval' + | 'gelatoWithdrawBPS' + | 'getMintAmounts' + | 'getPositionID' + | 'getUnderlyingBalances' + | 'getUnderlyingBalancesAtPrice' + | 'increaseAllowance' + | 'initialize' + | 'initializeManagerFee' + | 'lowerTick' + | 'manager' + | 'managerBalance0' + | 'managerBalance1' + | 'managerFeeBPS' + | 'managerTreasury' + | 'mint' + | 'name' + | 'pool' + | 'rebalance' + | 'renounceOwnership' + | 'symbol' + | 'token0' + | 'token1' + | 'totalSupply' + | 'transfer' + | 'transferFrom' + | 'transferOwnership' + | 'uniswapV3MintCallback' + | 'uniswapV3SwapCallback' + | 'updateGelatoParams' + | 'upperTick' + | 'version' + | 'withdrawGelatoBalance' + | 'withdrawManagerBalance', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'GELATO', values?: undefined): string; + encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'burn', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'decreaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'executiveRebalance', + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish, boolean], + ): string; + encodeFunctionData(functionFragment: 'gelatoBalance0', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoBalance1', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoFeeBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoRebalanceBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoSlippageBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoSlippageInterval', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoWithdrawBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'getMintAmounts', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'getPositionID', values?: undefined): string; + encodeFunctionData(functionFragment: 'getUnderlyingBalances', values?: undefined): string; + encodeFunctionData(functionFragment: 'getUnderlyingBalancesAtPrice', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'increaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'initialize', + values: [string, string, string, BigNumberish, BigNumberish, BigNumberish, string], + ): string; + encodeFunctionData(functionFragment: 'initializeManagerFee', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'lowerTick', values?: undefined): string; + encodeFunctionData(functionFragment: 'manager', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerBalance0', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerBalance1', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerFeeBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerTreasury', values?: undefined): string; + encodeFunctionData(functionFragment: 'mint', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'pool', values?: undefined): string; + encodeFunctionData( + functionFragment: 'rebalance', + values: [BigNumberish, BigNumberish, boolean, BigNumberish, string], + ): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'token0', values?: undefined): string; + encodeFunctionData(functionFragment: 'token1', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [string]): string; + encodeFunctionData( + functionFragment: 'uniswapV3MintCallback', + values: [BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'uniswapV3SwapCallback', + values: [BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'updateGelatoParams', + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish, string], + ): string; + encodeFunctionData(functionFragment: 'upperTick', values?: undefined): string; + encodeFunctionData(functionFragment: 'version', values?: undefined): string; + encodeFunctionData(functionFragment: 'withdrawGelatoBalance', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'withdrawManagerBalance', values: [BigNumberish, string]): string; + + decodeFunctionResult(functionFragment: 'GELATO', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'executiveRebalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoBalance0', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoBalance1', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoFeeBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoRebalanceBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoSlippageBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoSlippageInterval', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoWithdrawBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getMintAmounts', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPositionID', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUnderlyingBalances', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUnderlyingBalancesAtPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initializeManagerFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lowerTick', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'manager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerBalance0', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerBalance1', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerFeeBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerTreasury', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rebalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'token0', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'token1', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'uniswapV3MintCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'uniswapV3SwapCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateGelatoParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'upperTick', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'version', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdrawGelatoBalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdrawManagerBalance', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Burned(address,uint256,uint256,uint256,uint128)': EventFragment; + 'FeesEarned(uint256,uint256)': EventFragment; + 'Minted(address,uint256,uint256,uint256,uint128)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'Rebalance(int24,int24,uint128,uint128)': EventFragment; + 'SetManagerFee(uint16)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + 'UpdateAdminTreasury(address,address)': EventFragment; + 'UpdateGelatoParams(uint16,uint16,uint16,uint32)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Burned'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FeesEarned'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Minted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Rebalance'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'SetManagerFee'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'UpdateAdminTreasury'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'UpdateGelatoParams'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface BurnedEventObject { + receiver: string; + burnAmount: BigNumber; + amount0Out: BigNumber; + amount1Out: BigNumber; + liquidityBurned: BigNumber; +} +export type BurnedEvent = TypedEvent<[string, BigNumber, BigNumber, BigNumber, BigNumber], BurnedEventObject>; + +export type BurnedEventFilter = TypedEventFilter; + +export interface FeesEarnedEventObject { + feesEarned0: BigNumber; + feesEarned1: BigNumber; +} +export type FeesEarnedEvent = TypedEvent<[BigNumber, BigNumber], FeesEarnedEventObject>; + +export type FeesEarnedEventFilter = TypedEventFilter; + +export interface MintedEventObject { + receiver: string; + mintAmount: BigNumber; + amount0In: BigNumber; + amount1In: BigNumber; + liquidityMinted: BigNumber; +} +export type MintedEvent = TypedEvent<[string, BigNumber, BigNumber, BigNumber, BigNumber], MintedEventObject>; + +export type MintedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousManager: string; + newManager: string; +} +export type OwnershipTransferredEvent = TypedEvent<[string, string], OwnershipTransferredEventObject>; + +export type OwnershipTransferredEventFilter = TypedEventFilter; + +export interface RebalanceEventObject { + lowerTick_: number; + upperTick_: number; + liquidityBefore: BigNumber; + liquidityAfter: BigNumber; +} +export type RebalanceEvent = TypedEvent<[number, number, BigNumber, BigNumber], RebalanceEventObject>; + +export type RebalanceEventFilter = TypedEventFilter; + +export interface SetManagerFeeEventObject { + managerFee: number; +} +export type SetManagerFeeEvent = TypedEvent<[number], SetManagerFeeEventObject>; + +export type SetManagerFeeEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface UpdateAdminTreasuryEventObject { + oldAdminTreasury: string; + newAdminTreasury: string; +} +export type UpdateAdminTreasuryEvent = TypedEvent<[string, string], UpdateAdminTreasuryEventObject>; + +export type UpdateAdminTreasuryEventFilter = TypedEventFilter; + +export interface UpdateGelatoParamsEventObject { + gelatoRebalanceBPS: number; + gelatoWithdrawBPS: number; + gelatoSlippageBPS: number; + gelatoSlippageInterval: number; +} +export type UpdateGelatoParamsEvent = TypedEvent<[number, number, number, number], UpdateGelatoParamsEventObject>; + +export type UpdateGelatoParamsEventFilter = TypedEventFilter; + +export interface ArrakisGelatoPool extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ArrakisGelatoPoolInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + GELATO(overrides?: CallOverrides): Promise<[string]>; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + gelatoBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + gelatoFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise<[number]>; + + gelatoWithdrawBPS(overrides?: CallOverrides): Promise<[number]>; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise<[string] & { positionID: string }>; + + getUnderlyingBalances(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeManagerFee( + _managerFeeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise<[number]>; + + manager(overrides?: CallOverrides): Promise<[string]>; + + managerBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + managerBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + managerFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + managerTreasury(overrides?: CallOverrides): Promise<[string]>; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + pool(overrides?: CallOverrides): Promise<[string]>; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + token0(overrides?: CallOverrides): Promise<[string]>; + + token1(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGelatoParams( + newRebalanceBPS: BigNumberish, + newWithdrawBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + newTreasury: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise<[number]>; + + version(overrides?: CallOverrides): Promise<[string]>; + + withdrawGelatoBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + withdrawManagerBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + GELATO(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoBalance0(overrides?: CallOverrides): Promise; + + gelatoBalance1(overrides?: CallOverrides): Promise; + + gelatoFeeBPS(overrides?: CallOverrides): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + gelatoWithdrawBPS(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeManagerFee( + _managerFeeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + symbol(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGelatoParams( + newRebalanceBPS: BigNumberish, + newWithdrawBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + newTreasury: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawGelatoBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + withdrawManagerBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + GELATO(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve(spender: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityBurned: BigNumber; + } + >; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance(spender: string, subtractedValue: BigNumberish, overrides?: CallOverrides): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: CallOverrides, + ): Promise; + + gelatoBalance0(overrides?: CallOverrides): Promise; + + gelatoBalance1(overrides?: CallOverrides): Promise; + + gelatoFeeBPS(overrides?: CallOverrides): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + gelatoWithdrawBPS(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance(spender: string, addedValue: BigNumberish, overrides?: CallOverrides): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: CallOverrides, + ): Promise; + + initializeManagerFee(_managerFeeBPS: BigNumberish, overrides?: CallOverrides): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityMinted: BigNumber; + } + >; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: CallOverrides, + ): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer(recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferFrom(sender: string, recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferOwnership(newOwner: string, overrides?: CallOverrides): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides, + ): Promise; + + updateGelatoParams( + newRebalanceBPS: BigNumberish, + newWithdrawBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + newTreasury: string, + overrides?: CallOverrides, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawGelatoBalance(feeAmount: BigNumberish, feeToken: string, overrides?: CallOverrides): Promise; + + withdrawManagerBalance(feeAmount: BigNumberish, feeToken: string, overrides?: CallOverrides): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; + + 'Burned(address,uint256,uint256,uint256,uint128)'( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null, + ): BurnedEventFilter; + Burned( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null, + ): BurnedEventFilter; + + 'FeesEarned(uint256,uint256)'(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; + FeesEarned(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; + + 'Minted(address,uint256,uint256,uint256,uint128)'( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null, + ): MintedEventFilter; + Minted( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null, + ): MintedEventFilter; + + 'OwnershipTransferred(address,address)'( + previousManager?: string | null, + newManager?: string | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred(previousManager?: string | null, newManager?: string | null): OwnershipTransferredEventFilter; + + 'Rebalance(int24,int24,uint128,uint128)'( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null, + ): RebalanceEventFilter; + Rebalance( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null, + ): RebalanceEventFilter; + + 'SetManagerFee(uint16)'(managerFee?: null): SetManagerFeeEventFilter; + SetManagerFee(managerFee?: null): SetManagerFeeEventFilter; + + 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + + 'UpdateAdminTreasury(address,address)'( + oldAdminTreasury?: null, + newAdminTreasury?: null, + ): UpdateAdminTreasuryEventFilter; + UpdateAdminTreasury(oldAdminTreasury?: null, newAdminTreasury?: null): UpdateAdminTreasuryEventFilter; + + 'UpdateGelatoParams(uint16,uint16,uint16,uint32)'( + gelatoRebalanceBPS?: null, + gelatoWithdrawBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null, + ): UpdateGelatoParamsEventFilter; + UpdateGelatoParams( + gelatoRebalanceBPS?: null, + gelatoWithdrawBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null, + ): UpdateGelatoParamsEventFilter; + }; + + estimateGas: { + GELATO(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoBalance0(overrides?: CallOverrides): Promise; + + gelatoBalance1(overrides?: CallOverrides): Promise; + + gelatoFeeBPS(overrides?: CallOverrides): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + gelatoWithdrawBPS(overrides?: CallOverrides): Promise; + + getMintAmounts(amount0Max: BigNumberish, amount1Max: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise; + + getUnderlyingBalancesAtPrice(sqrtRatioX96: BigNumberish, overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeManagerFee( + _managerFeeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + symbol(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGelatoParams( + newRebalanceBPS: BigNumberish, + newWithdrawBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + newTreasury: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawGelatoBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + withdrawManagerBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + GELATO(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoBalance0(overrides?: CallOverrides): Promise; + + gelatoBalance1(overrides?: CallOverrides): Promise; + + gelatoFeeBPS(overrides?: CallOverrides): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + gelatoWithdrawBPS(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise; + + getUnderlyingBalancesAtPrice(sqrtRatioX96: BigNumberish, overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initializeManagerFee( + _managerFeeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + symbol(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateGelatoParams( + newRebalanceBPS: BigNumberish, + newWithdrawBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + newTreasury: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawGelatoBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + withdrawManagerBalance( + feeAmount: BigNumberish, + feeToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/arrakis/contracts/ethers/ArrakisPool.ts b/src/apps/arrakis/contracts/ethers/ArrakisPool.ts new file mode 100644 index 000000000..eb1b2c8aa --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/ArrakisPool.ts @@ -0,0 +1,1364 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export interface ArrakisPoolInterface extends utils.Interface { + functions: { + 'GELATO()': FunctionFragment; + 'RESTRICTED_MINT_ENABLED()': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'arrakisBalance0()': FunctionFragment; + 'arrakisBalance1()': FunctionFragment; + 'arrakisFeeBPS()': FunctionFragment; + 'arrakisTreasury()': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(uint256,address)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'executiveRebalance(int24,int24,uint160,uint256,bool)': FunctionFragment; + 'gelatoRebalanceBPS()': FunctionFragment; + 'gelatoSlippageBPS()': FunctionFragment; + 'gelatoSlippageInterval()': FunctionFragment; + 'getMintAmounts(uint256,uint256)': FunctionFragment; + 'getPositionID()': FunctionFragment; + 'getUnderlyingBalances()': FunctionFragment; + 'getUnderlyingBalancesAtPrice(uint160)': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'initialize(string,string,address,uint16,int24,int24,address)': FunctionFragment; + 'lowerTick()': FunctionFragment; + 'manager()': FunctionFragment; + 'managerBalance0()': FunctionFragment; + 'managerBalance1()': FunctionFragment; + 'managerFeeBPS()': FunctionFragment; + 'managerTreasury()': FunctionFragment; + 'mint(uint256,address)': FunctionFragment; + 'name()': FunctionFragment; + 'pool()': FunctionFragment; + 'rebalance(uint160,uint256,bool,uint256,address)': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'restrictedMintToggle()': FunctionFragment; + 'symbol()': FunctionFragment; + 'toggleRestrictMint()': FunctionFragment; + 'token0()': FunctionFragment; + 'token1()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + 'uniswapV3MintCallback(uint256,uint256,bytes)': FunctionFragment; + 'uniswapV3SwapCallback(int256,int256,bytes)': FunctionFragment; + 'updateManagerParams(int16,address,int16,int16,int32)': FunctionFragment; + 'upperTick()': FunctionFragment; + 'version()': FunctionFragment; + 'withdrawArrakisBalance()': FunctionFragment; + 'withdrawManagerBalance()': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'GELATO' + | 'RESTRICTED_MINT_ENABLED' + | 'allowance' + | 'approve' + | 'arrakisBalance0' + | 'arrakisBalance1' + | 'arrakisFeeBPS' + | 'arrakisTreasury' + | 'balanceOf' + | 'burn' + | 'decimals' + | 'decreaseAllowance' + | 'executiveRebalance' + | 'gelatoRebalanceBPS' + | 'gelatoSlippageBPS' + | 'gelatoSlippageInterval' + | 'getMintAmounts' + | 'getPositionID' + | 'getUnderlyingBalances' + | 'getUnderlyingBalancesAtPrice' + | 'increaseAllowance' + | 'initialize' + | 'lowerTick' + | 'manager' + | 'managerBalance0' + | 'managerBalance1' + | 'managerFeeBPS' + | 'managerTreasury' + | 'mint' + | 'name' + | 'pool' + | 'rebalance' + | 'renounceOwnership' + | 'restrictedMintToggle' + | 'symbol' + | 'toggleRestrictMint' + | 'token0' + | 'token1' + | 'totalSupply' + | 'transfer' + | 'transferFrom' + | 'transferOwnership' + | 'uniswapV3MintCallback' + | 'uniswapV3SwapCallback' + | 'updateManagerParams' + | 'upperTick' + | 'version' + | 'withdrawArrakisBalance' + | 'withdrawManagerBalance', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'GELATO', values?: undefined): string; + encodeFunctionData(functionFragment: 'RESTRICTED_MINT_ENABLED', values?: undefined): string; + encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'arrakisBalance0', values?: undefined): string; + encodeFunctionData(functionFragment: 'arrakisBalance1', values?: undefined): string; + encodeFunctionData(functionFragment: 'arrakisFeeBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'arrakisTreasury', values?: undefined): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'burn', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'decreaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'executiveRebalance', + values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish, boolean], + ): string; + encodeFunctionData(functionFragment: 'gelatoRebalanceBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoSlippageBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'gelatoSlippageInterval', values?: undefined): string; + encodeFunctionData(functionFragment: 'getMintAmounts', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'getPositionID', values?: undefined): string; + encodeFunctionData(functionFragment: 'getUnderlyingBalances', values?: undefined): string; + encodeFunctionData(functionFragment: 'getUnderlyingBalancesAtPrice', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'increaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData( + functionFragment: 'initialize', + values: [string, string, string, BigNumberish, BigNumberish, BigNumberish, string], + ): string; + encodeFunctionData(functionFragment: 'lowerTick', values?: undefined): string; + encodeFunctionData(functionFragment: 'manager', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerBalance0', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerBalance1', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerFeeBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'managerTreasury', values?: undefined): string; + encodeFunctionData(functionFragment: 'mint', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'pool', values?: undefined): string; + encodeFunctionData( + functionFragment: 'rebalance', + values: [BigNumberish, BigNumberish, boolean, BigNumberish, string], + ): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'restrictedMintToggle', values?: undefined): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'toggleRestrictMint', values?: undefined): string; + encodeFunctionData(functionFragment: 'token0', values?: undefined): string; + encodeFunctionData(functionFragment: 'token1', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [string]): string; + encodeFunctionData( + functionFragment: 'uniswapV3MintCallback', + values: [BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'uniswapV3SwapCallback', + values: [BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'updateManagerParams', + values: [BigNumberish, string, BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'upperTick', values?: undefined): string; + encodeFunctionData(functionFragment: 'version', values?: undefined): string; + encodeFunctionData(functionFragment: 'withdrawArrakisBalance', values?: undefined): string; + encodeFunctionData(functionFragment: 'withdrawManagerBalance', values?: undefined): string; + + decodeFunctionResult(functionFragment: 'GELATO', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'RESTRICTED_MINT_ENABLED', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'arrakisBalance0', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'arrakisBalance1', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'arrakisFeeBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'arrakisTreasury', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'executiveRebalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoRebalanceBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoSlippageBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gelatoSlippageInterval', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getMintAmounts', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPositionID', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUnderlyingBalances', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getUnderlyingBalancesAtPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lowerTick', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'manager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerBalance0', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerBalance1', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerFeeBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'managerTreasury', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rebalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'restrictedMintToggle', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'toggleRestrictMint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'token0', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'token1', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'uniswapV3MintCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'uniswapV3SwapCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateManagerParams', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'upperTick', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'version', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdrawArrakisBalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdrawManagerBalance', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Burned(address,uint256,uint256,uint256,uint128)': EventFragment; + 'FeesEarned(uint256,uint256)': EventFragment; + 'Minted(address,uint256,uint256,uint256,uint128)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'Rebalance(int24,int24,uint128,uint128)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + 'UpdateManagerParams(uint16,address,uint16,uint16,uint32)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Burned'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FeesEarned'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Minted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Rebalance'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'UpdateManagerParams'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface BurnedEventObject { + receiver: string; + burnAmount: BigNumber; + amount0Out: BigNumber; + amount1Out: BigNumber; + liquidityBurned: BigNumber; +} +export type BurnedEvent = TypedEvent<[string, BigNumber, BigNumber, BigNumber, BigNumber], BurnedEventObject>; + +export type BurnedEventFilter = TypedEventFilter; + +export interface FeesEarnedEventObject { + feesEarned0: BigNumber; + feesEarned1: BigNumber; +} +export type FeesEarnedEvent = TypedEvent<[BigNumber, BigNumber], FeesEarnedEventObject>; + +export type FeesEarnedEventFilter = TypedEventFilter; + +export interface MintedEventObject { + receiver: string; + mintAmount: BigNumber; + amount0In: BigNumber; + amount1In: BigNumber; + liquidityMinted: BigNumber; +} +export type MintedEvent = TypedEvent<[string, BigNumber, BigNumber, BigNumber, BigNumber], MintedEventObject>; + +export type MintedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousManager: string; + newManager: string; +} +export type OwnershipTransferredEvent = TypedEvent<[string, string], OwnershipTransferredEventObject>; + +export type OwnershipTransferredEventFilter = TypedEventFilter; + +export interface RebalanceEventObject { + lowerTick_: number; + upperTick_: number; + liquidityBefore: BigNumber; + liquidityAfter: BigNumber; +} +export type RebalanceEvent = TypedEvent<[number, number, BigNumber, BigNumber], RebalanceEventObject>; + +export type RebalanceEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface UpdateManagerParamsEventObject { + managerFeeBPS: number; + managerTreasury: string; + gelatoRebalanceBPS: number; + gelatoSlippageBPS: number; + gelatoSlippageInterval: number; +} +export type UpdateManagerParamsEvent = TypedEvent< + [number, string, number, number, number], + UpdateManagerParamsEventObject +>; + +export type UpdateManagerParamsEventFilter = TypedEventFilter; + +export interface ArrakisPool extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ArrakisPoolInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + GELATO(overrides?: CallOverrides): Promise<[string]>; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise<[number]>; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + arrakisBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + arrakisFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + arrakisTreasury(overrides?: CallOverrides): Promise<[string]>; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise<[number]>; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise<[number]>; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise<[string] & { positionID: string }>; + + getUnderlyingBalances(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise<[number]>; + + manager(overrides?: CallOverrides): Promise<[string]>; + + managerBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + managerBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + managerFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + managerTreasury(overrides?: CallOverrides): Promise<[string]>; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + pool(overrides?: CallOverrides): Promise<[string]>; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise<[number]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + toggleRestrictMint(overrides?: Overrides & { from?: string | Promise }): Promise; + + token0(overrides?: CallOverrides): Promise<[string]>; + + token1(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise<[number]>; + + version(overrides?: CallOverrides): Promise<[string]>; + + withdrawArrakisBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + + withdrawManagerBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + }; + + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint(overrides?: Overrides & { from?: string | Promise }): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + + withdrawManagerBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + + callStatic: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve(spender: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityBurned: BigNumber; + } + >; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance(spender: string, subtractedValue: BigNumberish, overrides?: CallOverrides): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: CallOverrides, + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: BigNumberish, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance(spender: string, addedValue: BigNumberish, overrides?: CallOverrides): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: CallOverrides, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityMinted: BigNumber; + } + >; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: CallOverrides, + ): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer(recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferFrom(sender: string, recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferOwnership(newOwner: string, overrides?: CallOverrides): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: CallOverrides, + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance(overrides?: CallOverrides): Promise; + + withdrawManagerBalance(overrides?: CallOverrides): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; + + 'Burned(address,uint256,uint256,uint256,uint128)'( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null, + ): BurnedEventFilter; + Burned( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null, + ): BurnedEventFilter; + + 'FeesEarned(uint256,uint256)'(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; + FeesEarned(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; + + 'Minted(address,uint256,uint256,uint256,uint128)'( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null, + ): MintedEventFilter; + Minted( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null, + ): MintedEventFilter; + + 'OwnershipTransferred(address,address)'( + previousManager?: string | null, + newManager?: string | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred(previousManager?: string | null, newManager?: string | null): OwnershipTransferredEventFilter; + + 'Rebalance(int24,int24,uint128,uint128)'( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null, + ): RebalanceEventFilter; + Rebalance( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null, + ): RebalanceEventFilter; + + 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + + 'UpdateManagerParams(uint16,address,uint16,uint16,uint32)'( + managerFeeBPS?: null, + managerTreasury?: null, + gelatoRebalanceBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null, + ): UpdateManagerParamsEventFilter; + UpdateManagerParams( + managerFeeBPS?: null, + managerTreasury?: null, + gelatoRebalanceBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null, + ): UpdateManagerParamsEventFilter; + }; + + estimateGas: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts(amount0Max: BigNumberish, amount1Max: BigNumberish, overrides?: CallOverrides): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise; + + getUnderlyingBalancesAtPrice(sqrtRatioX96: BigNumberish, overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint(overrides?: Overrides & { from?: string | Promise }): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + + withdrawManagerBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + }; + + populateTransaction: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + burnAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + executiveRebalance( + newLowerTick: BigNumberish, + newUpperTick: BigNumberish, + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: BigNumberish, + amount1Max: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise; + + getUnderlyingBalancesAtPrice(sqrtRatioX96: BigNumberish, overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + _name: string, + _symbol: string, + _pool: string, + _managerFeeBPS: BigNumberish, + _lowerTick: BigNumberish, + _upperTick: BigNumberish, + _manager_: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: BigNumberish, + swapAmountBPS: BigNumberish, + zeroForOne: boolean, + feeAmount: BigNumberish, + paymentToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint(overrides?: Overrides & { from?: string | Promise }): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3MintCallback( + amount0Owed: BigNumberish, + amount1Owed: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: BigNumberish, + amount1Delta: BigNumberish, + arg2: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + updateManagerParams( + newManagerFeeBPS: BigNumberish, + newManagerTreasury: string, + newRebalanceBPS: BigNumberish, + newSlippageBPS: BigNumberish, + newSlippageInterval: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + + withdrawManagerBalance(overrides?: Overrides & { from?: string | Promise }): Promise; + }; +} diff --git a/src/apps/arrakis/contracts/ethers/common.ts b/src/apps/arrakis/contracts/ethers/common.ts new file mode 100644 index 000000000..6cfb10425 --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/common.ts @@ -0,0 +1,30 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { Listener } from '@ethersproject/providers'; +import type { Event, EventFilter } from 'ethers'; + +export interface TypedEvent = any, TArgsObject = any> extends Event { + args: TArgsArray & TArgsObject; +} + +export interface TypedEventFilter<_TEvent extends TypedEvent> extends EventFilter {} + +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; +} + +type __TypechainArgsArray = T extends TypedEvent ? U : never; + +export interface OnEvent { + (eventFilter: TypedEventFilter, listener: TypedListener): TRes; + (eventName: string, listener: Listener): TRes; +} + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory ? Parameters : never; diff --git a/src/apps/arrakis/contracts/ethers/factories/ArrakisGelatoPool__factory.ts b/src/apps/arrakis/contracts/ethers/factories/ArrakisGelatoPool__factory.ts new file mode 100644 index 000000000..124b90c9d --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/factories/ArrakisGelatoPool__factory.ts @@ -0,0 +1,1168 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { ArrakisGelatoPool, ArrakisGelatoPoolInterface } from '../ArrakisGelatoPool'; + +const _abi = [ + { + inputs: [ + { + internalType: 'address payable', + name: '_gelato', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'burnAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityBurned', + type: 'uint128', + }, + ], + name: 'Burned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'feesEarned0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'feesEarned1', + type: 'uint256', + }, + ], + name: 'FeesEarned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'mintAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityMinted', + type: 'uint128', + }, + ], + name: 'Minted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousManager', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newManager', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'int24', + name: 'lowerTick_', + type: 'int24', + }, + { + indexed: false, + internalType: 'int24', + name: 'upperTick_', + type: 'int24', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityBefore', + type: 'uint128', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityAfter', + type: 'uint128', + }, + ], + name: 'Rebalance', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint16', + name: 'managerFee', + type: 'uint16', + }, + ], + name: 'SetManagerFee', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oldAdminTreasury', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdminTreasury', + type: 'address', + }, + ], + name: 'UpdateAdminTreasury', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint16', + name: 'gelatoRebalanceBPS', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint16', + name: 'gelatoWithdrawBPS', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint16', + name: 'gelatoSlippageBPS', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint32', + name: 'gelatoSlippageInterval', + type: 'uint32', + }, + ], + name: 'UpdateGelatoParams', + type: 'event', + }, + { + inputs: [], + name: 'GELATO', + outputs: [ + { + internalType: 'address payable', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'burnAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'burn', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + internalType: 'uint128', + name: 'liquidityBurned', + type: 'uint128', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int24', + name: 'newLowerTick', + type: 'int24', + }, + { + internalType: 'int24', + name: 'newUpperTick', + type: 'int24', + }, + { + internalType: 'uint160', + name: 'swapThresholdPrice', + type: 'uint160', + }, + { + internalType: 'uint256', + name: 'swapAmountBPS', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'zeroForOne', + type: 'bool', + }, + ], + name: 'executiveRebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'gelatoBalance0', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoBalance1', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoFeeBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoRebalanceBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoSlippageBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoSlippageInterval', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoWithdrawBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount0Max', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Max', + type: 'uint256', + }, + ], + name: 'getMintAmounts', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'mintAmount', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPositionID', + outputs: [ + { + internalType: 'bytes32', + name: 'positionID', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getUnderlyingBalances', + outputs: [ + { + internalType: 'uint256', + name: 'amount0Current', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Current', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint160', + name: 'sqrtRatioX96', + type: 'uint160', + }, + ], + name: 'getUnderlyingBalancesAtPrice', + outputs: [ + { + internalType: 'uint256', + name: 'amount0Current', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Current', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: '_name', + type: 'string', + }, + { + internalType: 'string', + name: '_symbol', + type: 'string', + }, + { + internalType: 'address', + name: '_pool', + type: 'address', + }, + { + internalType: 'uint16', + name: '_managerFeeBPS', + type: 'uint16', + }, + { + internalType: 'int24', + name: '_lowerTick', + type: 'int24', + }, + { + internalType: 'int24', + name: '_upperTick', + type: 'int24', + }, + { + internalType: 'address', + name: '_manager_', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint16', + name: '_managerFeeBPS', + type: 'uint16', + }, + ], + name: 'initializeManagerFee', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'lowerTick', + outputs: [ + { + internalType: 'int24', + name: '', + type: 'int24', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerBalance0', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerBalance1', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerFeeBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerTreasury', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'mintAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + internalType: 'uint128', + name: 'liquidityMinted', + type: 'uint128', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pool', + outputs: [ + { + internalType: 'contract IUniswapV3Pool', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint160', + name: 'swapThresholdPrice', + type: 'uint160', + }, + { + internalType: 'uint256', + name: 'swapAmountBPS', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'zeroForOne', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'feeAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'paymentToken', + type: 'address', + }, + ], + name: 'rebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'token0', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'token1', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount0Owed', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Owed', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'uniswapV3MintCallback', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int256', + name: 'amount0Delta', + type: 'int256', + }, + { + internalType: 'int256', + name: 'amount1Delta', + type: 'int256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'uniswapV3SwapCallback', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint16', + name: 'newRebalanceBPS', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'newWithdrawBPS', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'newSlippageBPS', + type: 'uint16', + }, + { + internalType: 'uint32', + name: 'newSlippageInterval', + type: 'uint32', + }, + { + internalType: 'address', + name: 'newTreasury', + type: 'address', + }, + ], + name: 'updateGelatoParams', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'upperTick', + outputs: [ + { + internalType: 'int24', + name: '', + type: 'int24', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'version', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'feeAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'feeToken', + type: 'address', + }, + ], + name: 'withdrawGelatoBalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'feeAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'feeToken', + type: 'address', + }, + ], + name: 'withdrawManagerBalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class ArrakisGelatoPool__factory { + static readonly abi = _abi; + static createInterface(): ArrakisGelatoPoolInterface { + return new utils.Interface(_abi) as ArrakisGelatoPoolInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): ArrakisGelatoPool { + return new Contract(address, _abi, signerOrProvider) as ArrakisGelatoPool; + } +} diff --git a/src/apps/arrakis/contracts/ethers/factories/ArrakisPool__factory.ts b/src/apps/arrakis/contracts/ethers/factories/ArrakisPool__factory.ts new file mode 100644 index 000000000..66471561e --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/factories/ArrakisPool__factory.ts @@ -0,0 +1,1145 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { ArrakisPool, ArrakisPoolInterface } from '../ArrakisPool'; + +const _abi = [ + { + inputs: [ + { + internalType: 'address payable', + name: '_gelato', + type: 'address', + }, + { + internalType: 'address', + name: '_arrakisTreasury', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'burnAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityBurned', + type: 'uint128', + }, + ], + name: 'Burned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'feesEarned0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'feesEarned1', + type: 'uint256', + }, + ], + name: 'FeesEarned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'mintAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityMinted', + type: 'uint128', + }, + ], + name: 'Minted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousManager', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newManager', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'int24', + name: 'lowerTick_', + type: 'int24', + }, + { + indexed: false, + internalType: 'int24', + name: 'upperTick_', + type: 'int24', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityBefore', + type: 'uint128', + }, + { + indexed: false, + internalType: 'uint128', + name: 'liquidityAfter', + type: 'uint128', + }, + ], + name: 'Rebalance', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint16', + name: 'managerFeeBPS', + type: 'uint16', + }, + { + indexed: false, + internalType: 'address', + name: 'managerTreasury', + type: 'address', + }, + { + indexed: false, + internalType: 'uint16', + name: 'gelatoRebalanceBPS', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint16', + name: 'gelatoSlippageBPS', + type: 'uint16', + }, + { + indexed: false, + internalType: 'uint32', + name: 'gelatoSlippageInterval', + type: 'uint32', + }, + ], + name: 'UpdateManagerParams', + type: 'event', + }, + { + inputs: [], + name: 'GELATO', + outputs: [ + { + internalType: 'address payable', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'RESTRICTED_MINT_ENABLED', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'arrakisBalance0', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'arrakisBalance1', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'arrakisFeeBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'arrakisTreasury', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'burnAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'burn', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + internalType: 'uint128', + name: 'liquidityBurned', + type: 'uint128', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int24', + name: 'newLowerTick', + type: 'int24', + }, + { + internalType: 'int24', + name: 'newUpperTick', + type: 'int24', + }, + { + internalType: 'uint160', + name: 'swapThresholdPrice', + type: 'uint160', + }, + { + internalType: 'uint256', + name: 'swapAmountBPS', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'zeroForOne', + type: 'bool', + }, + ], + name: 'executiveRebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'gelatoRebalanceBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoSlippageBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gelatoSlippageInterval', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount0Max', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Max', + type: 'uint256', + }, + ], + name: 'getMintAmounts', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'mintAmount', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPositionID', + outputs: [ + { + internalType: 'bytes32', + name: 'positionID', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getUnderlyingBalances', + outputs: [ + { + internalType: 'uint256', + name: 'amount0Current', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Current', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint160', + name: 'sqrtRatioX96', + type: 'uint160', + }, + ], + name: 'getUnderlyingBalancesAtPrice', + outputs: [ + { + internalType: 'uint256', + name: 'amount0Current', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Current', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: '_name', + type: 'string', + }, + { + internalType: 'string', + name: '_symbol', + type: 'string', + }, + { + internalType: 'address', + name: '_pool', + type: 'address', + }, + { + internalType: 'uint16', + name: '_managerFeeBPS', + type: 'uint16', + }, + { + internalType: 'int24', + name: '_lowerTick', + type: 'int24', + }, + { + internalType: 'int24', + name: '_upperTick', + type: 'int24', + }, + { + internalType: 'address', + name: '_manager_', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'lowerTick', + outputs: [ + { + internalType: 'int24', + name: '', + type: 'int24', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerBalance0', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerBalance1', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerFeeBPS', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'managerTreasury', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'mintAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + internalType: 'uint128', + name: 'liquidityMinted', + type: 'uint128', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pool', + outputs: [ + { + internalType: 'contract IUniswapV3Pool', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint160', + name: 'swapThresholdPrice', + type: 'uint160', + }, + { + internalType: 'uint256', + name: 'swapAmountBPS', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'zeroForOne', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'feeAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'paymentToken', + type: 'address', + }, + ], + name: 'rebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'restrictedMintToggle', + outputs: [ + { + internalType: 'uint16', + name: '', + type: 'uint16', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'toggleRestrictMint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'token0', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'token1', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount0Owed', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Owed', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'uniswapV3MintCallback', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int256', + name: 'amount0Delta', + type: 'int256', + }, + { + internalType: 'int256', + name: 'amount1Delta', + type: 'int256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'uniswapV3SwapCallback', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'int16', + name: 'newManagerFeeBPS', + type: 'int16', + }, + { + internalType: 'address', + name: 'newManagerTreasury', + type: 'address', + }, + { + internalType: 'int16', + name: 'newRebalanceBPS', + type: 'int16', + }, + { + internalType: 'int16', + name: 'newSlippageBPS', + type: 'int16', + }, + { + internalType: 'int32', + name: 'newSlippageInterval', + type: 'int32', + }, + ], + name: 'updateManagerParams', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'upperTick', + outputs: [ + { + internalType: 'int24', + name: '', + type: 'int24', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'version', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'withdrawArrakisBalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'withdrawManagerBalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class ArrakisPool__factory { + static readonly abi = _abi; + static createInterface(): ArrakisPoolInterface { + return new utils.Interface(_abi) as ArrakisPoolInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): ArrakisPool { + return new Contract(address, _abi, signerOrProvider) as ArrakisPool; + } +} diff --git a/src/apps/arrakis/contracts/ethers/factories/index.ts b/src/apps/arrakis/contracts/ethers/factories/index.ts new file mode 100644 index 000000000..7da937f4c --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/factories/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { ArrakisGelatoPool__factory } from './ArrakisGelatoPool__factory'; +export { ArrakisPool__factory } from './ArrakisPool__factory'; diff --git a/src/apps/arrakis/contracts/ethers/index.ts b/src/apps/arrakis/contracts/ethers/index.ts new file mode 100644 index 000000000..40f747d99 --- /dev/null +++ b/src/apps/arrakis/contracts/ethers/index.ts @@ -0,0 +1,8 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { ArrakisGelatoPool } from './ArrakisGelatoPool'; +export type { ArrakisPool } from './ArrakisPool'; +export * as factories from './factories'; +export { ArrakisGelatoPool__factory } from './factories/ArrakisGelatoPool__factory'; +export { ArrakisPool__factory } from './factories/ArrakisPool__factory'; diff --git a/src/apps/arrakis/contracts/index.ts b/src/apps/arrakis/contracts/index.ts new file mode 100644 index 000000000..2b8896745 --- /dev/null +++ b/src/apps/arrakis/contracts/index.ts @@ -0,0 +1,28 @@ +import { Injectable, Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { ContractFactory } from '~contract/contracts'; +import { Network } from '~types/network.interface'; + +import { ArrakisGelatoPool__factory } from './ethers'; +import { ArrakisPool__factory } from './ethers'; + +// eslint-disable-next-line +type ContractOpts = { address: string; network: Network }; + +@Injectable() +export class ArrakisContractFactory extends ContractFactory { + constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) { + super((network: Network) => appToolkit.getNetworkProvider(network)); + } + + arrakisGelatoPool({ address, network }: ContractOpts) { + return ArrakisGelatoPool__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + arrakisPool({ address, network }: ContractOpts) { + return ArrakisPool__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } +} + +export type { ArrakisGelatoPool } from './ethers'; +export type { ArrakisPool } from './ethers'; diff --git a/src/apps/arrakis/ethereum/arrakis.balance-fetcher.ts b/src/apps/arrakis/ethereum/arrakis.balance-fetcher.ts new file mode 100644 index 000000000..4f675b3f1 --- /dev/null +++ b/src/apps/arrakis/ethereum/arrakis.balance-fetcher.ts @@ -0,0 +1,36 @@ +import { Inject } from '@nestjs/common'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; + +const network = Network.ETHEREUM_MAINNET; + +@Register.BalanceFetcher(ARRAKIS_DEFINITION.id, Network.ETHEREUM_MAINNET) +export class EthereumArrakisBalanceFetcher implements BalanceFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + private async getPoolTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId: ARRAKIS_DEFINITION.id, + groupId: ARRAKIS_DEFINITION.groups.pool.id, + network, + }); + } + + async getBalances(address: string) { + const [poolTokenBalances] = await Promise.all([this.getPoolTokenBalances(address)]); + + return presentBalanceFetcherResponse([ + { + label: 'Pools', + assets: poolTokenBalances, + }, + ]); + } +} diff --git a/src/apps/arrakis/ethereum/arrakis.pool.token-fetcher.ts b/src/apps/arrakis/ethereum/arrakis.pool.token-fetcher.ts new file mode 100644 index 000000000..25cf0b62b --- /dev/null +++ b/src/apps/arrakis/ethereum/arrakis.pool.token-fetcher.ts @@ -0,0 +1,25 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; +import { ArrakisPoolTokenHelper } from '../helpers/arrakis.pool.token-helper'; + +const appId = ARRAKIS_DEFINITION.id; +const groupId = ARRAKIS_DEFINITION.groups.pool.id; +const network = Network.ETHEREUM_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class EthereumArrakisPoolTokenFetcher implements PositionFetcher { + constructor(@Inject(ArrakisPoolTokenHelper) private readonly arrakisPoolTokenHelper: ArrakisPoolTokenHelper) {} + + async getPositions() { + return this.arrakisPoolTokenHelper.getPositions({ + subgraphUrl: 'https://api.thegraph.com/subgraphs/name/gelatodigital/g-uni', + network, + }); + } +} diff --git a/src/apps/arrakis/helpers/arrakis.pool.token-helper.ts b/src/apps/arrakis/helpers/arrakis.pool.token-helper.ts new file mode 100644 index 000000000..bb3dec78c --- /dev/null +++ b/src/apps/arrakis/helpers/arrakis.pool.token-helper.ts @@ -0,0 +1,143 @@ +import { Inject, Injectable } from '@nestjs/common'; +import { gql } from 'graphql-request'; +import { compact } from 'lodash'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { + buildDollarDisplayItem, + buildPercentageDisplayItem, +} from '~app-toolkit/helpers/presentation/display-item.present'; +import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; +import { ArrakisContractFactory } from '../contracts'; + +export enum PoolLabelStrategy { + TOKEN_SYMBOLS = 'token-symbols', + POOL_NAME = 'pool-name', +} + +type ArrakisPoolTokenDataProps = { + liquidity: number; + fee: number; + reserves: number[]; +}; + +type GetArrakisPoolTokensParams = { + network: Network; + subgraphUrl: string; +}; + +type PoolAddressesResponse = { + pools: { + id: string; + }[]; +}; + +const POOL_ADDRESSES_QUERY = gql` + { + pools { + id + } + } +`; + +@Injectable() +export class ArrakisPoolTokenHelper { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(ArrakisContractFactory) private readonly contractFactory: ArrakisContractFactory, + ) {} + + async getPositions({ network, subgraphUrl }: GetArrakisPoolTokensParams) { + const multicall = this.appToolkit.getMulticall(network); + const baseTokens = await this.appToolkit.getBaseTokenPrices(network); + + const poolsData = await this.appToolkit.helpers.theGraphHelper.request({ + endpoint: subgraphUrl, + query: POOL_ADDRESSES_QUERY, + }); + + const poolAddresses = (poolsData.pools ?? []).map(v => v.id); + const poolTokens = await Promise.all( + poolAddresses.map(async poolAddress => { + const poolContract = this.contractFactory.arrakisGelatoPool({ network, address: poolAddress }); + + const [symbol, decimals, supplyRaw, token0Address, token1Address, reservesRaw, feeRaw] = await Promise.all([ + multicall.wrap(poolContract).symbol(), + multicall.wrap(poolContract).decimals(), + multicall.wrap(poolContract).totalSupply(), + multicall.wrap(poolContract).token0(), + multicall.wrap(poolContract).token1(), + multicall.wrap(poolContract).getUnderlyingBalances(), + multicall + .wrap(poolContract) + .gelatoFeeBPS() + .catch(() => + multicall.wrap(this.contractFactory.arrakisPool({ network, address: poolAddress })).arrakisFeeBPS(), + ), + ]); + + const maybeTokens = [token0Address, token1Address] + .map(v => v.toLowerCase()) + .map(v => baseTokens.find(t => t.address === v)); + const tokens = compact(maybeTokens); + if (tokens.length !== maybeTokens.length) return null; + + const reserves = reservesRaw.map((r, i) => Number(r) / 10 ** tokens[i].decimals); + const liquidity = tokens.reduce((acc, v, i) => acc + v.price * reserves[i], 0); + if (liquidity < 1000) return null; + + // Data Props + const supply = Number(supplyRaw) / 10 ** decimals; + const fee = Number(feeRaw) / 10 ** 4; + const price = liquidity / supply; + const pricePerShare = reserves.map(r => r / supply); + const reservePercentages = tokens.map((t, i) => reserves[i] * (t.price / liquidity)); + + // Display Props + const label = tokens.map(v => v.symbol).join(' / '); + const secondaryLabel = reservePercentages.map(p => `${Math.round(p * 100)}%`).join(' / '); + const images = tokens.map(v => getTokenImg(v.address, network)); + const statsItems = [ + { label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }, + { label: 'Fee', value: buildPercentageDisplayItem(fee) }, + ]; + + const token: AppTokenPosition = { + type: ContractType.APP_TOKEN, + appId: ARRAKIS_DEFINITION.id, + groupId: ARRAKIS_DEFINITION.groups.pool.id, + address: poolAddress, + network, + symbol, + decimals, + supply, + price, + pricePerShare, + tokens, + + dataProps: { + fee, + liquidity, + reserves, + }, + + displayProps: { + label, + secondaryLabel, + images, + statsItems, + }, + }; + + return token; + }), + ); + + return compact(poolTokens); + } +} diff --git a/src/apps/arrakis/optimism/arrakis.balance-fetcher.ts b/src/apps/arrakis/optimism/arrakis.balance-fetcher.ts new file mode 100644 index 000000000..cb8c2edd1 --- /dev/null +++ b/src/apps/arrakis/optimism/arrakis.balance-fetcher.ts @@ -0,0 +1,36 @@ +import { Inject } from '@nestjs/common'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; + +const network = Network.OPTIMISM_MAINNET; + +@Register.BalanceFetcher(ARRAKIS_DEFINITION.id, Network.OPTIMISM_MAINNET) +export class OptimismArrakisBalanceFetcher implements BalanceFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + private async getPoolTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId: ARRAKIS_DEFINITION.id, + groupId: ARRAKIS_DEFINITION.groups.pool.id, + network, + }); + } + + async getBalances(address: string) { + const [poolTokenBalances] = await Promise.all([this.getPoolTokenBalances(address)]); + + return presentBalanceFetcherResponse([ + { + label: 'Pools', + assets: poolTokenBalances, + }, + ]); + } +} diff --git a/src/apps/arrakis/optimism/arrakis.pool.token-fetcher.ts b/src/apps/arrakis/optimism/arrakis.pool.token-fetcher.ts new file mode 100644 index 000000000..1bbee9705 --- /dev/null +++ b/src/apps/arrakis/optimism/arrakis.pool.token-fetcher.ts @@ -0,0 +1,25 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; +import { ArrakisPoolTokenHelper } from '../helpers/arrakis.pool.token-helper'; + +const appId = ARRAKIS_DEFINITION.id; +const groupId = ARRAKIS_DEFINITION.groups.pool.id; +const network = Network.OPTIMISM_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class OptimismArrakisPoolTokenFetcher implements PositionFetcher { + constructor(@Inject(ArrakisPoolTokenHelper) private readonly arrakisPoolTokenHelper: ArrakisPoolTokenHelper) {} + + async getPositions() { + return this.arrakisPoolTokenHelper.getPositions({ + subgraphUrl: 'https://api.thegraph.com/subgraphs/name/gelatodigital/g-uni-optimism', + network, + }); + } +} diff --git a/src/apps/arrakis/polygon/arrakis.balance-fetcher.ts b/src/apps/arrakis/polygon/arrakis.balance-fetcher.ts new file mode 100644 index 000000000..5e4c94d2c --- /dev/null +++ b/src/apps/arrakis/polygon/arrakis.balance-fetcher.ts @@ -0,0 +1,36 @@ +import { Inject } from '@nestjs/common'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; + +const network = Network.POLYGON_MAINNET; + +@Register.BalanceFetcher(ARRAKIS_DEFINITION.id, Network.POLYGON_MAINNET) +export class PolygonArrakisBalanceFetcher implements BalanceFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + private async getPoolTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId: ARRAKIS_DEFINITION.id, + groupId: ARRAKIS_DEFINITION.groups.pool.id, + network, + }); + } + + async getBalances(address: string) { + const [poolTokenBalances] = await Promise.all([this.getPoolTokenBalances(address)]); + + return presentBalanceFetcherResponse([ + { + label: 'Pools', + assets: poolTokenBalances, + }, + ]); + } +} diff --git a/src/apps/arrakis/polygon/arrakis.pool.token-fetcher.ts b/src/apps/arrakis/polygon/arrakis.pool.token-fetcher.ts new file mode 100644 index 000000000..2ac8f79b4 --- /dev/null +++ b/src/apps/arrakis/polygon/arrakis.pool.token-fetcher.ts @@ -0,0 +1,25 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { ARRAKIS_DEFINITION } from '../arrakis.definition'; +import { ArrakisPoolTokenHelper } from '../helpers/arrakis.pool.token-helper'; + +const appId = ARRAKIS_DEFINITION.id; +const groupId = ARRAKIS_DEFINITION.groups.pool.id; +const network = Network.POLYGON_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class PolygonArrakisPoolTokenFetcher implements PositionFetcher { + constructor(@Inject(ArrakisPoolTokenHelper) private readonly arrakisPoolTokenHelper: ArrakisPoolTokenHelper) {} + + async getPositions() { + return this.arrakisPoolTokenHelper.getPositions({ + subgraphUrl: 'https://api.thegraph.com/subgraphs/name/gelatodigital/g-uni-polygon', + network, + }); + } +} diff --git a/src/apps/lyra-avalon/optimism/lyra-avalon.staking.contract-position-fetcher.ts b/src/apps/lyra-avalon/optimism/lyra-avalon.staking.contract-position-fetcher.ts index 38cd11cad..d1e42e5d9 100644 --- a/src/apps/lyra-avalon/optimism/lyra-avalon.staking.contract-position-fetcher.ts +++ b/src/apps/lyra-avalon/optimism/lyra-avalon.staking.contract-position-fetcher.ts @@ -2,6 +2,7 @@ import { Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; +import { ARRAKIS_DEFINITION } from '~apps/arrakis/arrakis.definition'; import { SynthetixSingleStakingIsActiveStrategy, SynthetixSingleStakingRoiStrategy } from '~apps/synthetix'; import { PositionFetcher } from '~position/position-fetcher.interface'; import { ContractPosition } from '~position/position.interface'; @@ -36,7 +37,7 @@ export class OptimismLyraAvalonStakingContractPositionFetcher implements Positio network, appId, groupId, - dependencies: [{ appId: 'sorbet', groupIds: ['pool'], network }], + dependencies: [{ appId: ARRAKIS_DEFINITION.id, groupIds: [ARRAKIS_DEFINITION.groups.pool.id], network }], resolveFarmContract: ({ network, address }) => this.lyraContractFactory.stakingRewards({ network, address }), resolveIsActive: this.synthetixSingleStakingIsActiveStrategy.build({ resolvePeriodFinish: ({ contract, multicall }) => multicall.wrap(contract).periodFinish(), diff --git a/src/apps/thales/optimism/thales.pool2.contract-position-fetcher.ts b/src/apps/thales/optimism/thales.pool2.contract-position-fetcher.ts index f2d06bb51..5790cde8b 100644 --- a/src/apps/thales/optimism/thales.pool2.contract-position-fetcher.ts +++ b/src/apps/thales/optimism/thales.pool2.contract-position-fetcher.ts @@ -5,6 +5,7 @@ import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Register } from '~app-toolkit/decorators'; import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { ARRAKIS_DEFINITION } from '~apps/arrakis/arrakis.definition'; import { ContractType } from '~position/contract.interface'; import { PositionFetcher } from '~position/position-fetcher.interface'; import { ContractPosition, Token } from '~position/position.interface'; @@ -39,7 +40,12 @@ export class OptimismThalesPool2ContractPositionFetcher implements PositionFetch async getPositions() { const baseTokens = await this.appToolkit.getBaseTokenPrices(network); - const appTokens = await this.appToolkit.getAppTokenPositions({ appId: 'sorbet', groupIds: ['pool'], network }); + const appTokens = await this.appToolkit.getAppTokenPositions({ + appId: ARRAKIS_DEFINITION.id, + groupIds: [ARRAKIS_DEFINITION.groups.pool.id], + network, + }); + const allTokens = [...appTokens, ...baseTokens]; const multicall = this.appToolkit.getMulticall(network);