From 78856d188dd29b22bcce25210309e8e824c62fe8 Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:22:08 +0200 Subject: [PATCH] Added new swap contract integration and fixed fee utilities Also refactored fee resolver to make decision logic which fee to use based on asset correlation --- .../configs/utils/utils.ts | 3 + .../constants/operation-names.ts | 136 +- .../dma-common/utils/swap/calculate-fee.ts | 12 +- packages/dma-common/utils/swap/index.ts | 7 +- packages/dma-contracts/README.md | 6 + .../unit/actions/common/swap/asset-for-dai.ts | 4 +- .../unit/actions/common/swap/dai-for-asset.ts | 8 +- .../swap/dai-for-non-compliant-erc20.ts | 4 +- .../actions/common/swap/erc20-for-erc20.ts | 6 +- .../swap/non-compliant-erc20-for-dai.ts | 4 +- .../unit/actions/common/swap/swap.test.ts | 6 +- .../test/unit/swap/u-swap.test.ts | 4 +- packages/dma-contracts/test/utils/swap.ts | 4 +- packages/dma-library/package.json | 7 +- packages/dma-library/src/index.ts | 2 +- .../multiply/adjust/adjust-risk-down.ts | 16 +- .../multiply/adjust/adjust-risk-up.ts | 15 +- .../multiply/adjust/build-operation.ts | 7 +- .../aave-like/multiply/adjust/generate.ts | 29 +- .../aave-like/multiply/adjust/types.ts | 9 +- .../multiply/close/build-operation.ts | 7 +- .../aave-like/multiply/close/generate.ts | 26 +- .../multiply/open/build-operation.ts | 6 +- .../aave-like/multiply/open/generate.ts | 13 +- .../aave-like/multiply/open/open.ts | 14 +- .../aave/common/build-deposit-args.ts | 16 +- .../src/strategies/ajna/multiply/adjust.ts | 4 +- .../src/strategies/ajna/multiply/close.ts | 18 +- .../src/strategies/ajna/multiply/common.ts | 46 +- .../src/strategies/ajna/multiply/open.ts | 11 +- .../common/close-to-coll-swap-data.ts | 8 +- .../common/close-to-debt-swap-data.ts | 9 +- .../strategies/common/generic-swap-data.ts | 24 +- .../strategies/morphoblue/multiply/adjust.ts | 4 +- .../strategies/morphoblue/multiply/close.ts | 18 +- .../strategies/morphoblue/multiply/open.ts | 44 +- .../src/utils/fee-service/ProtocolId.ts | 8 + .../src/utils/fee-service/calculateFee.ts | 93 + .../fee-service/clients/aave-like-client.ts | 27 + .../fee-service/clients/ajna-v2-client.ts | 25 + .../src/utils/fee-service/constants.ts | 35 + .../utils/fee-service/createGraphQLClient.ts | 74 + .../fee-service/generated/client-aave-like.ts | 4147 +++++++++ .../fee-service/generated/client-ajna-v2.ts | 7416 +++++++++++++++++ .../utils/fee-service/getEarnMultiplyFee.ts | 40 + .../src/utils/fee-service/getPositionData.ts | 18 + .../src/utils/fee-service/index.ts | 1 + .../src/utils/fee-service/interfaces.ts | 5 + .../src/utils/fee-service/isCloseEvent.ts | 6 + .../src/utils/fee-service/isDeriskEvent.ts | 6 + .../src/utils/fee-service/isOpenEvent.ts | 6 + .../src/utils/fee-service/isWithdrawEvent.ts | 6 + .../fee-service/queries/aave-like.graphql | 29 + .../utils/fee-service/queries/ajna-v2.graphql | 29 + .../src/utils/fee-service/types.ts | 17 + .../utils/swap/calculate-swap-fee-amount.ts | 63 +- .../src/utils/swap/fee-resolver.ts | 175 +- .../src/utils/swap/get-swap-data.ts | 10 +- packages/dma-library/src/utils/swap/index.ts | 11 +- .../src/utils/swap/is-swap-needed.ts | 3 + .../src/utils/swap/isCorrelatedPosition.ts | 40 + .../src/utils/swap/percentage-fee-resolver.ts | 131 + .../dma-library/test/fee-resolver.test.ts | 42 +- packages/dma-library/tsconfig.json | 18 +- packages/domain/src/adjust-position.ts | 10 +- yarn.lock | 94 +- 66 files changed, 12702 insertions(+), 440 deletions(-) create mode 100644 packages/dma-library/src/utils/fee-service/ProtocolId.ts create mode 100644 packages/dma-library/src/utils/fee-service/calculateFee.ts create mode 100644 packages/dma-library/src/utils/fee-service/clients/aave-like-client.ts create mode 100644 packages/dma-library/src/utils/fee-service/clients/ajna-v2-client.ts create mode 100644 packages/dma-library/src/utils/fee-service/constants.ts create mode 100644 packages/dma-library/src/utils/fee-service/createGraphQLClient.ts create mode 100644 packages/dma-library/src/utils/fee-service/generated/client-aave-like.ts create mode 100644 packages/dma-library/src/utils/fee-service/generated/client-ajna-v2.ts create mode 100644 packages/dma-library/src/utils/fee-service/getEarnMultiplyFee.ts create mode 100644 packages/dma-library/src/utils/fee-service/getPositionData.ts create mode 100644 packages/dma-library/src/utils/fee-service/index.ts create mode 100644 packages/dma-library/src/utils/fee-service/interfaces.ts create mode 100644 packages/dma-library/src/utils/fee-service/isCloseEvent.ts create mode 100644 packages/dma-library/src/utils/fee-service/isDeriskEvent.ts create mode 100644 packages/dma-library/src/utils/fee-service/isOpenEvent.ts create mode 100644 packages/dma-library/src/utils/fee-service/isWithdrawEvent.ts create mode 100644 packages/dma-library/src/utils/fee-service/queries/aave-like.graphql create mode 100644 packages/dma-library/src/utils/fee-service/queries/ajna-v2.graphql create mode 100644 packages/dma-library/src/utils/fee-service/types.ts create mode 100644 packages/dma-library/src/utils/swap/isCorrelatedPosition.ts create mode 100644 packages/dma-library/src/utils/swap/percentage-fee-resolver.ts diff --git a/packages/deploy-configurations/configs/utils/utils.ts b/packages/deploy-configurations/configs/utils/utils.ts index 601f4c002..9e60bd447 100644 --- a/packages/deploy-configurations/configs/utils/utils.ts +++ b/packages/deploy-configurations/configs/utils/utils.ts @@ -4,6 +4,7 @@ import { Network } from '@deploy-configurations/types/network' import { config as arbitrumConfig } from '../arbitrum.conf' import { config as baseConfig } from '../base.conf' import { config as goerliConfig } from '../goerli.conf' +import { config as hardhatConfig } from '../hardhat.conf' import { config as localConfig } from '../local.conf' import { config as mainnetConfig } from '../mainnet.conf' import { config as optimismConfig } from '../optimism.conf' @@ -24,6 +25,8 @@ export function getConfigByNetwork(network: Network): SystemConfig { return localConfig } else if (network === Network.TENDERLY) { return tenderlyConfig + } else if (network === Network.HARDHAT) { + return hardhatConfig } else { throw new Error(`Unknown network ${network}`) } diff --git a/packages/deploy-configurations/constants/operation-names.ts b/packages/deploy-configurations/constants/operation-names.ts index 7ebb71c23..05e9912c1 100644 --- a/packages/deploy-configurations/constants/operation-names.ts +++ b/packages/deploy-configurations/constants/operation-names.ts @@ -1,28 +1,28 @@ import { Protocol } from '@deploy-configurations/types/protocol' export type AaveV3OperationNames = - | 'OpenAAVEV3Position_v2' - | 'CloseAAVEV3Position_v4' - | 'AdjustRiskUpAAVEV3Position_v2' - | 'AdjustRiskDownAAVEV3Position_v2' - | 'AAVEV3DepositBorrow_v2' - | 'AAVEV3OpenDepositBorrow_v2' - | 'AAVEV3Deposit' - | 'AAVEV3Borrow_v2' - | 'AAVEV3PaybackWithdraw_v2' - | 'MigrateAaveV3EOA_v2' + | 'OpenAAVEV3Position_v3' + | 'CloseAAVEV3Position_v5' + | 'AdjustRiskUpAAVEV3Position_v3' + | 'AdjustRiskDownAAVEV3Position_v3' + | 'AAVEV3DepositBorrow_v3' + | 'AAVEV3OpenDepositBorrow_v3' + | 'AAVEV3Deposit_v2' + | 'AAVEV3Borrow_v3' + | 'AAVEV3PaybackWithdraw_v3' + | 'MigrateAaveV3EOA_v3' export type SparkOperationNames = - | 'SparkOpenPosition_v2' - | 'SparkClosePosition_v2' - | 'SparkAdjustRiskUp_v2' - | 'SparkAdjustRiskDown_v2' - | 'SparkDepositBorrow_v2' - | 'SparkOpenDepositBorrow_v2' - | 'SparkDeposit' - | 'SparkBorrow_v2' - | 'SparkPaybackWithdraw_v2' - | 'MigrateSparkEOA_v2' + | 'SparkOpenPosition_v3' + | 'SparkClosePosition_v3' + | 'SparkAdjustRiskUp_v3' + | 'SparkAdjustRiskDown_v3' + | 'SparkDepositBorrow_v3' + | 'SparkOpenDepositBorrow_v3' + | 'SparkDeposit_v2' + | 'SparkBorrow_v3' + | 'SparkPaybackWithdraw_v3' + | 'MigrateSparkEOA_v3' export const OPERATION_NAMES = { aave: { @@ -38,66 +38,66 @@ export const OPERATION_NAMES = { PAYBACK_WITHDRAW: 'AAVEPaybackWithdraw_2', }, v3: { - OPEN_POSITION: 'OpenAAVEV3Position_v2', - CLOSE_POSITION: 'CloseAAVEV3Position_v4', - ADJUST_RISK_UP: 'AdjustRiskUpAAVEV3Position_v2', - ADJUST_RISK_DOWN: 'AdjustRiskDownAAVEV3Position_v2', - DEPOSIT_BORROW: 'AAVEV3DepositBorrow_v2', - OPEN_DEPOSIT_BORROW: 'AAVEV3OpenDepositBorrow_v2', - DEPOSIT: 'AAVEV3Deposit', - BORROW: 'AAVEV3Borrow_v2', - PAYBACK_WITHDRAW: 'AAVEV3PaybackWithdraw_v2', - MIGRATE_EOA: 'MigrateAaveV3EOA_v2', + OPEN_POSITION: 'OpenAAVEV3Position_v3', + CLOSE_POSITION: 'CloseAAVEV3Position_v5', + ADJUST_RISK_UP: 'AdjustRiskUpAAVEV3Position_v3', + ADJUST_RISK_DOWN: 'AdjustRiskDownAAVEV3Position_v3', + DEPOSIT_BORROW: 'AAVEV3DepositBorrow_v3', + OPEN_DEPOSIT_BORROW: 'AAVEV3OpenDepositBorrow_v3', + DEPOSIT: 'AAVEV3Deposit_v2', + BORROW: 'AAVEV3Borrow_v3', + PAYBACK_WITHDRAW: 'AAVEV3PaybackWithdraw_v3', + MIGRATE_EOA: 'MigrateAaveV3EOA_v3', }, }, spark: { - OPEN_POSITION: 'SparkOpenPosition_v2', - CLOSE_POSITION: 'SparkClosePosition_v2', - ADJUST_RISK_UP: 'SparkAdjustRiskUp_v2', - ADJUST_RISK_DOWN: 'SparkAdjustRiskDown_v2', - DEPOSIT_BORROW: 'SparkDepositBorrow_v2', - OPEN_DEPOSIT_BORROW: 'SparkOpenDepositBorrow_v2', - DEPOSIT: 'SparkDeposit', - BORROW: 'SparkBorrow_v2', - PAYBACK_WITHDRAW: 'SparkPaybackWithdraw_v2', - MIGRATE_EOA: 'MigrateSparkEOA_v2', + OPEN_POSITION: 'SparkOpenPosition_v3', + CLOSE_POSITION: 'SparkClosePosition_v3', + ADJUST_RISK_UP: 'SparkAdjustRiskUp_v3', + ADJUST_RISK_DOWN: 'SparkAdjustRiskDown_v3', + DEPOSIT_BORROW: 'SparkDepositBorrow_v3', + OPEN_DEPOSIT_BORROW: 'SparkOpenDepositBorrow_v3', + DEPOSIT: 'SparkDeposit_v2', + BORROW: 'SparkBorrow_v3', + PAYBACK_WITHDRAW: 'SparkPaybackWithdraw_v3', + MIGRATE_EOA: 'MigrateSparkEOA_v3', }, maker: { - OPEN_AND_DRAW: 'OpenAndDraw', - OPEN_DRAW_AND_CLOSE: 'OpenDrawAndClose', - INCREASE_MULTIPLE: 'IncreaseMultiple', - INCREASE_MULTIPLE_WITH_DAI_TOP_UP: 'IncreaseMultipleWithDaiTopup', - INCREASE_MULTIPLE_WITH_COLL_TOP_UP: 'IncreaseMultipleWithCollateralTopup', - INCREASE_MULTIPLE_WITH_DAI_AND_COLL_TOP_UP: 'IncreaseMultipleWithDaiAndCollTopup', - INCREASE_MULTIPLE_WITH_FLASHLOAN: 'IncreaseMultipleWithFlashloan', + OPEN_AND_DRAW: 'OpenAndDraw_v2', + OPEN_DRAW_AND_CLOSE: 'OpenDrawAndClose_v2', + INCREASE_MULTIPLE: 'IncreaseMultiple_v2', + INCREASE_MULTIPLE_WITH_DAI_TOP_UP: 'IncreaseMultipleWithDaiTopup_v2', + INCREASE_MULTIPLE_WITH_COLL_TOP_UP: 'IncreaseMultipleWithCollateralTopup_v2', + INCREASE_MULTIPLE_WITH_DAI_AND_COLL_TOP_UP: 'IncreaseMultipleWithDaiAndCollTopup_v2', + INCREASE_MULTIPLE_WITH_FLASHLOAN: 'IncreaseMultipleWithFlashloan_v2', INCREASE_MULTIPLE_WITH_FLASHLOAN_AND_DAI_AND_COLL_TOP_UP: - 'IncreaseMultipleWithFlashloanWithDaiAndCollTopup', + 'IncreaseMultipleWithFlashloanWithDaiAndCollTopup_v2', }, ajna: { - OPEN_MULTIPLY_POSITION: 'AjnaOpenMultiplyPosition_5', - ADJUST_RISK_UP: 'AjnaAdjustRiskUp_5', - ADJUST_RISK_DOWN: 'AjnaAdjustRiskDown_5', - DEPOSIT_BORROW: 'AjnaDepositBorrow_5', - PAYBACK_WITHDRAW: 'AjnaPaybackWithdraw_5', - CLOSE_POSITION_TO_QUOTE: 'AjnaCloseToQuotePosition_5', - CLOSE_POSITION_TO_COLLATERAL: 'AjnaCloseToCollateralPosition_5', + OPEN_MULTIPLY_POSITION: 'AjnaOpenMultiplyPosition_6', + ADJUST_RISK_UP: 'AjnaAdjustRiskUp_6', + ADJUST_RISK_DOWN: 'AjnaAdjustRiskDown_6', + DEPOSIT_BORROW: 'AjnaDepositBorrow_6', + PAYBACK_WITHDRAW: 'AjnaPaybackWithdraw_6', + CLOSE_POSITION_TO_QUOTE: 'AjnaCloseToQuotePosition_6', + CLOSE_POSITION_TO_COLLATERAL: 'AjnaCloseToCollateralPosition_6', }, morphoblue: { - OPEN_POSITION: 'MorphoBlueOpenPosition', - CLOSE_POSITION: 'MorphoBlueClosePosition_2', - ADJUST_RISK_UP: 'MorphoBlueAdjustRiskUp', - ADJUST_RISK_DOWN: 'MorphoBlueAdjustRiskDown_2', - DEPOSIT_BORROW: 'MorphoBlueDepositBorrow', - OPEN_DEPOSIT_BORROW: 'MorphoBlueOpenDepositBorrow', - DEPOSIT: 'MorphoBlueDeposit', - BORROW: 'MorphoBlueBorrow', - PAYBACK_WITHDRAW: 'MorphoBluePaybackWithdraw_2', - CLAIM_REWARDS: 'MorphoBlueClaimRewards', + OPEN_POSITION: 'MorphoBlueOpenPosition_2', + CLOSE_POSITION: 'MorphoBlueClosePosition_3', + ADJUST_RISK_UP: 'MorphoBlueAdjustRiskUp_2', + ADJUST_RISK_DOWN: 'MorphoBlueAdjustRiskDown_3', + DEPOSIT_BORROW: 'MorphoBlueDepositBorrow_2', + OPEN_DEPOSIT_BORROW: 'MorphoBlueOpenDepositBorrow_2', + DEPOSIT: 'MorphoBlueDeposit_2', + BORROW: 'MorphoBlueBorrow_2', + PAYBACK_WITHDRAW: 'MorphoBluePaybackWithdraw_3', + CLAIM_REWARDS: 'MorphoBlueClaimRewards_2', }, common: { - CUSTOM_OPERATION: 'CustomOperation', - ERC4626_DEPOSIT: 'ERC4626Deposit', - ERC4626_WITHDRAW: 'ERC4626Withdraw', + CUSTOM_OPERATION: 'CustomOperation_2', + ERC4626_DEPOSIT: 'ERC4626Deposit_2', + ERC4626_WITHDRAW: 'ERC4626Withdraw_2', }, } as const diff --git a/packages/dma-common/utils/swap/calculate-fee.ts b/packages/dma-common/utils/swap/calculate-fee.ts index 8f86eb258..3661a02d5 100644 --- a/packages/dma-common/utils/swap/calculate-fee.ts +++ b/packages/dma-common/utils/swap/calculate-fee.ts @@ -1,7 +1,7 @@ import { DEFAULT_FEE, FEE_BASE } from '@dma-common/constants' import BigNumber from 'bignumber.js' -export function calculateFee(amountWei: BigNumber, fee: number = DEFAULT_FEE): BigNumber { +export function calculatePercentageFee(amountWei: BigNumber, fee: number = DEFAULT_FEE): BigNumber { return amountWei .times(fee) .div(new BigNumber(fee).plus(new BigNumber(FEE_BASE))) @@ -9,9 +9,17 @@ export function calculateFee(amountWei: BigNumber, fee: number = DEFAULT_FEE): B .integerValue(BigNumber.ROUND_DOWN) } -export function calculateFeeOnInputAmount( +export function calculateFixedFee(amountWei: BigNumber, fee: string): BigNumber { + return amountWei.minus(fee).integerValue(BigNumber.ROUND_DOWN) +} + +export function calculatePercentageFeeOnInputAmount( amountWei: BigNumber, fee: number = DEFAULT_FEE, ): BigNumber { return amountWei.times(fee).div(new BigNumber(FEE_BASE)).abs().integerValue(BigNumber.ROUND_UP) } + +export function calculateFixedFeeOnInputAmount(amountWei: BigNumber, fee: string): BigNumber { + return amountWei.plus(fee).integerValue(BigNumber.ROUND_UP) +} diff --git a/packages/dma-common/utils/swap/index.ts b/packages/dma-common/utils/swap/index.ts index 36c55671d..b67cdfa12 100644 --- a/packages/dma-common/utils/swap/index.ts +++ b/packages/dma-common/utils/swap/index.ts @@ -1 +1,6 @@ -export { calculateFee, calculateFeeOnInputAmount } from './calculate-fee' +export { + calculateFixedFee, + calculateFixedFeeOnInputAmount, + calculatePercentageFee, + calculatePercentageFeeOnInputAmount, +} from './calculate-fee' diff --git a/packages/dma-contracts/README.md b/packages/dma-contracts/README.md index 53b8859b6..bdc55edfc 100644 --- a/packages/dma-contracts/README.md +++ b/packages/dma-contracts/README.md @@ -107,3 +107,9 @@ inclusion of the tools in the `hardhat.config.ts` file: //import './tasks/verify-deployment' //import './tasks/verify-operations' ``` + +## Other npm scripts + +e.g. verify operation configs + +`yarn operations:showremote aave.v3 --network mainnet` diff --git a/packages/dma-contracts/test/unit/actions/common/swap/asset-for-dai.ts b/packages/dma-contracts/test/unit/actions/common/swap/asset-for-dai.ts index d75292490..d2a2e3cba 100644 --- a/packages/dma-contracts/test/unit/actions/common/swap/asset-for-dai.ts +++ b/packages/dma-contracts/test/unit/actions/common/swap/asset-for-dai.ts @@ -6,7 +6,7 @@ import { asPercentageValue, exchangeToDAI, expect } from '@dma-common/test-utils import { FakeRequestEnv, RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFeeOnInputAmount } from '@dma-common/utils/swap' +import { calculatePercentageFeeOnInputAmount } from '@dma-common/utils/swap' import { testBlockNumber } from '@dma-contracts/test/config' import { restoreSnapshot, TestHelpers } from '@dma-contracts/utils' import { SwapFeeType } from '@dma-library/types' @@ -35,7 +35,7 @@ describe('Swap | Unit', async () => { describe('Asset for DAI', async () => { const assetAmount = new BigNumber(10) const assetAmountInWei = amountToWei(assetAmount) - const feeAmount = calculateFeeOnInputAmount(assetAmountInWei) + const feeAmount = calculatePercentageFeeOnInputAmount(assetAmountInWei) const assetAmountInWeiWithFee = assetAmountInWei.plus(feeAmount) let receiveAtLeastInWei: BigNumber let data: string diff --git a/packages/dma-contracts/test/unit/actions/common/swap/dai-for-asset.ts b/packages/dma-contracts/test/unit/actions/common/swap/dai-for-asset.ts index 9e2504ede..2eb5ed73f 100644 --- a/packages/dma-contracts/test/unit/actions/common/swap/dai-for-asset.ts +++ b/packages/dma-contracts/test/unit/actions/common/swap/dai-for-asset.ts @@ -6,7 +6,7 @@ import { asPercentageValue, exchangeFromDAI, expect } from '@dma-common/test-uti import { FakeRequestEnv, RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFeeOnInputAmount } from '@dma-common/utils/swap' +import { calculatePercentageFeeOnInputAmount } from '@dma-common/utils/swap' import { testBlockNumber } from '@dma-contracts/test/config' import { restoreSnapshot, TestHelpers } from '@dma-contracts/utils' import { SwapFeeType } from '@dma-library/types' @@ -36,7 +36,7 @@ describe('Swap | Unit', async () => { let data: string const amountInWei = amountToWei(1000) - const feeAmount = calculateFeeOnInputAmount(amountInWei) + const feeAmount = calculatePercentageFeeOnInputAmount(amountInWei) const amountWithFeeInWei = amountInWei.plus(feeAmount) before(async () => { @@ -185,7 +185,7 @@ describe('Swap | Unit', async () => { surplusAmount = new BigNumber(10) moreThanTheTransferAmountWei = amountInWei.plus(amountToWei(surplusAmount)) - moreThanTheTransferAmountWithFee = calculateFeeOnInputAmount( + moreThanTheTransferAmountWithFee = calculatePercentageFeeOnInputAmount( moreThanTheTransferAmountWei, ).plus(moreThanTheTransferAmountWei) @@ -237,7 +237,7 @@ describe('Swap | Unit', async () => { ), ) - const collectedFeeWei = calculateFeeOnInputAmount(moreThanTheTransferAmountWei) + const collectedFeeWei = calculatePercentageFeeOnInputAmount(moreThanTheTransferAmountWei) expect.toBeEqual( daiBalanceWei, diff --git a/packages/dma-contracts/test/unit/actions/common/swap/dai-for-non-compliant-erc20.ts b/packages/dma-contracts/test/unit/actions/common/swap/dai-for-non-compliant-erc20.ts index ede5b331f..2595cd8bf 100644 --- a/packages/dma-contracts/test/unit/actions/common/swap/dai-for-non-compliant-erc20.ts +++ b/packages/dma-contracts/test/unit/actions/common/swap/dai-for-non-compliant-erc20.ts @@ -4,7 +4,7 @@ import { asPercentageValue, exchangeFromDAI, expect } from '@dma-common/test-uti import { FakeRequestEnv, RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFeeOnInputAmount } from '@dma-common/utils/swap' +import { calculatePercentageFeeOnInputAmount } from '@dma-common/utils/swap' import { testBlockNumber } from '@dma-contracts/test/config' import { restoreSnapshot, TestHelpers } from '@dma-contracts/utils' import { SwapFeeType } from '@dma-library/types' @@ -66,7 +66,7 @@ describe('Swap | Unit', async () => { before(async () => { amountInWei = amountToWei(1000) - amountWithFeeInWei = calculateFeeOnInputAmount(amountInWei).plus(amountInWei) + amountWithFeeInWei = calculatePercentageFeeOnInputAmount(amountInWei).plus(amountInWei) }) beforeEach(async () => { diff --git a/packages/dma-contracts/test/unit/actions/common/swap/erc20-for-erc20.ts b/packages/dma-contracts/test/unit/actions/common/swap/erc20-for-erc20.ts index 65e27377c..b24f5defe 100644 --- a/packages/dma-contracts/test/unit/actions/common/swap/erc20-for-erc20.ts +++ b/packages/dma-contracts/test/unit/actions/common/swap/erc20-for-erc20.ts @@ -6,7 +6,7 @@ import { asPercentageValue, expect, swapOneInchTokens } from '@dma-common/test-u import { FakeRequestEnv, RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFeeOnInputAmount } from '@dma-common/utils/swap' +import { calculatePercentageFeeOnInputAmount } from '@dma-common/utils/swap' import { testBlockNumber } from '@dma-contracts/test/config' import { restoreSnapshot, TestHelpers } from '@dma-contracts/utils' import { SwapFeeType } from '@dma-library/types' @@ -76,7 +76,7 @@ describe('Swap | Unit', async () => { fromToken = WETH.address toToken = WBTC.address - amountWithFeeInWei = calculateFeeOnInputAmount(amountInWei).plus(amountInWei) + amountWithFeeInWei = calculatePercentageFeeOnInputAmount(amountInWei).plus(amountInWei) const response = await swapOneInchTokens( fromToken, @@ -146,7 +146,7 @@ describe('Swap | Unit', async () => { const feeWalletBalanceWeiAfter = await balanceOf(fromToken, feeBeneficiaryAddress, { config }) const feeWalletBalanceWeiChange = feeWalletBalanceWeiAfter.minus(feeWalletBalanceWeiBefore) - expect.toBeEqual(feeWalletBalanceWeiChange, calculateFeeOnInputAmount(amountInWei)) + expect.toBeEqual(feeWalletBalanceWeiChange, calculatePercentageFeeOnInputAmount(amountInWei)) }) it('should not leave any fromToken in Swap contract', async () => { diff --git a/packages/dma-contracts/test/unit/actions/common/swap/non-compliant-erc20-for-dai.ts b/packages/dma-contracts/test/unit/actions/common/swap/non-compliant-erc20-for-dai.ts index f1f96c600..5b6f95c08 100644 --- a/packages/dma-contracts/test/unit/actions/common/swap/non-compliant-erc20-for-dai.ts +++ b/packages/dma-contracts/test/unit/actions/common/swap/non-compliant-erc20-for-dai.ts @@ -4,7 +4,7 @@ import { asPercentageValue, exchangeToDAI, expect } from '@dma-common/test-utils import { FakeRequestEnv, RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { testBlockNumber } from '@dma-contracts/test/config' import { restoreSnapshot, TestHelpers } from '@dma-contracts/utils' import { SwapFeeType } from '@dma-library/types' @@ -75,7 +75,7 @@ describe('Swap | Unit', async () => { 6, ) - feeInUSDT = calculateFee(initialUSDTBalanceInWeiWithFee) + feeInUSDT = calculatePercentageFee(initialUSDTBalanceInWeiWithFee) initialUSDTBalanceInWei = initialUSDTBalanceInWeiWithFee.minus(feeInUSDT) diff --git a/packages/dma-contracts/test/unit/actions/common/swap/swap.test.ts b/packages/dma-contracts/test/unit/actions/common/swap/swap.test.ts index 4db6711e4..9162c182c 100644 --- a/packages/dma-contracts/test/unit/actions/common/swap/swap.test.ts +++ b/packages/dma-contracts/test/unit/actions/common/swap/swap.test.ts @@ -6,7 +6,7 @@ import { asPercentageValue, expect, swapOneInchTokens } from '@dma-common/test-u import { FakeRequestEnv, RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountToWei } from '@dma-common/utils/common' -import { calculateFeeOnInputAmount } from '@dma-common/utils/swap' +import { calculatePercentageFeeOnInputAmount } from '@dma-common/utils/swap' import { testBlockNumber } from '@dma-contracts/test/config' import { restoreSnapshot, TestHelpers } from '@dma-contracts/utils' import { SwapFeeType } from '@dma-library/types' @@ -137,7 +137,7 @@ describe('Swap | Unit', async () => { it('should allow to use different tiers', async () => { const amountInWei = amountToWei(10) const fee = 50 - const feeAmount = calculateFeeOnInputAmount(amountInWei, fee) + const feeAmount = calculatePercentageFeeOnInputAmount(amountInWei, fee) const amountInWeiWithFee = amountInWei.plus(feeAmount) await system.Swap.contract.connect(authorizedSigner).addFeeTier(fee) @@ -190,7 +190,7 @@ describe('Swap | Unit', async () => { it('should throw an error when fee tier does not exist', async () => { const amountInWei = amountToWei(10) const fee = 99 - const feeAmount = calculateFeeOnInputAmount(amountInWei, fee) + const feeAmount = calculatePercentageFeeOnInputAmount(amountInWei, fee) const amountInWeiWithFee = amountInWei.plus(feeAmount) const response = await swapOneInchTokens( diff --git a/packages/dma-contracts/test/unit/swap/u-swap.test.ts b/packages/dma-contracts/test/unit/swap/u-swap.test.ts index fc051b5e0..d16f621a0 100644 --- a/packages/dma-contracts/test/unit/swap/u-swap.test.ts +++ b/packages/dma-contracts/test/unit/swap/u-swap.test.ts @@ -10,7 +10,7 @@ import { balanceOf } from '@dma-common/utils/balances' import { amountToWei } from '@dma-common/utils/common' import { createDeploy } from '@dma-common/utils/deploy' import init from '@dma-common/utils/init' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { swap, uniswapV3Swap, unoswap } from '@dma-contracts/test/fixtures' import BigNumber from 'bignumber.js' import { Contract } from 'ethers' @@ -67,7 +67,7 @@ describe.skip('uSwap | Unit', () => { describe('WETH to DAI, fee in WETH', () => { const amountInWei = amountToWei(new BigNumber(10)) - const fee = calculateFee(amountInWei, FEE) + const fee = calculatePercentageFee(amountInWei, FEE) const depositAmountWithFeeWei = amountInWei.plus(fee) const slippage = asPercentageValue(10, 100) diff --git a/packages/dma-contracts/test/utils/swap.ts b/packages/dma-contracts/test/utils/swap.ts index 96899e514..ed5c0ba81 100644 --- a/packages/dma-contracts/test/utils/swap.ts +++ b/packages/dma-contracts/test/utils/swap.ts @@ -6,7 +6,7 @@ import { Percentage, swapOneInchTokens } from '@dma-common/test-utils' import { RuntimeConfig } from '@dma-common/types/common' import { balanceOf } from '@dma-common/utils/balances' import { amountToWei } from '@dma-common/utils/common' -import { calculateFeeOnInputAmount } from '@dma-common/utils/swap' +import { calculatePercentageFeeOnInputAmount } from '@dma-common/utils/swap' import { TestDeploymentSystem } from '@dma-contracts/utils' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { WETH, WETH__factory } from '@typechain' @@ -61,7 +61,7 @@ export async function swapTokens( } // Setup Swap - const amountWithFeeInWei = calculateFeeOnInputAmount(amount).plus(amount) + const amountWithFeeInWei = calculatePercentageFeeOnInputAmount(amount).plus(amount) const response = await swapOneInchTokens( fromToken, diff --git a/packages/dma-library/package.json b/packages/dma-library/package.json index 417c83ee3..9adb3301b 100644 --- a/packages/dma-library/package.json +++ b/packages/dma-library/package.json @@ -20,13 +20,14 @@ "lint:fix": "yarn eslint . --fix --ext .ts", "test": "yarn mocha -r ts-node/register -r tsconfig-paths/register 'test/**/*.ts'", "linked": "yarn link", - "unlinked": "yarn unlink", - "prepublish": "rm -rf ../../.parcel-cache && yarn build" + "unlinked": "yarn unlink" }, "license": "Apache-2.0", "dependencies": { "bignumber.js": "9.0.1", - "ethers": "^5.7.2" + "ethers": "^5.7.2", + "graphql-request": "^7.1.0", + "graphql-tag": "^2.12.6" }, "nx": { "implicitDependencies": [ diff --git a/packages/dma-library/src/index.ts b/packages/dma-library/src/index.ts index c65a83808..8f2f0376a 100644 --- a/packages/dma-library/src/index.ts +++ b/packages/dma-library/src/index.ts @@ -19,7 +19,7 @@ export { getMarketRate } from './strategies/morphoblue/validation' export { views } from './views' // UTILS -export { isCorrelatedPosition } from './utils/swap/fee-resolver' +export { isCorrelatedPosition } from './utils/swap/percentage-fee-resolver' export { normalizeValue } from '@dma-common/utils/common' export { negativeToZero } from '@dma-common/utils/common' diff --git a/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-down.ts b/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-down.ts index 8e9cef693..1a6aadb91 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-down.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-down.ts @@ -2,6 +2,7 @@ import { amountToWei } from '@dma-common/utils/common' import { getAaveTokenAddress } from '@dma-library/strategies/aave/common' import { AaveLikeAdjustDown } from '@dma-library/strategies/aave-like/multiply/adjust/types' import { AaveLikeTokens } from '@dma-library/types' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' import { feeResolver, getSwapDataHelper } from '@dma-library/utils/swap' import BigNumber from 'bignumber.js' @@ -12,9 +13,11 @@ import { simulate } from './simulate' export const adjustRiskDown: AaveLikeAdjustDown = async (args, dependencies) => { const isAdjustDown = true const isAdjustUp = !isAdjustDown - const fee = feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + + const fee = await feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { isIncreasingRisk: isAdjustUp, isEarnPosition: dependencies.positionType === 'Earn', + positionData: await getPositionDataAaveLike(dependencies), }) // Get quote swap @@ -27,7 +30,8 @@ export const adjustRiskDown: AaveLikeAdjustDown = async (args, dependencies) => fromToken: args.collateralToken, toToken: args.debtToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: estimatedSwapAmount, }, addresses: dependencies.addresses, @@ -41,7 +45,7 @@ export const adjustRiskDown: AaveLikeAdjustDown = async (args, dependencies) => const { simulatedPositionTransition: simulatedAdjustDown } = await simulate( isAdjustUp, quoteSwapData, - { ...args, fee }, + { ...args, fee: fee.feeToCharge }, dependencies, false, ) @@ -55,7 +59,8 @@ export const adjustRiskDown: AaveLikeAdjustDown = async (args, dependencies) => fromToken: args.collateralToken, toToken: args.debtToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: simulatedAdjustDown.swap.fromTokenAmount, }, addresses: dependencies.addresses, @@ -83,7 +88,8 @@ export const adjustRiskDown: AaveLikeAdjustDown = async (args, dependencies) => swapData, operation, collectFeeFrom, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, simulation: simulatedAdjustDown, args, dependencies, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-up.ts b/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-up.ts index 75299515d..6b2c52235 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-up.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/adjust/adjust-risk-up.ts @@ -1,6 +1,7 @@ import { amountToWei } from '@dma-common/utils/common' import { getAaveTokenAddress } from '@dma-library/strategies/aave/common' import { AaveLikeTokens } from '@dma-library/types' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' import { feeResolver, getSwapDataHelper } from '@dma-library/utils/swap' import BigNumber from 'bignumber.js' @@ -11,9 +12,10 @@ import { AaveLikeAdjustUp } from './types' export const adjustRiskUp: AaveLikeAdjustUp = async (args, dependencies) => { const isAdjustUp = true - const fee = feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + const fee = await feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { isIncreasingRisk: isAdjustUp, isEarnPosition: dependencies.positionType === 'Earn', + positionData: getPositionDataAaveLike(dependencies), }) // Get quote swap @@ -26,7 +28,8 @@ export const adjustRiskUp: AaveLikeAdjustUp = async (args, dependencies) => { fromToken: args.debtToken, toToken: args.collateralToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: estimatedSwapAmount, }, addresses: dependencies.addresses, @@ -40,7 +43,7 @@ export const adjustRiskUp: AaveLikeAdjustUp = async (args, dependencies) => { const { simulatedPositionTransition: simulatedAdjustUp } = await simulate( isAdjustUp, quoteSwapData, - { ...args, fee }, + { ...args, fee: fee.feeToCharge }, dependencies, true, dependencies.debug, @@ -55,7 +58,8 @@ export const adjustRiskUp: AaveLikeAdjustUp = async (args, dependencies) => { fromToken: args.debtToken, toToken: args.collateralToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: simulatedAdjustUp.swap.fromTokenAmount, }, addresses: dependencies.addresses, @@ -83,7 +87,8 @@ export const adjustRiskUp: AaveLikeAdjustUp = async (args, dependencies) => { swapData, operation, collectFeeFrom, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, simulation: simulatedAdjustUp, args, dependencies, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/adjust/build-operation.ts b/packages/dma-library/src/strategies/aave-like/multiply/adjust/build-operation.ts index 980635c2a..fd230a05c 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/adjust/build-operation.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/adjust/build-operation.ts @@ -5,6 +5,7 @@ import { AdjustRiskUpArgs } from '@dma-library/operations/aave/multiply/v3/adjus import { resolveAaveLikeMultiplyOperations } from '@dma-library/operations/aave-like/resolve-aavelike-operations' import { getAaveTokenAddresses } from '@dma-library/strategies/aave/common' import { IOperation, SwapData } from '@dma-library/types' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' import { resolveFlashloanProvider } from '@dma-library/utils/flashloan/resolve-provider' import { feeResolver } from '@dma-library/utils/swap' import * as Domain from '@domain' @@ -44,9 +45,11 @@ export async function buildOperation({ ? args.depositedByUser?.collateralInWei : args.depositedByUser?.debtInWei const adjustRiskDown = !adjustRiskUp - const fee = feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + + const fee = await feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { isIncreasingRisk: adjustRiskUp, isEarnPosition: dependencies.positionType === 'Earn', + positionData: getPositionDataAaveLike(dependencies), }) const adjustRiskArgs = { @@ -65,7 +68,7 @@ export async function buildOperation({ amount: depositAmount || ZERO, }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: swapAmountBeforeFees, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/adjust/generate.ts b/packages/dma-library/src/strategies/aave-like/multiply/adjust/generate.ts index 65d3db7dc..1194b9b20 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/adjust/generate.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/adjust/generate.ts @@ -1,7 +1,9 @@ -import { FEE_ESTIMATE_INFLATOR, ONE, ZERO } from '@dma-common/constants' import { amountFromWei } from '@dma-common/utils/common' -import { calculateFee } from '@dma-common/utils/swap' -import BigNumber from 'bignumber.js' +import { + calculateInflatedTokenFee, + calculatePostSwapFeeAmount, + calculatePreSwapFeeAmount, +} from '@dma-library/utils/swap' import { GenerateArgs, IAdjustStrategy } from './types' @@ -11,6 +13,7 @@ export async function generate({ operation, collectFeeFrom, fee, + feeType, simulation, args, }: GenerateArgs): Promise { @@ -36,15 +39,17 @@ export async function generate({ // When collecting fees from the target token (collateral here), we want to calculate the fee // Based on the toTokenAmount NOT minToTokenAmount so that we overestimate the fee where possible // And do not mislead the user - const shouldCollectFeeFromSourceToken = collectFeeFrom === 'sourceToken' const sourceTokenAmount = isIncreasingRisk ? simulation.delta.debt : simulation.delta.collateral - const preSwapFee = shouldCollectFeeFromSourceToken - ? calculateFee(sourceTokenAmount, fee.toNumber()) - : ZERO - const postSwapFee = shouldCollectFeeFromSourceToken - ? ZERO - : calculateFee(swapData.toTokenAmount, fee.toNumber()) + // TODO: extract this to a helper function like on the left side + const preSwapFee = calculatePreSwapFeeAmount(collectFeeFrom, sourceTokenAmount, fee, feeType) + + const postSwapFee = calculatePostSwapFeeAmount( + collectFeeFrom, + swapData.toTokenAmount, + fee, + feeType, + ) return { transaction: { @@ -57,9 +62,7 @@ export async function generate({ ...simulation.swap, ...swapData, collectFeeFrom, - tokenFee: preSwapFee.plus( - postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), - ), + tokenFee: calculateInflatedTokenFee({ postSwapFee, preSwapFee }), }, position: finalPosition, minConfigurableRiskRatio: finalPosition.minConfigurableRiskRatio( diff --git a/packages/dma-library/src/strategies/aave-like/multiply/adjust/types.ts b/packages/dma-library/src/strategies/aave-like/multiply/adjust/types.ts index a1c7a8079..acc55bda9 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/adjust/types.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/adjust/types.ts @@ -1,5 +1,11 @@ import { Network } from '@deploy-configurations/types/network' -import { AaveLikePositionV2, IOperation, SummerStrategy, SwapData } from '@dma-library/types' +import { + type SwapFeeType, + AaveLikePositionV2, + IOperation, + SummerStrategy, + SwapData, +} from '@dma-library/types' import * as Strategies from '@dma-library/types/strategies' import * as StrategyParams from '@dma-library/types/strategy-params' import { IBaseSimulatedTransition } from '@domain' @@ -51,6 +57,7 @@ export type GenerateArgs = { operation: IOperation collectFeeFrom: 'sourceToken' | 'targetToken' fee: BigNumber + feeType: SwapFeeType simulation: IBaseSimulatedTransition args: AaveLikeAdjustArgs dependencies: AaveLikeAdjustDependencies diff --git a/packages/dma-library/src/strategies/aave-like/multiply/close/build-operation.ts b/packages/dma-library/src/strategies/aave-like/multiply/close/build-operation.ts index 0723acd65..44e97a501 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/close/build-operation.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/close/build-operation.ts @@ -4,6 +4,7 @@ import { amountFromWei, amountToWei } from '@dma-common/utils/common' import { resolveAaveLikeMultiplyOperations } from '@dma-library/operations/aave-like/resolve-aavelike-operations' import { SAFETY_MARGIN } from '@dma-library/strategies/aave-like/multiply/close/constants' import { IOperation, SwapData } from '@dma-library/types' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' import { resolveFlashloanProvider } from '@dma-library/utils/flashloan/resolve-provider' import { feeResolver } from '@dma-library/utils/swap' import * as Domain from '@domain' @@ -25,7 +26,9 @@ export async function buildOperation( debtToken: { address: debtTokenAddress }, } = args - const fee = feeResolver(args.collateralToken.symbol, args.debtToken.symbol) + const fee = await feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + positionData: getPositionDataAaveLike(dependencies), + }) const collateralAmountToBeSwapped = args.shouldCloseToCollateral ? swapData.fromTokenAmount.plus(swapData.preSwapFee) : dependencies.currentPosition.collateral.amount.minus(1) @@ -62,7 +65,7 @@ export async function buildOperation( isEth: args.debtToken.symbol === 'ETH', }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: collateralAmountToBeSwapped, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/close/generate.ts b/packages/dma-library/src/strategies/aave-like/multiply/close/generate.ts index 4b8176c13..d3f23e9be 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/close/generate.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/close/generate.ts @@ -1,7 +1,11 @@ -import { FEE_ESTIMATE_INFLATOR, ONE, TYPICAL_PRECISION, ZERO } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { TYPICAL_PRECISION, ZERO } from '@dma-common/constants' import { IOperation, SwapData } from '@dma-library/types' -import { feeResolver } from '@dma-library/utils/swap' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' +import { + calculateInflatedTokenFee, + calculatePostSwapFeeAmount, + feeResolver, +} from '@dma-library/utils/swap' import { Position } from '@domain' import BigNumber from 'bignumber.js' @@ -45,10 +49,16 @@ export async function generate( currentPosition.category, ) - const fee = feeResolver(args.collateralToken.symbol, args.debtToken.symbol) + const fee = await feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + positionData: getPositionDataAaveLike(dependencies), + }) - const postSwapFee = - collectFeeFrom === 'targetToken' ? calculateFee(swapData.toTokenAmount, fee.toNumber()) : ZERO + const postSwapFee = calculatePostSwapFeeAmount( + collectFeeFrom, + swapData.toTokenAmount, + fee.feeToCharge, + fee.feeType, + ) return { transaction: { @@ -62,9 +72,7 @@ export async function generate( }, swap: { ...swapData, - tokenFee: preSwapFee.plus( - postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), - ), + tokenFee: calculateInflatedTokenFee({ postSwapFee, preSwapFee }), collectFeeFrom, sourceToken: { symbol: args.collateralToken.symbol, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/open/build-operation.ts b/packages/dma-library/src/strategies/aave-like/multiply/open/build-operation.ts index ff79edf57..a9b1d9a9b 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/open/build-operation.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/open/build-operation.ts @@ -7,6 +7,7 @@ import { AaveLikeOpenDependencies, } from '@dma-library/strategies/aave-like/multiply/open/types' import { SwapData } from '@dma-library/types' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' import { resolveFlashloanProvider } from '@dma-library/utils/flashloan/resolve-provider' import * as SwapUtils from '@dma-library/utils/swap' import * as Domain from '@domain' @@ -31,9 +32,10 @@ export async function buildOperation( const swapAmountBeforeFees = simulation.swap.fromTokenAmount const isIncreasingRisk = true - const fee = SwapUtils.feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + const fee = await SwapUtils.feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { isIncreasingRisk, isEarnPosition: dependencies.positionType === 'Earn', + positionData: getPositionDataAaveLike(dependencies), }) const positionType = dependencies.positionType @@ -66,7 +68,7 @@ export async function buildOperation( amount: depositAmount || ZERO, }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: swapAmountBeforeFees, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/open/generate.ts b/packages/dma-library/src/strategies/aave-like/multiply/open/generate.ts index d19bb6870..abaa6e264 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/open/generate.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/open/generate.ts @@ -1,6 +1,7 @@ -import { FEE_ESTIMATE_INFLATOR, ONE, ZERO } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { ZERO } from '@dma-common/constants' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { IOperation, SwapData } from '@dma-library/types' +import { calculateInflatedTokenFee } from '@dma-library/utils/swap' import { IBaseSimulatedTransition } from '@domain' import BigNumber from 'bignumber.js' @@ -32,11 +33,11 @@ export async function generate({ const shouldCollectFeeFromSourceToken = collectFeeFrom === 'sourceToken' const preSwapFee = shouldCollectFeeFromSourceToken - ? calculateFee(simulatedPositionTransition.delta.debt, fee.toNumber()) + ? calculatePercentageFee(simulatedPositionTransition.delta.debt, fee.toNumber()) : ZERO const postSwapFee = shouldCollectFeeFromSourceToken ? ZERO - : calculateFee(swapData.toTokenAmount, fee.toNumber()) + : calculatePercentageFee(swapData.toTokenAmount, fee.toNumber()) return { transaction: { @@ -49,9 +50,7 @@ export async function generate({ ...simulatedPositionTransition.swap, ...swapData, collectFeeFrom, - tokenFee: preSwapFee.plus( - postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), - ), + tokenFee: calculateInflatedTokenFee({ postSwapFee, preSwapFee }), }, position: finalPosition, }, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/open/open.ts b/packages/dma-library/src/strategies/aave-like/multiply/open/open.ts index 004533119..3ebd44272 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/open/open.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/open/open.ts @@ -1,6 +1,7 @@ import { amountToWei } from '@dma-common/utils/common' import { getAaveTokenAddress } from '@dma-library/strategies/aave/common' import { AaveLikeTokens } from '@dma-library/types/aave-like' +import { getPositionDataAaveLike } from '@dma-library/utils/fee-service' import * as SwapUtils from '@dma-library/utils/swap' import BigNumber from 'bignumber.js' @@ -10,9 +11,10 @@ import { simulate } from './simulate' import { AaveLikeOpen } from './types' export const open: AaveLikeOpen = async (args, dependencies) => { - const fee = SwapUtils.feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { + const fee = await SwapUtils.feeResolver(args.collateralToken.symbol, args.debtToken.symbol, { isIncreasingRisk: true, isEarnPosition: dependencies.positionType === 'Earn', + positionData: getPositionDataAaveLike(dependencies), }) const estimatedSwapAmount = amountToWei(new BigNumber(1), args.debtToken.precision) @@ -25,7 +27,8 @@ export const open: AaveLikeOpen = async (args, dependencies) => { fromToken: args.debtToken, toToken: args.collateralToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: estimatedSwapAmount, }, addresses: dependencies.addresses, @@ -40,7 +43,7 @@ export const open: AaveLikeOpen = async (args, dependencies) => { quoteSwapData, { ...args, - fee, + fee: fee.feeToCharge, }, dependencies, true, @@ -54,7 +57,8 @@ export const open: AaveLikeOpen = async (args, dependencies) => { fromToken: args.debtToken, toToken: args.collateralToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: simulatedPositionTransition.swap.fromTokenAmount, }, addresses: dependencies.addresses, @@ -80,7 +84,7 @@ export const open: AaveLikeOpen = async (args, dependencies) => { operation, args, collectFeeFrom, - fee, + fee: fee.feeToCharge, dependencies, simulatedPositionTransition, quoteSwapData, diff --git a/packages/dma-library/src/strategies/aave/common/build-deposit-args.ts b/packages/dma-library/src/strategies/aave/common/build-deposit-args.ts index 472330831..28178b6bc 100644 --- a/packages/dma-library/src/strategies/aave/common/build-deposit-args.ts +++ b/packages/dma-library/src/strategies/aave/common/build-deposit-args.ts @@ -1,4 +1,5 @@ import { Address } from '@deploy-configurations/types/address' +import type { Network } from '@deploy-configurations/types/network' import { ZERO } from '@dma-common/constants' import { DepositArgs } from '@dma-library/operations' import { AaveLikeStrategyAddresses } from '@dma-library/operations/aave-like' @@ -16,6 +17,7 @@ export async function buildDepositArgs( slippage: BigNumber, dependencies: { user: Address + network: Network addresses: AaveLikeStrategyAddresses } & StrategyParams.WithOptionalGetSwap, alwaysReturnArgs = false, @@ -47,6 +49,7 @@ export async function buildDepositArgs( dependencies.addresses.tokens.ETH, dependencies.addresses.tokens.WETH, ) + const collectFeeFrom = SwapUtils.acceptedFeeTokenBySymbol({ fromTokenSymbol: entryToken.symbol, toTokenSymbol: collateralSymbol, @@ -68,7 +71,7 @@ export async function buildDepositArgs( if (!dependencies.getSwapData) throw new Error('Swap data is required for swap to be performed') const collectFeeInFromToken = collectFeeFrom === 'sourceToken' - const fee = SwapUtils.feeResolver(entryToken.symbol, collateralSymbol, { + const fee = SwapUtils.percentageFeeResolver(entryToken.symbol, collateralSymbol, { isEntrySwap: true, }) @@ -80,7 +83,8 @@ export async function buildDepositArgs( fromToken: entryToken, toToken: collateralToken, slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: entryTokenAmount, }, addresses: dependencies.addresses, @@ -93,11 +97,11 @@ export async function buildDepositArgs( const swapArgs = { calldata: swapData.exchangeCalldata.toString(), collectFeeInFromToken, - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), receiveAtLeast: swapData.minToTokenAmount, } - // If a swap is needed, the collateral delta is to token amount (amount of collateral received) + // If a swap is needed, the collateral delta is min to token amount (amount of collateral received) const collateralDelta = swapData.minToTokenAmount // Estimated fee collected from Swap @@ -105,7 +109,8 @@ export async function buildDepositArgs( collectFeeFrom, entryTokenAmount, swapData.toTokenAmount, - fee, + fee.feeToCharge, + fee.feeType, ) return { @@ -121,6 +126,7 @@ export async function buildDepositArgs( }, } } + if (!isSwapNeeded) { // If no swap is needed, the collateral delta is the same as the entry token amount (deposit amount) const collateralDelta = entryTokenAmount diff --git a/packages/dma-library/src/strategies/ajna/multiply/adjust.ts b/packages/dma-library/src/strategies/ajna/multiply/adjust.ts index bec613e7a..2c3bb0937 100644 --- a/packages/dma-library/src/strategies/ajna/multiply/adjust.ts +++ b/packages/dma-library/src/strategies/ajna/multiply/adjust.ts @@ -143,7 +143,7 @@ async function buildOperation( const fromTokenSymbol = riskIsIncreasing ? args.quoteTokenSymbol : args.collateralTokenSymbol const toTokenSymbol = riskIsIncreasing ? args.collateralTokenSymbol : args.quoteTokenSymbol - const fee = SwapUtils.feeResolver(fromTokenSymbol, toTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(fromTokenSymbol, toTokenSymbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: SwapUtils.isCorrelatedPosition(fromTokenSymbol, toTokenSymbol), }) @@ -184,7 +184,7 @@ async function buildOperation( amount: args.collateralAmount, }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: swapAmountBeforeFees, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/ajna/multiply/close.ts b/packages/dma-library/src/strategies/ajna/multiply/close.ts index 385a6f011..66e5c9d77 100644 --- a/packages/dma-library/src/strategies/ajna/multiply/close.ts +++ b/packages/dma-library/src/strategies/ajna/multiply/close.ts @@ -1,7 +1,7 @@ -import { FEE_ESTIMATE_INFLATOR, ONE, ZERO } from '@dma-common/constants' +import { ONE, ZERO } from '@dma-common/constants' import { CollectFeeFrom } from '@dma-common/types' import { amountToWei } from '@dma-common/utils/common' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { areSymbolsEqual } from '@dma-common/utils/symbols' import { operations } from '@dma-library/operations' import { prepareAjnaDMAPayload, resolveTxValue } from '@dma-library/protocols/ajna' @@ -57,7 +57,7 @@ export const closeMultiply: AjnaCloseStrategy = async (args, dependencies) => { const targetPosition = args.position.close() - const fee = SwapUtils.feeResolver(args.collateralTokenSymbol, args.quoteTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(args.collateralTokenSymbol, args.quoteTokenSymbol, { isEarnPosition: SwapUtils.isCorrelatedPosition( args.collateralTokenSymbol, args.quoteTokenSymbol, @@ -66,11 +66,11 @@ export const closeMultiply: AjnaCloseStrategy = async (args, dependencies) => { }) const postSwapFee = - collectFeeFrom === 'targetToken' ? calculateFee(swapData.toTokenAmount, fee.toNumber()) : ZERO + collectFeeFrom === 'targetToken' + ? calculatePercentageFee(swapData.toTokenAmount, fee.feeToCharge.toNumber()) + : ZERO - const tokenFee = preSwapFee.plus( - postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), - ) + const tokenFee = SwapUtils.calculateInflatedTokenFee({ postSwapFee, preSwapFee }) // Validation const errors = [ @@ -188,7 +188,7 @@ async function buildOperation( address: position.pool.quoteToken, } - const fee = SwapUtils.feeResolver(args.collateralTokenSymbol, args.quoteTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(args.collateralTokenSymbol, args.quoteTokenSymbol, { isEarnPosition: SwapUtils.isCorrelatedPosition( args.collateralTokenSymbol, args.quoteTokenSymbol, @@ -210,7 +210,7 @@ async function buildOperation( isEth: areSymbolsEqual(debtToken.symbol, 'ETH'), }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: collateralAmountToBeSwapped, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/ajna/multiply/common.ts b/packages/dma-library/src/strategies/ajna/multiply/common.ts index 4da3e14e8..a3604dd5a 100644 --- a/packages/dma-library/src/strategies/ajna/multiply/common.ts +++ b/packages/dma-library/src/strategies/ajna/multiply/common.ts @@ -2,7 +2,7 @@ import { ONE, TYPICAL_PRECISION, ZERO } from '@dma-common/constants' import { CollectFeeFrom } from '@dma-common/types' import { areAddressesEqual } from '@dma-common/utils/addresses/index' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { BALANCER_FEE } from '@dma-library/config/flashloan-fees' import { getNeutralPrice, prepareAjnaDMAPayload, resolveTxValue } from '@dma-library/protocols/ajna' import { @@ -40,13 +40,13 @@ export async function simulateAdjustment( const fromToken = buildFromToken(args, riskIsIncreasing) const toToken = buildToToken(args, riskIsIncreasing) - const fee = - __feeOverride || - SwapUtils.feeResolver(fromToken.symbol, toToken.symbol, { - isIncreasingRisk: riskIsIncreasing, - // Strategy is called open multiply (not open earn) - isEarnPosition: positionType === 'Earn', - }) + const feeResult = SwapUtils.percentageFeeResolver(fromToken.symbol, toToken.symbol, { + isIncreasingRisk: riskIsIncreasing, + // Strategy is called open multiply (not open earn) + isEarnPosition: positionType === 'Earn', + }) + const fee = __feeOverride || feeResult.feeToCharge + const { swapData: preFlightSwapData } = await SwapUtils.getSwapDataHelper< typeof dependencies.addresses, string @@ -56,6 +56,7 @@ export async function simulateAdjustment( toToken, slippage: args.slippage, fee, + feeType: feeResult.feeType, swapAmountBeforeFees: preFlightSwapAmount, }, addresses: dependencies.addresses, @@ -136,17 +137,17 @@ export async function getSwapData( __feeOverride?: BigNumber, ) { const swapAmountBeforeFees = simulatedAdjust.swap.fromTokenAmount - const fee = - __feeOverride || - SwapUtils.feeResolver( - simulatedAdjust.position.collateral.symbol, - simulatedAdjust.position.debt.symbol, - { - isIncreasingRisk: riskIsIncreasing, - // Strategy is called open multiply (not open earn) - isEarnPosition: positionType === 'Earn', - }, - ) + const feeResult = SwapUtils.percentageFeeResolver( + simulatedAdjust.position.collateral.symbol, + simulatedAdjust.position.debt.symbol, + { + isIncreasingRisk: riskIsIncreasing, + // Strategy is called open multiply (not open earn) + isEarnPosition: positionType === 'Earn', + }, + ) + const fee = __feeOverride || feeResult.feeToCharge + const { swapData, collectFeeFrom, preSwapFee } = await SwapUtils.getSwapDataHelper< typeof dependencies.addresses, string @@ -156,6 +157,7 @@ export async function getSwapData( toToken: buildToToken(args, riskIsIncreasing), slippage: args.slippage, fee, + feeType: feeResult.feeType, swapAmountBeforeFees: swapAmountBeforeFees, }, addresses: dependencies.addresses, @@ -211,12 +213,14 @@ export function prepareAjnaMultiplyDMAPayload( const txAmount = args.collateralAmount const fromTokenSymbol = riskIsIncreasing ? args.quoteTokenSymbol : args.collateralTokenSymbol const toTokenSymbol = riskIsIncreasing ? args.collateralTokenSymbol : args.quoteTokenSymbol - const fee = SwapUtils.feeResolver(fromTokenSymbol, toTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(fromTokenSymbol, toTokenSymbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: false, }) const postSwapFee = - collectFeeFrom === 'sourceToken' ? ZERO : calculateFee(swapData.toTokenAmount, fee.toNumber()) + collectFeeFrom === 'sourceToken' + ? ZERO + : calculatePercentageFee(swapData.toTokenAmount, fee.feeToCharge.toNumber()) const tokenFee = preSwapFee.plus(postSwapFee) // Validation diff --git a/packages/dma-library/src/strategies/ajna/multiply/open.ts b/packages/dma-library/src/strategies/ajna/multiply/open.ts index 6205b13ad..8e661b841 100644 --- a/packages/dma-library/src/strategies/ajna/multiply/open.ts +++ b/packages/dma-library/src/strategies/ajna/multiply/open.ts @@ -124,7 +124,7 @@ async function simulateAdjustment( const preFlightSwapAmount = amountToWei(ONE, args.quoteTokenPrecision) const fromToken = buildFromToken({ ...args, position }, riskIsIncreasing) const toToken = buildToToken({ ...args, position }, riskIsIncreasing) - const fee = SwapUtils.feeResolver(fromToken.symbol, toToken.symbol, { + const fee = SwapUtils.percentageFeeResolver(fromToken.symbol, toToken.symbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: SwapUtils.isCorrelatedPosition(fromToken.symbol, toToken.symbol), }) @@ -136,7 +136,8 @@ async function simulateAdjustment( fromToken, toToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: preFlightSwapAmount, }, addresses: dependencies.addresses, @@ -166,7 +167,7 @@ async function simulateAdjustment( debt: ZERO, }, fees: { - oazo: fee, + oazo: fee.feeToCharge, flashLoan: BALANCER_FEE, }, prices: { @@ -212,7 +213,7 @@ async function buildOperation( const borrowAmount = simulatedAdjust.delta.debt.minus(debtTokensDeposited) const collateralTokenSymbol = simulatedAdjust.position.collateral.symbol.toUpperCase() const debtTokenSymbol = simulatedAdjust.position.debt.symbol.toUpperCase() - const fee = SwapUtils.feeResolver(collateralTokenSymbol, debtTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(collateralTokenSymbol, debtTokenSymbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: SwapUtils.isCorrelatedPosition(collateralTokenSymbol, debtTokenSymbol), }) @@ -242,7 +243,7 @@ async function buildOperation( amount: args.collateralAmount, }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: swapAmountBeforeFees, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/common/close-to-coll-swap-data.ts b/packages/dma-library/src/strategies/common/close-to-coll-swap-data.ts index 36f9b1c10..8a3b42e3e 100644 --- a/packages/dma-library/src/strategies/common/close-to-coll-swap-data.ts +++ b/packages/dma-library/src/strategies/common/close-to-coll-swap-data.ts @@ -1,6 +1,6 @@ import { Address } from '@deploy-configurations/types/address' import { FEE_BASE, ONE, TEN, ZERO } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { SAFETY_MARGIN } from '@dma-library/strategies/aave-like/multiply/close/constants' import { GetSwapData } from '@dma-library/types/common' import * as SwapUtils from '@dma-library/utils/swap' @@ -50,7 +50,9 @@ export async function getSwapDataForCloseToCollateral({ // so instead of charging the user a fee, we add an offset ( equal to the fee ) to the // collateral amount. This means irrespective of whether the fee is collected before // or after the swap, there will always be sufficient debt token remaining to cover the outstanding position debt. - const fee = __feeOverride || SwapUtils.feeResolver(collateralToken.symbol, debtToken.symbol) + const fee = + __feeOverride || + SwapUtils.percentageFeeResolver(collateralToken.symbol, debtToken.symbol).feeToCharge // 2. Calculated the needed amount of collateral to payback the debt // This value is calculated based on oracle prices. @@ -108,7 +110,7 @@ export async function getSwapDataForCloseToCollateral({ const preSwapFee = collectFeeFrom === 'sourceToken' - ? calculateFee(amountNeededToEnsureRemainingDebtIsRepaid, fee.toNumber()) + ? calculatePercentageFee(amountNeededToEnsureRemainingDebtIsRepaid, fee.toNumber()) : ZERO // 5. Get Swap Data diff --git a/packages/dma-library/src/strategies/common/close-to-debt-swap-data.ts b/packages/dma-library/src/strategies/common/close-to-debt-swap-data.ts index 952e79a54..1026270a5 100644 --- a/packages/dma-library/src/strategies/common/close-to-debt-swap-data.ts +++ b/packages/dma-library/src/strategies/common/close-to-debt-swap-data.ts @@ -1,6 +1,6 @@ import { Address } from '@deploy-configurations/types/address' import { ZERO } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { GetSwapData } from '@dma-library/types/common' import * as SwapUtils from '@dma-library/utils/swap' import BigNumber from 'bignumber.js' @@ -35,10 +35,13 @@ export async function getSwapDataForCloseToDebt({ toTokenAddress: toToken.address, }) - const fee = __feeOverride || SwapUtils.feeResolver(fromToken.symbol, toToken.symbol) + const fee = + __feeOverride || SwapUtils.percentageFeeResolver(fromToken.symbol, toToken.symbol).feeToCharge const preSwapFee = - collectFeeFrom === 'sourceToken' ? calculateFee(swapAmountBeforeFees, fee.toNumber()) : ZERO + collectFeeFrom === 'sourceToken' + ? calculatePercentageFee(swapAmountBeforeFees, fee.toNumber()) + : ZERO const swapAmountAfterFees = swapAmountBeforeFees .minus(preSwapFee) diff --git a/packages/dma-library/src/strategies/common/generic-swap-data.ts b/packages/dma-library/src/strategies/common/generic-swap-data.ts index 25e8f8b16..d03805be8 100644 --- a/packages/dma-library/src/strategies/common/generic-swap-data.ts +++ b/packages/dma-library/src/strategies/common/generic-swap-data.ts @@ -1,12 +1,10 @@ import { Address } from '@deploy-configurations/types/address' -import { FEE_ESTIMATE_INFLATOR } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { ZERO } from '@dma-common/constants' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { GetSwapData } from '@dma-library/types/common' import * as SwapUtils from '@dma-library/utils/swap' import BigNumber from 'bignumber.js' -import { ONE, ZERO } from '../../../../dma-common/constants/numbers' - interface GetGenericSwapDataArgs { fromToken: { symbol: string @@ -23,7 +21,6 @@ interface GetGenericSwapDataArgs { getSwapData: GetSwapData __feeOverride?: BigNumber } - export async function getGenericSwapData({ fromToken, toToken, @@ -37,10 +34,13 @@ export async function getGenericSwapData({ toTokenAddress: toToken.address, }) - const fee = __feeOverride || SwapUtils.feeResolver(fromToken.symbol, toToken.symbol) + const fee = + __feeOverride || SwapUtils.percentageFeeResolver(fromToken.symbol, toToken.symbol).feeToCharge const preSwapFee = - collectFeeFrom === 'sourceToken' ? calculateFee(swapAmountBeforeFees, fee.toNumber()) : ZERO + collectFeeFrom === 'sourceToken' + ? calculatePercentageFee(swapAmountBeforeFees, fee.toNumber()) + : ZERO const swapAmountAfterFees = swapAmountBeforeFees .minus(preSwapFee) @@ -53,10 +53,10 @@ export async function getGenericSwapData({ slippage, ) const postSwapFee = - collectFeeFrom === 'targetToken' ? calculateFee(swapData.toTokenAmount, fee.toNumber()) : ZERO + collectFeeFrom === 'targetToken' + ? calculatePercentageFee(swapData.toTokenAmount, fee.toNumber()) + : ZERO - const tokenFee = preSwapFee.plus( - postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), - ) - return { swapData, collectFeeFrom, fee: fee.toString(), tokenFee } + const tokenFee = SwapUtils.calculateInflatedTokenFee({ postSwapFee, preSwapFee }) + return { swapData, collectFeeFrom, fee: fee.toNumber(), tokenFee } } diff --git a/packages/dma-library/src/strategies/morphoblue/multiply/adjust.ts b/packages/dma-library/src/strategies/morphoblue/multiply/adjust.ts index 6938e7b6b..037d4d3b7 100644 --- a/packages/dma-library/src/strategies/morphoblue/multiply/adjust.ts +++ b/packages/dma-library/src/strategies/morphoblue/multiply/adjust.ts @@ -221,7 +221,7 @@ async function buildOperation( const borrowAmount = simulatedAdjust.delta.debt.minus(debtTokensDeposited) const collateralTokenSymbol = simulatedAdjust.position.collateral.symbol.toUpperCase() const debtTokenSymbol = simulatedAdjust.position.debt.symbol.toUpperCase() - const fee = SwapUtils.feeResolver(collateralTokenSymbol, debtTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(collateralTokenSymbol, debtTokenSymbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: SwapUtils.isCorrelatedPosition(collateralTokenSymbol, debtTokenSymbol), }) @@ -261,7 +261,7 @@ async function buildOperation( } const swap = { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: swapAmountBeforeFees, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/morphoblue/multiply/close.ts b/packages/dma-library/src/strategies/morphoblue/multiply/close.ts index 974011dd4..6de858b7f 100644 --- a/packages/dma-library/src/strategies/morphoblue/multiply/close.ts +++ b/packages/dma-library/src/strategies/morphoblue/multiply/close.ts @@ -1,8 +1,8 @@ -import { FEE_ESTIMATE_INFLATOR, ONE, TEN, ZERO } from '@dma-common/constants' +import { TEN, ZERO } from '@dma-common/constants' import { CollectFeeFrom } from '@dma-common/types' import { areAddressesEqual } from '@dma-common/utils/addresses' import { amountToWei } from '@dma-common/utils/common' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { operations } from '@dma-library/operations' import { resolveTxValue } from '@dma-library/protocols/ajna' import * as StrategiesCommon from '@dma-library/strategies/common' @@ -81,17 +81,17 @@ export const closeMultiply: MorphoCloseStrategy = async (args, dependencies) => const targetPosition = args.position.close() - const fee = SwapUtils.feeResolver(collateralTokenSymbol, debtTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(collateralTokenSymbol, debtTokenSymbol, { isEarnPosition: SwapUtils.isCorrelatedPosition(collateralTokenSymbol, debtTokenSymbol), isIncreasingRisk: false, }) const postSwapFee = - collectFeeFrom === 'targetToken' ? calculateFee(swapData.toTokenAmount, fee.toNumber()) : ZERO + collectFeeFrom === 'targetToken' + ? calculatePercentageFee(swapData.toTokenAmount, fee.feeToCharge.toNumber()) + : ZERO - const tokenFee = preSwapFee.plus( - postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), - ) + const tokenFee = SwapUtils.calculateInflatedTokenFee({ postSwapFee, preSwapFee }) // Validation const errors = [ @@ -215,7 +215,7 @@ async function buildOperation( address: position.marketParams.loanToken, } - const fee = SwapUtils.feeResolver(collateralTokenSymbol, debtTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(collateralTokenSymbol, debtTokenSymbol, { isEarnPosition: SwapUtils.isCorrelatedPosition(collateralTokenSymbol, debtTokenSymbol), isIncreasingRisk: false, }) @@ -237,7 +237,7 @@ async function buildOperation( isEth: areAddressesEqual(debtToken.address, dependencies.addresses.WETH), }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: collateralAmountToBeSwapped, collectFeeFrom, diff --git a/packages/dma-library/src/strategies/morphoblue/multiply/open.ts b/packages/dma-library/src/strategies/morphoblue/multiply/open.ts index 7ef036ef3..a51ea36b0 100644 --- a/packages/dma-library/src/strategies/morphoblue/multiply/open.ts +++ b/packages/dma-library/src/strategies/morphoblue/multiply/open.ts @@ -4,7 +4,7 @@ import { ONE, TEN, ZERO } from '@dma-common/constants' import { Address, CollectFeeFrom } from '@dma-common/types' import { areAddressesEqual } from '@dma-common/utils/addresses' import { amountFromWei, amountToWei } from '@dma-common/utils/common' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { BALANCER_FEE } from '@dma-library/config/flashloan-fees' import { operations } from '@dma-library/operations' import { TokenAddresses } from '@dma-library/operations/morphoblue/addresses' @@ -252,7 +252,7 @@ export async function simulateAdjustment( debtTokenSymbol, ) const preFlightSwapAmount = amountToWei(ONE, fromToken.precision) - const fee = SwapUtils.feeResolver(fromToken.symbol, toToken.symbol, { + const fee = SwapUtils.percentageFeeResolver(fromToken.symbol, toToken.symbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: SwapUtils.isCorrelatedPosition(fromToken.symbol, toToken.symbol), }) @@ -265,7 +265,8 @@ export async function simulateAdjustment( fromToken, toToken, slippage: args.slippage, - fee, + fee: fee.feeToCharge, + feeType: fee.feeType, swapAmountBeforeFees: preFlightSwapAmount, }, addresses: dependencies.addresses, @@ -292,7 +293,7 @@ export async function simulateAdjustment( debt: ZERO, }, fees: { - oazo: fee, + oazo: fee.feeToCharge, flashLoan: BALANCER_FEE, }, prices: { @@ -337,7 +338,7 @@ async function buildOperation( const borrowAmount = simulatedAdjust.delta.debt.minus(debtTokensDeposited) const collateralTokenSymbol = simulatedAdjust.position.collateral.symbol.toUpperCase() const debtTokenSymbol = simulatedAdjust.position.debt.symbol.toUpperCase() - const fee = SwapUtils.feeResolver(collateralTokenSymbol, debtTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(collateralTokenSymbol, debtTokenSymbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: SwapUtils.isCorrelatedPosition(collateralTokenSymbol, debtTokenSymbol), }) @@ -375,7 +376,7 @@ async function buildOperation( amount: args.collateralAmount.times(TEN.pow(args.collateralTokenPrecision)).integerValue(), }, swap: { - fee: fee.toNumber(), + fee: fee.feeToCharge.toNumber(), data: swapData.exchangeCalldata, amount: swapAmountBeforeFees, collectFeeFrom, @@ -419,17 +420,17 @@ export async function getSwapData( __feeOverride?: BigNumber, ) { const swapAmountBeforeFees = simulatedAdjust.swap.fromTokenAmount - const fee = - __feeOverride || - SwapUtils.feeResolver( - simulatedAdjust.position.collateral.symbol, - simulatedAdjust.position.debt.symbol, - { - isIncreasingRisk: riskIsIncreasing, - // Strategy is called open multiply (not open earn) - isEarnPosition: positionType === 'Earn', - }, - ) + const feeResult = SwapUtils.percentageFeeResolver( + simulatedAdjust.position.collateral.symbol, + simulatedAdjust.position.debt.symbol, + { + isIncreasingRisk: riskIsIncreasing, + // Strategy is called open multiply (not open earn) + isEarnPosition: positionType === 'Earn', + }, + ) + const fee = __feeOverride || feeResult.feeToCharge + const { swapData, collectFeeFrom, preSwapFee } = await SwapUtils.getSwapDataHelper< typeof dependencies.addresses, string @@ -450,7 +451,8 @@ export async function getSwapData( debtTokenSymbol, ), slippage: args.slippage, - fee, + fee: fee, + feeType: feeResult.feeType, swapAmountBeforeFees: swapAmountBeforeFees, }, addresses: dependencies.addresses, @@ -549,12 +551,14 @@ export function prepareMorphoMultiplyDMAPayload( const txAmount = args.collateralAmount const fromTokenSymbol = riskIsIncreasing ? debtTokenSymbol : collateralTokenSymbol const toTokenSymbol = riskIsIncreasing ? collateralTokenSymbol : debtTokenSymbol - const fee = SwapUtils.feeResolver(fromTokenSymbol, toTokenSymbol, { + const fee = SwapUtils.percentageFeeResolver(fromTokenSymbol, toTokenSymbol, { isIncreasingRisk: riskIsIncreasing, isEarnPosition: false, }) const postSwapFee = - collectFeeFrom === 'sourceToken' ? ZERO : calculateFee(swapData.toTokenAmount, fee.toNumber()) + collectFeeFrom === 'sourceToken' + ? ZERO + : calculatePercentageFee(swapData.toTokenAmount, fee.feeToCharge.toNumber()) const tokenFee = preSwapFee.plus(postSwapFee) const withdrawUndercollateralized = !riskIsIncreasing diff --git a/packages/dma-library/src/utils/fee-service/ProtocolId.ts b/packages/dma-library/src/utils/fee-service/ProtocolId.ts new file mode 100644 index 000000000..88997c4f7 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/ProtocolId.ts @@ -0,0 +1,8 @@ +export enum ProtocolId { + AAVE = 'AAVE', + AAVE_V3 = 'AAVE_V3', + SPARK = 'Spark', + AJNA = 'ajna', + MORPHO_BLUE = 'morphoblue', + MAKER = 'maker', +} diff --git a/packages/dma-library/src/utils/fee-service/calculateFee.ts b/packages/dma-library/src/utils/fee-service/calculateFee.ts new file mode 100644 index 000000000..39d7f2f00 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/calculateFee.ts @@ -0,0 +1,93 @@ +import BigNumber from 'bignumber.js' + +import { AUM_FEE_RATE } from './constants' +import { isCloseEvent } from './isCloseEvent' +import { isDeriskEvent } from './isDeriskEvent' +import { isOpenEvent } from './isOpenEvent' +import { isWithdrawEvent } from './isWithdrawEvent' +import type { OasisEvent, OasisPosition } from './types' + +export const calculateFee = (position: OasisPosition, toTimestamp?: number) => { + const endTimestamp = toTimestamp ?? Date.now() + + // find open event + const openEventIndex = position.events.findIndex(isOpenEvent) + // there is no open events + if (openEventIndex === -1) { + throw 'Position is missing open event, not possible to calculate fee' + } + + let startEventIndex: number + // there is no closed events + const closeEventIndex = position.events.findIndex(isCloseEvent) + if (closeEventIndex === -1) { + startEventIndex = openEventIndex + } + // there is closed event but position was reopened + else if (closeEventIndex !== position.events.length - 1) { + startEventIndex = closeEventIndex + 1 + } else { + throw 'Position is closed, not possible to calculate fee' + } + + const eventsToCalculate = position.events + .slice(startEventIndex) + .filter(event => new BigNumber(getEventSwapAmount(event)).gt(0)) + const [totalFee] = eventsToCalculate.reduce( + ([accFee, accSwapAmount], event, index, arr) => { + const nextEvent = arr[index + 1] + // calc fee for the current event period only + const nextTimestampOrEnd = nextEvent + ? new BigNumber(nextEvent.timestamp.toString()).toNumber() + : endTimestamp + const eventSwapAmount = getEventSwapAmount(event) + const newAccSwapAmount = + isWithdrawEvent(event) || isDeriskEvent(event) + ? accSwapAmount.minus(eventSwapAmount) + : accSwapAmount.plus(eventSwapAmount) + const eventFee = calculateFeeFromTo( + newAccSwapAmount.toString(), + event.timestamp, + nextTimestampOrEnd, + ) + + // if event is derisk, it means fee was paid so we should drop prev fee + // and start accumulating again from this point and keep the acc swap amount + if (isDeriskEvent(event)) { + return [new BigNumber(eventFee), newAccSwapAmount] + } + + return [accFee.plus(eventFee), newAccSwapAmount] + }, + [new BigNumber(0), new BigNumber(0)], + ) + + return totalFee.toString() +} + +const getEventSwapAmount = (event: OasisEvent) => { + let swapAmount = '0' + if (event.swapToToken === event.debtToken && event.swapToAmount) { + swapAmount = event.swapToAmount + } else if (event.swapFromToken === event.debtToken && event.swapFromAmount) { + swapAmount = event.swapFromAmount + } + return swapAmount +} + +const calculateFeeFromTo = ( + amountInCollateral: string, + fromTimestamp: bigint, + toTimestamp: number, +) => { + const startTimestamp = fromTimestamp + const endTimestamp = toTimestamp + const daysPassed = new BigNumber(endTimestamp) + .minus(startTimestamp.toString()) + .div(1000 * 60 * 60 * 24) // miliseconds per day + .toNumber() + + const feeValue = new BigNumber(AUM_FEE_RATE).times(daysPassed / 365).times(amountInCollateral) + + return feeValue.toString() +} diff --git a/packages/dma-library/src/utils/fee-service/clients/aave-like-client.ts b/packages/dma-library/src/utils/fee-service/clients/aave-like-client.ts new file mode 100644 index 000000000..f626e5e7a --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/clients/aave-like-client.ts @@ -0,0 +1,27 @@ +import { Network } from '@deploy-configurations/types/network' +import type { GraphQLClient } from 'graphql-request' + +import { getSdk } from '../generated/client-aave-like' +import type { OasisPosition } from '../types' + +export const getAaveLikeSubgraphNameByChainId = (network: Network): string => { + const subgraphNameByChainMap: Partial> = { + [Network.MAINNET]: 'summer-oasis-history', + [Network.ARBITRUM]: 'summer-oasis-history-arbitrum', + [Network.BASE]: 'summer-oasis-history-base', + [Network.OPTIMISM]: 'summer-oasis-history-optimism', + } + const subgraph = subgraphNameByChainMap[network] + if (!subgraph) { + throw new Error(`No subgraph for network ${network} on Aave-like`) + } + return subgraph +} + +export const getAaveLikePosition = async ( + client: GraphQLClient, + positionId: string, +): Promise => { + const events = (await getSdk(client).GetPosition({ id: positionId })).position?.events + return events ? { events } : undefined +} diff --git a/packages/dma-library/src/utils/fee-service/clients/ajna-v2-client.ts b/packages/dma-library/src/utils/fee-service/clients/ajna-v2-client.ts new file mode 100644 index 000000000..a85759e81 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/clients/ajna-v2-client.ts @@ -0,0 +1,25 @@ +import { Network } from '@deploy-configurations/types/network' +import type { GraphQLClient } from 'graphql-request' + +import { getSdk } from '../generated/client-ajna-v2' +import type { OasisPosition } from '../types' + +export const getAjnaSubgraphNameByChainId = (network: Network): string => { + const subgraphNameByChainMap: Partial> = { + [Network.MAINNET]: 'summer-ajna-v2', + [Network.BASE]: 'summer-ajna-v2-base', + } + const subgraph = subgraphNameByChainMap[network] + if (!subgraph) { + throw new Error(`No subgraph for network ${network} on Ajna`) + } + return subgraph +} + +export const getAjnaPosition = async ( + client: GraphQLClient, + positionId: string, +): Promise => { + const events = (await getSdk(client).GetPosition({ id: positionId })).earnPosition?.oasisEvents + return events ? { events } : undefined +} diff --git a/packages/dma-library/src/utils/fee-service/constants.ts b/packages/dma-library/src/utils/fee-service/constants.ts new file mode 100644 index 000000000..a6b4a693c --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/constants.ts @@ -0,0 +1,35 @@ +import { OPERATION_NAMES } from '@deploy-configurations/constants' + +export const AUM_FEE_RATE = 0.0002 // 0.02% + +export const supportedOpenEvents = [ + OPERATION_NAMES.aave.v2.OPEN_POSITION, + OPERATION_NAMES.aave.v2.OPEN_DEPOSIT_BORROW, + OPERATION_NAMES.aave.v3.OPEN_POSITION, + OPERATION_NAMES.aave.v3.OPEN_DEPOSIT_BORROW, + OPERATION_NAMES.spark.OPEN_POSITION, + OPERATION_NAMES.spark.OPEN_DEPOSIT_BORROW, + OPERATION_NAMES.ajna.OPEN_MULTIPLY_POSITION, +] + +export const supportedCloseEvents = [ + OPERATION_NAMES.aave.v2.CLOSE_POSITION, + OPERATION_NAMES.aave.v3.CLOSE_POSITION, + OPERATION_NAMES.spark.CLOSE_POSITION, + OPERATION_NAMES.ajna.CLOSE_POSITION_TO_COLLATERAL, + OPERATION_NAMES.ajna.CLOSE_POSITION_TO_QUOTE, +] + +export const supportedDeriskEvents = [ + OPERATION_NAMES.aave.v2.DECREASE_POSITION, + OPERATION_NAMES.aave.v3.ADJUST_RISK_DOWN, + OPERATION_NAMES.spark.ADJUST_RISK_DOWN, + OPERATION_NAMES.ajna.ADJUST_RISK_DOWN, +] + +export const supportedWithdrawEvents = [ + OPERATION_NAMES.aave.v2.PAYBACK_WITHDRAW, + OPERATION_NAMES.aave.v3.PAYBACK_WITHDRAW, + OPERATION_NAMES.spark.PAYBACK_WITHDRAW, + OPERATION_NAMES.ajna.PAYBACK_WITHDRAW, +] diff --git a/packages/dma-library/src/utils/fee-service/createGraphQLClient.ts b/packages/dma-library/src/utils/fee-service/createGraphQLClient.ts new file mode 100644 index 000000000..9d45e7f79 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/createGraphQLClient.ts @@ -0,0 +1,74 @@ +import { Network } from '@deploy-configurations/types/network' +import { GraphQLClient } from 'graphql-request' + +import { getAaveLikePosition, getAaveLikeSubgraphNameByChainId } from './clients/aave-like-client' +import { getAjnaPosition, getAjnaSubgraphNameByChainId } from './clients/ajna-v2-client' +import type { IFeeManagerClient } from './interfaces' +import { ProtocolId } from './ProtocolId' + +const getSubgraphName = (network: Network, protocolId: ProtocolId): string => { + switch (protocolId) { + case ProtocolId.AAVE: + case ProtocolId.AAVE_V3: + case ProtocolId.SPARK: + return getAaveLikeSubgraphNameByChainId(network) + case ProtocolId.AJNA: + return getAjnaSubgraphNameByChainId(network) + default: + throw new Error(`No subgraph assigned to Protocol ID ${protocolId}`) + } +} + +const validateChainId = (network: Network): void => { + const supportedNetworks = [Network.MAINNET, Network.ARBITRUM, Network.BASE, Network.OPTIMISM] + if (!supportedNetworks.includes(network)) { + throw new Error( + `Chain ID ${network} is not supported. Supported chains are: ${supportedNetworks.join(', ')}`, + ) + } +} + +const validateProtocolId = (protocolId: ProtocolId): void => { + const supportedProtocols = [ + ProtocolId.AAVE, + ProtocolId.AAVE_V3, + ProtocolId.SPARK, + ProtocolId.AJNA, + ] + if (!supportedProtocols.includes(protocolId)) { + throw new Error( + `Protocol ID ${protocolId} is not supported. Supported protocols are: ${supportedProtocols.join( + ', ', + )}`, + ) + } +} + +export const createGraphQLClient = ( + network: Network, + protocolId: ProtocolId, + baseUrl: string, +): IFeeManagerClient => { + validateChainId(network) + validateProtocolId(protocolId) + const subgraphName = getSubgraphName(network, protocolId) + const url = `${baseUrl}/${subgraphName}` + const client = new GraphQLClient(url) + + const GetPosition = async (proxyAddress: string) => { + switch (protocolId) { + case ProtocolId.AAVE: + case ProtocolId.AAVE_V3: + case ProtocolId.SPARK: + return getAaveLikePosition(client, `${proxyAddress}-${protocolId}`) + case ProtocolId.AJNA: + return getAjnaPosition(client, proxyAddress) + default: + throw new Error(`No subgraph assigned to Protocol ID ${protocolId}`) + } + } + + return { + GetPosition, + } +} diff --git a/packages/dma-library/src/utils/fee-service/generated/client-aave-like.ts b/packages/dma-library/src/utils/fee-service/generated/client-aave-like.ts new file mode 100644 index 000000000..f5b140612 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/generated/client-aave-like.ts @@ -0,0 +1,4147 @@ +// This file was automatically generated and should not be edited. +// @ts-nocheck +/* eslint-disable */ +import type { DocumentNode } from "graphql/language/ast"; +import { GraphQLClient, RequestOptions } from 'graphql-request'; +import gql from 'graphql-tag'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +type GraphQLClientRequestHeaders = RequestOptions['requestHeaders']; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + BigDecimal: { input: any; output: any; } + BigInt: { input: any; output: any; } + Bytes: { input: any; output: any; } + Int8: { input: any; output: any; } + Timestamp: { input: any; output: any; } +}; + +export type AaveLikeBorrow = { + __typename?: 'AaveLikeBorrow'; + amount: Scalars['BigInt']['output']; + blockNumber: Scalars['BigInt']['output']; + borrowRate: Scalars['BigInt']['output']; + borrowRateMode: Scalars['BigInt']['output']; + debtDelta?: Maybe; + id: Scalars['ID']['output']; + onBehalfOf: Scalars['Bytes']['output']; + protocol: Scalars['String']['output']; + referral: Scalars['BigInt']['output']; + reserve: Scalars['Bytes']['output']; + stableDebtAfter?: Maybe; + timestamp: Scalars['BigInt']['output']; + token?: Maybe; + tokenPriceUSD?: Maybe; + txHash: Scalars['Bytes']['output']; + user: Scalars['Bytes']['output']; + variableDebtAfter?: Maybe; + version?: Maybe; +}; + +export type AaveLikeBorrow_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amount?: InputMaybe; + amount_gt?: InputMaybe; + amount_gte?: InputMaybe; + amount_in?: InputMaybe>; + amount_lt?: InputMaybe; + amount_lte?: InputMaybe; + amount_not?: InputMaybe; + amount_not_in?: InputMaybe>; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + borrowRate?: InputMaybe; + borrowRateMode?: InputMaybe; + borrowRateMode_gt?: InputMaybe; + borrowRateMode_gte?: InputMaybe; + borrowRateMode_in?: InputMaybe>; + borrowRateMode_lt?: InputMaybe; + borrowRateMode_lte?: InputMaybe; + borrowRateMode_not?: InputMaybe; + borrowRateMode_not_in?: InputMaybe>; + borrowRate_gt?: InputMaybe; + borrowRate_gte?: InputMaybe; + borrowRate_in?: InputMaybe>; + borrowRate_lt?: InputMaybe; + borrowRate_lte?: InputMaybe; + borrowRate_not?: InputMaybe; + borrowRate_not_in?: InputMaybe>; + debtDelta?: InputMaybe; + debtDelta_gt?: InputMaybe; + debtDelta_gte?: InputMaybe; + debtDelta_in?: InputMaybe>; + debtDelta_lt?: InputMaybe; + debtDelta_lte?: InputMaybe; + debtDelta_not?: InputMaybe; + debtDelta_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + onBehalfOf?: InputMaybe; + onBehalfOf_contains?: InputMaybe; + onBehalfOf_gt?: InputMaybe; + onBehalfOf_gte?: InputMaybe; + onBehalfOf_in?: InputMaybe>; + onBehalfOf_lt?: InputMaybe; + onBehalfOf_lte?: InputMaybe; + onBehalfOf_not?: InputMaybe; + onBehalfOf_not_contains?: InputMaybe; + onBehalfOf_not_in?: InputMaybe>; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + referral?: InputMaybe; + referral_gt?: InputMaybe; + referral_gte?: InputMaybe; + referral_in?: InputMaybe>; + referral_lt?: InputMaybe; + referral_lte?: InputMaybe; + referral_not?: InputMaybe; + referral_not_in?: InputMaybe>; + reserve?: InputMaybe; + reserve_contains?: InputMaybe; + reserve_gt?: InputMaybe; + reserve_gte?: InputMaybe; + reserve_in?: InputMaybe>; + reserve_lt?: InputMaybe; + reserve_lte?: InputMaybe; + reserve_not?: InputMaybe; + reserve_not_contains?: InputMaybe; + reserve_not_in?: InputMaybe>; + stableDebtAfter?: InputMaybe; + stableDebtAfter_gt?: InputMaybe; + stableDebtAfter_gte?: InputMaybe; + stableDebtAfter_in?: InputMaybe>; + stableDebtAfter_lt?: InputMaybe; + stableDebtAfter_lte?: InputMaybe; + stableDebtAfter_not?: InputMaybe; + stableDebtAfter_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + token?: InputMaybe; + tokenPriceUSD?: InputMaybe; + tokenPriceUSD_gt?: InputMaybe; + tokenPriceUSD_gte?: InputMaybe; + tokenPriceUSD_in?: InputMaybe>; + tokenPriceUSD_lt?: InputMaybe; + tokenPriceUSD_lte?: InputMaybe; + tokenPriceUSD_not?: InputMaybe; + tokenPriceUSD_not_in?: InputMaybe>; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_in?: InputMaybe>; + user?: InputMaybe; + user_contains?: InputMaybe; + user_gt?: InputMaybe; + user_gte?: InputMaybe; + user_in?: InputMaybe>; + user_lt?: InputMaybe; + user_lte?: InputMaybe; + user_not?: InputMaybe; + user_not_contains?: InputMaybe; + user_not_in?: InputMaybe>; + variableDebtAfter?: InputMaybe; + variableDebtAfter_gt?: InputMaybe; + variableDebtAfter_gte?: InputMaybe; + variableDebtAfter_in?: InputMaybe>; + variableDebtAfter_lt?: InputMaybe; + variableDebtAfter_lte?: InputMaybe; + variableDebtAfter_not?: InputMaybe; + variableDebtAfter_not_in?: InputMaybe>; + version?: InputMaybe; + version_contains?: InputMaybe; + version_contains_nocase?: InputMaybe; + version_ends_with?: InputMaybe; + version_ends_with_nocase?: InputMaybe; + version_gt?: InputMaybe; + version_gte?: InputMaybe; + version_in?: InputMaybe>; + version_lt?: InputMaybe; + version_lte?: InputMaybe; + version_not?: InputMaybe; + version_not_contains?: InputMaybe; + version_not_contains_nocase?: InputMaybe; + version_not_ends_with?: InputMaybe; + version_not_ends_with_nocase?: InputMaybe; + version_not_in?: InputMaybe>; + version_not_starts_with?: InputMaybe; + version_not_starts_with_nocase?: InputMaybe; + version_starts_with?: InputMaybe; + version_starts_with_nocase?: InputMaybe; +}; + +export enum AaveLikeBorrow_OrderBy { + Amount = 'amount', + BlockNumber = 'blockNumber', + BorrowRate = 'borrowRate', + BorrowRateMode = 'borrowRateMode', + DebtDelta = 'debtDelta', + Id = 'id', + OnBehalfOf = 'onBehalfOf', + Protocol = 'protocol', + Referral = 'referral', + Reserve = 'reserve', + StableDebtAfter = 'stableDebtAfter', + Timestamp = 'timestamp', + Token = 'token', + TokenPriceUsd = 'tokenPriceUSD', + TokenAddress = 'token__address', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenPrecision = 'token__precision', + TokenSymbol = 'token__symbol', + TxHash = 'txHash', + User = 'user', + VariableDebtAfter = 'variableDebtAfter', + Version = 'version' +} + +export type AaveLikeDeposit = { + __typename?: 'AaveLikeDeposit'; + amount: Scalars['BigInt']['output']; + blockNumber: Scalars['BigInt']['output']; + collateralAfter?: Maybe; + collateralDelta?: Maybe; + id: Scalars['ID']['output']; + onBehalfOf: Scalars['Bytes']['output']; + protocol: Scalars['String']['output']; + referral: Scalars['BigInt']['output']; + reserve: Scalars['Bytes']['output']; + timestamp: Scalars['BigInt']['output']; + token?: Maybe; + tokenPriceUSD?: Maybe; + txHash: Scalars['Bytes']['output']; + user: Scalars['Bytes']['output']; + version?: Maybe; +}; + +export type AaveLikeDeposit_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amount?: InputMaybe; + amount_gt?: InputMaybe; + amount_gte?: InputMaybe; + amount_in?: InputMaybe>; + amount_lt?: InputMaybe; + amount_lte?: InputMaybe; + amount_not?: InputMaybe; + amount_not_in?: InputMaybe>; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + collateralAfter?: InputMaybe; + collateralAfter_gt?: InputMaybe; + collateralAfter_gte?: InputMaybe; + collateralAfter_in?: InputMaybe>; + collateralAfter_lt?: InputMaybe; + collateralAfter_lte?: InputMaybe; + collateralAfter_not?: InputMaybe; + collateralAfter_not_in?: InputMaybe>; + collateralDelta?: InputMaybe; + collateralDelta_gt?: InputMaybe; + collateralDelta_gte?: InputMaybe; + collateralDelta_in?: InputMaybe>; + collateralDelta_lt?: InputMaybe; + collateralDelta_lte?: InputMaybe; + collateralDelta_not?: InputMaybe; + collateralDelta_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + onBehalfOf?: InputMaybe; + onBehalfOf_contains?: InputMaybe; + onBehalfOf_gt?: InputMaybe; + onBehalfOf_gte?: InputMaybe; + onBehalfOf_in?: InputMaybe>; + onBehalfOf_lt?: InputMaybe; + onBehalfOf_lte?: InputMaybe; + onBehalfOf_not?: InputMaybe; + onBehalfOf_not_contains?: InputMaybe; + onBehalfOf_not_in?: InputMaybe>; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + referral?: InputMaybe; + referral_gt?: InputMaybe; + referral_gte?: InputMaybe; + referral_in?: InputMaybe>; + referral_lt?: InputMaybe; + referral_lte?: InputMaybe; + referral_not?: InputMaybe; + referral_not_in?: InputMaybe>; + reserve?: InputMaybe; + reserve_contains?: InputMaybe; + reserve_gt?: InputMaybe; + reserve_gte?: InputMaybe; + reserve_in?: InputMaybe>; + reserve_lt?: InputMaybe; + reserve_lte?: InputMaybe; + reserve_not?: InputMaybe; + reserve_not_contains?: InputMaybe; + reserve_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + token?: InputMaybe; + tokenPriceUSD?: InputMaybe; + tokenPriceUSD_gt?: InputMaybe; + tokenPriceUSD_gte?: InputMaybe; + tokenPriceUSD_in?: InputMaybe>; + tokenPriceUSD_lt?: InputMaybe; + tokenPriceUSD_lte?: InputMaybe; + tokenPriceUSD_not?: InputMaybe; + tokenPriceUSD_not_in?: InputMaybe>; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_in?: InputMaybe>; + user?: InputMaybe; + user_contains?: InputMaybe; + user_gt?: InputMaybe; + user_gte?: InputMaybe; + user_in?: InputMaybe>; + user_lt?: InputMaybe; + user_lte?: InputMaybe; + user_not?: InputMaybe; + user_not_contains?: InputMaybe; + user_not_in?: InputMaybe>; + version?: InputMaybe; + version_contains?: InputMaybe; + version_contains_nocase?: InputMaybe; + version_ends_with?: InputMaybe; + version_ends_with_nocase?: InputMaybe; + version_gt?: InputMaybe; + version_gte?: InputMaybe; + version_in?: InputMaybe>; + version_lt?: InputMaybe; + version_lte?: InputMaybe; + version_not?: InputMaybe; + version_not_contains?: InputMaybe; + version_not_contains_nocase?: InputMaybe; + version_not_ends_with?: InputMaybe; + version_not_ends_with_nocase?: InputMaybe; + version_not_in?: InputMaybe>; + version_not_starts_with?: InputMaybe; + version_not_starts_with_nocase?: InputMaybe; + version_starts_with?: InputMaybe; + version_starts_with_nocase?: InputMaybe; +}; + +export enum AaveLikeDeposit_OrderBy { + Amount = 'amount', + BlockNumber = 'blockNumber', + CollateralAfter = 'collateralAfter', + CollateralDelta = 'collateralDelta', + Id = 'id', + OnBehalfOf = 'onBehalfOf', + Protocol = 'protocol', + Referral = 'referral', + Reserve = 'reserve', + Timestamp = 'timestamp', + Token = 'token', + TokenPriceUsd = 'tokenPriceUSD', + TokenAddress = 'token__address', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenPrecision = 'token__precision', + TokenSymbol = 'token__symbol', + TxHash = 'txHash', + User = 'user', + Version = 'version' +} + +export type AaveLikeLiquidation = { + __typename?: 'AaveLikeLiquidation'; + blockNumber: Scalars['BigInt']['output']; + collateralAfter?: Maybe; + collateralAsset: Scalars['Bytes']['output']; + collateralDelta: Scalars['BigDecimal']['output']; + collateralToken: Token; + collateralTokenPriceUSD?: Maybe; + debtAsset: Scalars['Bytes']['output']; + debtDelta: Scalars['BigDecimal']['output']; + debtToCover: Scalars['BigInt']['output']; + debtToken: Token; + debtTokenPriceUSD?: Maybe; + id: Scalars['ID']['output']; + liquidatedCollateralAmount: Scalars['BigInt']['output']; + liquidator: Scalars['Bytes']['output']; + protocol: Scalars['String']['output']; + receiveAToken: Scalars['Boolean']['output']; + stableDebtAfter?: Maybe; + timestamp: Scalars['BigInt']['output']; + txHash: Scalars['Bytes']['output']; + user: Scalars['Bytes']['output']; + variableDebtAfter?: Maybe; + version?: Maybe; +}; + +export type AaveLikeLiquidation_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + collateralAfter?: InputMaybe; + collateralAfter_gt?: InputMaybe; + collateralAfter_gte?: InputMaybe; + collateralAfter_in?: InputMaybe>; + collateralAfter_lt?: InputMaybe; + collateralAfter_lte?: InputMaybe; + collateralAfter_not?: InputMaybe; + collateralAfter_not_in?: InputMaybe>; + collateralAsset?: InputMaybe; + collateralAsset_contains?: InputMaybe; + collateralAsset_gt?: InputMaybe; + collateralAsset_gte?: InputMaybe; + collateralAsset_in?: InputMaybe>; + collateralAsset_lt?: InputMaybe; + collateralAsset_lte?: InputMaybe; + collateralAsset_not?: InputMaybe; + collateralAsset_not_contains?: InputMaybe; + collateralAsset_not_in?: InputMaybe>; + collateralDelta?: InputMaybe; + collateralDelta_gt?: InputMaybe; + collateralDelta_gte?: InputMaybe; + collateralDelta_in?: InputMaybe>; + collateralDelta_lt?: InputMaybe; + collateralDelta_lte?: InputMaybe; + collateralDelta_not?: InputMaybe; + collateralDelta_not_in?: InputMaybe>; + collateralToken?: InputMaybe; + collateralTokenPriceUSD?: InputMaybe; + collateralTokenPriceUSD_gt?: InputMaybe; + collateralTokenPriceUSD_gte?: InputMaybe; + collateralTokenPriceUSD_in?: InputMaybe>; + collateralTokenPriceUSD_lt?: InputMaybe; + collateralTokenPriceUSD_lte?: InputMaybe; + collateralTokenPriceUSD_not?: InputMaybe; + collateralTokenPriceUSD_not_in?: InputMaybe>; + collateralToken_?: InputMaybe; + collateralToken_contains?: InputMaybe; + collateralToken_contains_nocase?: InputMaybe; + collateralToken_ends_with?: InputMaybe; + collateralToken_ends_with_nocase?: InputMaybe; + collateralToken_gt?: InputMaybe; + collateralToken_gte?: InputMaybe; + collateralToken_in?: InputMaybe>; + collateralToken_lt?: InputMaybe; + collateralToken_lte?: InputMaybe; + collateralToken_not?: InputMaybe; + collateralToken_not_contains?: InputMaybe; + collateralToken_not_contains_nocase?: InputMaybe; + collateralToken_not_ends_with?: InputMaybe; + collateralToken_not_ends_with_nocase?: InputMaybe; + collateralToken_not_in?: InputMaybe>; + collateralToken_not_starts_with?: InputMaybe; + collateralToken_not_starts_with_nocase?: InputMaybe; + collateralToken_starts_with?: InputMaybe; + collateralToken_starts_with_nocase?: InputMaybe; + debtAsset?: InputMaybe; + debtAsset_contains?: InputMaybe; + debtAsset_gt?: InputMaybe; + debtAsset_gte?: InputMaybe; + debtAsset_in?: InputMaybe>; + debtAsset_lt?: InputMaybe; + debtAsset_lte?: InputMaybe; + debtAsset_not?: InputMaybe; + debtAsset_not_contains?: InputMaybe; + debtAsset_not_in?: InputMaybe>; + debtDelta?: InputMaybe; + debtDelta_gt?: InputMaybe; + debtDelta_gte?: InputMaybe; + debtDelta_in?: InputMaybe>; + debtDelta_lt?: InputMaybe; + debtDelta_lte?: InputMaybe; + debtDelta_not?: InputMaybe; + debtDelta_not_in?: InputMaybe>; + debtToCover?: InputMaybe; + debtToCover_gt?: InputMaybe; + debtToCover_gte?: InputMaybe; + debtToCover_in?: InputMaybe>; + debtToCover_lt?: InputMaybe; + debtToCover_lte?: InputMaybe; + debtToCover_not?: InputMaybe; + debtToCover_not_in?: InputMaybe>; + debtToken?: InputMaybe; + debtTokenPriceUSD?: InputMaybe; + debtTokenPriceUSD_gt?: InputMaybe; + debtTokenPriceUSD_gte?: InputMaybe; + debtTokenPriceUSD_in?: InputMaybe>; + debtTokenPriceUSD_lt?: InputMaybe; + debtTokenPriceUSD_lte?: InputMaybe; + debtTokenPriceUSD_not?: InputMaybe; + debtTokenPriceUSD_not_in?: InputMaybe>; + debtToken_?: InputMaybe; + debtToken_contains?: InputMaybe; + debtToken_contains_nocase?: InputMaybe; + debtToken_ends_with?: InputMaybe; + debtToken_ends_with_nocase?: InputMaybe; + debtToken_gt?: InputMaybe; + debtToken_gte?: InputMaybe; + debtToken_in?: InputMaybe>; + debtToken_lt?: InputMaybe; + debtToken_lte?: InputMaybe; + debtToken_not?: InputMaybe; + debtToken_not_contains?: InputMaybe; + debtToken_not_contains_nocase?: InputMaybe; + debtToken_not_ends_with?: InputMaybe; + debtToken_not_ends_with_nocase?: InputMaybe; + debtToken_not_in?: InputMaybe>; + debtToken_not_starts_with?: InputMaybe; + debtToken_not_starts_with_nocase?: InputMaybe; + debtToken_starts_with?: InputMaybe; + debtToken_starts_with_nocase?: InputMaybe; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + liquidatedCollateralAmount?: InputMaybe; + liquidatedCollateralAmount_gt?: InputMaybe; + liquidatedCollateralAmount_gte?: InputMaybe; + liquidatedCollateralAmount_in?: InputMaybe>; + liquidatedCollateralAmount_lt?: InputMaybe; + liquidatedCollateralAmount_lte?: InputMaybe; + liquidatedCollateralAmount_not?: InputMaybe; + liquidatedCollateralAmount_not_in?: InputMaybe>; + liquidator?: InputMaybe; + liquidator_contains?: InputMaybe; + liquidator_gt?: InputMaybe; + liquidator_gte?: InputMaybe; + liquidator_in?: InputMaybe>; + liquidator_lt?: InputMaybe; + liquidator_lte?: InputMaybe; + liquidator_not?: InputMaybe; + liquidator_not_contains?: InputMaybe; + liquidator_not_in?: InputMaybe>; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + receiveAToken?: InputMaybe; + receiveAToken_in?: InputMaybe>; + receiveAToken_not?: InputMaybe; + receiveAToken_not_in?: InputMaybe>; + stableDebtAfter?: InputMaybe; + stableDebtAfter_gt?: InputMaybe; + stableDebtAfter_gte?: InputMaybe; + stableDebtAfter_in?: InputMaybe>; + stableDebtAfter_lt?: InputMaybe; + stableDebtAfter_lte?: InputMaybe; + stableDebtAfter_not?: InputMaybe; + stableDebtAfter_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_in?: InputMaybe>; + user?: InputMaybe; + user_contains?: InputMaybe; + user_gt?: InputMaybe; + user_gte?: InputMaybe; + user_in?: InputMaybe>; + user_lt?: InputMaybe; + user_lte?: InputMaybe; + user_not?: InputMaybe; + user_not_contains?: InputMaybe; + user_not_in?: InputMaybe>; + variableDebtAfter?: InputMaybe; + variableDebtAfter_gt?: InputMaybe; + variableDebtAfter_gte?: InputMaybe; + variableDebtAfter_in?: InputMaybe>; + variableDebtAfter_lt?: InputMaybe; + variableDebtAfter_lte?: InputMaybe; + variableDebtAfter_not?: InputMaybe; + variableDebtAfter_not_in?: InputMaybe>; + version?: InputMaybe; + version_contains?: InputMaybe; + version_contains_nocase?: InputMaybe; + version_ends_with?: InputMaybe; + version_ends_with_nocase?: InputMaybe; + version_gt?: InputMaybe; + version_gte?: InputMaybe; + version_in?: InputMaybe>; + version_lt?: InputMaybe; + version_lte?: InputMaybe; + version_not?: InputMaybe; + version_not_contains?: InputMaybe; + version_not_contains_nocase?: InputMaybe; + version_not_ends_with?: InputMaybe; + version_not_ends_with_nocase?: InputMaybe; + version_not_in?: InputMaybe>; + version_not_starts_with?: InputMaybe; + version_not_starts_with_nocase?: InputMaybe; + version_starts_with?: InputMaybe; + version_starts_with_nocase?: InputMaybe; +}; + +export enum AaveLikeLiquidation_OrderBy { + BlockNumber = 'blockNumber', + CollateralAfter = 'collateralAfter', + CollateralAsset = 'collateralAsset', + CollateralDelta = 'collateralDelta', + CollateralToken = 'collateralToken', + CollateralTokenPriceUsd = 'collateralTokenPriceUSD', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + DebtAsset = 'debtAsset', + DebtDelta = 'debtDelta', + DebtToCover = 'debtToCover', + DebtToken = 'debtToken', + DebtTokenPriceUsd = 'debtTokenPriceUSD', + DebtTokenAddress = 'debtToken__address', + DebtTokenDecimals = 'debtToken__decimals', + DebtTokenId = 'debtToken__id', + DebtTokenPrecision = 'debtToken__precision', + DebtTokenSymbol = 'debtToken__symbol', + Id = 'id', + LiquidatedCollateralAmount = 'liquidatedCollateralAmount', + Liquidator = 'liquidator', + Protocol = 'protocol', + ReceiveAToken = 'receiveAToken', + StableDebtAfter = 'stableDebtAfter', + Timestamp = 'timestamp', + TxHash = 'txHash', + User = 'user', + VariableDebtAfter = 'variableDebtAfter', + Version = 'version' +} + +export type AaveLikeRepay = { + __typename?: 'AaveLikeRepay'; + amount: Scalars['BigInt']['output']; + blockNumber: Scalars['BigInt']['output']; + debtDelta?: Maybe; + id: Scalars['ID']['output']; + protocol: Scalars['String']['output']; + repayer: Scalars['Bytes']['output']; + reserve: Scalars['Bytes']['output']; + stableDebtAfter?: Maybe; + timestamp: Scalars['BigInt']['output']; + token?: Maybe; + tokenPriceUSD?: Maybe; + txHash: Scalars['Bytes']['output']; + user: Scalars['Bytes']['output']; + variableDebtAfter?: Maybe; + version?: Maybe; +}; + +export type AaveLikeRepay_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amount?: InputMaybe; + amount_gt?: InputMaybe; + amount_gte?: InputMaybe; + amount_in?: InputMaybe>; + amount_lt?: InputMaybe; + amount_lte?: InputMaybe; + amount_not?: InputMaybe; + amount_not_in?: InputMaybe>; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + debtDelta?: InputMaybe; + debtDelta_gt?: InputMaybe; + debtDelta_gte?: InputMaybe; + debtDelta_in?: InputMaybe>; + debtDelta_lt?: InputMaybe; + debtDelta_lte?: InputMaybe; + debtDelta_not?: InputMaybe; + debtDelta_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + repayer?: InputMaybe; + repayer_contains?: InputMaybe; + repayer_gt?: InputMaybe; + repayer_gte?: InputMaybe; + repayer_in?: InputMaybe>; + repayer_lt?: InputMaybe; + repayer_lte?: InputMaybe; + repayer_not?: InputMaybe; + repayer_not_contains?: InputMaybe; + repayer_not_in?: InputMaybe>; + reserve?: InputMaybe; + reserve_contains?: InputMaybe; + reserve_gt?: InputMaybe; + reserve_gte?: InputMaybe; + reserve_in?: InputMaybe>; + reserve_lt?: InputMaybe; + reserve_lte?: InputMaybe; + reserve_not?: InputMaybe; + reserve_not_contains?: InputMaybe; + reserve_not_in?: InputMaybe>; + stableDebtAfter?: InputMaybe; + stableDebtAfter_gt?: InputMaybe; + stableDebtAfter_gte?: InputMaybe; + stableDebtAfter_in?: InputMaybe>; + stableDebtAfter_lt?: InputMaybe; + stableDebtAfter_lte?: InputMaybe; + stableDebtAfter_not?: InputMaybe; + stableDebtAfter_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + token?: InputMaybe; + tokenPriceUSD?: InputMaybe; + tokenPriceUSD_gt?: InputMaybe; + tokenPriceUSD_gte?: InputMaybe; + tokenPriceUSD_in?: InputMaybe>; + tokenPriceUSD_lt?: InputMaybe; + tokenPriceUSD_lte?: InputMaybe; + tokenPriceUSD_not?: InputMaybe; + tokenPriceUSD_not_in?: InputMaybe>; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_in?: InputMaybe>; + user?: InputMaybe; + user_contains?: InputMaybe; + user_gt?: InputMaybe; + user_gte?: InputMaybe; + user_in?: InputMaybe>; + user_lt?: InputMaybe; + user_lte?: InputMaybe; + user_not?: InputMaybe; + user_not_contains?: InputMaybe; + user_not_in?: InputMaybe>; + variableDebtAfter?: InputMaybe; + variableDebtAfter_gt?: InputMaybe; + variableDebtAfter_gte?: InputMaybe; + variableDebtAfter_in?: InputMaybe>; + variableDebtAfter_lt?: InputMaybe; + variableDebtAfter_lte?: InputMaybe; + variableDebtAfter_not?: InputMaybe; + variableDebtAfter_not_in?: InputMaybe>; + version?: InputMaybe; + version_contains?: InputMaybe; + version_contains_nocase?: InputMaybe; + version_ends_with?: InputMaybe; + version_ends_with_nocase?: InputMaybe; + version_gt?: InputMaybe; + version_gte?: InputMaybe; + version_in?: InputMaybe>; + version_lt?: InputMaybe; + version_lte?: InputMaybe; + version_not?: InputMaybe; + version_not_contains?: InputMaybe; + version_not_contains_nocase?: InputMaybe; + version_not_ends_with?: InputMaybe; + version_not_ends_with_nocase?: InputMaybe; + version_not_in?: InputMaybe>; + version_not_starts_with?: InputMaybe; + version_not_starts_with_nocase?: InputMaybe; + version_starts_with?: InputMaybe; + version_starts_with_nocase?: InputMaybe; +}; + +export enum AaveLikeRepay_OrderBy { + Amount = 'amount', + BlockNumber = 'blockNumber', + DebtDelta = 'debtDelta', + Id = 'id', + Protocol = 'protocol', + Repayer = 'repayer', + Reserve = 'reserve', + StableDebtAfter = 'stableDebtAfter', + Timestamp = 'timestamp', + Token = 'token', + TokenPriceUsd = 'tokenPriceUSD', + TokenAddress = 'token__address', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenPrecision = 'token__precision', + TokenSymbol = 'token__symbol', + TxHash = 'txHash', + User = 'user', + VariableDebtAfter = 'variableDebtAfter', + Version = 'version' +} + +export type AaveLikeWithdraw = { + __typename?: 'AaveLikeWithdraw'; + amount: Scalars['BigInt']['output']; + blockNumber: Scalars['BigInt']['output']; + collateralAfter?: Maybe; + collateralDelta?: Maybe; + id: Scalars['ID']['output']; + protocol: Scalars['String']['output']; + reserve: Scalars['Bytes']['output']; + timestamp: Scalars['BigInt']['output']; + to: Scalars['Bytes']['output']; + token?: Maybe; + tokenPriceUSD?: Maybe; + txHash: Scalars['Bytes']['output']; + user: Scalars['Bytes']['output']; + version?: Maybe; +}; + +export type AaveLikeWithdraw_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amount?: InputMaybe; + amount_gt?: InputMaybe; + amount_gte?: InputMaybe; + amount_in?: InputMaybe>; + amount_lt?: InputMaybe; + amount_lte?: InputMaybe; + amount_not?: InputMaybe; + amount_not_in?: InputMaybe>; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + collateralAfter?: InputMaybe; + collateralAfter_gt?: InputMaybe; + collateralAfter_gte?: InputMaybe; + collateralAfter_in?: InputMaybe>; + collateralAfter_lt?: InputMaybe; + collateralAfter_lte?: InputMaybe; + collateralAfter_not?: InputMaybe; + collateralAfter_not_in?: InputMaybe>; + collateralDelta?: InputMaybe; + collateralDelta_gt?: InputMaybe; + collateralDelta_gte?: InputMaybe; + collateralDelta_in?: InputMaybe>; + collateralDelta_lt?: InputMaybe; + collateralDelta_lte?: InputMaybe; + collateralDelta_not?: InputMaybe; + collateralDelta_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + reserve?: InputMaybe; + reserve_contains?: InputMaybe; + reserve_gt?: InputMaybe; + reserve_gte?: InputMaybe; + reserve_in?: InputMaybe>; + reserve_lt?: InputMaybe; + reserve_lte?: InputMaybe; + reserve_not?: InputMaybe; + reserve_not_contains?: InputMaybe; + reserve_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + to?: InputMaybe; + to_contains?: InputMaybe; + to_gt?: InputMaybe; + to_gte?: InputMaybe; + to_in?: InputMaybe>; + to_lt?: InputMaybe; + to_lte?: InputMaybe; + to_not?: InputMaybe; + to_not_contains?: InputMaybe; + to_not_in?: InputMaybe>; + token?: InputMaybe; + tokenPriceUSD?: InputMaybe; + tokenPriceUSD_gt?: InputMaybe; + tokenPriceUSD_gte?: InputMaybe; + tokenPriceUSD_in?: InputMaybe>; + tokenPriceUSD_lt?: InputMaybe; + tokenPriceUSD_lte?: InputMaybe; + tokenPriceUSD_not?: InputMaybe; + tokenPriceUSD_not_in?: InputMaybe>; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_in?: InputMaybe>; + user?: InputMaybe; + user_contains?: InputMaybe; + user_gt?: InputMaybe; + user_gte?: InputMaybe; + user_in?: InputMaybe>; + user_lt?: InputMaybe; + user_lte?: InputMaybe; + user_not?: InputMaybe; + user_not_contains?: InputMaybe; + user_not_in?: InputMaybe>; + version?: InputMaybe; + version_contains?: InputMaybe; + version_contains_nocase?: InputMaybe; + version_ends_with?: InputMaybe; + version_ends_with_nocase?: InputMaybe; + version_gt?: InputMaybe; + version_gte?: InputMaybe; + version_in?: InputMaybe>; + version_lt?: InputMaybe; + version_lte?: InputMaybe; + version_not?: InputMaybe; + version_not_contains?: InputMaybe; + version_not_contains_nocase?: InputMaybe; + version_not_ends_with?: InputMaybe; + version_not_ends_with_nocase?: InputMaybe; + version_not_in?: InputMaybe>; + version_not_starts_with?: InputMaybe; + version_not_starts_with_nocase?: InputMaybe; + version_starts_with?: InputMaybe; + version_starts_with_nocase?: InputMaybe; +}; + +export enum AaveLikeWithdraw_OrderBy { + Amount = 'amount', + BlockNumber = 'blockNumber', + CollateralAfter = 'collateralAfter', + CollateralDelta = 'collateralDelta', + Id = 'id', + Protocol = 'protocol', + Reserve = 'reserve', + Timestamp = 'timestamp', + To = 'to', + Token = 'token', + TokenPriceUsd = 'tokenPriceUSD', + TokenAddress = 'token__address', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenPrecision = 'token__precision', + TokenSymbol = 'token__symbol', + TxHash = 'txHash', + User = 'user', + Version = 'version' +} + +export enum Aggregation_Interval { + Day = 'day', + Hour = 'hour' +} + +export type AssetSwap = { + __typename?: 'AssetSwap'; + amountIn: Scalars['BigInt']['output']; + amountOut: Scalars['BigInt']['output']; + assetIn: Scalars['Bytes']['output']; + assetOut: Scalars['Bytes']['output']; + /** + * id is a tx_hash-actionLogIndex + * it uses action log index to easily combine all swap events into one + * + */ + id: Scalars['ID']['output']; + proxy?: Maybe; +}; + +export type AssetSwap_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amountIn?: InputMaybe; + amountIn_gt?: InputMaybe; + amountIn_gte?: InputMaybe; + amountIn_in?: InputMaybe>; + amountIn_lt?: InputMaybe; + amountIn_lte?: InputMaybe; + amountIn_not?: InputMaybe; + amountIn_not_in?: InputMaybe>; + amountOut?: InputMaybe; + amountOut_gt?: InputMaybe; + amountOut_gte?: InputMaybe; + amountOut_in?: InputMaybe>; + amountOut_lt?: InputMaybe; + amountOut_lte?: InputMaybe; + amountOut_not?: InputMaybe; + amountOut_not_in?: InputMaybe>; + and?: InputMaybe>>; + assetIn?: InputMaybe; + assetIn_contains?: InputMaybe; + assetIn_gt?: InputMaybe; + assetIn_gte?: InputMaybe; + assetIn_in?: InputMaybe>; + assetIn_lt?: InputMaybe; + assetIn_lte?: InputMaybe; + assetIn_not?: InputMaybe; + assetIn_not_contains?: InputMaybe; + assetIn_not_in?: InputMaybe>; + assetOut?: InputMaybe; + assetOut_contains?: InputMaybe; + assetOut_gt?: InputMaybe; + assetOut_gte?: InputMaybe; + assetOut_in?: InputMaybe>; + assetOut_lt?: InputMaybe; + assetOut_lte?: InputMaybe; + assetOut_not?: InputMaybe; + assetOut_not_contains?: InputMaybe; + assetOut_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + proxy?: InputMaybe; + proxy_contains?: InputMaybe; + proxy_gt?: InputMaybe; + proxy_gte?: InputMaybe; + proxy_in?: InputMaybe>; + proxy_lt?: InputMaybe; + proxy_lte?: InputMaybe; + proxy_not?: InputMaybe; + proxy_not_contains?: InputMaybe; + proxy_not_in?: InputMaybe>; +}; + +export enum AssetSwap_OrderBy { + AmountIn = 'amountIn', + AmountOut = 'amountOut', + AssetIn = 'assetIn', + AssetOut = 'assetOut', + Id = 'id', + Proxy = 'proxy' +} + +export type BlockChangedFilter = { + number_gte: Scalars['Int']['input']; +}; + +export type Block_Height = { + hash?: InputMaybe; + number?: InputMaybe; + number_gte?: InputMaybe; +}; + +export type FeePaid = { + __typename?: 'FeePaid'; + amount: Scalars['BigInt']['output']; + beneficiary: Scalars['Bytes']['output']; + /** + * id is a tx_hash-actionLogIndex + * it uses action log index to easily combine all swap events into one + * + */ + id: Scalars['ID']['output']; + token: Scalars['Bytes']['output']; +}; + +export type FeePaid_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amount?: InputMaybe; + amount_gt?: InputMaybe; + amount_gte?: InputMaybe; + amount_in?: InputMaybe>; + amount_lt?: InputMaybe; + amount_lte?: InputMaybe; + amount_not?: InputMaybe; + amount_not_in?: InputMaybe>; + and?: InputMaybe>>; + beneficiary?: InputMaybe; + beneficiary_contains?: InputMaybe; + beneficiary_gt?: InputMaybe; + beneficiary_gte?: InputMaybe; + beneficiary_in?: InputMaybe>; + beneficiary_lt?: InputMaybe; + beneficiary_lte?: InputMaybe; + beneficiary_not?: InputMaybe; + beneficiary_not_contains?: InputMaybe; + beneficiary_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + token?: InputMaybe; + token_contains?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_in?: InputMaybe>; +}; + +export enum FeePaid_OrderBy { + Amount = 'amount', + Beneficiary = 'beneficiary', + Id = 'id', + Token = 'token' +} + +export type InterestRate = { + __typename?: 'InterestRate'; + blockNumber: Scalars['BigInt']['output']; + id: Scalars['Bytes']['output']; + protocol: Scalars['String']['output']; + rate: Scalars['BigDecimal']['output']; + timestamp: Scalars['BigInt']['output']; + token: Token; + type: Scalars['String']['output']; +}; + +export type InterestRateConfig = { + __typename?: 'InterestRateConfig'; + id: Scalars['ID']['output']; + lastUpdateTimestamp: Scalars['BigInt']['output']; +}; + +export type InterestRateConfig_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + lastUpdateTimestamp?: InputMaybe; + lastUpdateTimestamp_gt?: InputMaybe; + lastUpdateTimestamp_gte?: InputMaybe; + lastUpdateTimestamp_in?: InputMaybe>; + lastUpdateTimestamp_lt?: InputMaybe; + lastUpdateTimestamp_lte?: InputMaybe; + lastUpdateTimestamp_not?: InputMaybe; + lastUpdateTimestamp_not_in?: InputMaybe>; + or?: InputMaybe>>; +}; + +export enum InterestRateConfig_OrderBy { + Id = 'id', + LastUpdateTimestamp = 'lastUpdateTimestamp' +} + +export type InterestRate_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + rate?: InputMaybe; + rate_gt?: InputMaybe; + rate_gte?: InputMaybe; + rate_in?: InputMaybe>; + rate_lt?: InputMaybe; + rate_lte?: InputMaybe; + rate_not?: InputMaybe; + rate_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + token?: InputMaybe; + token_?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + type?: InputMaybe; + type_contains?: InputMaybe; + type_contains_nocase?: InputMaybe; + type_ends_with?: InputMaybe; + type_ends_with_nocase?: InputMaybe; + type_gt?: InputMaybe; + type_gte?: InputMaybe; + type_in?: InputMaybe>; + type_lt?: InputMaybe; + type_lte?: InputMaybe; + type_not?: InputMaybe; + type_not_contains?: InputMaybe; + type_not_contains_nocase?: InputMaybe; + type_not_ends_with?: InputMaybe; + type_not_ends_with_nocase?: InputMaybe; + type_not_in?: InputMaybe>; + type_not_starts_with?: InputMaybe; + type_not_starts_with_nocase?: InputMaybe; + type_starts_with?: InputMaybe; + type_starts_with_nocase?: InputMaybe; +}; + +export enum InterestRate_OrderBy { + BlockNumber = 'blockNumber', + Id = 'id', + Protocol = 'protocol', + Rate = 'rate', + Timestamp = 'timestamp', + Token = 'token', + TokenAddress = 'token__address', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenPrecision = 'token__precision', + TokenSymbol = 'token__symbol', + Type = 'type' +} + +/** Defines the order direction, either ascending or descending */ +export enum OrderDirection { + Asc = 'asc', + Desc = 'desc' +} + +export type Position = { + __typename?: 'Position'; + account: Scalars['Bytes']['output']; + collateral: Scalars['BigDecimal']['output']; + collateralAddress: Scalars['Bytes']['output']; + cumulativeDeposit?: Maybe; + cumulativeDepositInCollateralToken?: Maybe; + cumulativeDepositInQuoteToken?: Maybe; + cumulativeDepositUSD?: Maybe; + cumulativeFees?: Maybe; + cumulativeFeesInCollateralToken?: Maybe; + cumulativeFeesInQuoteToken?: Maybe; + cumulativeFeesUSD?: Maybe; + cumulativeWithdraw?: Maybe; + cumulativeWithdrawInCollateralToken?: Maybe; + cumulativeWithdrawInQuoteToken?: Maybe; + cumulativeWithdrawUSD?: Maybe; + debt: Scalars['BigDecimal']['output']; + debtAddress: Scalars['Bytes']['output']; + events: Array; + fromEvent: Scalars['Boolean']['output']; + id: Scalars['ID']['output']; + lastEvent?: Maybe; + protocol: Scalars['String']['output']; + proxy: Proxy; + type: Scalars['String']['output']; +}; + + +export type PositionEventsArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + +export type PositionEvent = { + __typename?: 'PositionEvent'; + account: Scalars['Bytes']['output']; + blockNumber: Scalars['BigInt']['output']; + collateralAddress: Scalars['Bytes']['output']; + collateralAfter: Scalars['BigDecimal']['output']; + collateralBefore: Scalars['BigDecimal']['output']; + collateralDelta: Scalars['BigDecimal']['output']; + collateralOraclePrice: Scalars['BigDecimal']['output']; + collateralToken?: Maybe; + collateralTokenPriceUSD: Scalars['BigDecimal']['output']; + debtAddress: Scalars['Bytes']['output']; + debtAfter: Scalars['BigDecimal']['output']; + debtBefore: Scalars['BigDecimal']['output']; + debtDelta: Scalars['BigDecimal']['output']; + debtOraclePrice: Scalars['BigDecimal']['output']; + debtToken?: Maybe; + debtTokenPriceUSD: Scalars['BigDecimal']['output']; + depositTransfers: Array; + depositedUSD?: Maybe; + ethPrice: Scalars['BigDecimal']['output']; + gasFeeUSD: Scalars['BigDecimal']['output']; + gasPrice: Scalars['BigInt']['output']; + gasUsed: Scalars['BigInt']['output']; + healthFactorAfter: Scalars['BigDecimal']['output']; + id: Scalars['ID']['output']; + isAutomation?: Maybe; + kind: Scalars['String']['output']; + liquidationPriceAfter?: Maybe; + liquidationPriceBefore?: Maybe; + liquidationThreshold: Scalars['BigDecimal']['output']; + ltvAfter: Scalars['BigDecimal']['output']; + ltvBefore?: Maybe; + marketPrice?: Maybe; + multipleAfter?: Maybe; + multipleBefore?: Maybe; + netValueAfter?: Maybe; + netValueBefore?: Maybe; + oasisFee: Scalars['BigDecimal']['output']; + /** + * Depricated fields prefixed with oasis + * + */ + oasisFeeToken?: Maybe; + oasisFeeUSD: Scalars['BigDecimal']['output']; + position?: Maybe; + proxy: Proxy; + summerFee: Scalars['BigDecimal']['output']; + summerFeeToken?: Maybe; + summerFeeUSD: Scalars['BigDecimal']['output']; + swapFromAmount?: Maybe; + /** + * First iteration assumes just one + * swap in an operation + * + */ + swapFromToken?: Maybe; + swapToAmount?: Maybe; + swapToToken?: Maybe; + timestamp: Scalars['BigInt']['output']; + totalFee: Scalars['BigDecimal']['output']; + trigger?: Maybe; + txHash: Scalars['Bytes']['output']; + withdrawTransfers: Array; + withdrawnUSD?: Maybe; +}; + + +export type PositionEventDepositTransfersArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + + +export type PositionEventWithdrawTransfersArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + +export type PositionEvent_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + account?: InputMaybe; + account_contains?: InputMaybe; + account_gt?: InputMaybe; + account_gte?: InputMaybe; + account_in?: InputMaybe>; + account_lt?: InputMaybe; + account_lte?: InputMaybe; + account_not?: InputMaybe; + account_not_contains?: InputMaybe; + account_not_in?: InputMaybe>; + and?: InputMaybe>>; + blockNumber?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_lt?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_not_in?: InputMaybe>; + collateralAddress?: InputMaybe; + collateralAddress_contains?: InputMaybe; + collateralAddress_gt?: InputMaybe; + collateralAddress_gte?: InputMaybe; + collateralAddress_in?: InputMaybe>; + collateralAddress_lt?: InputMaybe; + collateralAddress_lte?: InputMaybe; + collateralAddress_not?: InputMaybe; + collateralAddress_not_contains?: InputMaybe; + collateralAddress_not_in?: InputMaybe>; + collateralAfter?: InputMaybe; + collateralAfter_gt?: InputMaybe; + collateralAfter_gte?: InputMaybe; + collateralAfter_in?: InputMaybe>; + collateralAfter_lt?: InputMaybe; + collateralAfter_lte?: InputMaybe; + collateralAfter_not?: InputMaybe; + collateralAfter_not_in?: InputMaybe>; + collateralBefore?: InputMaybe; + collateralBefore_gt?: InputMaybe; + collateralBefore_gte?: InputMaybe; + collateralBefore_in?: InputMaybe>; + collateralBefore_lt?: InputMaybe; + collateralBefore_lte?: InputMaybe; + collateralBefore_not?: InputMaybe; + collateralBefore_not_in?: InputMaybe>; + collateralDelta?: InputMaybe; + collateralDelta_gt?: InputMaybe; + collateralDelta_gte?: InputMaybe; + collateralDelta_in?: InputMaybe>; + collateralDelta_lt?: InputMaybe; + collateralDelta_lte?: InputMaybe; + collateralDelta_not?: InputMaybe; + collateralDelta_not_in?: InputMaybe>; + collateralOraclePrice?: InputMaybe; + collateralOraclePrice_gt?: InputMaybe; + collateralOraclePrice_gte?: InputMaybe; + collateralOraclePrice_in?: InputMaybe>; + collateralOraclePrice_lt?: InputMaybe; + collateralOraclePrice_lte?: InputMaybe; + collateralOraclePrice_not?: InputMaybe; + collateralOraclePrice_not_in?: InputMaybe>; + collateralToken?: InputMaybe; + collateralTokenPriceUSD?: InputMaybe; + collateralTokenPriceUSD_gt?: InputMaybe; + collateralTokenPriceUSD_gte?: InputMaybe; + collateralTokenPriceUSD_in?: InputMaybe>; + collateralTokenPriceUSD_lt?: InputMaybe; + collateralTokenPriceUSD_lte?: InputMaybe; + collateralTokenPriceUSD_not?: InputMaybe; + collateralTokenPriceUSD_not_in?: InputMaybe>; + collateralToken_?: InputMaybe; + collateralToken_contains?: InputMaybe; + collateralToken_contains_nocase?: InputMaybe; + collateralToken_ends_with?: InputMaybe; + collateralToken_ends_with_nocase?: InputMaybe; + collateralToken_gt?: InputMaybe; + collateralToken_gte?: InputMaybe; + collateralToken_in?: InputMaybe>; + collateralToken_lt?: InputMaybe; + collateralToken_lte?: InputMaybe; + collateralToken_not?: InputMaybe; + collateralToken_not_contains?: InputMaybe; + collateralToken_not_contains_nocase?: InputMaybe; + collateralToken_not_ends_with?: InputMaybe; + collateralToken_not_ends_with_nocase?: InputMaybe; + collateralToken_not_in?: InputMaybe>; + collateralToken_not_starts_with?: InputMaybe; + collateralToken_not_starts_with_nocase?: InputMaybe; + collateralToken_starts_with?: InputMaybe; + collateralToken_starts_with_nocase?: InputMaybe; + debtAddress?: InputMaybe; + debtAddress_contains?: InputMaybe; + debtAddress_gt?: InputMaybe; + debtAddress_gte?: InputMaybe; + debtAddress_in?: InputMaybe>; + debtAddress_lt?: InputMaybe; + debtAddress_lte?: InputMaybe; + debtAddress_not?: InputMaybe; + debtAddress_not_contains?: InputMaybe; + debtAddress_not_in?: InputMaybe>; + debtAfter?: InputMaybe; + debtAfter_gt?: InputMaybe; + debtAfter_gte?: InputMaybe; + debtAfter_in?: InputMaybe>; + debtAfter_lt?: InputMaybe; + debtAfter_lte?: InputMaybe; + debtAfter_not?: InputMaybe; + debtAfter_not_in?: InputMaybe>; + debtBefore?: InputMaybe; + debtBefore_gt?: InputMaybe; + debtBefore_gte?: InputMaybe; + debtBefore_in?: InputMaybe>; + debtBefore_lt?: InputMaybe; + debtBefore_lte?: InputMaybe; + debtBefore_not?: InputMaybe; + debtBefore_not_in?: InputMaybe>; + debtDelta?: InputMaybe; + debtDelta_gt?: InputMaybe; + debtDelta_gte?: InputMaybe; + debtDelta_in?: InputMaybe>; + debtDelta_lt?: InputMaybe; + debtDelta_lte?: InputMaybe; + debtDelta_not?: InputMaybe; + debtDelta_not_in?: InputMaybe>; + debtOraclePrice?: InputMaybe; + debtOraclePrice_gt?: InputMaybe; + debtOraclePrice_gte?: InputMaybe; + debtOraclePrice_in?: InputMaybe>; + debtOraclePrice_lt?: InputMaybe; + debtOraclePrice_lte?: InputMaybe; + debtOraclePrice_not?: InputMaybe; + debtOraclePrice_not_in?: InputMaybe>; + debtToken?: InputMaybe; + debtTokenPriceUSD?: InputMaybe; + debtTokenPriceUSD_gt?: InputMaybe; + debtTokenPriceUSD_gte?: InputMaybe; + debtTokenPriceUSD_in?: InputMaybe>; + debtTokenPriceUSD_lt?: InputMaybe; + debtTokenPriceUSD_lte?: InputMaybe; + debtTokenPriceUSD_not?: InputMaybe; + debtTokenPriceUSD_not_in?: InputMaybe>; + debtToken_?: InputMaybe; + debtToken_contains?: InputMaybe; + debtToken_contains_nocase?: InputMaybe; + debtToken_ends_with?: InputMaybe; + debtToken_ends_with_nocase?: InputMaybe; + debtToken_gt?: InputMaybe; + debtToken_gte?: InputMaybe; + debtToken_in?: InputMaybe>; + debtToken_lt?: InputMaybe; + debtToken_lte?: InputMaybe; + debtToken_not?: InputMaybe; + debtToken_not_contains?: InputMaybe; + debtToken_not_contains_nocase?: InputMaybe; + debtToken_not_ends_with?: InputMaybe; + debtToken_not_ends_with_nocase?: InputMaybe; + debtToken_not_in?: InputMaybe>; + debtToken_not_starts_with?: InputMaybe; + debtToken_not_starts_with_nocase?: InputMaybe; + debtToken_starts_with?: InputMaybe; + debtToken_starts_with_nocase?: InputMaybe; + depositTransfers?: InputMaybe>; + depositTransfers_?: InputMaybe; + depositTransfers_contains?: InputMaybe>; + depositTransfers_contains_nocase?: InputMaybe>; + depositTransfers_not?: InputMaybe>; + depositTransfers_not_contains?: InputMaybe>; + depositTransfers_not_contains_nocase?: InputMaybe>; + depositedUSD?: InputMaybe; + depositedUSD_gt?: InputMaybe; + depositedUSD_gte?: InputMaybe; + depositedUSD_in?: InputMaybe>; + depositedUSD_lt?: InputMaybe; + depositedUSD_lte?: InputMaybe; + depositedUSD_not?: InputMaybe; + depositedUSD_not_in?: InputMaybe>; + ethPrice?: InputMaybe; + ethPrice_gt?: InputMaybe; + ethPrice_gte?: InputMaybe; + ethPrice_in?: InputMaybe>; + ethPrice_lt?: InputMaybe; + ethPrice_lte?: InputMaybe; + ethPrice_not?: InputMaybe; + ethPrice_not_in?: InputMaybe>; + gasFeeUSD?: InputMaybe; + gasFeeUSD_gt?: InputMaybe; + gasFeeUSD_gte?: InputMaybe; + gasFeeUSD_in?: InputMaybe>; + gasFeeUSD_lt?: InputMaybe; + gasFeeUSD_lte?: InputMaybe; + gasFeeUSD_not?: InputMaybe; + gasFeeUSD_not_in?: InputMaybe>; + gasPrice?: InputMaybe; + gasPrice_gt?: InputMaybe; + gasPrice_gte?: InputMaybe; + gasPrice_in?: InputMaybe>; + gasPrice_lt?: InputMaybe; + gasPrice_lte?: InputMaybe; + gasPrice_not?: InputMaybe; + gasPrice_not_in?: InputMaybe>; + gasUsed?: InputMaybe; + gasUsed_gt?: InputMaybe; + gasUsed_gte?: InputMaybe; + gasUsed_in?: InputMaybe>; + gasUsed_lt?: InputMaybe; + gasUsed_lte?: InputMaybe; + gasUsed_not?: InputMaybe; + gasUsed_not_in?: InputMaybe>; + healthFactorAfter?: InputMaybe; + healthFactorAfter_gt?: InputMaybe; + healthFactorAfter_gte?: InputMaybe; + healthFactorAfter_in?: InputMaybe>; + healthFactorAfter_lt?: InputMaybe; + healthFactorAfter_lte?: InputMaybe; + healthFactorAfter_not?: InputMaybe; + healthFactorAfter_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + isAutomation?: InputMaybe; + isAutomation_in?: InputMaybe>; + isAutomation_not?: InputMaybe; + isAutomation_not_in?: InputMaybe>; + kind?: InputMaybe; + kind_contains?: InputMaybe; + kind_contains_nocase?: InputMaybe; + kind_ends_with?: InputMaybe; + kind_ends_with_nocase?: InputMaybe; + kind_gt?: InputMaybe; + kind_gte?: InputMaybe; + kind_in?: InputMaybe>; + kind_lt?: InputMaybe; + kind_lte?: InputMaybe; + kind_not?: InputMaybe; + kind_not_contains?: InputMaybe; + kind_not_contains_nocase?: InputMaybe; + kind_not_ends_with?: InputMaybe; + kind_not_ends_with_nocase?: InputMaybe; + kind_not_in?: InputMaybe>; + kind_not_starts_with?: InputMaybe; + kind_not_starts_with_nocase?: InputMaybe; + kind_starts_with?: InputMaybe; + kind_starts_with_nocase?: InputMaybe; + liquidationPriceAfter?: InputMaybe; + liquidationPriceAfter_gt?: InputMaybe; + liquidationPriceAfter_gte?: InputMaybe; + liquidationPriceAfter_in?: InputMaybe>; + liquidationPriceAfter_lt?: InputMaybe; + liquidationPriceAfter_lte?: InputMaybe; + liquidationPriceAfter_not?: InputMaybe; + liquidationPriceAfter_not_in?: InputMaybe>; + liquidationPriceBefore?: InputMaybe; + liquidationPriceBefore_gt?: InputMaybe; + liquidationPriceBefore_gte?: InputMaybe; + liquidationPriceBefore_in?: InputMaybe>; + liquidationPriceBefore_lt?: InputMaybe; + liquidationPriceBefore_lte?: InputMaybe; + liquidationPriceBefore_not?: InputMaybe; + liquidationPriceBefore_not_in?: InputMaybe>; + liquidationThreshold?: InputMaybe; + liquidationThreshold_gt?: InputMaybe; + liquidationThreshold_gte?: InputMaybe; + liquidationThreshold_in?: InputMaybe>; + liquidationThreshold_lt?: InputMaybe; + liquidationThreshold_lte?: InputMaybe; + liquidationThreshold_not?: InputMaybe; + liquidationThreshold_not_in?: InputMaybe>; + ltvAfter?: InputMaybe; + ltvAfter_gt?: InputMaybe; + ltvAfter_gte?: InputMaybe; + ltvAfter_in?: InputMaybe>; + ltvAfter_lt?: InputMaybe; + ltvAfter_lte?: InputMaybe; + ltvAfter_not?: InputMaybe; + ltvAfter_not_in?: InputMaybe>; + ltvBefore?: InputMaybe; + ltvBefore_gt?: InputMaybe; + ltvBefore_gte?: InputMaybe; + ltvBefore_in?: InputMaybe>; + ltvBefore_lt?: InputMaybe; + ltvBefore_lte?: InputMaybe; + ltvBefore_not?: InputMaybe; + ltvBefore_not_in?: InputMaybe>; + marketPrice?: InputMaybe; + marketPrice_gt?: InputMaybe; + marketPrice_gte?: InputMaybe; + marketPrice_in?: InputMaybe>; + marketPrice_lt?: InputMaybe; + marketPrice_lte?: InputMaybe; + marketPrice_not?: InputMaybe; + marketPrice_not_in?: InputMaybe>; + multipleAfter?: InputMaybe; + multipleAfter_gt?: InputMaybe; + multipleAfter_gte?: InputMaybe; + multipleAfter_in?: InputMaybe>; + multipleAfter_lt?: InputMaybe; + multipleAfter_lte?: InputMaybe; + multipleAfter_not?: InputMaybe; + multipleAfter_not_in?: InputMaybe>; + multipleBefore?: InputMaybe; + multipleBefore_gt?: InputMaybe; + multipleBefore_gte?: InputMaybe; + multipleBefore_in?: InputMaybe>; + multipleBefore_lt?: InputMaybe; + multipleBefore_lte?: InputMaybe; + multipleBefore_not?: InputMaybe; + multipleBefore_not_in?: InputMaybe>; + netValueAfter?: InputMaybe; + netValueAfter_gt?: InputMaybe; + netValueAfter_gte?: InputMaybe; + netValueAfter_in?: InputMaybe>; + netValueAfter_lt?: InputMaybe; + netValueAfter_lte?: InputMaybe; + netValueAfter_not?: InputMaybe; + netValueAfter_not_in?: InputMaybe>; + netValueBefore?: InputMaybe; + netValueBefore_gt?: InputMaybe; + netValueBefore_gte?: InputMaybe; + netValueBefore_in?: InputMaybe>; + netValueBefore_lt?: InputMaybe; + netValueBefore_lte?: InputMaybe; + netValueBefore_not?: InputMaybe; + netValueBefore_not_in?: InputMaybe>; + oasisFee?: InputMaybe; + oasisFeeToken?: InputMaybe; + oasisFeeToken_contains?: InputMaybe; + oasisFeeToken_gt?: InputMaybe; + oasisFeeToken_gte?: InputMaybe; + oasisFeeToken_in?: InputMaybe>; + oasisFeeToken_lt?: InputMaybe; + oasisFeeToken_lte?: InputMaybe; + oasisFeeToken_not?: InputMaybe; + oasisFeeToken_not_contains?: InputMaybe; + oasisFeeToken_not_in?: InputMaybe>; + oasisFeeUSD?: InputMaybe; + oasisFeeUSD_gt?: InputMaybe; + oasisFeeUSD_gte?: InputMaybe; + oasisFeeUSD_in?: InputMaybe>; + oasisFeeUSD_lt?: InputMaybe; + oasisFeeUSD_lte?: InputMaybe; + oasisFeeUSD_not?: InputMaybe; + oasisFeeUSD_not_in?: InputMaybe>; + oasisFee_gt?: InputMaybe; + oasisFee_gte?: InputMaybe; + oasisFee_in?: InputMaybe>; + oasisFee_lt?: InputMaybe; + oasisFee_lte?: InputMaybe; + oasisFee_not?: InputMaybe; + oasisFee_not_in?: InputMaybe>; + or?: InputMaybe>>; + position?: InputMaybe; + position_?: InputMaybe; + position_contains?: InputMaybe; + position_contains_nocase?: InputMaybe; + position_ends_with?: InputMaybe; + position_ends_with_nocase?: InputMaybe; + position_gt?: InputMaybe; + position_gte?: InputMaybe; + position_in?: InputMaybe>; + position_lt?: InputMaybe; + position_lte?: InputMaybe; + position_not?: InputMaybe; + position_not_contains?: InputMaybe; + position_not_contains_nocase?: InputMaybe; + position_not_ends_with?: InputMaybe; + position_not_ends_with_nocase?: InputMaybe; + position_not_in?: InputMaybe>; + position_not_starts_with?: InputMaybe; + position_not_starts_with_nocase?: InputMaybe; + position_starts_with?: InputMaybe; + position_starts_with_nocase?: InputMaybe; + proxy?: InputMaybe; + proxy_?: InputMaybe; + proxy_contains?: InputMaybe; + proxy_contains_nocase?: InputMaybe; + proxy_ends_with?: InputMaybe; + proxy_ends_with_nocase?: InputMaybe; + proxy_gt?: InputMaybe; + proxy_gte?: InputMaybe; + proxy_in?: InputMaybe>; + proxy_lt?: InputMaybe; + proxy_lte?: InputMaybe; + proxy_not?: InputMaybe; + proxy_not_contains?: InputMaybe; + proxy_not_contains_nocase?: InputMaybe; + proxy_not_ends_with?: InputMaybe; + proxy_not_ends_with_nocase?: InputMaybe; + proxy_not_in?: InputMaybe>; + proxy_not_starts_with?: InputMaybe; + proxy_not_starts_with_nocase?: InputMaybe; + proxy_starts_with?: InputMaybe; + proxy_starts_with_nocase?: InputMaybe; + summerFee?: InputMaybe; + summerFeeToken?: InputMaybe; + summerFeeToken_contains?: InputMaybe; + summerFeeToken_gt?: InputMaybe; + summerFeeToken_gte?: InputMaybe; + summerFeeToken_in?: InputMaybe>; + summerFeeToken_lt?: InputMaybe; + summerFeeToken_lte?: InputMaybe; + summerFeeToken_not?: InputMaybe; + summerFeeToken_not_contains?: InputMaybe; + summerFeeToken_not_in?: InputMaybe>; + summerFeeUSD?: InputMaybe; + summerFeeUSD_gt?: InputMaybe; + summerFeeUSD_gte?: InputMaybe; + summerFeeUSD_in?: InputMaybe>; + summerFeeUSD_lt?: InputMaybe; + summerFeeUSD_lte?: InputMaybe; + summerFeeUSD_not?: InputMaybe; + summerFeeUSD_not_in?: InputMaybe>; + summerFee_gt?: InputMaybe; + summerFee_gte?: InputMaybe; + summerFee_in?: InputMaybe>; + summerFee_lt?: InputMaybe; + summerFee_lte?: InputMaybe; + summerFee_not?: InputMaybe; + summerFee_not_in?: InputMaybe>; + swapFromAmount?: InputMaybe; + swapFromAmount_gt?: InputMaybe; + swapFromAmount_gte?: InputMaybe; + swapFromAmount_in?: InputMaybe>; + swapFromAmount_lt?: InputMaybe; + swapFromAmount_lte?: InputMaybe; + swapFromAmount_not?: InputMaybe; + swapFromAmount_not_in?: InputMaybe>; + swapFromToken?: InputMaybe; + swapFromToken_contains?: InputMaybe; + swapFromToken_gt?: InputMaybe; + swapFromToken_gte?: InputMaybe; + swapFromToken_in?: InputMaybe>; + swapFromToken_lt?: InputMaybe; + swapFromToken_lte?: InputMaybe; + swapFromToken_not?: InputMaybe; + swapFromToken_not_contains?: InputMaybe; + swapFromToken_not_in?: InputMaybe>; + swapToAmount?: InputMaybe; + swapToAmount_gt?: InputMaybe; + swapToAmount_gte?: InputMaybe; + swapToAmount_in?: InputMaybe>; + swapToAmount_lt?: InputMaybe; + swapToAmount_lte?: InputMaybe; + swapToAmount_not?: InputMaybe; + swapToAmount_not_in?: InputMaybe>; + swapToToken?: InputMaybe; + swapToToken_contains?: InputMaybe; + swapToToken_gt?: InputMaybe; + swapToToken_gte?: InputMaybe; + swapToToken_in?: InputMaybe>; + swapToToken_lt?: InputMaybe; + swapToToken_lte?: InputMaybe; + swapToToken_not?: InputMaybe; + swapToToken_not_contains?: InputMaybe; + swapToToken_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_not_in?: InputMaybe>; + totalFee?: InputMaybe; + totalFee_gt?: InputMaybe; + totalFee_gte?: InputMaybe; + totalFee_in?: InputMaybe>; + totalFee_lt?: InputMaybe; + totalFee_lte?: InputMaybe; + totalFee_not?: InputMaybe; + totalFee_not_in?: InputMaybe>; + trigger?: InputMaybe; + trigger_?: InputMaybe; + trigger_contains?: InputMaybe; + trigger_contains_nocase?: InputMaybe; + trigger_ends_with?: InputMaybe; + trigger_ends_with_nocase?: InputMaybe; + trigger_gt?: InputMaybe; + trigger_gte?: InputMaybe; + trigger_in?: InputMaybe>; + trigger_lt?: InputMaybe; + trigger_lte?: InputMaybe; + trigger_not?: InputMaybe; + trigger_not_contains?: InputMaybe; + trigger_not_contains_nocase?: InputMaybe; + trigger_not_ends_with?: InputMaybe; + trigger_not_ends_with_nocase?: InputMaybe; + trigger_not_in?: InputMaybe>; + trigger_not_starts_with?: InputMaybe; + trigger_not_starts_with_nocase?: InputMaybe; + trigger_starts_with?: InputMaybe; + trigger_starts_with_nocase?: InputMaybe; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_in?: InputMaybe>; + withdrawTransfers?: InputMaybe>; + withdrawTransfers_?: InputMaybe; + withdrawTransfers_contains?: InputMaybe>; + withdrawTransfers_contains_nocase?: InputMaybe>; + withdrawTransfers_not?: InputMaybe>; + withdrawTransfers_not_contains?: InputMaybe>; + withdrawTransfers_not_contains_nocase?: InputMaybe>; + withdrawnUSD?: InputMaybe; + withdrawnUSD_gt?: InputMaybe; + withdrawnUSD_gte?: InputMaybe; + withdrawnUSD_in?: InputMaybe>; + withdrawnUSD_lt?: InputMaybe; + withdrawnUSD_lte?: InputMaybe; + withdrawnUSD_not?: InputMaybe; + withdrawnUSD_not_in?: InputMaybe>; +}; + +export enum PositionEvent_OrderBy { + Account = 'account', + BlockNumber = 'blockNumber', + CollateralAddress = 'collateralAddress', + CollateralAfter = 'collateralAfter', + CollateralBefore = 'collateralBefore', + CollateralDelta = 'collateralDelta', + CollateralOraclePrice = 'collateralOraclePrice', + CollateralToken = 'collateralToken', + CollateralTokenPriceUsd = 'collateralTokenPriceUSD', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + DebtAddress = 'debtAddress', + DebtAfter = 'debtAfter', + DebtBefore = 'debtBefore', + DebtDelta = 'debtDelta', + DebtOraclePrice = 'debtOraclePrice', + DebtToken = 'debtToken', + DebtTokenPriceUsd = 'debtTokenPriceUSD', + DebtTokenAddress = 'debtToken__address', + DebtTokenDecimals = 'debtToken__decimals', + DebtTokenId = 'debtToken__id', + DebtTokenPrecision = 'debtToken__precision', + DebtTokenSymbol = 'debtToken__symbol', + DepositTransfers = 'depositTransfers', + DepositedUsd = 'depositedUSD', + EthPrice = 'ethPrice', + GasFeeUsd = 'gasFeeUSD', + GasPrice = 'gasPrice', + GasUsed = 'gasUsed', + HealthFactorAfter = 'healthFactorAfter', + Id = 'id', + IsAutomation = 'isAutomation', + Kind = 'kind', + LiquidationPriceAfter = 'liquidationPriceAfter', + LiquidationPriceBefore = 'liquidationPriceBefore', + LiquidationThreshold = 'liquidationThreshold', + LtvAfter = 'ltvAfter', + LtvBefore = 'ltvBefore', + MarketPrice = 'marketPrice', + MultipleAfter = 'multipleAfter', + MultipleBefore = 'multipleBefore', + NetValueAfter = 'netValueAfter', + NetValueBefore = 'netValueBefore', + OasisFee = 'oasisFee', + OasisFeeToken = 'oasisFeeToken', + OasisFeeUsd = 'oasisFeeUSD', + Position = 'position', + PositionAccount = 'position__account', + PositionCollateral = 'position__collateral', + PositionCollateralAddress = 'position__collateralAddress', + PositionCumulativeDeposit = 'position__cumulativeDeposit', + PositionCumulativeDepositInCollateralToken = 'position__cumulativeDepositInCollateralToken', + PositionCumulativeDepositInQuoteToken = 'position__cumulativeDepositInQuoteToken', + PositionCumulativeDepositUsd = 'position__cumulativeDepositUSD', + PositionCumulativeFees = 'position__cumulativeFees', + PositionCumulativeFeesInCollateralToken = 'position__cumulativeFeesInCollateralToken', + PositionCumulativeFeesInQuoteToken = 'position__cumulativeFeesInQuoteToken', + PositionCumulativeFeesUsd = 'position__cumulativeFeesUSD', + PositionCumulativeWithdraw = 'position__cumulativeWithdraw', + PositionCumulativeWithdrawInCollateralToken = 'position__cumulativeWithdrawInCollateralToken', + PositionCumulativeWithdrawInQuoteToken = 'position__cumulativeWithdrawInQuoteToken', + PositionCumulativeWithdrawUsd = 'position__cumulativeWithdrawUSD', + PositionDebt = 'position__debt', + PositionDebtAddress = 'position__debtAddress', + PositionFromEvent = 'position__fromEvent', + PositionId = 'position__id', + PositionProtocol = 'position__protocol', + PositionType = 'position__type', + Proxy = 'proxy', + ProxyId = 'proxy__id', + ProxyIsDpm = 'proxy__isDPM', + ProxyOwner = 'proxy__owner', + ProxyVaultId = 'proxy__vaultId', + SummerFee = 'summerFee', + SummerFeeToken = 'summerFeeToken', + SummerFeeUsd = 'summerFeeUSD', + SwapFromAmount = 'swapFromAmount', + SwapFromToken = 'swapFromToken', + SwapToAmount = 'swapToAmount', + SwapToToken = 'swapToToken', + Timestamp = 'timestamp', + TotalFee = 'totalFee', + Trigger = 'trigger', + TriggerAddedBlock = 'trigger__addedBlock', + TriggerAddedLogIndex = 'trigger__addedLogIndex', + TriggerAddedTimestamp = 'trigger__addedTimestamp', + TriggerAddedTransaction = 'trigger__addedTransaction', + TriggerCommandAddress = 'trigger__commandAddress', + TriggerExecutedBlock = 'trigger__executedBlock', + TriggerExecutedLogIndex = 'trigger__executedLogIndex', + TriggerExecutedTimestamp = 'trigger__executedTimestamp', + TriggerExecutedTransaction = 'trigger__executedTransaction', + TriggerId = 'trigger__id', + TriggerKind = 'trigger__kind', + TriggerRemovedBlock = 'trigger__removedBlock', + TriggerRemovedLogIndex = 'trigger__removedLogIndex', + TriggerRemovedTimestamp = 'trigger__removedTimestamp', + TriggerRemovedTransaction = 'trigger__removedTransaction', + TriggerTriggerData = 'trigger__triggerData', + TriggerTriggerType = 'trigger__triggerType', + TxHash = 'txHash', + WithdrawTransfers = 'withdrawTransfers', + WithdrawnUsd = 'withdrawnUSD' +} + +export type Position_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + account?: InputMaybe; + account_contains?: InputMaybe; + account_gt?: InputMaybe; + account_gte?: InputMaybe; + account_in?: InputMaybe>; + account_lt?: InputMaybe; + account_lte?: InputMaybe; + account_not?: InputMaybe; + account_not_contains?: InputMaybe; + account_not_in?: InputMaybe>; + and?: InputMaybe>>; + collateral?: InputMaybe; + collateralAddress?: InputMaybe; + collateralAddress_contains?: InputMaybe; + collateralAddress_gt?: InputMaybe; + collateralAddress_gte?: InputMaybe; + collateralAddress_in?: InputMaybe>; + collateralAddress_lt?: InputMaybe; + collateralAddress_lte?: InputMaybe; + collateralAddress_not?: InputMaybe; + collateralAddress_not_contains?: InputMaybe; + collateralAddress_not_in?: InputMaybe>; + collateral_gt?: InputMaybe; + collateral_gte?: InputMaybe; + collateral_in?: InputMaybe>; + collateral_lt?: InputMaybe; + collateral_lte?: InputMaybe; + collateral_not?: InputMaybe; + collateral_not_in?: InputMaybe>; + cumulativeDeposit?: InputMaybe; + cumulativeDepositInCollateralToken?: InputMaybe; + cumulativeDepositInCollateralToken_gt?: InputMaybe; + cumulativeDepositInCollateralToken_gte?: InputMaybe; + cumulativeDepositInCollateralToken_in?: InputMaybe>; + cumulativeDepositInCollateralToken_lt?: InputMaybe; + cumulativeDepositInCollateralToken_lte?: InputMaybe; + cumulativeDepositInCollateralToken_not?: InputMaybe; + cumulativeDepositInCollateralToken_not_in?: InputMaybe>; + cumulativeDepositInQuoteToken?: InputMaybe; + cumulativeDepositInQuoteToken_gt?: InputMaybe; + cumulativeDepositInQuoteToken_gte?: InputMaybe; + cumulativeDepositInQuoteToken_in?: InputMaybe>; + cumulativeDepositInQuoteToken_lt?: InputMaybe; + cumulativeDepositInQuoteToken_lte?: InputMaybe; + cumulativeDepositInQuoteToken_not?: InputMaybe; + cumulativeDepositInQuoteToken_not_in?: InputMaybe>; + cumulativeDepositUSD?: InputMaybe; + cumulativeDepositUSD_gt?: InputMaybe; + cumulativeDepositUSD_gte?: InputMaybe; + cumulativeDepositUSD_in?: InputMaybe>; + cumulativeDepositUSD_lt?: InputMaybe; + cumulativeDepositUSD_lte?: InputMaybe; + cumulativeDepositUSD_not?: InputMaybe; + cumulativeDepositUSD_not_in?: InputMaybe>; + cumulativeDeposit_gt?: InputMaybe; + cumulativeDeposit_gte?: InputMaybe; + cumulativeDeposit_in?: InputMaybe>; + cumulativeDeposit_lt?: InputMaybe; + cumulativeDeposit_lte?: InputMaybe; + cumulativeDeposit_not?: InputMaybe; + cumulativeDeposit_not_in?: InputMaybe>; + cumulativeFees?: InputMaybe; + cumulativeFeesInCollateralToken?: InputMaybe; + cumulativeFeesInCollateralToken_gt?: InputMaybe; + cumulativeFeesInCollateralToken_gte?: InputMaybe; + cumulativeFeesInCollateralToken_in?: InputMaybe>; + cumulativeFeesInCollateralToken_lt?: InputMaybe; + cumulativeFeesInCollateralToken_lte?: InputMaybe; + cumulativeFeesInCollateralToken_not?: InputMaybe; + cumulativeFeesInCollateralToken_not_in?: InputMaybe>; + cumulativeFeesInQuoteToken?: InputMaybe; + cumulativeFeesInQuoteToken_gt?: InputMaybe; + cumulativeFeesInQuoteToken_gte?: InputMaybe; + cumulativeFeesInQuoteToken_in?: InputMaybe>; + cumulativeFeesInQuoteToken_lt?: InputMaybe; + cumulativeFeesInQuoteToken_lte?: InputMaybe; + cumulativeFeesInQuoteToken_not?: InputMaybe; + cumulativeFeesInQuoteToken_not_in?: InputMaybe>; + cumulativeFeesUSD?: InputMaybe; + cumulativeFeesUSD_gt?: InputMaybe; + cumulativeFeesUSD_gte?: InputMaybe; + cumulativeFeesUSD_in?: InputMaybe>; + cumulativeFeesUSD_lt?: InputMaybe; + cumulativeFeesUSD_lte?: InputMaybe; + cumulativeFeesUSD_not?: InputMaybe; + cumulativeFeesUSD_not_in?: InputMaybe>; + cumulativeFees_gt?: InputMaybe; + cumulativeFees_gte?: InputMaybe; + cumulativeFees_in?: InputMaybe>; + cumulativeFees_lt?: InputMaybe; + cumulativeFees_lte?: InputMaybe; + cumulativeFees_not?: InputMaybe; + cumulativeFees_not_in?: InputMaybe>; + cumulativeWithdraw?: InputMaybe; + cumulativeWithdrawInCollateralToken?: InputMaybe; + cumulativeWithdrawInCollateralToken_gt?: InputMaybe; + cumulativeWithdrawInCollateralToken_gte?: InputMaybe; + cumulativeWithdrawInCollateralToken_in?: InputMaybe>; + cumulativeWithdrawInCollateralToken_lt?: InputMaybe; + cumulativeWithdrawInCollateralToken_lte?: InputMaybe; + cumulativeWithdrawInCollateralToken_not?: InputMaybe; + cumulativeWithdrawInCollateralToken_not_in?: InputMaybe>; + cumulativeWithdrawInQuoteToken?: InputMaybe; + cumulativeWithdrawInQuoteToken_gt?: InputMaybe; + cumulativeWithdrawInQuoteToken_gte?: InputMaybe; + cumulativeWithdrawInQuoteToken_in?: InputMaybe>; + cumulativeWithdrawInQuoteToken_lt?: InputMaybe; + cumulativeWithdrawInQuoteToken_lte?: InputMaybe; + cumulativeWithdrawInQuoteToken_not?: InputMaybe; + cumulativeWithdrawInQuoteToken_not_in?: InputMaybe>; + cumulativeWithdrawUSD?: InputMaybe; + cumulativeWithdrawUSD_gt?: InputMaybe; + cumulativeWithdrawUSD_gte?: InputMaybe; + cumulativeWithdrawUSD_in?: InputMaybe>; + cumulativeWithdrawUSD_lt?: InputMaybe; + cumulativeWithdrawUSD_lte?: InputMaybe; + cumulativeWithdrawUSD_not?: InputMaybe; + cumulativeWithdrawUSD_not_in?: InputMaybe>; + cumulativeWithdraw_gt?: InputMaybe; + cumulativeWithdraw_gte?: InputMaybe; + cumulativeWithdraw_in?: InputMaybe>; + cumulativeWithdraw_lt?: InputMaybe; + cumulativeWithdraw_lte?: InputMaybe; + cumulativeWithdraw_not?: InputMaybe; + cumulativeWithdraw_not_in?: InputMaybe>; + debt?: InputMaybe; + debtAddress?: InputMaybe; + debtAddress_contains?: InputMaybe; + debtAddress_gt?: InputMaybe; + debtAddress_gte?: InputMaybe; + debtAddress_in?: InputMaybe>; + debtAddress_lt?: InputMaybe; + debtAddress_lte?: InputMaybe; + debtAddress_not?: InputMaybe; + debtAddress_not_contains?: InputMaybe; + debtAddress_not_in?: InputMaybe>; + debt_gt?: InputMaybe; + debt_gte?: InputMaybe; + debt_in?: InputMaybe>; + debt_lt?: InputMaybe; + debt_lte?: InputMaybe; + debt_not?: InputMaybe; + debt_not_in?: InputMaybe>; + events_?: InputMaybe; + fromEvent?: InputMaybe; + fromEvent_in?: InputMaybe>; + fromEvent_not?: InputMaybe; + fromEvent_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + lastEvent?: InputMaybe; + lastEvent_?: InputMaybe; + lastEvent_contains?: InputMaybe; + lastEvent_contains_nocase?: InputMaybe; + lastEvent_ends_with?: InputMaybe; + lastEvent_ends_with_nocase?: InputMaybe; + lastEvent_gt?: InputMaybe; + lastEvent_gte?: InputMaybe; + lastEvent_in?: InputMaybe>; + lastEvent_lt?: InputMaybe; + lastEvent_lte?: InputMaybe; + lastEvent_not?: InputMaybe; + lastEvent_not_contains?: InputMaybe; + lastEvent_not_contains_nocase?: InputMaybe; + lastEvent_not_ends_with?: InputMaybe; + lastEvent_not_ends_with_nocase?: InputMaybe; + lastEvent_not_in?: InputMaybe>; + lastEvent_not_starts_with?: InputMaybe; + lastEvent_not_starts_with_nocase?: InputMaybe; + lastEvent_starts_with?: InputMaybe; + lastEvent_starts_with_nocase?: InputMaybe; + or?: InputMaybe>>; + protocol?: InputMaybe; + protocol_contains?: InputMaybe; + protocol_contains_nocase?: InputMaybe; + protocol_ends_with?: InputMaybe; + protocol_ends_with_nocase?: InputMaybe; + protocol_gt?: InputMaybe; + protocol_gte?: InputMaybe; + protocol_in?: InputMaybe>; + protocol_lt?: InputMaybe; + protocol_lte?: InputMaybe; + protocol_not?: InputMaybe; + protocol_not_contains?: InputMaybe; + protocol_not_contains_nocase?: InputMaybe; + protocol_not_ends_with?: InputMaybe; + protocol_not_ends_with_nocase?: InputMaybe; + protocol_not_in?: InputMaybe>; + protocol_not_starts_with?: InputMaybe; + protocol_not_starts_with_nocase?: InputMaybe; + protocol_starts_with?: InputMaybe; + protocol_starts_with_nocase?: InputMaybe; + proxy_?: InputMaybe; + type?: InputMaybe; + type_contains?: InputMaybe; + type_contains_nocase?: InputMaybe; + type_ends_with?: InputMaybe; + type_ends_with_nocase?: InputMaybe; + type_gt?: InputMaybe; + type_gte?: InputMaybe; + type_in?: InputMaybe>; + type_lt?: InputMaybe; + type_lte?: InputMaybe; + type_not?: InputMaybe; + type_not_contains?: InputMaybe; + type_not_contains_nocase?: InputMaybe; + type_not_ends_with?: InputMaybe; + type_not_ends_with_nocase?: InputMaybe; + type_not_in?: InputMaybe>; + type_not_starts_with?: InputMaybe; + type_not_starts_with_nocase?: InputMaybe; + type_starts_with?: InputMaybe; + type_starts_with_nocase?: InputMaybe; +}; + +export enum Position_OrderBy { + Account = 'account', + Collateral = 'collateral', + CollateralAddress = 'collateralAddress', + CumulativeDeposit = 'cumulativeDeposit', + CumulativeDepositInCollateralToken = 'cumulativeDepositInCollateralToken', + CumulativeDepositInQuoteToken = 'cumulativeDepositInQuoteToken', + CumulativeDepositUsd = 'cumulativeDepositUSD', + CumulativeFees = 'cumulativeFees', + CumulativeFeesInCollateralToken = 'cumulativeFeesInCollateralToken', + CumulativeFeesInQuoteToken = 'cumulativeFeesInQuoteToken', + CumulativeFeesUsd = 'cumulativeFeesUSD', + CumulativeWithdraw = 'cumulativeWithdraw', + CumulativeWithdrawInCollateralToken = 'cumulativeWithdrawInCollateralToken', + CumulativeWithdrawInQuoteToken = 'cumulativeWithdrawInQuoteToken', + CumulativeWithdrawUsd = 'cumulativeWithdrawUSD', + Debt = 'debt', + DebtAddress = 'debtAddress', + Events = 'events', + FromEvent = 'fromEvent', + Id = 'id', + LastEvent = 'lastEvent', + LastEventAccount = 'lastEvent__account', + LastEventBlockNumber = 'lastEvent__blockNumber', + LastEventCollateralAddress = 'lastEvent__collateralAddress', + LastEventCollateralAfter = 'lastEvent__collateralAfter', + LastEventCollateralBefore = 'lastEvent__collateralBefore', + LastEventCollateralDelta = 'lastEvent__collateralDelta', + LastEventCollateralOraclePrice = 'lastEvent__collateralOraclePrice', + LastEventCollateralTokenPriceUsd = 'lastEvent__collateralTokenPriceUSD', + LastEventDebtAddress = 'lastEvent__debtAddress', + LastEventDebtAfter = 'lastEvent__debtAfter', + LastEventDebtBefore = 'lastEvent__debtBefore', + LastEventDebtDelta = 'lastEvent__debtDelta', + LastEventDebtOraclePrice = 'lastEvent__debtOraclePrice', + LastEventDebtTokenPriceUsd = 'lastEvent__debtTokenPriceUSD', + LastEventDepositedUsd = 'lastEvent__depositedUSD', + LastEventEthPrice = 'lastEvent__ethPrice', + LastEventGasFeeUsd = 'lastEvent__gasFeeUSD', + LastEventGasPrice = 'lastEvent__gasPrice', + LastEventGasUsed = 'lastEvent__gasUsed', + LastEventHealthFactorAfter = 'lastEvent__healthFactorAfter', + LastEventId = 'lastEvent__id', + LastEventIsAutomation = 'lastEvent__isAutomation', + LastEventKind = 'lastEvent__kind', + LastEventLiquidationPriceAfter = 'lastEvent__liquidationPriceAfter', + LastEventLiquidationPriceBefore = 'lastEvent__liquidationPriceBefore', + LastEventLiquidationThreshold = 'lastEvent__liquidationThreshold', + LastEventLtvAfter = 'lastEvent__ltvAfter', + LastEventLtvBefore = 'lastEvent__ltvBefore', + LastEventMarketPrice = 'lastEvent__marketPrice', + LastEventMultipleAfter = 'lastEvent__multipleAfter', + LastEventMultipleBefore = 'lastEvent__multipleBefore', + LastEventNetValueAfter = 'lastEvent__netValueAfter', + LastEventNetValueBefore = 'lastEvent__netValueBefore', + LastEventOasisFee = 'lastEvent__oasisFee', + LastEventOasisFeeToken = 'lastEvent__oasisFeeToken', + LastEventOasisFeeUsd = 'lastEvent__oasisFeeUSD', + LastEventSummerFee = 'lastEvent__summerFee', + LastEventSummerFeeToken = 'lastEvent__summerFeeToken', + LastEventSummerFeeUsd = 'lastEvent__summerFeeUSD', + LastEventSwapFromAmount = 'lastEvent__swapFromAmount', + LastEventSwapFromToken = 'lastEvent__swapFromToken', + LastEventSwapToAmount = 'lastEvent__swapToAmount', + LastEventSwapToToken = 'lastEvent__swapToToken', + LastEventTimestamp = 'lastEvent__timestamp', + LastEventTotalFee = 'lastEvent__totalFee', + LastEventTxHash = 'lastEvent__txHash', + LastEventWithdrawnUsd = 'lastEvent__withdrawnUSD', + Protocol = 'protocol', + Proxy = 'proxy', + ProxyId = 'proxy__id', + ProxyIsDpm = 'proxy__isDPM', + ProxyOwner = 'proxy__owner', + ProxyVaultId = 'proxy__vaultId', + Type = 'type' +} + +export type Proxy = { + __typename?: 'Proxy'; + /** + * Address of DPM or DS proxy + * + */ + id: Scalars['ID']['output']; + isDPM: Scalars['Boolean']['output']; + owner: Scalars['Bytes']['output']; + position?: Maybe; + positions?: Maybe>; + triggers: Array; + vaultId?: Maybe; +}; + + +export type ProxyPositionsArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + + +export type ProxyTriggersArgs = { + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + where?: InputMaybe; +}; + +export type Proxy_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + isDPM?: InputMaybe; + isDPM_in?: InputMaybe>; + isDPM_not?: InputMaybe; + isDPM_not_in?: InputMaybe>; + or?: InputMaybe>>; + owner?: InputMaybe; + owner_contains?: InputMaybe; + owner_gt?: InputMaybe; + owner_gte?: InputMaybe; + owner_in?: InputMaybe>; + owner_lt?: InputMaybe; + owner_lte?: InputMaybe; + owner_not?: InputMaybe; + owner_not_contains?: InputMaybe; + owner_not_in?: InputMaybe>; + position?: InputMaybe; + position_?: InputMaybe; + position_contains?: InputMaybe; + position_contains_nocase?: InputMaybe; + position_ends_with?: InputMaybe; + position_ends_with_nocase?: InputMaybe; + position_gt?: InputMaybe; + position_gte?: InputMaybe; + position_in?: InputMaybe>; + position_lt?: InputMaybe; + position_lte?: InputMaybe; + position_not?: InputMaybe; + position_not_contains?: InputMaybe; + position_not_contains_nocase?: InputMaybe; + position_not_ends_with?: InputMaybe; + position_not_ends_with_nocase?: InputMaybe; + position_not_in?: InputMaybe>; + position_not_starts_with?: InputMaybe; + position_not_starts_with_nocase?: InputMaybe; + position_starts_with?: InputMaybe; + position_starts_with_nocase?: InputMaybe; + positions?: InputMaybe>; + positions_?: InputMaybe; + positions_contains?: InputMaybe>; + positions_contains_nocase?: InputMaybe>; + positions_not?: InputMaybe>; + positions_not_contains?: InputMaybe>; + positions_not_contains_nocase?: InputMaybe>; + triggers_?: InputMaybe; + vaultId?: InputMaybe; + vaultId_gt?: InputMaybe; + vaultId_gte?: InputMaybe; + vaultId_in?: InputMaybe>; + vaultId_lt?: InputMaybe; + vaultId_lte?: InputMaybe; + vaultId_not?: InputMaybe; + vaultId_not_in?: InputMaybe>; +}; + +export enum Proxy_OrderBy { + Id = 'id', + IsDpm = 'isDPM', + Owner = 'owner', + Position = 'position', + PositionAccount = 'position__account', + PositionCollateral = 'position__collateral', + PositionCollateralAddress = 'position__collateralAddress', + PositionCumulativeDeposit = 'position__cumulativeDeposit', + PositionCumulativeDepositInCollateralToken = 'position__cumulativeDepositInCollateralToken', + PositionCumulativeDepositInQuoteToken = 'position__cumulativeDepositInQuoteToken', + PositionCumulativeDepositUsd = 'position__cumulativeDepositUSD', + PositionCumulativeFees = 'position__cumulativeFees', + PositionCumulativeFeesInCollateralToken = 'position__cumulativeFeesInCollateralToken', + PositionCumulativeFeesInQuoteToken = 'position__cumulativeFeesInQuoteToken', + PositionCumulativeFeesUsd = 'position__cumulativeFeesUSD', + PositionCumulativeWithdraw = 'position__cumulativeWithdraw', + PositionCumulativeWithdrawInCollateralToken = 'position__cumulativeWithdrawInCollateralToken', + PositionCumulativeWithdrawInQuoteToken = 'position__cumulativeWithdrawInQuoteToken', + PositionCumulativeWithdrawUsd = 'position__cumulativeWithdrawUSD', + PositionDebt = 'position__debt', + PositionDebtAddress = 'position__debtAddress', + PositionFromEvent = 'position__fromEvent', + PositionId = 'position__id', + PositionProtocol = 'position__protocol', + PositionType = 'position__type', + Positions = 'positions', + Triggers = 'triggers', + VaultId = 'vaultId' +} + +export type Query = { + __typename?: 'Query'; + /** Access to subgraph metadata */ + _meta?: Maybe<_Meta_>; + aaveLikeBorrow?: Maybe; + aaveLikeBorrows: Array; + aaveLikeDeposit?: Maybe; + aaveLikeDeposits: Array; + aaveLikeLiquidation?: Maybe; + aaveLikeLiquidations: Array; + aaveLikeRepay?: Maybe; + aaveLikeRepays: Array; + aaveLikeWithdraw?: Maybe; + aaveLikeWithdraws: Array; + assetSwap?: Maybe; + assetSwaps: Array; + feePaid?: Maybe; + feePaids: Array; + interestRate?: Maybe; + interestRateConfig?: Maybe; + interestRateConfigs: Array; + interestRates: Array; + position?: Maybe; + positionEvent?: Maybe; + positionEvents: Array; + positions: Array; + proxies: Array; + proxy?: Maybe; + registeredOperation?: Maybe; + registeredOperations: Array; + slippageSaved?: Maybe; + slippageSaveds: Array; + token?: Maybe; + tokens: Array; + transfer?: Maybe; + transfers: Array; + trigger?: Maybe; + triggers: Array; +}; + + +export type Query_MetaArgs = { + block?: InputMaybe; +}; + + +export type QueryAaveLikeBorrowArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryAaveLikeBorrowsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryAaveLikeDepositArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryAaveLikeDepositsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryAaveLikeLiquidationArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryAaveLikeLiquidationsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryAaveLikeRepayArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryAaveLikeRepaysArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryAaveLikeWithdrawArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryAaveLikeWithdrawsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryAssetSwapArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryAssetSwapsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryFeePaidArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryFeePaidsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryInterestRateArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryInterestRateConfigArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryInterestRateConfigsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryInterestRatesArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryPositionArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryPositionEventArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryPositionEventsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryPositionsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryProxiesArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryProxyArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryRegisteredOperationArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryRegisteredOperationsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QuerySlippageSavedArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerySlippageSavedsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryTokenArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryTokensArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryTransferArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryTransfersArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type QueryTriggerArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryTriggersArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type RegisteredOperation = { + __typename?: 'RegisteredOperation'; + actions: Array; + id: Scalars['ID']['output']; + name: Scalars['String']['output']; + skipped: Array; +}; + +export type RegisteredOperation_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + actions?: InputMaybe>; + actions_contains?: InputMaybe>; + actions_contains_nocase?: InputMaybe>; + actions_not?: InputMaybe>; + actions_not_contains?: InputMaybe>; + actions_not_contains_nocase?: InputMaybe>; + and?: InputMaybe>>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + name?: InputMaybe; + name_contains?: InputMaybe; + name_contains_nocase?: InputMaybe; + name_ends_with?: InputMaybe; + name_ends_with_nocase?: InputMaybe; + name_gt?: InputMaybe; + name_gte?: InputMaybe; + name_in?: InputMaybe>; + name_lt?: InputMaybe; + name_lte?: InputMaybe; + name_not?: InputMaybe; + name_not_contains?: InputMaybe; + name_not_contains_nocase?: InputMaybe; + name_not_ends_with?: InputMaybe; + name_not_ends_with_nocase?: InputMaybe; + name_not_in?: InputMaybe>; + name_not_starts_with?: InputMaybe; + name_not_starts_with_nocase?: InputMaybe; + name_starts_with?: InputMaybe; + name_starts_with_nocase?: InputMaybe; + or?: InputMaybe>>; + skipped?: InputMaybe>; + skipped_contains?: InputMaybe>; + skipped_contains_nocase?: InputMaybe>; + skipped_not?: InputMaybe>; + skipped_not_contains?: InputMaybe>; + skipped_not_contains_nocase?: InputMaybe>; +}; + +export enum RegisteredOperation_OrderBy { + Actions = 'actions', + Id = 'id', + Name = 'name', + Skipped = 'skipped' +} + +export type SlippageSaved = { + __typename?: 'SlippageSaved'; + actualAmount: Scalars['BigInt']['output']; + /** + * id is a tx_hash-actionLogIndex + * it uses action log index to easily combine all swap events into one + * + */ + id: Scalars['ID']['output']; + minimumPossible: Scalars['BigInt']['output']; +}; + +export type SlippageSaved_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + actualAmount?: InputMaybe; + actualAmount_gt?: InputMaybe; + actualAmount_gte?: InputMaybe; + actualAmount_in?: InputMaybe>; + actualAmount_lt?: InputMaybe; + actualAmount_lte?: InputMaybe; + actualAmount_not?: InputMaybe; + actualAmount_not_in?: InputMaybe>; + and?: InputMaybe>>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + minimumPossible?: InputMaybe; + minimumPossible_gt?: InputMaybe; + minimumPossible_gte?: InputMaybe; + minimumPossible_in?: InputMaybe>; + minimumPossible_lt?: InputMaybe; + minimumPossible_lte?: InputMaybe; + minimumPossible_not?: InputMaybe; + minimumPossible_not_in?: InputMaybe>; + or?: InputMaybe>>; +}; + +export enum SlippageSaved_OrderBy { + ActualAmount = 'actualAmount', + Id = 'id', + MinimumPossible = 'minimumPossible' +} + +export type Subscription = { + __typename?: 'Subscription'; + /** Access to subgraph metadata */ + _meta?: Maybe<_Meta_>; + aaveLikeBorrow?: Maybe; + aaveLikeBorrows: Array; + aaveLikeDeposit?: Maybe; + aaveLikeDeposits: Array; + aaveLikeLiquidation?: Maybe; + aaveLikeLiquidations: Array; + aaveLikeRepay?: Maybe; + aaveLikeRepays: Array; + aaveLikeWithdraw?: Maybe; + aaveLikeWithdraws: Array; + assetSwap?: Maybe; + assetSwaps: Array; + feePaid?: Maybe; + feePaids: Array; + interestRate?: Maybe; + interestRateConfig?: Maybe; + interestRateConfigs: Array; + interestRates: Array; + position?: Maybe; + positionEvent?: Maybe; + positionEvents: Array; + positions: Array; + proxies: Array; + proxy?: Maybe; + registeredOperation?: Maybe; + registeredOperations: Array; + slippageSaved?: Maybe; + slippageSaveds: Array; + token?: Maybe; + tokens: Array; + transfer?: Maybe; + transfers: Array; + trigger?: Maybe; + triggers: Array; +}; + + +export type Subscription_MetaArgs = { + block?: InputMaybe; +}; + + +export type SubscriptionAaveLikeBorrowArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionAaveLikeBorrowsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionAaveLikeDepositArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionAaveLikeDepositsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionAaveLikeLiquidationArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionAaveLikeLiquidationsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionAaveLikeRepayArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionAaveLikeRepaysArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionAaveLikeWithdrawArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionAaveLikeWithdrawsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionAssetSwapArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionAssetSwapsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionFeePaidArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionFeePaidsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionInterestRateArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionInterestRateConfigArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionInterestRateConfigsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionInterestRatesArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionPositionArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionPositionEventArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionPositionEventsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionPositionsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionProxiesArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionProxyArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionRegisteredOperationArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionRegisteredOperationsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionSlippageSavedArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionSlippageSavedsArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionTokenArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionTokensArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionTransferArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionTransfersArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + + +export type SubscriptionTriggerArgs = { + block?: InputMaybe; + id: Scalars['ID']['input']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionTriggersArgs = { + block?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where?: InputMaybe; +}; + +export type Token = { + __typename?: 'Token'; + address: Scalars['Bytes']['output']; + decimals: Scalars['BigInt']['output']; + id: Scalars['ID']['output']; + precision: Scalars['String']['output']; + symbol: Scalars['String']['output']; +}; + +export type Token_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + address?: InputMaybe; + address_contains?: InputMaybe; + address_gt?: InputMaybe; + address_gte?: InputMaybe; + address_in?: InputMaybe>; + address_lt?: InputMaybe; + address_lte?: InputMaybe; + address_not?: InputMaybe; + address_not_contains?: InputMaybe; + address_not_in?: InputMaybe>; + and?: InputMaybe>>; + decimals?: InputMaybe; + decimals_gt?: InputMaybe; + decimals_gte?: InputMaybe; + decimals_in?: InputMaybe>; + decimals_lt?: InputMaybe; + decimals_lte?: InputMaybe; + decimals_not?: InputMaybe; + decimals_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + precision?: InputMaybe; + precision_contains?: InputMaybe; + precision_contains_nocase?: InputMaybe; + precision_ends_with?: InputMaybe; + precision_ends_with_nocase?: InputMaybe; + precision_gt?: InputMaybe; + precision_gte?: InputMaybe; + precision_in?: InputMaybe>; + precision_lt?: InputMaybe; + precision_lte?: InputMaybe; + precision_not?: InputMaybe; + precision_not_contains?: InputMaybe; + precision_not_contains_nocase?: InputMaybe; + precision_not_ends_with?: InputMaybe; + precision_not_ends_with_nocase?: InputMaybe; + precision_not_in?: InputMaybe>; + precision_not_starts_with?: InputMaybe; + precision_not_starts_with_nocase?: InputMaybe; + precision_starts_with?: InputMaybe; + precision_starts_with_nocase?: InputMaybe; + symbol?: InputMaybe; + symbol_contains?: InputMaybe; + symbol_contains_nocase?: InputMaybe; + symbol_ends_with?: InputMaybe; + symbol_ends_with_nocase?: InputMaybe; + symbol_gt?: InputMaybe; + symbol_gte?: InputMaybe; + symbol_in?: InputMaybe>; + symbol_lt?: InputMaybe; + symbol_lte?: InputMaybe; + symbol_not?: InputMaybe; + symbol_not_contains?: InputMaybe; + symbol_not_contains_nocase?: InputMaybe; + symbol_not_ends_with?: InputMaybe; + symbol_not_ends_with_nocase?: InputMaybe; + symbol_not_in?: InputMaybe>; + symbol_not_starts_with?: InputMaybe; + symbol_not_starts_with_nocase?: InputMaybe; + symbol_starts_with?: InputMaybe; + symbol_starts_with_nocase?: InputMaybe; +}; + +export enum Token_OrderBy { + Address = 'address', + Decimals = 'decimals', + Id = 'id', + Precision = 'precision', + Symbol = 'symbol' +} + +export type Transfer = { + __typename?: 'Transfer'; + amount: Scalars['BigDecimal']['output']; + amountUSD: Scalars['BigDecimal']['output']; + event: PositionEvent; + from: Scalars['Bytes']['output']; + id: Scalars['ID']['output']; + priceInUSD: Scalars['BigDecimal']['output']; + to: Scalars['Bytes']['output']; + token: Scalars['Bytes']['output']; + txHash: Scalars['String']['output']; +}; + +export type Transfer_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + amount?: InputMaybe; + amountUSD?: InputMaybe; + amountUSD_gt?: InputMaybe; + amountUSD_gte?: InputMaybe; + amountUSD_in?: InputMaybe>; + amountUSD_lt?: InputMaybe; + amountUSD_lte?: InputMaybe; + amountUSD_not?: InputMaybe; + amountUSD_not_in?: InputMaybe>; + amount_gt?: InputMaybe; + amount_gte?: InputMaybe; + amount_in?: InputMaybe>; + amount_lt?: InputMaybe; + amount_lte?: InputMaybe; + amount_not?: InputMaybe; + amount_not_in?: InputMaybe>; + and?: InputMaybe>>; + event?: InputMaybe; + event_?: InputMaybe; + event_contains?: InputMaybe; + event_contains_nocase?: InputMaybe; + event_ends_with?: InputMaybe; + event_ends_with_nocase?: InputMaybe; + event_gt?: InputMaybe; + event_gte?: InputMaybe; + event_in?: InputMaybe>; + event_lt?: InputMaybe; + event_lte?: InputMaybe; + event_not?: InputMaybe; + event_not_contains?: InputMaybe; + event_not_contains_nocase?: InputMaybe; + event_not_ends_with?: InputMaybe; + event_not_ends_with_nocase?: InputMaybe; + event_not_in?: InputMaybe>; + event_not_starts_with?: InputMaybe; + event_not_starts_with_nocase?: InputMaybe; + event_starts_with?: InputMaybe; + event_starts_with_nocase?: InputMaybe; + from?: InputMaybe; + from_contains?: InputMaybe; + from_gt?: InputMaybe; + from_gte?: InputMaybe; + from_in?: InputMaybe>; + from_lt?: InputMaybe; + from_lte?: InputMaybe; + from_not?: InputMaybe; + from_not_contains?: InputMaybe; + from_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + or?: InputMaybe>>; + priceInUSD?: InputMaybe; + priceInUSD_gt?: InputMaybe; + priceInUSD_gte?: InputMaybe; + priceInUSD_in?: InputMaybe>; + priceInUSD_lt?: InputMaybe; + priceInUSD_lte?: InputMaybe; + priceInUSD_not?: InputMaybe; + priceInUSD_not_in?: InputMaybe>; + to?: InputMaybe; + to_contains?: InputMaybe; + to_gt?: InputMaybe; + to_gte?: InputMaybe; + to_in?: InputMaybe>; + to_lt?: InputMaybe; + to_lte?: InputMaybe; + to_not?: InputMaybe; + to_not_contains?: InputMaybe; + to_not_in?: InputMaybe>; + token?: InputMaybe; + token_contains?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_in?: InputMaybe>; + txHash?: InputMaybe; + txHash_contains?: InputMaybe; + txHash_contains_nocase?: InputMaybe; + txHash_ends_with?: InputMaybe; + txHash_ends_with_nocase?: InputMaybe; + txHash_gt?: InputMaybe; + txHash_gte?: InputMaybe; + txHash_in?: InputMaybe>; + txHash_lt?: InputMaybe; + txHash_lte?: InputMaybe; + txHash_not?: InputMaybe; + txHash_not_contains?: InputMaybe; + txHash_not_contains_nocase?: InputMaybe; + txHash_not_ends_with?: InputMaybe; + txHash_not_ends_with_nocase?: InputMaybe; + txHash_not_in?: InputMaybe>; + txHash_not_starts_with?: InputMaybe; + txHash_not_starts_with_nocase?: InputMaybe; + txHash_starts_with?: InputMaybe; + txHash_starts_with_nocase?: InputMaybe; +}; + +export enum Transfer_OrderBy { + Amount = 'amount', + AmountUsd = 'amountUSD', + Event = 'event', + EventAccount = 'event__account', + EventBlockNumber = 'event__blockNumber', + EventCollateralAddress = 'event__collateralAddress', + EventCollateralAfter = 'event__collateralAfter', + EventCollateralBefore = 'event__collateralBefore', + EventCollateralDelta = 'event__collateralDelta', + EventCollateralOraclePrice = 'event__collateralOraclePrice', + EventCollateralTokenPriceUsd = 'event__collateralTokenPriceUSD', + EventDebtAddress = 'event__debtAddress', + EventDebtAfter = 'event__debtAfter', + EventDebtBefore = 'event__debtBefore', + EventDebtDelta = 'event__debtDelta', + EventDebtOraclePrice = 'event__debtOraclePrice', + EventDebtTokenPriceUsd = 'event__debtTokenPriceUSD', + EventDepositedUsd = 'event__depositedUSD', + EventEthPrice = 'event__ethPrice', + EventGasFeeUsd = 'event__gasFeeUSD', + EventGasPrice = 'event__gasPrice', + EventGasUsed = 'event__gasUsed', + EventHealthFactorAfter = 'event__healthFactorAfter', + EventId = 'event__id', + EventIsAutomation = 'event__isAutomation', + EventKind = 'event__kind', + EventLiquidationPriceAfter = 'event__liquidationPriceAfter', + EventLiquidationPriceBefore = 'event__liquidationPriceBefore', + EventLiquidationThreshold = 'event__liquidationThreshold', + EventLtvAfter = 'event__ltvAfter', + EventLtvBefore = 'event__ltvBefore', + EventMarketPrice = 'event__marketPrice', + EventMultipleAfter = 'event__multipleAfter', + EventMultipleBefore = 'event__multipleBefore', + EventNetValueAfter = 'event__netValueAfter', + EventNetValueBefore = 'event__netValueBefore', + EventOasisFee = 'event__oasisFee', + EventOasisFeeToken = 'event__oasisFeeToken', + EventOasisFeeUsd = 'event__oasisFeeUSD', + EventSummerFee = 'event__summerFee', + EventSummerFeeToken = 'event__summerFeeToken', + EventSummerFeeUsd = 'event__summerFeeUSD', + EventSwapFromAmount = 'event__swapFromAmount', + EventSwapFromToken = 'event__swapFromToken', + EventSwapToAmount = 'event__swapToAmount', + EventSwapToToken = 'event__swapToToken', + EventTimestamp = 'event__timestamp', + EventTotalFee = 'event__totalFee', + EventTxHash = 'event__txHash', + EventWithdrawnUsd = 'event__withdrawnUSD', + From = 'from', + Id = 'id', + PriceInUsd = 'priceInUSD', + To = 'to', + Token = 'token', + TxHash = 'txHash' +} + +export type Trigger = { + __typename?: 'Trigger'; + account: Proxy; + addedBlock: Scalars['BigInt']['output']; + addedLogIndex: Scalars['BigInt']['output']; + addedTimestamp: Scalars['BigInt']['output']; + addedTransaction: Scalars['Bytes']['output']; + commandAddress: Scalars['Bytes']['output']; + decodedData?: Maybe>; + decodedDataNames?: Maybe>; + executedBlock?: Maybe; + executedLogIndex?: Maybe; + executedTimestamp?: Maybe; + executedTransaction?: Maybe; + id: Scalars['ID']['output']; + kind: Scalars['String']['output']; + removedBlock?: Maybe; + removedLogIndex?: Maybe; + removedTimestamp?: Maybe; + removedTransaction?: Maybe; + triggerData: Scalars['Bytes']['output']; + triggerType: Scalars['BigInt']['output']; +}; + +export type Trigger_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + account?: InputMaybe; + account_?: InputMaybe; + account_contains?: InputMaybe; + account_contains_nocase?: InputMaybe; + account_ends_with?: InputMaybe; + account_ends_with_nocase?: InputMaybe; + account_gt?: InputMaybe; + account_gte?: InputMaybe; + account_in?: InputMaybe>; + account_lt?: InputMaybe; + account_lte?: InputMaybe; + account_not?: InputMaybe; + account_not_contains?: InputMaybe; + account_not_contains_nocase?: InputMaybe; + account_not_ends_with?: InputMaybe; + account_not_ends_with_nocase?: InputMaybe; + account_not_in?: InputMaybe>; + account_not_starts_with?: InputMaybe; + account_not_starts_with_nocase?: InputMaybe; + account_starts_with?: InputMaybe; + account_starts_with_nocase?: InputMaybe; + addedBlock?: InputMaybe; + addedBlock_gt?: InputMaybe; + addedBlock_gte?: InputMaybe; + addedBlock_in?: InputMaybe>; + addedBlock_lt?: InputMaybe; + addedBlock_lte?: InputMaybe; + addedBlock_not?: InputMaybe; + addedBlock_not_in?: InputMaybe>; + addedLogIndex?: InputMaybe; + addedLogIndex_gt?: InputMaybe; + addedLogIndex_gte?: InputMaybe; + addedLogIndex_in?: InputMaybe>; + addedLogIndex_lt?: InputMaybe; + addedLogIndex_lte?: InputMaybe; + addedLogIndex_not?: InputMaybe; + addedLogIndex_not_in?: InputMaybe>; + addedTimestamp?: InputMaybe; + addedTimestamp_gt?: InputMaybe; + addedTimestamp_gte?: InputMaybe; + addedTimestamp_in?: InputMaybe>; + addedTimestamp_lt?: InputMaybe; + addedTimestamp_lte?: InputMaybe; + addedTimestamp_not?: InputMaybe; + addedTimestamp_not_in?: InputMaybe>; + addedTransaction?: InputMaybe; + addedTransaction_contains?: InputMaybe; + addedTransaction_gt?: InputMaybe; + addedTransaction_gte?: InputMaybe; + addedTransaction_in?: InputMaybe>; + addedTransaction_lt?: InputMaybe; + addedTransaction_lte?: InputMaybe; + addedTransaction_not?: InputMaybe; + addedTransaction_not_contains?: InputMaybe; + addedTransaction_not_in?: InputMaybe>; + and?: InputMaybe>>; + commandAddress?: InputMaybe; + commandAddress_contains?: InputMaybe; + commandAddress_gt?: InputMaybe; + commandAddress_gte?: InputMaybe; + commandAddress_in?: InputMaybe>; + commandAddress_lt?: InputMaybe; + commandAddress_lte?: InputMaybe; + commandAddress_not?: InputMaybe; + commandAddress_not_contains?: InputMaybe; + commandAddress_not_in?: InputMaybe>; + decodedData?: InputMaybe>; + decodedDataNames?: InputMaybe>; + decodedDataNames_contains?: InputMaybe>; + decodedDataNames_contains_nocase?: InputMaybe>; + decodedDataNames_not?: InputMaybe>; + decodedDataNames_not_contains?: InputMaybe>; + decodedDataNames_not_contains_nocase?: InputMaybe>; + decodedData_contains?: InputMaybe>; + decodedData_contains_nocase?: InputMaybe>; + decodedData_not?: InputMaybe>; + decodedData_not_contains?: InputMaybe>; + decodedData_not_contains_nocase?: InputMaybe>; + executedBlock?: InputMaybe; + executedBlock_gt?: InputMaybe; + executedBlock_gte?: InputMaybe; + executedBlock_in?: InputMaybe>; + executedBlock_lt?: InputMaybe; + executedBlock_lte?: InputMaybe; + executedBlock_not?: InputMaybe; + executedBlock_not_in?: InputMaybe>; + executedLogIndex?: InputMaybe; + executedLogIndex_gt?: InputMaybe; + executedLogIndex_gte?: InputMaybe; + executedLogIndex_in?: InputMaybe>; + executedLogIndex_lt?: InputMaybe; + executedLogIndex_lte?: InputMaybe; + executedLogIndex_not?: InputMaybe; + executedLogIndex_not_in?: InputMaybe>; + executedTimestamp?: InputMaybe; + executedTimestamp_gt?: InputMaybe; + executedTimestamp_gte?: InputMaybe; + executedTimestamp_in?: InputMaybe>; + executedTimestamp_lt?: InputMaybe; + executedTimestamp_lte?: InputMaybe; + executedTimestamp_not?: InputMaybe; + executedTimestamp_not_in?: InputMaybe>; + executedTransaction?: InputMaybe; + executedTransaction_contains?: InputMaybe; + executedTransaction_gt?: InputMaybe; + executedTransaction_gte?: InputMaybe; + executedTransaction_in?: InputMaybe>; + executedTransaction_lt?: InputMaybe; + executedTransaction_lte?: InputMaybe; + executedTransaction_not?: InputMaybe; + executedTransaction_not_contains?: InputMaybe; + executedTransaction_not_in?: InputMaybe>; + id?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_in?: InputMaybe>; + kind?: InputMaybe; + kind_contains?: InputMaybe; + kind_contains_nocase?: InputMaybe; + kind_ends_with?: InputMaybe; + kind_ends_with_nocase?: InputMaybe; + kind_gt?: InputMaybe; + kind_gte?: InputMaybe; + kind_in?: InputMaybe>; + kind_lt?: InputMaybe; + kind_lte?: InputMaybe; + kind_not?: InputMaybe; + kind_not_contains?: InputMaybe; + kind_not_contains_nocase?: InputMaybe; + kind_not_ends_with?: InputMaybe; + kind_not_ends_with_nocase?: InputMaybe; + kind_not_in?: InputMaybe>; + kind_not_starts_with?: InputMaybe; + kind_not_starts_with_nocase?: InputMaybe; + kind_starts_with?: InputMaybe; + kind_starts_with_nocase?: InputMaybe; + or?: InputMaybe>>; + removedBlock?: InputMaybe; + removedBlock_gt?: InputMaybe; + removedBlock_gte?: InputMaybe; + removedBlock_in?: InputMaybe>; + removedBlock_lt?: InputMaybe; + removedBlock_lte?: InputMaybe; + removedBlock_not?: InputMaybe; + removedBlock_not_in?: InputMaybe>; + removedLogIndex?: InputMaybe; + removedLogIndex_gt?: InputMaybe; + removedLogIndex_gte?: InputMaybe; + removedLogIndex_in?: InputMaybe>; + removedLogIndex_lt?: InputMaybe; + removedLogIndex_lte?: InputMaybe; + removedLogIndex_not?: InputMaybe; + removedLogIndex_not_in?: InputMaybe>; + removedTimestamp?: InputMaybe; + removedTimestamp_gt?: InputMaybe; + removedTimestamp_gte?: InputMaybe; + removedTimestamp_in?: InputMaybe>; + removedTimestamp_lt?: InputMaybe; + removedTimestamp_lte?: InputMaybe; + removedTimestamp_not?: InputMaybe; + removedTimestamp_not_in?: InputMaybe>; + removedTransaction?: InputMaybe; + removedTransaction_contains?: InputMaybe; + removedTransaction_gt?: InputMaybe; + removedTransaction_gte?: InputMaybe; + removedTransaction_in?: InputMaybe>; + removedTransaction_lt?: InputMaybe; + removedTransaction_lte?: InputMaybe; + removedTransaction_not?: InputMaybe; + removedTransaction_not_contains?: InputMaybe; + removedTransaction_not_in?: InputMaybe>; + triggerData?: InputMaybe; + triggerData_contains?: InputMaybe; + triggerData_gt?: InputMaybe; + triggerData_gte?: InputMaybe; + triggerData_in?: InputMaybe>; + triggerData_lt?: InputMaybe; + triggerData_lte?: InputMaybe; + triggerData_not?: InputMaybe; + triggerData_not_contains?: InputMaybe; + triggerData_not_in?: InputMaybe>; + triggerType?: InputMaybe; + triggerType_gt?: InputMaybe; + triggerType_gte?: InputMaybe; + triggerType_in?: InputMaybe>; + triggerType_lt?: InputMaybe; + triggerType_lte?: InputMaybe; + triggerType_not?: InputMaybe; + triggerType_not_in?: InputMaybe>; +}; + +export enum Trigger_OrderBy { + Account = 'account', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountOwner = 'account__owner', + AccountVaultId = 'account__vaultId', + AddedBlock = 'addedBlock', + AddedLogIndex = 'addedLogIndex', + AddedTimestamp = 'addedTimestamp', + AddedTransaction = 'addedTransaction', + CommandAddress = 'commandAddress', + DecodedData = 'decodedData', + DecodedDataNames = 'decodedDataNames', + ExecutedBlock = 'executedBlock', + ExecutedLogIndex = 'executedLogIndex', + ExecutedTimestamp = 'executedTimestamp', + ExecutedTransaction = 'executedTransaction', + Id = 'id', + Kind = 'kind', + RemovedBlock = 'removedBlock', + RemovedLogIndex = 'removedLogIndex', + RemovedTimestamp = 'removedTimestamp', + RemovedTransaction = 'removedTransaction', + TriggerData = 'triggerData', + TriggerType = 'triggerType' +} + +export type _Block_ = { + __typename?: '_Block_'; + /** The hash of the block */ + hash?: Maybe; + /** The block number */ + number: Scalars['Int']['output']; + /** The hash of the parent block */ + parentHash?: Maybe; + /** Integer representation of the timestamp stored in blocks for the chain */ + timestamp?: Maybe; +}; + +/** The type for the top-level _meta field */ +export type _Meta_ = { + __typename?: '_Meta_'; + /** + * Information about a specific subgraph block. The hash of the block + * will be null if the _meta field has a block constraint that asks for + * a block number. It will be filled if the _meta field has no block constraint + * and therefore asks for the latest block + * + */ + block: _Block_; + /** The deployment ID */ + deployment: Scalars['String']['output']; + /** If `true`, the subgraph encountered indexing errors at some past block */ + hasIndexingErrors: Scalars['Boolean']['output']; +}; + +export enum _SubgraphErrorPolicy_ { + /** Data will be returned even if the subgraph has indexing errors */ + Allow = 'allow', + /** If the subgraph has indexing errors, data will be omitted. The default. */ + Deny = 'deny' +} + +export type GetPositionQueryVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type GetPositionQuery = { __typename?: 'Query', position?: { __typename?: 'Position', events: Array<{ __typename?: 'PositionEvent', kind: string, blockNumber: bigint, timestamp: bigint, swapToToken?: string | null, swapToAmount?: string | null, swapFromToken?: string | null, swapFromAmount?: string | null, collateralBefore: string, collateralAfter: string, collateralDelta: string, debtBefore: string, debtAfter: string, debtDelta: string, collateralToken?: { __typename?: 'Token', address: string, symbol: string, decimals: bigint } | null, debtToken?: { __typename?: 'Token', address: string, symbol: string, decimals: bigint } | null }> } | null }; + + +export const GetPositionDocument = gql` + query GetPosition($id: ID!) { + position(id: $id) { + events(first: 10000, orderBy: blockNumber, orderDirection: desc) { + kind + blockNumber + timestamp + collateralToken { + address + symbol + decimals + } + debtToken { + address + symbol + decimals + } + swapToToken + swapToAmount + swapFromToken + swapFromAmount + collateralBefore + collateralAfter + collateralDelta + debtBefore + debtAfter + debtDelta + } + } +} + `; + +export type SdkFunctionWrapper = (action: (requestHeaders?:Record) => Promise, operationName: string, operationType?: string, variables?: any) => Promise; + + +const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, _variables) => action(); + +export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { + return { + GetPosition(variables: GetPositionQueryVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise { + return withWrapper((wrappedRequestHeaders) => client.request(GetPositionDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'GetPosition', 'query', variables); + } + }; +} +export type Sdk = ReturnType; \ No newline at end of file diff --git a/packages/dma-library/src/utils/fee-service/generated/client-ajna-v2.ts b/packages/dma-library/src/utils/fee-service/generated/client-ajna-v2.ts new file mode 100644 index 000000000..1c999b44b --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/generated/client-ajna-v2.ts @@ -0,0 +1,7416 @@ +// This file was automatically generated and should not be edited. +// @ts-nocheck +/* eslint-disable */ +import type { DocumentNode } from 'graphql/language/ast' +import { GraphQLClient, RequestOptions } from 'graphql-request' +import gql from 'graphql-tag' +export type Maybe = T | null +export type InputMaybe = Maybe +export type Exact = { [K in keyof T]: T[K] } +export type MakeOptional = Omit & { [SubKey in K]?: Maybe } +export type MakeMaybe = Omit & { [SubKey in K]: Maybe } +export type MakeEmpty = { + [_ in K]?: never +} +export type Incremental = + | T + | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never } +type GraphQLClientRequestHeaders = RequestOptions['requestHeaders'] +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: { input: string; output: string } + String: { input: string; output: string } + Boolean: { input: boolean; output: boolean } + Int: { input: number; output: number } + Float: { input: number; output: number } + BigDecimal: { input: any; output: any } + BigInt: { input: any; output: any } + Bytes: { input: any; output: any } + Int8: { input: any; output: any } + Timestamp: { input: any; output: any } +} + +export type Account = { + __typename?: 'Account' + address: Scalars['Bytes']['output'] + borrowPositions?: Maybe> + collateralToken?: Maybe + createEvents?: Maybe> + debtToken?: Maybe + earnPositions?: Maybe> + id: Scalars['Bytes']['output'] + isDPM: Scalars['Boolean']['output'] + nfts?: Maybe> + positionType?: Maybe + protocol?: Maybe + user: User + vaultId: Scalars['BigInt']['output'] +} + +export type AccountBorrowPositionsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type AccountCreateEventsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type AccountEarnPositionsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type AccountNftsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type Account_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + address?: InputMaybe + address_contains?: InputMaybe + address_gt?: InputMaybe + address_gte?: InputMaybe + address_in?: InputMaybe> + address_lt?: InputMaybe + address_lte?: InputMaybe + address_not?: InputMaybe + address_not_contains?: InputMaybe + address_not_in?: InputMaybe> + and?: InputMaybe>> + borrowPositions_?: InputMaybe + collateralToken?: InputMaybe + collateralToken_contains?: InputMaybe + collateralToken_gt?: InputMaybe + collateralToken_gte?: InputMaybe + collateralToken_in?: InputMaybe> + collateralToken_lt?: InputMaybe + collateralToken_lte?: InputMaybe + collateralToken_not?: InputMaybe + collateralToken_not_contains?: InputMaybe + collateralToken_not_in?: InputMaybe> + createEvents_?: InputMaybe + debtToken?: InputMaybe + debtToken_contains?: InputMaybe + debtToken_gt?: InputMaybe + debtToken_gte?: InputMaybe + debtToken_in?: InputMaybe> + debtToken_lt?: InputMaybe + debtToken_lte?: InputMaybe + debtToken_not?: InputMaybe + debtToken_not_contains?: InputMaybe + debtToken_not_in?: InputMaybe> + earnPositions_?: InputMaybe + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + isDPM?: InputMaybe + isDPM_in?: InputMaybe> + isDPM_not?: InputMaybe + isDPM_not_in?: InputMaybe> + nfts_?: InputMaybe + or?: InputMaybe>> + positionType?: InputMaybe + positionType_contains?: InputMaybe + positionType_contains_nocase?: InputMaybe + positionType_ends_with?: InputMaybe + positionType_ends_with_nocase?: InputMaybe + positionType_gt?: InputMaybe + positionType_gte?: InputMaybe + positionType_in?: InputMaybe> + positionType_lt?: InputMaybe + positionType_lte?: InputMaybe + positionType_not?: InputMaybe + positionType_not_contains?: InputMaybe + positionType_not_contains_nocase?: InputMaybe + positionType_not_ends_with?: InputMaybe + positionType_not_ends_with_nocase?: InputMaybe + positionType_not_in?: InputMaybe> + positionType_not_starts_with?: InputMaybe + positionType_not_starts_with_nocase?: InputMaybe + positionType_starts_with?: InputMaybe + positionType_starts_with_nocase?: InputMaybe + protocol?: InputMaybe + protocol_contains?: InputMaybe + protocol_contains_nocase?: InputMaybe + protocol_ends_with?: InputMaybe + protocol_ends_with_nocase?: InputMaybe + protocol_gt?: InputMaybe + protocol_gte?: InputMaybe + protocol_in?: InputMaybe> + protocol_lt?: InputMaybe + protocol_lte?: InputMaybe + protocol_not?: InputMaybe + protocol_not_contains?: InputMaybe + protocol_not_contains_nocase?: InputMaybe + protocol_not_ends_with?: InputMaybe + protocol_not_ends_with_nocase?: InputMaybe + protocol_not_in?: InputMaybe> + protocol_not_starts_with?: InputMaybe + protocol_not_starts_with_nocase?: InputMaybe + protocol_starts_with?: InputMaybe + protocol_starts_with_nocase?: InputMaybe + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe + vaultId?: InputMaybe + vaultId_gt?: InputMaybe + vaultId_gte?: InputMaybe + vaultId_in?: InputMaybe> + vaultId_lt?: InputMaybe + vaultId_lte?: InputMaybe + vaultId_not?: InputMaybe + vaultId_not_in?: InputMaybe> +} + +export enum Account_OrderBy { + Address = 'address', + BorrowPositions = 'borrowPositions', + CollateralToken = 'collateralToken', + CreateEvents = 'createEvents', + DebtToken = 'debtToken', + EarnPositions = 'earnPositions', + Id = 'id', + IsDpm = 'isDPM', + Nfts = 'nfts', + PositionType = 'positionType', + Protocol = 'protocol', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', + VaultId = 'vaultId', +} + +export enum Aggregation_Interval { + Day = 'day', + Hour = 'hour', +} + +export type AssetSwap = { + __typename?: 'AssetSwap' + amountIn: Scalars['BigInt']['output'] + amountOut: Scalars['BigInt']['output'] + assetIn: Scalars['Bytes']['output'] + assetOut: Scalars['Bytes']['output'] + /** + * id is a tx_hash-actionLogIndex + * it uses action log index to easily combine all swap events into one + * + */ + id: Scalars['Bytes']['output'] + proxy?: Maybe +} + +export type AssetSwap_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + amountIn?: InputMaybe + amountIn_gt?: InputMaybe + amountIn_gte?: InputMaybe + amountIn_in?: InputMaybe> + amountIn_lt?: InputMaybe + amountIn_lte?: InputMaybe + amountIn_not?: InputMaybe + amountIn_not_in?: InputMaybe> + amountOut?: InputMaybe + amountOut_gt?: InputMaybe + amountOut_gte?: InputMaybe + amountOut_in?: InputMaybe> + amountOut_lt?: InputMaybe + amountOut_lte?: InputMaybe + amountOut_not?: InputMaybe + amountOut_not_in?: InputMaybe> + and?: InputMaybe>> + assetIn?: InputMaybe + assetIn_contains?: InputMaybe + assetIn_gt?: InputMaybe + assetIn_gte?: InputMaybe + assetIn_in?: InputMaybe> + assetIn_lt?: InputMaybe + assetIn_lte?: InputMaybe + assetIn_not?: InputMaybe + assetIn_not_contains?: InputMaybe + assetIn_not_in?: InputMaybe> + assetOut?: InputMaybe + assetOut_contains?: InputMaybe + assetOut_gt?: InputMaybe + assetOut_gte?: InputMaybe + assetOut_in?: InputMaybe> + assetOut_lt?: InputMaybe + assetOut_lte?: InputMaybe + assetOut_not?: InputMaybe + assetOut_not_contains?: InputMaybe + assetOut_not_in?: InputMaybe> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + proxy?: InputMaybe + proxy_contains?: InputMaybe + proxy_gt?: InputMaybe + proxy_gte?: InputMaybe + proxy_in?: InputMaybe> + proxy_lt?: InputMaybe + proxy_lte?: InputMaybe + proxy_not?: InputMaybe + proxy_not_contains?: InputMaybe + proxy_not_in?: InputMaybe> +} + +export enum AssetSwap_OrderBy { + AmountIn = 'amountIn', + AmountOut = 'amountOut', + AssetIn = 'assetIn', + AssetOut = 'assetOut', + Id = 'id', + Proxy = 'proxy', +} + +export type Auction = { + __typename?: 'Auction' + account?: Maybe + bondSize: Scalars['BigInt']['output'] + collateral: Scalars['BigInt']['output'] + debtToCover: Scalars['BigInt']['output'] + endOfGracePeriod: Scalars['BigInt']['output'] + hpbOnKick?: Maybe + id: Scalars['ID']['output'] + inLiquidation: Scalars['Boolean']['output'] + isCollateralized: Scalars['Boolean']['output'] + kickTime: Scalars['BigInt']['output'] + kicker?: Maybe + neutralPrice: Scalars['BigInt']['output'] + pool: Pool + position: BorrowPosition + price: Scalars['BigInt']['output'] + referencePrice: Scalars['BigInt']['output'] + user?: Maybe +} + +export type Auction_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + bondSize?: InputMaybe + bondSize_gt?: InputMaybe + bondSize_gte?: InputMaybe + bondSize_in?: InputMaybe> + bondSize_lt?: InputMaybe + bondSize_lte?: InputMaybe + bondSize_not?: InputMaybe + bondSize_not_in?: InputMaybe> + collateral?: InputMaybe + collateral_gt?: InputMaybe + collateral_gte?: InputMaybe + collateral_in?: InputMaybe> + collateral_lt?: InputMaybe + collateral_lte?: InputMaybe + collateral_not?: InputMaybe + collateral_not_in?: InputMaybe> + debtToCover?: InputMaybe + debtToCover_gt?: InputMaybe + debtToCover_gte?: InputMaybe + debtToCover_in?: InputMaybe> + debtToCover_lt?: InputMaybe + debtToCover_lte?: InputMaybe + debtToCover_not?: InputMaybe + debtToCover_not_in?: InputMaybe> + endOfGracePeriod?: InputMaybe + endOfGracePeriod_gt?: InputMaybe + endOfGracePeriod_gte?: InputMaybe + endOfGracePeriod_in?: InputMaybe> + endOfGracePeriod_lt?: InputMaybe + endOfGracePeriod_lte?: InputMaybe + endOfGracePeriod_not?: InputMaybe + endOfGracePeriod_not_in?: InputMaybe> + hpbOnKick?: InputMaybe + hpbOnKick_gt?: InputMaybe + hpbOnKick_gte?: InputMaybe + hpbOnKick_in?: InputMaybe> + hpbOnKick_lt?: InputMaybe + hpbOnKick_lte?: InputMaybe + hpbOnKick_not?: InputMaybe + hpbOnKick_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + inLiquidation?: InputMaybe + inLiquidation_in?: InputMaybe> + inLiquidation_not?: InputMaybe + inLiquidation_not_in?: InputMaybe> + isCollateralized?: InputMaybe + isCollateralized_in?: InputMaybe> + isCollateralized_not?: InputMaybe + isCollateralized_not_in?: InputMaybe> + kickTime?: InputMaybe + kickTime_gt?: InputMaybe + kickTime_gte?: InputMaybe + kickTime_in?: InputMaybe> + kickTime_lt?: InputMaybe + kickTime_lte?: InputMaybe + kickTime_not?: InputMaybe + kickTime_not_in?: InputMaybe> + kicker?: InputMaybe + kicker_contains?: InputMaybe + kicker_contains_nocase?: InputMaybe + kicker_ends_with?: InputMaybe + kicker_ends_with_nocase?: InputMaybe + kicker_gt?: InputMaybe + kicker_gte?: InputMaybe + kicker_in?: InputMaybe> + kicker_lt?: InputMaybe + kicker_lte?: InputMaybe + kicker_not?: InputMaybe + kicker_not_contains?: InputMaybe + kicker_not_contains_nocase?: InputMaybe + kicker_not_ends_with?: InputMaybe + kicker_not_ends_with_nocase?: InputMaybe + kicker_not_in?: InputMaybe> + kicker_not_starts_with?: InputMaybe + kicker_not_starts_with_nocase?: InputMaybe + kicker_starts_with?: InputMaybe + kicker_starts_with_nocase?: InputMaybe + neutralPrice?: InputMaybe + neutralPrice_gt?: InputMaybe + neutralPrice_gte?: InputMaybe + neutralPrice_in?: InputMaybe> + neutralPrice_lt?: InputMaybe + neutralPrice_lte?: InputMaybe + neutralPrice_not?: InputMaybe + neutralPrice_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + position?: InputMaybe + position_?: InputMaybe + position_contains?: InputMaybe + position_contains_nocase?: InputMaybe + position_ends_with?: InputMaybe + position_ends_with_nocase?: InputMaybe + position_gt?: InputMaybe + position_gte?: InputMaybe + position_in?: InputMaybe> + position_lt?: InputMaybe + position_lte?: InputMaybe + position_not?: InputMaybe + position_not_contains?: InputMaybe + position_not_contains_nocase?: InputMaybe + position_not_ends_with?: InputMaybe + position_not_ends_with_nocase?: InputMaybe + position_not_in?: InputMaybe> + position_not_starts_with?: InputMaybe + position_not_starts_with_nocase?: InputMaybe + position_starts_with?: InputMaybe + position_starts_with_nocase?: InputMaybe + price?: InputMaybe + price_gt?: InputMaybe + price_gte?: InputMaybe + price_in?: InputMaybe> + price_lt?: InputMaybe + price_lte?: InputMaybe + price_not?: InputMaybe + price_not_in?: InputMaybe> + referencePrice?: InputMaybe + referencePrice_gt?: InputMaybe + referencePrice_gte?: InputMaybe + referencePrice_in?: InputMaybe> + referencePrice_lt?: InputMaybe + referencePrice_lte?: InputMaybe + referencePrice_not?: InputMaybe + referencePrice_not_in?: InputMaybe> + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe +} + +export enum Auction_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + BondSize = 'bondSize', + Collateral = 'collateral', + DebtToCover = 'debtToCover', + EndOfGracePeriod = 'endOfGracePeriod', + HpbOnKick = 'hpbOnKick', + Id = 'id', + InLiquidation = 'inLiquidation', + IsCollateralized = 'isCollateralized', + KickTime = 'kickTime', + Kicker = 'kicker', + NeutralPrice = 'neutralPrice', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Position = 'position', + PositionBorrowCumulativeCollateralDeposit = 'position__borrowCumulativeCollateralDeposit', + PositionBorrowCumulativeCollateralWithdraw = 'position__borrowCumulativeCollateralWithdraw', + PositionBorrowCumulativeDebtDeposit = 'position__borrowCumulativeDebtDeposit', + PositionBorrowCumulativeDebtWithdraw = 'position__borrowCumulativeDebtWithdraw', + PositionBorrowCumulativeDepositInCollateralToken = 'position__borrowCumulativeDepositInCollateralToken', + PositionBorrowCumulativeDepositInQuoteToken = 'position__borrowCumulativeDepositInQuoteToken', + PositionBorrowCumulativeDepositUsd = 'position__borrowCumulativeDepositUSD', + PositionBorrowCumulativeFeesInCollateralToken = 'position__borrowCumulativeFeesInCollateralToken', + PositionBorrowCumulativeFeesInQuoteToken = 'position__borrowCumulativeFeesInQuoteToken', + PositionBorrowCumulativeFeesUsd = 'position__borrowCumulativeFeesUSD', + PositionBorrowCumulativeWithdrawInCollateralToken = 'position__borrowCumulativeWithdrawInCollateralToken', + PositionBorrowCumulativeWithdrawInQuoteToken = 'position__borrowCumulativeWithdrawInQuoteToken', + PositionBorrowCumulativeWithdrawUsd = 'position__borrowCumulativeWithdrawUSD', + PositionBorrowDailyTokenBlocks = 'position__borrowDailyTokenBlocks', + PositionBorrowLastUpdateBlock = 'position__borrowLastUpdateBlock', + PositionCollateral = 'position__collateral', + PositionDebt = 'position__debt', + PositionId = 'position__id', + PositionLiquidationPrice = 'position__liquidationPrice', + PositionT0Debt = 'position__t0Debt', + PositionT0Np = 'position__t0Np_', + Price = 'price', + ReferencePrice = 'referencePrice', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', +} + +export type BlockChangedFilter = { + number_gte: Scalars['Int']['input'] +} + +export type Block_Height = { + hash?: InputMaybe + number?: InputMaybe + number_gte?: InputMaybe +} + +export type BorrowDailyReward = { + __typename?: 'BorrowDailyReward' + account?: Maybe + day: Day + id: Scalars['ID']['output'] + pool: Pool + reward: Scalars['BigDecimal']['output'] + user?: Maybe + week: Week +} + +export type BorrowDailyReward_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + day?: InputMaybe + day_?: InputMaybe + day_contains?: InputMaybe + day_contains_nocase?: InputMaybe + day_ends_with?: InputMaybe + day_ends_with_nocase?: InputMaybe + day_gt?: InputMaybe + day_gte?: InputMaybe + day_in?: InputMaybe> + day_lt?: InputMaybe + day_lte?: InputMaybe + day_not?: InputMaybe + day_not_contains?: InputMaybe + day_not_contains_nocase?: InputMaybe + day_not_ends_with?: InputMaybe + day_not_ends_with_nocase?: InputMaybe + day_not_in?: InputMaybe> + day_not_starts_with?: InputMaybe + day_not_starts_with_nocase?: InputMaybe + day_starts_with?: InputMaybe + day_starts_with_nocase?: InputMaybe + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + reward?: InputMaybe + reward_gt?: InputMaybe + reward_gte?: InputMaybe + reward_in?: InputMaybe> + reward_lt?: InputMaybe + reward_lte?: InputMaybe + reward_not?: InputMaybe + reward_not_in?: InputMaybe> + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe + week?: InputMaybe + week_?: InputMaybe + week_contains?: InputMaybe + week_contains_nocase?: InputMaybe + week_ends_with?: InputMaybe + week_ends_with_nocase?: InputMaybe + week_gt?: InputMaybe + week_gte?: InputMaybe + week_in?: InputMaybe> + week_lt?: InputMaybe + week_lte?: InputMaybe + week_not?: InputMaybe + week_not_contains?: InputMaybe + week_not_contains_nocase?: InputMaybe + week_not_ends_with?: InputMaybe + week_not_ends_with_nocase?: InputMaybe + week_not_in?: InputMaybe> + week_not_starts_with?: InputMaybe + week_not_starts_with_nocase?: InputMaybe + week_starts_with?: InputMaybe + week_starts_with_nocase?: InputMaybe +} + +export enum BorrowDailyReward_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + Day = 'day', + DayDay = 'day__day', + DayDayDate = 'day__dayDate', + DayDayStartTimestamp = 'day__dayStartTimestamp', + DayId = 'day__id', + Id = 'id', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Reward = 'reward', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', + Week = 'week', + WeekId = 'week__id', + WeekWeek = 'week__week', + WeekWeekEndTimestamp = 'week__weekEndTimestamp', + WeekWeekStartTimestamp = 'week__weekStartTimestamp', +} + +export type BorrowPosition = { + __typename?: 'BorrowPosition' + account?: Maybe + borrowCumulativeCollateralDeposit: Scalars['BigDecimal']['output'] + borrowCumulativeCollateralWithdraw: Scalars['BigDecimal']['output'] + borrowCumulativeDebtDeposit: Scalars['BigDecimal']['output'] + borrowCumulativeDebtWithdraw: Scalars['BigDecimal']['output'] + borrowCumulativeDepositInCollateralToken: Scalars['BigDecimal']['output'] + borrowCumulativeDepositInQuoteToken: Scalars['BigDecimal']['output'] + borrowCumulativeDepositUSD: Scalars['BigDecimal']['output'] + borrowCumulativeFeesInCollateralToken: Scalars['BigDecimal']['output'] + borrowCumulativeFeesInQuoteToken: Scalars['BigDecimal']['output'] + borrowCumulativeFeesUSD: Scalars['BigDecimal']['output'] + borrowCumulativeWithdrawInCollateralToken: Scalars['BigDecimal']['output'] + borrowCumulativeWithdrawInQuoteToken: Scalars['BigDecimal']['output'] + borrowCumulativeWithdrawUSD: Scalars['BigDecimal']['output'] + borrowDailyTokenBlocks: Scalars['BigInt']['output'] + borrowLastUpdateBlock: Scalars['BigInt']['output'] + collateral: Scalars['BigInt']['output'] + debt: Scalars['BigInt']['output'] + id: Scalars['ID']['output'] + liquidationPrice: Scalars['BigDecimal']['output'] + liquidations: Array + oasisEvents?: Maybe> + pool: Pool + protocolEvents?: Maybe> + t0Debt: Scalars['BigInt']['output'] + t0Np_: Scalars['BigInt']['output'] + user?: Maybe +} + +export type BorrowPositionLiquidationsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type BorrowPositionOasisEventsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type BorrowPositionProtocolEventsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type BorrowPosition_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + borrowCumulativeCollateralDeposit?: InputMaybe + borrowCumulativeCollateralDeposit_gt?: InputMaybe + borrowCumulativeCollateralDeposit_gte?: InputMaybe + borrowCumulativeCollateralDeposit_in?: InputMaybe> + borrowCumulativeCollateralDeposit_lt?: InputMaybe + borrowCumulativeCollateralDeposit_lte?: InputMaybe + borrowCumulativeCollateralDeposit_not?: InputMaybe + borrowCumulativeCollateralDeposit_not_in?: InputMaybe> + borrowCumulativeCollateralWithdraw?: InputMaybe + borrowCumulativeCollateralWithdraw_gt?: InputMaybe + borrowCumulativeCollateralWithdraw_gte?: InputMaybe + borrowCumulativeCollateralWithdraw_in?: InputMaybe> + borrowCumulativeCollateralWithdraw_lt?: InputMaybe + borrowCumulativeCollateralWithdraw_lte?: InputMaybe + borrowCumulativeCollateralWithdraw_not?: InputMaybe + borrowCumulativeCollateralWithdraw_not_in?: InputMaybe> + borrowCumulativeDebtDeposit?: InputMaybe + borrowCumulativeDebtDeposit_gt?: InputMaybe + borrowCumulativeDebtDeposit_gte?: InputMaybe + borrowCumulativeDebtDeposit_in?: InputMaybe> + borrowCumulativeDebtDeposit_lt?: InputMaybe + borrowCumulativeDebtDeposit_lte?: InputMaybe + borrowCumulativeDebtDeposit_not?: InputMaybe + borrowCumulativeDebtDeposit_not_in?: InputMaybe> + borrowCumulativeDebtWithdraw?: InputMaybe + borrowCumulativeDebtWithdraw_gt?: InputMaybe + borrowCumulativeDebtWithdraw_gte?: InputMaybe + borrowCumulativeDebtWithdraw_in?: InputMaybe> + borrowCumulativeDebtWithdraw_lt?: InputMaybe + borrowCumulativeDebtWithdraw_lte?: InputMaybe + borrowCumulativeDebtWithdraw_not?: InputMaybe + borrowCumulativeDebtWithdraw_not_in?: InputMaybe> + borrowCumulativeDepositInCollateralToken?: InputMaybe + borrowCumulativeDepositInCollateralToken_gt?: InputMaybe + borrowCumulativeDepositInCollateralToken_gte?: InputMaybe + borrowCumulativeDepositInCollateralToken_in?: InputMaybe> + borrowCumulativeDepositInCollateralToken_lt?: InputMaybe + borrowCumulativeDepositInCollateralToken_lte?: InputMaybe + borrowCumulativeDepositInCollateralToken_not?: InputMaybe + borrowCumulativeDepositInCollateralToken_not_in?: InputMaybe< + Array + > + borrowCumulativeDepositInQuoteToken?: InputMaybe + borrowCumulativeDepositInQuoteToken_gt?: InputMaybe + borrowCumulativeDepositInQuoteToken_gte?: InputMaybe + borrowCumulativeDepositInQuoteToken_in?: InputMaybe> + borrowCumulativeDepositInQuoteToken_lt?: InputMaybe + borrowCumulativeDepositInQuoteToken_lte?: InputMaybe + borrowCumulativeDepositInQuoteToken_not?: InputMaybe + borrowCumulativeDepositInQuoteToken_not_in?: InputMaybe> + borrowCumulativeDepositUSD?: InputMaybe + borrowCumulativeDepositUSD_gt?: InputMaybe + borrowCumulativeDepositUSD_gte?: InputMaybe + borrowCumulativeDepositUSD_in?: InputMaybe> + borrowCumulativeDepositUSD_lt?: InputMaybe + borrowCumulativeDepositUSD_lte?: InputMaybe + borrowCumulativeDepositUSD_not?: InputMaybe + borrowCumulativeDepositUSD_not_in?: InputMaybe> + borrowCumulativeFeesInCollateralToken?: InputMaybe + borrowCumulativeFeesInCollateralToken_gt?: InputMaybe + borrowCumulativeFeesInCollateralToken_gte?: InputMaybe + borrowCumulativeFeesInCollateralToken_in?: InputMaybe> + borrowCumulativeFeesInCollateralToken_lt?: InputMaybe + borrowCumulativeFeesInCollateralToken_lte?: InputMaybe + borrowCumulativeFeesInCollateralToken_not?: InputMaybe + borrowCumulativeFeesInCollateralToken_not_in?: InputMaybe> + borrowCumulativeFeesInQuoteToken?: InputMaybe + borrowCumulativeFeesInQuoteToken_gt?: InputMaybe + borrowCumulativeFeesInQuoteToken_gte?: InputMaybe + borrowCumulativeFeesInQuoteToken_in?: InputMaybe> + borrowCumulativeFeesInQuoteToken_lt?: InputMaybe + borrowCumulativeFeesInQuoteToken_lte?: InputMaybe + borrowCumulativeFeesInQuoteToken_not?: InputMaybe + borrowCumulativeFeesInQuoteToken_not_in?: InputMaybe> + borrowCumulativeFeesUSD?: InputMaybe + borrowCumulativeFeesUSD_gt?: InputMaybe + borrowCumulativeFeesUSD_gte?: InputMaybe + borrowCumulativeFeesUSD_in?: InputMaybe> + borrowCumulativeFeesUSD_lt?: InputMaybe + borrowCumulativeFeesUSD_lte?: InputMaybe + borrowCumulativeFeesUSD_not?: InputMaybe + borrowCumulativeFeesUSD_not_in?: InputMaybe> + borrowCumulativeWithdrawInCollateralToken?: InputMaybe + borrowCumulativeWithdrawInCollateralToken_gt?: InputMaybe + borrowCumulativeWithdrawInCollateralToken_gte?: InputMaybe + borrowCumulativeWithdrawInCollateralToken_in?: InputMaybe> + borrowCumulativeWithdrawInCollateralToken_lt?: InputMaybe + borrowCumulativeWithdrawInCollateralToken_lte?: InputMaybe + borrowCumulativeWithdrawInCollateralToken_not?: InputMaybe + borrowCumulativeWithdrawInCollateralToken_not_in?: InputMaybe< + Array + > + borrowCumulativeWithdrawInQuoteToken?: InputMaybe + borrowCumulativeWithdrawInQuoteToken_gt?: InputMaybe + borrowCumulativeWithdrawInQuoteToken_gte?: InputMaybe + borrowCumulativeWithdrawInQuoteToken_in?: InputMaybe> + borrowCumulativeWithdrawInQuoteToken_lt?: InputMaybe + borrowCumulativeWithdrawInQuoteToken_lte?: InputMaybe + borrowCumulativeWithdrawInQuoteToken_not?: InputMaybe + borrowCumulativeWithdrawInQuoteToken_not_in?: InputMaybe> + borrowCumulativeWithdrawUSD?: InputMaybe + borrowCumulativeWithdrawUSD_gt?: InputMaybe + borrowCumulativeWithdrawUSD_gte?: InputMaybe + borrowCumulativeWithdrawUSD_in?: InputMaybe> + borrowCumulativeWithdrawUSD_lt?: InputMaybe + borrowCumulativeWithdrawUSD_lte?: InputMaybe + borrowCumulativeWithdrawUSD_not?: InputMaybe + borrowCumulativeWithdrawUSD_not_in?: InputMaybe> + borrowDailyTokenBlocks?: InputMaybe + borrowDailyTokenBlocks_gt?: InputMaybe + borrowDailyTokenBlocks_gte?: InputMaybe + borrowDailyTokenBlocks_in?: InputMaybe> + borrowDailyTokenBlocks_lt?: InputMaybe + borrowDailyTokenBlocks_lte?: InputMaybe + borrowDailyTokenBlocks_not?: InputMaybe + borrowDailyTokenBlocks_not_in?: InputMaybe> + borrowLastUpdateBlock?: InputMaybe + borrowLastUpdateBlock_gt?: InputMaybe + borrowLastUpdateBlock_gte?: InputMaybe + borrowLastUpdateBlock_in?: InputMaybe> + borrowLastUpdateBlock_lt?: InputMaybe + borrowLastUpdateBlock_lte?: InputMaybe + borrowLastUpdateBlock_not?: InputMaybe + borrowLastUpdateBlock_not_in?: InputMaybe> + collateral?: InputMaybe + collateral_gt?: InputMaybe + collateral_gte?: InputMaybe + collateral_in?: InputMaybe> + collateral_lt?: InputMaybe + collateral_lte?: InputMaybe + collateral_not?: InputMaybe + collateral_not_in?: InputMaybe> + debt?: InputMaybe + debt_gt?: InputMaybe + debt_gte?: InputMaybe + debt_in?: InputMaybe> + debt_lt?: InputMaybe + debt_lte?: InputMaybe + debt_not?: InputMaybe + debt_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + liquidationPrice?: InputMaybe + liquidationPrice_gt?: InputMaybe + liquidationPrice_gte?: InputMaybe + liquidationPrice_in?: InputMaybe> + liquidationPrice_lt?: InputMaybe + liquidationPrice_lte?: InputMaybe + liquidationPrice_not?: InputMaybe + liquidationPrice_not_in?: InputMaybe> + liquidations?: InputMaybe> + liquidations_?: InputMaybe + liquidations_contains?: InputMaybe> + liquidations_contains_nocase?: InputMaybe> + liquidations_not?: InputMaybe> + liquidations_not_contains?: InputMaybe> + liquidations_not_contains_nocase?: InputMaybe> + oasisEvents_?: InputMaybe + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + protocolEvents_?: InputMaybe + t0Debt?: InputMaybe + t0Debt_gt?: InputMaybe + t0Debt_gte?: InputMaybe + t0Debt_in?: InputMaybe> + t0Debt_lt?: InputMaybe + t0Debt_lte?: InputMaybe + t0Debt_not?: InputMaybe + t0Debt_not_in?: InputMaybe> + t0Np_?: InputMaybe + t0Np__gt?: InputMaybe + t0Np__gte?: InputMaybe + t0Np__in?: InputMaybe> + t0Np__lt?: InputMaybe + t0Np__lte?: InputMaybe + t0Np__not?: InputMaybe + t0Np__not_in?: InputMaybe> + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe +} + +export enum BorrowPosition_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + BorrowCumulativeCollateralDeposit = 'borrowCumulativeCollateralDeposit', + BorrowCumulativeCollateralWithdraw = 'borrowCumulativeCollateralWithdraw', + BorrowCumulativeDebtDeposit = 'borrowCumulativeDebtDeposit', + BorrowCumulativeDebtWithdraw = 'borrowCumulativeDebtWithdraw', + BorrowCumulativeDepositInCollateralToken = 'borrowCumulativeDepositInCollateralToken', + BorrowCumulativeDepositInQuoteToken = 'borrowCumulativeDepositInQuoteToken', + BorrowCumulativeDepositUsd = 'borrowCumulativeDepositUSD', + BorrowCumulativeFeesInCollateralToken = 'borrowCumulativeFeesInCollateralToken', + BorrowCumulativeFeesInQuoteToken = 'borrowCumulativeFeesInQuoteToken', + BorrowCumulativeFeesUsd = 'borrowCumulativeFeesUSD', + BorrowCumulativeWithdrawInCollateralToken = 'borrowCumulativeWithdrawInCollateralToken', + BorrowCumulativeWithdrawInQuoteToken = 'borrowCumulativeWithdrawInQuoteToken', + BorrowCumulativeWithdrawUsd = 'borrowCumulativeWithdrawUSD', + BorrowDailyTokenBlocks = 'borrowDailyTokenBlocks', + BorrowLastUpdateBlock = 'borrowLastUpdateBlock', + Collateral = 'collateral', + Debt = 'debt', + Id = 'id', + LiquidationPrice = 'liquidationPrice', + Liquidations = 'liquidations', + OasisEvents = 'oasisEvents', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + ProtocolEvents = 'protocolEvents', + T0Debt = 't0Debt', + T0Np = 't0Np_', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', +} + +export type BorrowerEvent = { + __typename?: 'BorrowerEvent' + account?: Maybe + amountBorrowed?: Maybe + auction?: Maybe + blockNumber: Scalars['BigInt']['output'] + bondChange?: Maybe + collateralAfter: Scalars['BigDecimal']['output'] + collateralBefore: Scalars['BigDecimal']['output'] + collateralDelta: Scalars['BigDecimal']['output'] + collateralForLiquidation?: Maybe + collateralPledged?: Maybe + collateralPulled?: Maybe + collateralPurachased?: Maybe + collateralToken: Token + collateralTokenPriceUSD: Scalars['BigDecimal']['output'] + debtAfter: Scalars['BigDecimal']['output'] + debtBefore: Scalars['BigDecimal']['output'] + debtDelta: Scalars['BigDecimal']['output'] + debtToCover?: Maybe + debtToken: Token + debtTokenPriceUSD: Scalars['BigDecimal']['output'] + id: Scalars['ID']['output'] + isReward?: Maybe + kind: Scalars['String']['output'] + originationFee?: Maybe + pool: Pool + position: BorrowPosition + quoteRepaid?: Maybe + quoteUsedToPurchase?: Maybe + remainingCollateral?: Maybe + settledDebt?: Maybe + takeIndex?: Maybe + timestamp: Scalars['BigInt']['output'] + txHash: Scalars['Bytes']['output'] +} + +export type BorrowerEvent_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + amountBorrowed?: InputMaybe + amountBorrowed_gt?: InputMaybe + amountBorrowed_gte?: InputMaybe + amountBorrowed_in?: InputMaybe> + amountBorrowed_lt?: InputMaybe + amountBorrowed_lte?: InputMaybe + amountBorrowed_not?: InputMaybe + amountBorrowed_not_in?: InputMaybe> + and?: InputMaybe>> + auction?: InputMaybe + auction_?: InputMaybe + auction_contains?: InputMaybe + auction_contains_nocase?: InputMaybe + auction_ends_with?: InputMaybe + auction_ends_with_nocase?: InputMaybe + auction_gt?: InputMaybe + auction_gte?: InputMaybe + auction_in?: InputMaybe> + auction_lt?: InputMaybe + auction_lte?: InputMaybe + auction_not?: InputMaybe + auction_not_contains?: InputMaybe + auction_not_contains_nocase?: InputMaybe + auction_not_ends_with?: InputMaybe + auction_not_ends_with_nocase?: InputMaybe + auction_not_in?: InputMaybe> + auction_not_starts_with?: InputMaybe + auction_not_starts_with_nocase?: InputMaybe + auction_starts_with?: InputMaybe + auction_starts_with_nocase?: InputMaybe + blockNumber?: InputMaybe + blockNumber_gt?: InputMaybe + blockNumber_gte?: InputMaybe + blockNumber_in?: InputMaybe> + blockNumber_lt?: InputMaybe + blockNumber_lte?: InputMaybe + blockNumber_not?: InputMaybe + blockNumber_not_in?: InputMaybe> + bondChange?: InputMaybe + bondChange_gt?: InputMaybe + bondChange_gte?: InputMaybe + bondChange_in?: InputMaybe> + bondChange_lt?: InputMaybe + bondChange_lte?: InputMaybe + bondChange_not?: InputMaybe + bondChange_not_in?: InputMaybe> + collateralAfter?: InputMaybe + collateralAfter_gt?: InputMaybe + collateralAfter_gte?: InputMaybe + collateralAfter_in?: InputMaybe> + collateralAfter_lt?: InputMaybe + collateralAfter_lte?: InputMaybe + collateralAfter_not?: InputMaybe + collateralAfter_not_in?: InputMaybe> + collateralBefore?: InputMaybe + collateralBefore_gt?: InputMaybe + collateralBefore_gte?: InputMaybe + collateralBefore_in?: InputMaybe> + collateralBefore_lt?: InputMaybe + collateralBefore_lte?: InputMaybe + collateralBefore_not?: InputMaybe + collateralBefore_not_in?: InputMaybe> + collateralDelta?: InputMaybe + collateralDelta_gt?: InputMaybe + collateralDelta_gte?: InputMaybe + collateralDelta_in?: InputMaybe> + collateralDelta_lt?: InputMaybe + collateralDelta_lte?: InputMaybe + collateralDelta_not?: InputMaybe + collateralDelta_not_in?: InputMaybe> + collateralForLiquidation?: InputMaybe + collateralForLiquidation_gt?: InputMaybe + collateralForLiquidation_gte?: InputMaybe + collateralForLiquidation_in?: InputMaybe> + collateralForLiquidation_lt?: InputMaybe + collateralForLiquidation_lte?: InputMaybe + collateralForLiquidation_not?: InputMaybe + collateralForLiquidation_not_in?: InputMaybe> + collateralPledged?: InputMaybe + collateralPledged_gt?: InputMaybe + collateralPledged_gte?: InputMaybe + collateralPledged_in?: InputMaybe> + collateralPledged_lt?: InputMaybe + collateralPledged_lte?: InputMaybe + collateralPledged_not?: InputMaybe + collateralPledged_not_in?: InputMaybe> + collateralPulled?: InputMaybe + collateralPulled_gt?: InputMaybe + collateralPulled_gte?: InputMaybe + collateralPulled_in?: InputMaybe> + collateralPulled_lt?: InputMaybe + collateralPulled_lte?: InputMaybe + collateralPulled_not?: InputMaybe + collateralPulled_not_in?: InputMaybe> + collateralPurachased?: InputMaybe + collateralPurachased_gt?: InputMaybe + collateralPurachased_gte?: InputMaybe + collateralPurachased_in?: InputMaybe> + collateralPurachased_lt?: InputMaybe + collateralPurachased_lte?: InputMaybe + collateralPurachased_not?: InputMaybe + collateralPurachased_not_in?: InputMaybe> + collateralToken?: InputMaybe + collateralTokenPriceUSD?: InputMaybe + collateralTokenPriceUSD_gt?: InputMaybe + collateralTokenPriceUSD_gte?: InputMaybe + collateralTokenPriceUSD_in?: InputMaybe> + collateralTokenPriceUSD_lt?: InputMaybe + collateralTokenPriceUSD_lte?: InputMaybe + collateralTokenPriceUSD_not?: InputMaybe + collateralTokenPriceUSD_not_in?: InputMaybe> + collateralToken_?: InputMaybe + collateralToken_contains?: InputMaybe + collateralToken_contains_nocase?: InputMaybe + collateralToken_ends_with?: InputMaybe + collateralToken_ends_with_nocase?: InputMaybe + collateralToken_gt?: InputMaybe + collateralToken_gte?: InputMaybe + collateralToken_in?: InputMaybe> + collateralToken_lt?: InputMaybe + collateralToken_lte?: InputMaybe + collateralToken_not?: InputMaybe + collateralToken_not_contains?: InputMaybe + collateralToken_not_contains_nocase?: InputMaybe + collateralToken_not_ends_with?: InputMaybe + collateralToken_not_ends_with_nocase?: InputMaybe + collateralToken_not_in?: InputMaybe> + collateralToken_not_starts_with?: InputMaybe + collateralToken_not_starts_with_nocase?: InputMaybe + collateralToken_starts_with?: InputMaybe + collateralToken_starts_with_nocase?: InputMaybe + debtAfter?: InputMaybe + debtAfter_gt?: InputMaybe + debtAfter_gte?: InputMaybe + debtAfter_in?: InputMaybe> + debtAfter_lt?: InputMaybe + debtAfter_lte?: InputMaybe + debtAfter_not?: InputMaybe + debtAfter_not_in?: InputMaybe> + debtBefore?: InputMaybe + debtBefore_gt?: InputMaybe + debtBefore_gte?: InputMaybe + debtBefore_in?: InputMaybe> + debtBefore_lt?: InputMaybe + debtBefore_lte?: InputMaybe + debtBefore_not?: InputMaybe + debtBefore_not_in?: InputMaybe> + debtDelta?: InputMaybe + debtDelta_gt?: InputMaybe + debtDelta_gte?: InputMaybe + debtDelta_in?: InputMaybe> + debtDelta_lt?: InputMaybe + debtDelta_lte?: InputMaybe + debtDelta_not?: InputMaybe + debtDelta_not_in?: InputMaybe> + debtToCover?: InputMaybe + debtToCover_gt?: InputMaybe + debtToCover_gte?: InputMaybe + debtToCover_in?: InputMaybe> + debtToCover_lt?: InputMaybe + debtToCover_lte?: InputMaybe + debtToCover_not?: InputMaybe + debtToCover_not_in?: InputMaybe> + debtToken?: InputMaybe + debtTokenPriceUSD?: InputMaybe + debtTokenPriceUSD_gt?: InputMaybe + debtTokenPriceUSD_gte?: InputMaybe + debtTokenPriceUSD_in?: InputMaybe> + debtTokenPriceUSD_lt?: InputMaybe + debtTokenPriceUSD_lte?: InputMaybe + debtTokenPriceUSD_not?: InputMaybe + debtTokenPriceUSD_not_in?: InputMaybe> + debtToken_?: InputMaybe + debtToken_contains?: InputMaybe + debtToken_contains_nocase?: InputMaybe + debtToken_ends_with?: InputMaybe + debtToken_ends_with_nocase?: InputMaybe + debtToken_gt?: InputMaybe + debtToken_gte?: InputMaybe + debtToken_in?: InputMaybe> + debtToken_lt?: InputMaybe + debtToken_lte?: InputMaybe + debtToken_not?: InputMaybe + debtToken_not_contains?: InputMaybe + debtToken_not_contains_nocase?: InputMaybe + debtToken_not_ends_with?: InputMaybe + debtToken_not_ends_with_nocase?: InputMaybe + debtToken_not_in?: InputMaybe> + debtToken_not_starts_with?: InputMaybe + debtToken_not_starts_with_nocase?: InputMaybe + debtToken_starts_with?: InputMaybe + debtToken_starts_with_nocase?: InputMaybe + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + isReward?: InputMaybe + isReward_in?: InputMaybe> + isReward_not?: InputMaybe + isReward_not_in?: InputMaybe> + kind?: InputMaybe + kind_contains?: InputMaybe + kind_contains_nocase?: InputMaybe + kind_ends_with?: InputMaybe + kind_ends_with_nocase?: InputMaybe + kind_gt?: InputMaybe + kind_gte?: InputMaybe + kind_in?: InputMaybe> + kind_lt?: InputMaybe + kind_lte?: InputMaybe + kind_not?: InputMaybe + kind_not_contains?: InputMaybe + kind_not_contains_nocase?: InputMaybe + kind_not_ends_with?: InputMaybe + kind_not_ends_with_nocase?: InputMaybe + kind_not_in?: InputMaybe> + kind_not_starts_with?: InputMaybe + kind_not_starts_with_nocase?: InputMaybe + kind_starts_with?: InputMaybe + kind_starts_with_nocase?: InputMaybe + or?: InputMaybe>> + originationFee?: InputMaybe + originationFee_gt?: InputMaybe + originationFee_gte?: InputMaybe + originationFee_in?: InputMaybe> + originationFee_lt?: InputMaybe + originationFee_lte?: InputMaybe + originationFee_not?: InputMaybe + originationFee_not_in?: InputMaybe> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + position?: InputMaybe + position_?: InputMaybe + position_contains?: InputMaybe + position_contains_nocase?: InputMaybe + position_ends_with?: InputMaybe + position_ends_with_nocase?: InputMaybe + position_gt?: InputMaybe + position_gte?: InputMaybe + position_in?: InputMaybe> + position_lt?: InputMaybe + position_lte?: InputMaybe + position_not?: InputMaybe + position_not_contains?: InputMaybe + position_not_contains_nocase?: InputMaybe + position_not_ends_with?: InputMaybe + position_not_ends_with_nocase?: InputMaybe + position_not_in?: InputMaybe> + position_not_starts_with?: InputMaybe + position_not_starts_with_nocase?: InputMaybe + position_starts_with?: InputMaybe + position_starts_with_nocase?: InputMaybe + quoteRepaid?: InputMaybe + quoteRepaid_gt?: InputMaybe + quoteRepaid_gte?: InputMaybe + quoteRepaid_in?: InputMaybe> + quoteRepaid_lt?: InputMaybe + quoteRepaid_lte?: InputMaybe + quoteRepaid_not?: InputMaybe + quoteRepaid_not_in?: InputMaybe> + quoteUsedToPurchase?: InputMaybe + quoteUsedToPurchase_gt?: InputMaybe + quoteUsedToPurchase_gte?: InputMaybe + quoteUsedToPurchase_in?: InputMaybe> + quoteUsedToPurchase_lt?: InputMaybe + quoteUsedToPurchase_lte?: InputMaybe + quoteUsedToPurchase_not?: InputMaybe + quoteUsedToPurchase_not_in?: InputMaybe> + remainingCollateral?: InputMaybe + remainingCollateral_gt?: InputMaybe + remainingCollateral_gte?: InputMaybe + remainingCollateral_in?: InputMaybe> + remainingCollateral_lt?: InputMaybe + remainingCollateral_lte?: InputMaybe + remainingCollateral_not?: InputMaybe + remainingCollateral_not_in?: InputMaybe> + settledDebt?: InputMaybe + settledDebt_gt?: InputMaybe + settledDebt_gte?: InputMaybe + settledDebt_in?: InputMaybe> + settledDebt_lt?: InputMaybe + settledDebt_lte?: InputMaybe + settledDebt_not?: InputMaybe + settledDebt_not_in?: InputMaybe> + takeIndex?: InputMaybe + takeIndex_gt?: InputMaybe + takeIndex_gte?: InputMaybe + takeIndex_in?: InputMaybe> + takeIndex_lt?: InputMaybe + takeIndex_lte?: InputMaybe + takeIndex_not?: InputMaybe + takeIndex_not_in?: InputMaybe> + timestamp?: InputMaybe + timestamp_gt?: InputMaybe + timestamp_gte?: InputMaybe + timestamp_in?: InputMaybe> + timestamp_lt?: InputMaybe + timestamp_lte?: InputMaybe + timestamp_not?: InputMaybe + timestamp_not_in?: InputMaybe> + txHash?: InputMaybe + txHash_contains?: InputMaybe + txHash_gt?: InputMaybe + txHash_gte?: InputMaybe + txHash_in?: InputMaybe> + txHash_lt?: InputMaybe + txHash_lte?: InputMaybe + txHash_not?: InputMaybe + txHash_not_contains?: InputMaybe + txHash_not_in?: InputMaybe> +} + +export enum BorrowerEvent_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + AmountBorrowed = 'amountBorrowed', + Auction = 'auction', + AuctionBondSize = 'auction__bondSize', + AuctionCollateral = 'auction__collateral', + AuctionDebtToCover = 'auction__debtToCover', + AuctionEndOfGracePeriod = 'auction__endOfGracePeriod', + AuctionHpbOnKick = 'auction__hpbOnKick', + AuctionId = 'auction__id', + AuctionInLiquidation = 'auction__inLiquidation', + AuctionIsCollateralized = 'auction__isCollateralized', + AuctionKickTime = 'auction__kickTime', + AuctionKicker = 'auction__kicker', + AuctionNeutralPrice = 'auction__neutralPrice', + AuctionPrice = 'auction__price', + AuctionReferencePrice = 'auction__referencePrice', + BlockNumber = 'blockNumber', + BondChange = 'bondChange', + CollateralAfter = 'collateralAfter', + CollateralBefore = 'collateralBefore', + CollateralDelta = 'collateralDelta', + CollateralForLiquidation = 'collateralForLiquidation', + CollateralPledged = 'collateralPledged', + CollateralPulled = 'collateralPulled', + CollateralPurachased = 'collateralPurachased', + CollateralToken = 'collateralToken', + CollateralTokenPriceUsd = 'collateralTokenPriceUSD', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + DebtAfter = 'debtAfter', + DebtBefore = 'debtBefore', + DebtDelta = 'debtDelta', + DebtToCover = 'debtToCover', + DebtToken = 'debtToken', + DebtTokenPriceUsd = 'debtTokenPriceUSD', + DebtTokenAddress = 'debtToken__address', + DebtTokenDecimals = 'debtToken__decimals', + DebtTokenId = 'debtToken__id', + DebtTokenPrecision = 'debtToken__precision', + DebtTokenSymbol = 'debtToken__symbol', + Id = 'id', + IsReward = 'isReward', + Kind = 'kind', + OriginationFee = 'originationFee', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Position = 'position', + PositionBorrowCumulativeCollateralDeposit = 'position__borrowCumulativeCollateralDeposit', + PositionBorrowCumulativeCollateralWithdraw = 'position__borrowCumulativeCollateralWithdraw', + PositionBorrowCumulativeDebtDeposit = 'position__borrowCumulativeDebtDeposit', + PositionBorrowCumulativeDebtWithdraw = 'position__borrowCumulativeDebtWithdraw', + PositionBorrowCumulativeDepositInCollateralToken = 'position__borrowCumulativeDepositInCollateralToken', + PositionBorrowCumulativeDepositInQuoteToken = 'position__borrowCumulativeDepositInQuoteToken', + PositionBorrowCumulativeDepositUsd = 'position__borrowCumulativeDepositUSD', + PositionBorrowCumulativeFeesInCollateralToken = 'position__borrowCumulativeFeesInCollateralToken', + PositionBorrowCumulativeFeesInQuoteToken = 'position__borrowCumulativeFeesInQuoteToken', + PositionBorrowCumulativeFeesUsd = 'position__borrowCumulativeFeesUSD', + PositionBorrowCumulativeWithdrawInCollateralToken = 'position__borrowCumulativeWithdrawInCollateralToken', + PositionBorrowCumulativeWithdrawInQuoteToken = 'position__borrowCumulativeWithdrawInQuoteToken', + PositionBorrowCumulativeWithdrawUsd = 'position__borrowCumulativeWithdrawUSD', + PositionBorrowDailyTokenBlocks = 'position__borrowDailyTokenBlocks', + PositionBorrowLastUpdateBlock = 'position__borrowLastUpdateBlock', + PositionCollateral = 'position__collateral', + PositionDebt = 'position__debt', + PositionId = 'position__id', + PositionLiquidationPrice = 'position__liquidationPrice', + PositionT0Debt = 'position__t0Debt', + PositionT0Np = 'position__t0Np_', + QuoteRepaid = 'quoteRepaid', + QuoteUsedToPurchase = 'quoteUsedToPurchase', + RemainingCollateral = 'remainingCollateral', + SettledDebt = 'settledDebt', + TakeIndex = 'takeIndex', + Timestamp = 'timestamp', + TxHash = 'txHash', +} + +export type Bucket = { + __typename?: 'Bucket' + bucketLPs: Scalars['BigInt']['output'] + collateral: Scalars['BigInt']['output'] + exchangeRate?: Maybe + id: Scalars['ID']['output'] + index?: Maybe + pool: Pool + price?: Maybe + quoteTokens: Scalars['BigInt']['output'] + scale: Scalars['BigInt']['output'] +} + +export type Bucket_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + and?: InputMaybe>> + bucketLPs?: InputMaybe + bucketLPs_gt?: InputMaybe + bucketLPs_gte?: InputMaybe + bucketLPs_in?: InputMaybe> + bucketLPs_lt?: InputMaybe + bucketLPs_lte?: InputMaybe + bucketLPs_not?: InputMaybe + bucketLPs_not_in?: InputMaybe> + collateral?: InputMaybe + collateral_gt?: InputMaybe + collateral_gte?: InputMaybe + collateral_in?: InputMaybe> + collateral_lt?: InputMaybe + collateral_lte?: InputMaybe + collateral_not?: InputMaybe + collateral_not_in?: InputMaybe> + exchangeRate?: InputMaybe + exchangeRate_gt?: InputMaybe + exchangeRate_gte?: InputMaybe + exchangeRate_in?: InputMaybe> + exchangeRate_lt?: InputMaybe + exchangeRate_lte?: InputMaybe + exchangeRate_not?: InputMaybe + exchangeRate_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + index?: InputMaybe + index_gt?: InputMaybe + index_gte?: InputMaybe + index_in?: InputMaybe> + index_lt?: InputMaybe + index_lte?: InputMaybe + index_not?: InputMaybe + index_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + price?: InputMaybe + price_gt?: InputMaybe + price_gte?: InputMaybe + price_in?: InputMaybe> + price_lt?: InputMaybe + price_lte?: InputMaybe + price_not?: InputMaybe + price_not_in?: InputMaybe> + quoteTokens?: InputMaybe + quoteTokens_gt?: InputMaybe + quoteTokens_gte?: InputMaybe + quoteTokens_in?: InputMaybe> + quoteTokens_lt?: InputMaybe + quoteTokens_lte?: InputMaybe + quoteTokens_not?: InputMaybe + quoteTokens_not_in?: InputMaybe> + scale?: InputMaybe + scale_gt?: InputMaybe + scale_gte?: InputMaybe + scale_in?: InputMaybe> + scale_lt?: InputMaybe + scale_lte?: InputMaybe + scale_not?: InputMaybe + scale_not_in?: InputMaybe> +} + +export enum Bucket_OrderBy { + BucketLPs = 'bucketLPs', + Collateral = 'collateral', + ExchangeRate = 'exchangeRate', + Id = 'id', + Index = 'index', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Price = 'price', + QuoteTokens = 'quoteTokens', + Scale = 'scale', +} + +export type Claimed = { + __typename?: 'Claimed' + amount?: Maybe + id: Scalars['Bytes']['output'] + type: Scalars['String']['output'] + user: User + week: Week +} + +export type Claimed_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + amount?: InputMaybe + amount_gt?: InputMaybe + amount_gte?: InputMaybe + amount_in?: InputMaybe> + amount_lt?: InputMaybe + amount_lte?: InputMaybe + amount_not?: InputMaybe + amount_not_in?: InputMaybe> + and?: InputMaybe>> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + type?: InputMaybe + type_contains?: InputMaybe + type_contains_nocase?: InputMaybe + type_ends_with?: InputMaybe + type_ends_with_nocase?: InputMaybe + type_gt?: InputMaybe + type_gte?: InputMaybe + type_in?: InputMaybe> + type_lt?: InputMaybe + type_lte?: InputMaybe + type_not?: InputMaybe + type_not_contains?: InputMaybe + type_not_contains_nocase?: InputMaybe + type_not_ends_with?: InputMaybe + type_not_ends_with_nocase?: InputMaybe + type_not_in?: InputMaybe> + type_not_starts_with?: InputMaybe + type_not_starts_with_nocase?: InputMaybe + type_starts_with?: InputMaybe + type_starts_with_nocase?: InputMaybe + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe + week?: InputMaybe + week_?: InputMaybe + week_contains?: InputMaybe + week_contains_nocase?: InputMaybe + week_ends_with?: InputMaybe + week_ends_with_nocase?: InputMaybe + week_gt?: InputMaybe + week_gte?: InputMaybe + week_in?: InputMaybe> + week_lt?: InputMaybe + week_lte?: InputMaybe + week_not?: InputMaybe + week_not_contains?: InputMaybe + week_not_contains_nocase?: InputMaybe + week_not_ends_with?: InputMaybe + week_not_ends_with_nocase?: InputMaybe + week_not_in?: InputMaybe> + week_not_starts_with?: InputMaybe + week_not_starts_with_nocase?: InputMaybe + week_starts_with?: InputMaybe + week_starts_with_nocase?: InputMaybe +} + +export enum Claimed_OrderBy { + Amount = 'amount', + Id = 'id', + Type = 'type', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', + Week = 'week', + WeekId = 'week__id', + WeekWeek = 'week__week', + WeekWeekEndTimestamp = 'week__weekEndTimestamp', + WeekWeekStartTimestamp = 'week__weekStartTimestamp', +} + +export type CreatePositionEvent = { + __typename?: 'CreatePositionEvent' + account?: Maybe + blockNumber: Scalars['BigInt']['output'] + collateralToken: Token + debtToken: Token + id: Scalars['Bytes']['output'] + positionType: Scalars['String']['output'] + protocol: Scalars['String']['output'] + timestamp: Scalars['BigInt']['output'] + txHash: Scalars['Bytes']['output'] +} + +export type CreatePositionEvent_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + blockNumber?: InputMaybe + blockNumber_gt?: InputMaybe + blockNumber_gte?: InputMaybe + blockNumber_in?: InputMaybe> + blockNumber_lt?: InputMaybe + blockNumber_lte?: InputMaybe + blockNumber_not?: InputMaybe + blockNumber_not_in?: InputMaybe> + collateralToken?: InputMaybe + collateralToken_?: InputMaybe + collateralToken_contains?: InputMaybe + collateralToken_contains_nocase?: InputMaybe + collateralToken_ends_with?: InputMaybe + collateralToken_ends_with_nocase?: InputMaybe + collateralToken_gt?: InputMaybe + collateralToken_gte?: InputMaybe + collateralToken_in?: InputMaybe> + collateralToken_lt?: InputMaybe + collateralToken_lte?: InputMaybe + collateralToken_not?: InputMaybe + collateralToken_not_contains?: InputMaybe + collateralToken_not_contains_nocase?: InputMaybe + collateralToken_not_ends_with?: InputMaybe + collateralToken_not_ends_with_nocase?: InputMaybe + collateralToken_not_in?: InputMaybe> + collateralToken_not_starts_with?: InputMaybe + collateralToken_not_starts_with_nocase?: InputMaybe + collateralToken_starts_with?: InputMaybe + collateralToken_starts_with_nocase?: InputMaybe + debtToken?: InputMaybe + debtToken_?: InputMaybe + debtToken_contains?: InputMaybe + debtToken_contains_nocase?: InputMaybe + debtToken_ends_with?: InputMaybe + debtToken_ends_with_nocase?: InputMaybe + debtToken_gt?: InputMaybe + debtToken_gte?: InputMaybe + debtToken_in?: InputMaybe> + debtToken_lt?: InputMaybe + debtToken_lte?: InputMaybe + debtToken_not?: InputMaybe + debtToken_not_contains?: InputMaybe + debtToken_not_contains_nocase?: InputMaybe + debtToken_not_ends_with?: InputMaybe + debtToken_not_ends_with_nocase?: InputMaybe + debtToken_not_in?: InputMaybe> + debtToken_not_starts_with?: InputMaybe + debtToken_not_starts_with_nocase?: InputMaybe + debtToken_starts_with?: InputMaybe + debtToken_starts_with_nocase?: InputMaybe + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + positionType?: InputMaybe + positionType_contains?: InputMaybe + positionType_contains_nocase?: InputMaybe + positionType_ends_with?: InputMaybe + positionType_ends_with_nocase?: InputMaybe + positionType_gt?: InputMaybe + positionType_gte?: InputMaybe + positionType_in?: InputMaybe> + positionType_lt?: InputMaybe + positionType_lte?: InputMaybe + positionType_not?: InputMaybe + positionType_not_contains?: InputMaybe + positionType_not_contains_nocase?: InputMaybe + positionType_not_ends_with?: InputMaybe + positionType_not_ends_with_nocase?: InputMaybe + positionType_not_in?: InputMaybe> + positionType_not_starts_with?: InputMaybe + positionType_not_starts_with_nocase?: InputMaybe + positionType_starts_with?: InputMaybe + positionType_starts_with_nocase?: InputMaybe + protocol?: InputMaybe + protocol_contains?: InputMaybe + protocol_contains_nocase?: InputMaybe + protocol_ends_with?: InputMaybe + protocol_ends_with_nocase?: InputMaybe + protocol_gt?: InputMaybe + protocol_gte?: InputMaybe + protocol_in?: InputMaybe> + protocol_lt?: InputMaybe + protocol_lte?: InputMaybe + protocol_not?: InputMaybe + protocol_not_contains?: InputMaybe + protocol_not_contains_nocase?: InputMaybe + protocol_not_ends_with?: InputMaybe + protocol_not_ends_with_nocase?: InputMaybe + protocol_not_in?: InputMaybe> + protocol_not_starts_with?: InputMaybe + protocol_not_starts_with_nocase?: InputMaybe + protocol_starts_with?: InputMaybe + protocol_starts_with_nocase?: InputMaybe + timestamp?: InputMaybe + timestamp_gt?: InputMaybe + timestamp_gte?: InputMaybe + timestamp_in?: InputMaybe> + timestamp_lt?: InputMaybe + timestamp_lte?: InputMaybe + timestamp_not?: InputMaybe + timestamp_not_in?: InputMaybe> + txHash?: InputMaybe + txHash_contains?: InputMaybe + txHash_gt?: InputMaybe + txHash_gte?: InputMaybe + txHash_in?: InputMaybe> + txHash_lt?: InputMaybe + txHash_lte?: InputMaybe + txHash_not?: InputMaybe + txHash_not_contains?: InputMaybe + txHash_not_in?: InputMaybe> +} + +export enum CreatePositionEvent_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + BlockNumber = 'blockNumber', + CollateralToken = 'collateralToken', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + DebtToken = 'debtToken', + DebtTokenAddress = 'debtToken__address', + DebtTokenDecimals = 'debtToken__decimals', + DebtTokenId = 'debtToken__id', + DebtTokenPrecision = 'debtToken__precision', + DebtTokenSymbol = 'debtToken__symbol', + Id = 'id', + PositionType = 'positionType', + Protocol = 'protocol', + Timestamp = 'timestamp', + TxHash = 'txHash', +} + +export type Day = { + __typename?: 'Day' + borrowDailyRewards?: Maybe> + day: Scalars['BigInt']['output'] + dayDate?: Maybe + dayStartTimestamp: Scalars['BigInt']['output'] + earnDailyRewards?: Maybe> + id: Scalars['ID']['output'] + week: Week +} + +export type DayBorrowDailyRewardsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type DayEarnDailyRewardsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type Day_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + and?: InputMaybe>> + borrowDailyRewards_?: InputMaybe + day?: InputMaybe + dayDate?: InputMaybe + dayDate_contains?: InputMaybe + dayDate_contains_nocase?: InputMaybe + dayDate_ends_with?: InputMaybe + dayDate_ends_with_nocase?: InputMaybe + dayDate_gt?: InputMaybe + dayDate_gte?: InputMaybe + dayDate_in?: InputMaybe> + dayDate_lt?: InputMaybe + dayDate_lte?: InputMaybe + dayDate_not?: InputMaybe + dayDate_not_contains?: InputMaybe + dayDate_not_contains_nocase?: InputMaybe + dayDate_not_ends_with?: InputMaybe + dayDate_not_ends_with_nocase?: InputMaybe + dayDate_not_in?: InputMaybe> + dayDate_not_starts_with?: InputMaybe + dayDate_not_starts_with_nocase?: InputMaybe + dayDate_starts_with?: InputMaybe + dayDate_starts_with_nocase?: InputMaybe + dayStartTimestamp?: InputMaybe + dayStartTimestamp_gt?: InputMaybe + dayStartTimestamp_gte?: InputMaybe + dayStartTimestamp_in?: InputMaybe> + dayStartTimestamp_lt?: InputMaybe + dayStartTimestamp_lte?: InputMaybe + dayStartTimestamp_not?: InputMaybe + dayStartTimestamp_not_in?: InputMaybe> + day_gt?: InputMaybe + day_gte?: InputMaybe + day_in?: InputMaybe> + day_lt?: InputMaybe + day_lte?: InputMaybe + day_not?: InputMaybe + day_not_in?: InputMaybe> + earnDailyRewards_?: InputMaybe + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + week?: InputMaybe + week_?: InputMaybe + week_contains?: InputMaybe + week_contains_nocase?: InputMaybe + week_ends_with?: InputMaybe + week_ends_with_nocase?: InputMaybe + week_gt?: InputMaybe + week_gte?: InputMaybe + week_in?: InputMaybe> + week_lt?: InputMaybe + week_lte?: InputMaybe + week_not?: InputMaybe + week_not_contains?: InputMaybe + week_not_contains_nocase?: InputMaybe + week_not_ends_with?: InputMaybe + week_not_ends_with_nocase?: InputMaybe + week_not_in?: InputMaybe> + week_not_starts_with?: InputMaybe + week_not_starts_with_nocase?: InputMaybe + week_starts_with?: InputMaybe + week_starts_with_nocase?: InputMaybe +} + +export enum Day_OrderBy { + BorrowDailyRewards = 'borrowDailyRewards', + Day = 'day', + DayDate = 'dayDate', + DayStartTimestamp = 'dayStartTimestamp', + EarnDailyRewards = 'earnDailyRewards', + Id = 'id', + Week = 'week', + WeekId = 'week__id', + WeekWeek = 'week__week', + WeekWeekEndTimestamp = 'week__weekEndTimestamp', + WeekWeekStartTimestamp = 'week__weekStartTimestamp', +} + +export type EarnDailyReward = { + __typename?: 'EarnDailyReward' + account?: Maybe + day: Day + id: Scalars['ID']['output'] + pool: Pool + reward: Scalars['BigDecimal']['output'] + user?: Maybe + week: Week +} + +export type EarnDailyReward_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + day?: InputMaybe + day_?: InputMaybe + day_contains?: InputMaybe + day_contains_nocase?: InputMaybe + day_ends_with?: InputMaybe + day_ends_with_nocase?: InputMaybe + day_gt?: InputMaybe + day_gte?: InputMaybe + day_in?: InputMaybe> + day_lt?: InputMaybe + day_lte?: InputMaybe + day_not?: InputMaybe + day_not_contains?: InputMaybe + day_not_contains_nocase?: InputMaybe + day_not_ends_with?: InputMaybe + day_not_ends_with_nocase?: InputMaybe + day_not_in?: InputMaybe> + day_not_starts_with?: InputMaybe + day_not_starts_with_nocase?: InputMaybe + day_starts_with?: InputMaybe + day_starts_with_nocase?: InputMaybe + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + reward?: InputMaybe + reward_gt?: InputMaybe + reward_gte?: InputMaybe + reward_in?: InputMaybe> + reward_lt?: InputMaybe + reward_lte?: InputMaybe + reward_not?: InputMaybe + reward_not_in?: InputMaybe> + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe + week?: InputMaybe + week_?: InputMaybe + week_contains?: InputMaybe + week_contains_nocase?: InputMaybe + week_ends_with?: InputMaybe + week_ends_with_nocase?: InputMaybe + week_gt?: InputMaybe + week_gte?: InputMaybe + week_in?: InputMaybe> + week_lt?: InputMaybe + week_lte?: InputMaybe + week_not?: InputMaybe + week_not_contains?: InputMaybe + week_not_contains_nocase?: InputMaybe + week_not_ends_with?: InputMaybe + week_not_ends_with_nocase?: InputMaybe + week_not_in?: InputMaybe> + week_not_starts_with?: InputMaybe + week_not_starts_with_nocase?: InputMaybe + week_starts_with?: InputMaybe + week_starts_with_nocase?: InputMaybe +} + +export enum EarnDailyReward_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + Day = 'day', + DayDay = 'day__day', + DayDayDate = 'day__dayDate', + DayDayStartTimestamp = 'day__dayStartTimestamp', + DayId = 'day__id', + Id = 'id', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Reward = 'reward', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', + Week = 'week', + WeekId = 'week__id', + WeekWeek = 'week__week', + WeekWeekEndTimestamp = 'week__weekEndTimestamp', + WeekWeekStartTimestamp = 'week__weekStartTimestamp', +} + +export type EarnPosition = { + __typename?: 'EarnPosition' + account?: Maybe + bucketPositions?: Maybe> + earnCumulativeDepositInCollateralToken: Scalars['BigDecimal']['output'] + earnCumulativeDepositInQuoteToken: Scalars['BigDecimal']['output'] + earnCumulativeDepositUSD: Scalars['BigDecimal']['output'] + earnCumulativeFeesInCollateralToken: Scalars['BigDecimal']['output'] + earnCumulativeFeesInQuoteToken: Scalars['BigDecimal']['output'] + earnCumulativeFeesUSD: Scalars['BigDecimal']['output'] + earnCumulativeQuoteTokenDeposit: Scalars['BigDecimal']['output'] + earnCumulativeQuoteTokenWithdraw: Scalars['BigDecimal']['output'] + earnCumulativeWithdrawInCollateralToken: Scalars['BigDecimal']['output'] + earnCumulativeWithdrawInQuoteToken: Scalars['BigDecimal']['output'] + earnCumulativeWithdrawUSD: Scalars['BigDecimal']['output'] + earnDailyTokenBlocks: Scalars['BigInt']['output'] + earnIsEarning: Scalars['Boolean']['output'] + earnLastUpdateBlock: Scalars['BigInt']['output'] + earnPosition?: Maybe + id: Scalars['ID']['output'] + nft?: Maybe + oasisEvents?: Maybe> + pool: Pool + protocolEvents?: Maybe> + user: User +} + +export type EarnPositionBucketPositionsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type EarnPositionOasisEventsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type EarnPositionProtocolEventsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type EarnPositionBucket = { + __typename?: 'EarnPositionBucket' + account?: Maybe + depositTime: Scalars['BigInt']['output'] + id: Scalars['ID']['output'] + index: Scalars['BigInt']['output'] + lps: Scalars['BigInt']['output'] + nft?: Maybe + pool: Pool + position: EarnPosition + protocolEvents?: Maybe> + user: User +} + +export type EarnPositionBucketProtocolEventsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type EarnPositionBucket_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + depositTime?: InputMaybe + depositTime_gt?: InputMaybe + depositTime_gte?: InputMaybe + depositTime_in?: InputMaybe> + depositTime_lt?: InputMaybe + depositTime_lte?: InputMaybe + depositTime_not?: InputMaybe + depositTime_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + index?: InputMaybe + index_gt?: InputMaybe + index_gte?: InputMaybe + index_in?: InputMaybe> + index_lt?: InputMaybe + index_lte?: InputMaybe + index_not?: InputMaybe + index_not_in?: InputMaybe> + lps?: InputMaybe + lps_gt?: InputMaybe + lps_gte?: InputMaybe + lps_in?: InputMaybe> + lps_lt?: InputMaybe + lps_lte?: InputMaybe + lps_not?: InputMaybe + lps_not_in?: InputMaybe> + nft?: InputMaybe + nft_?: InputMaybe + nft_contains?: InputMaybe + nft_contains_nocase?: InputMaybe + nft_ends_with?: InputMaybe + nft_ends_with_nocase?: InputMaybe + nft_gt?: InputMaybe + nft_gte?: InputMaybe + nft_in?: InputMaybe> + nft_lt?: InputMaybe + nft_lte?: InputMaybe + nft_not?: InputMaybe + nft_not_contains?: InputMaybe + nft_not_contains_nocase?: InputMaybe + nft_not_ends_with?: InputMaybe + nft_not_ends_with_nocase?: InputMaybe + nft_not_in?: InputMaybe> + nft_not_starts_with?: InputMaybe + nft_not_starts_with_nocase?: InputMaybe + nft_starts_with?: InputMaybe + nft_starts_with_nocase?: InputMaybe + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + position?: InputMaybe + position_?: InputMaybe + position_contains?: InputMaybe + position_contains_nocase?: InputMaybe + position_ends_with?: InputMaybe + position_ends_with_nocase?: InputMaybe + position_gt?: InputMaybe + position_gte?: InputMaybe + position_in?: InputMaybe> + position_lt?: InputMaybe + position_lte?: InputMaybe + position_not?: InputMaybe + position_not_contains?: InputMaybe + position_not_contains_nocase?: InputMaybe + position_not_ends_with?: InputMaybe + position_not_ends_with_nocase?: InputMaybe + position_not_in?: InputMaybe> + position_not_starts_with?: InputMaybe + position_not_starts_with_nocase?: InputMaybe + position_starts_with?: InputMaybe + position_starts_with_nocase?: InputMaybe + protocolEvents_?: InputMaybe + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe +} + +export enum EarnPositionBucket_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + DepositTime = 'depositTime', + Id = 'id', + Index = 'index', + Lps = 'lps', + Nft = 'nft', + NftCurrentReward = 'nft__currentReward', + NftId = 'nft__id', + NftStaked = 'nft__staked', + NftTokenId = 'nft__tokenId', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Position = 'position', + PositionEarnCumulativeDepositInCollateralToken = 'position__earnCumulativeDepositInCollateralToken', + PositionEarnCumulativeDepositInQuoteToken = 'position__earnCumulativeDepositInQuoteToken', + PositionEarnCumulativeDepositUsd = 'position__earnCumulativeDepositUSD', + PositionEarnCumulativeFeesInCollateralToken = 'position__earnCumulativeFeesInCollateralToken', + PositionEarnCumulativeFeesInQuoteToken = 'position__earnCumulativeFeesInQuoteToken', + PositionEarnCumulativeFeesUsd = 'position__earnCumulativeFeesUSD', + PositionEarnCumulativeQuoteTokenDeposit = 'position__earnCumulativeQuoteTokenDeposit', + PositionEarnCumulativeQuoteTokenWithdraw = 'position__earnCumulativeQuoteTokenWithdraw', + PositionEarnCumulativeWithdrawInCollateralToken = 'position__earnCumulativeWithdrawInCollateralToken', + PositionEarnCumulativeWithdrawInQuoteToken = 'position__earnCumulativeWithdrawInQuoteToken', + PositionEarnCumulativeWithdrawUsd = 'position__earnCumulativeWithdrawUSD', + PositionEarnDailyTokenBlocks = 'position__earnDailyTokenBlocks', + PositionEarnIsEarning = 'position__earnIsEarning', + PositionEarnLastUpdateBlock = 'position__earnLastUpdateBlock', + PositionId = 'position__id', + ProtocolEvents = 'protocolEvents', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', +} + +export type EarnPosition_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + bucketPositions_?: InputMaybe + earnCumulativeDepositInCollateralToken?: InputMaybe + earnCumulativeDepositInCollateralToken_gt?: InputMaybe + earnCumulativeDepositInCollateralToken_gte?: InputMaybe + earnCumulativeDepositInCollateralToken_in?: InputMaybe> + earnCumulativeDepositInCollateralToken_lt?: InputMaybe + earnCumulativeDepositInCollateralToken_lte?: InputMaybe + earnCumulativeDepositInCollateralToken_not?: InputMaybe + earnCumulativeDepositInCollateralToken_not_in?: InputMaybe> + earnCumulativeDepositInQuoteToken?: InputMaybe + earnCumulativeDepositInQuoteToken_gt?: InputMaybe + earnCumulativeDepositInQuoteToken_gte?: InputMaybe + earnCumulativeDepositInQuoteToken_in?: InputMaybe> + earnCumulativeDepositInQuoteToken_lt?: InputMaybe + earnCumulativeDepositInQuoteToken_lte?: InputMaybe + earnCumulativeDepositInQuoteToken_not?: InputMaybe + earnCumulativeDepositInQuoteToken_not_in?: InputMaybe> + earnCumulativeDepositUSD?: InputMaybe + earnCumulativeDepositUSD_gt?: InputMaybe + earnCumulativeDepositUSD_gte?: InputMaybe + earnCumulativeDepositUSD_in?: InputMaybe> + earnCumulativeDepositUSD_lt?: InputMaybe + earnCumulativeDepositUSD_lte?: InputMaybe + earnCumulativeDepositUSD_not?: InputMaybe + earnCumulativeDepositUSD_not_in?: InputMaybe> + earnCumulativeFeesInCollateralToken?: InputMaybe + earnCumulativeFeesInCollateralToken_gt?: InputMaybe + earnCumulativeFeesInCollateralToken_gte?: InputMaybe + earnCumulativeFeesInCollateralToken_in?: InputMaybe> + earnCumulativeFeesInCollateralToken_lt?: InputMaybe + earnCumulativeFeesInCollateralToken_lte?: InputMaybe + earnCumulativeFeesInCollateralToken_not?: InputMaybe + earnCumulativeFeesInCollateralToken_not_in?: InputMaybe> + earnCumulativeFeesInQuoteToken?: InputMaybe + earnCumulativeFeesInQuoteToken_gt?: InputMaybe + earnCumulativeFeesInQuoteToken_gte?: InputMaybe + earnCumulativeFeesInQuoteToken_in?: InputMaybe> + earnCumulativeFeesInQuoteToken_lt?: InputMaybe + earnCumulativeFeesInQuoteToken_lte?: InputMaybe + earnCumulativeFeesInQuoteToken_not?: InputMaybe + earnCumulativeFeesInQuoteToken_not_in?: InputMaybe> + earnCumulativeFeesUSD?: InputMaybe + earnCumulativeFeesUSD_gt?: InputMaybe + earnCumulativeFeesUSD_gte?: InputMaybe + earnCumulativeFeesUSD_in?: InputMaybe> + earnCumulativeFeesUSD_lt?: InputMaybe + earnCumulativeFeesUSD_lte?: InputMaybe + earnCumulativeFeesUSD_not?: InputMaybe + earnCumulativeFeesUSD_not_in?: InputMaybe> + earnCumulativeQuoteTokenDeposit?: InputMaybe + earnCumulativeQuoteTokenDeposit_gt?: InputMaybe + earnCumulativeQuoteTokenDeposit_gte?: InputMaybe + earnCumulativeQuoteTokenDeposit_in?: InputMaybe> + earnCumulativeQuoteTokenDeposit_lt?: InputMaybe + earnCumulativeQuoteTokenDeposit_lte?: InputMaybe + earnCumulativeQuoteTokenDeposit_not?: InputMaybe + earnCumulativeQuoteTokenDeposit_not_in?: InputMaybe> + earnCumulativeQuoteTokenWithdraw?: InputMaybe + earnCumulativeQuoteTokenWithdraw_gt?: InputMaybe + earnCumulativeQuoteTokenWithdraw_gte?: InputMaybe + earnCumulativeQuoteTokenWithdraw_in?: InputMaybe> + earnCumulativeQuoteTokenWithdraw_lt?: InputMaybe + earnCumulativeQuoteTokenWithdraw_lte?: InputMaybe + earnCumulativeQuoteTokenWithdraw_not?: InputMaybe + earnCumulativeQuoteTokenWithdraw_not_in?: InputMaybe> + earnCumulativeWithdrawInCollateralToken?: InputMaybe + earnCumulativeWithdrawInCollateralToken_gt?: InputMaybe + earnCumulativeWithdrawInCollateralToken_gte?: InputMaybe + earnCumulativeWithdrawInCollateralToken_in?: InputMaybe> + earnCumulativeWithdrawInCollateralToken_lt?: InputMaybe + earnCumulativeWithdrawInCollateralToken_lte?: InputMaybe + earnCumulativeWithdrawInCollateralToken_not?: InputMaybe + earnCumulativeWithdrawInCollateralToken_not_in?: InputMaybe> + earnCumulativeWithdrawInQuoteToken?: InputMaybe + earnCumulativeWithdrawInQuoteToken_gt?: InputMaybe + earnCumulativeWithdrawInQuoteToken_gte?: InputMaybe + earnCumulativeWithdrawInQuoteToken_in?: InputMaybe> + earnCumulativeWithdrawInQuoteToken_lt?: InputMaybe + earnCumulativeWithdrawInQuoteToken_lte?: InputMaybe + earnCumulativeWithdrawInQuoteToken_not?: InputMaybe + earnCumulativeWithdrawInQuoteToken_not_in?: InputMaybe> + earnCumulativeWithdrawUSD?: InputMaybe + earnCumulativeWithdrawUSD_gt?: InputMaybe + earnCumulativeWithdrawUSD_gte?: InputMaybe + earnCumulativeWithdrawUSD_in?: InputMaybe> + earnCumulativeWithdrawUSD_lt?: InputMaybe + earnCumulativeWithdrawUSD_lte?: InputMaybe + earnCumulativeWithdrawUSD_not?: InputMaybe + earnCumulativeWithdrawUSD_not_in?: InputMaybe> + earnDailyTokenBlocks?: InputMaybe + earnDailyTokenBlocks_gt?: InputMaybe + earnDailyTokenBlocks_gte?: InputMaybe + earnDailyTokenBlocks_in?: InputMaybe> + earnDailyTokenBlocks_lt?: InputMaybe + earnDailyTokenBlocks_lte?: InputMaybe + earnDailyTokenBlocks_not?: InputMaybe + earnDailyTokenBlocks_not_in?: InputMaybe> + earnIsEarning?: InputMaybe + earnIsEarning_in?: InputMaybe> + earnIsEarning_not?: InputMaybe + earnIsEarning_not_in?: InputMaybe> + earnLastUpdateBlock?: InputMaybe + earnLastUpdateBlock_gt?: InputMaybe + earnLastUpdateBlock_gte?: InputMaybe + earnLastUpdateBlock_in?: InputMaybe> + earnLastUpdateBlock_lt?: InputMaybe + earnLastUpdateBlock_lte?: InputMaybe + earnLastUpdateBlock_not?: InputMaybe + earnLastUpdateBlock_not_in?: InputMaybe> + earnPosition?: InputMaybe + earnPosition_?: InputMaybe + earnPosition_contains?: InputMaybe + earnPosition_contains_nocase?: InputMaybe + earnPosition_ends_with?: InputMaybe + earnPosition_ends_with_nocase?: InputMaybe + earnPosition_gt?: InputMaybe + earnPosition_gte?: InputMaybe + earnPosition_in?: InputMaybe> + earnPosition_lt?: InputMaybe + earnPosition_lte?: InputMaybe + earnPosition_not?: InputMaybe + earnPosition_not_contains?: InputMaybe + earnPosition_not_contains_nocase?: InputMaybe + earnPosition_not_ends_with?: InputMaybe + earnPosition_not_ends_with_nocase?: InputMaybe + earnPosition_not_in?: InputMaybe> + earnPosition_not_starts_with?: InputMaybe + earnPosition_not_starts_with_nocase?: InputMaybe + earnPosition_starts_with?: InputMaybe + earnPosition_starts_with_nocase?: InputMaybe + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + nft?: InputMaybe + nft_?: InputMaybe + nft_contains?: InputMaybe + nft_contains_nocase?: InputMaybe + nft_ends_with?: InputMaybe + nft_ends_with_nocase?: InputMaybe + nft_gt?: InputMaybe + nft_gte?: InputMaybe + nft_in?: InputMaybe> + nft_lt?: InputMaybe + nft_lte?: InputMaybe + nft_not?: InputMaybe + nft_not_contains?: InputMaybe + nft_not_contains_nocase?: InputMaybe + nft_not_ends_with?: InputMaybe + nft_not_ends_with_nocase?: InputMaybe + nft_not_in?: InputMaybe> + nft_not_starts_with?: InputMaybe + nft_not_starts_with_nocase?: InputMaybe + nft_starts_with?: InputMaybe + nft_starts_with_nocase?: InputMaybe + oasisEvents_?: InputMaybe + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + protocolEvents_?: InputMaybe + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe +} + +export enum EarnPosition_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + BucketPositions = 'bucketPositions', + EarnCumulativeDepositInCollateralToken = 'earnCumulativeDepositInCollateralToken', + EarnCumulativeDepositInQuoteToken = 'earnCumulativeDepositInQuoteToken', + EarnCumulativeDepositUsd = 'earnCumulativeDepositUSD', + EarnCumulativeFeesInCollateralToken = 'earnCumulativeFeesInCollateralToken', + EarnCumulativeFeesInQuoteToken = 'earnCumulativeFeesInQuoteToken', + EarnCumulativeFeesUsd = 'earnCumulativeFeesUSD', + EarnCumulativeQuoteTokenDeposit = 'earnCumulativeQuoteTokenDeposit', + EarnCumulativeQuoteTokenWithdraw = 'earnCumulativeQuoteTokenWithdraw', + EarnCumulativeWithdrawInCollateralToken = 'earnCumulativeWithdrawInCollateralToken', + EarnCumulativeWithdrawInQuoteToken = 'earnCumulativeWithdrawInQuoteToken', + EarnCumulativeWithdrawUsd = 'earnCumulativeWithdrawUSD', + EarnDailyTokenBlocks = 'earnDailyTokenBlocks', + EarnIsEarning = 'earnIsEarning', + EarnLastUpdateBlock = 'earnLastUpdateBlock', + EarnPosition = 'earnPosition', + EarnPositionDepositTime = 'earnPosition__depositTime', + EarnPositionId = 'earnPosition__id', + EarnPositionIndex = 'earnPosition__index', + EarnPositionLps = 'earnPosition__lps', + Id = 'id', + Nft = 'nft', + NftCurrentReward = 'nft__currentReward', + NftId = 'nft__id', + NftStaked = 'nft__staked', + NftTokenId = 'nft__tokenId', + OasisEvents = 'oasisEvents', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + ProtocolEvents = 'protocolEvents', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', +} + +export type FeePaid = { + __typename?: 'FeePaid' + amount: Scalars['BigInt']['output'] + beneficiary: Scalars['Bytes']['output'] + /** + * id is a tx_hash-actionLogIndex + * it uses action log index to easily combine all swap events into one + * + */ + id: Scalars['Bytes']['output'] + token: Scalars['Bytes']['output'] +} + +export type FeePaid_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + amount?: InputMaybe + amount_gt?: InputMaybe + amount_gte?: InputMaybe + amount_in?: InputMaybe> + amount_lt?: InputMaybe + amount_lte?: InputMaybe + amount_not?: InputMaybe + amount_not_in?: InputMaybe> + and?: InputMaybe>> + beneficiary?: InputMaybe + beneficiary_contains?: InputMaybe + beneficiary_gt?: InputMaybe + beneficiary_gte?: InputMaybe + beneficiary_in?: InputMaybe> + beneficiary_lt?: InputMaybe + beneficiary_lte?: InputMaybe + beneficiary_not?: InputMaybe + beneficiary_not_contains?: InputMaybe + beneficiary_not_in?: InputMaybe> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + token?: InputMaybe + token_contains?: InputMaybe + token_gt?: InputMaybe + token_gte?: InputMaybe + token_in?: InputMaybe> + token_lt?: InputMaybe + token_lte?: InputMaybe + token_not?: InputMaybe + token_not_contains?: InputMaybe + token_not_in?: InputMaybe> +} + +export enum FeePaid_OrderBy { + Amount = 'amount', + Beneficiary = 'beneficiary', + Id = 'id', + Token = 'token', +} + +export type InterestRate = { + __typename?: 'InterestRate' + blockNumber: Scalars['BigInt']['output'] + id: Scalars['Bytes']['output'] + pool: Pool + rate: Scalars['BigDecimal']['output'] + timestamp: Scalars['BigInt']['output'] + type: Scalars['String']['output'] +} + +export type InterestRate_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + and?: InputMaybe>> + blockNumber?: InputMaybe + blockNumber_gt?: InputMaybe + blockNumber_gte?: InputMaybe + blockNumber_in?: InputMaybe> + blockNumber_lt?: InputMaybe + blockNumber_lte?: InputMaybe + blockNumber_not?: InputMaybe + blockNumber_not_in?: InputMaybe> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + rate?: InputMaybe + rate_gt?: InputMaybe + rate_gte?: InputMaybe + rate_in?: InputMaybe> + rate_lt?: InputMaybe + rate_lte?: InputMaybe + rate_not?: InputMaybe + rate_not_in?: InputMaybe> + timestamp?: InputMaybe + timestamp_gt?: InputMaybe + timestamp_gte?: InputMaybe + timestamp_in?: InputMaybe> + timestamp_lt?: InputMaybe + timestamp_lte?: InputMaybe + timestamp_not?: InputMaybe + timestamp_not_in?: InputMaybe> + type?: InputMaybe + type_contains?: InputMaybe + type_contains_nocase?: InputMaybe + type_ends_with?: InputMaybe + type_ends_with_nocase?: InputMaybe + type_gt?: InputMaybe + type_gte?: InputMaybe + type_in?: InputMaybe> + type_lt?: InputMaybe + type_lte?: InputMaybe + type_not?: InputMaybe + type_not_contains?: InputMaybe + type_not_contains_nocase?: InputMaybe + type_not_ends_with?: InputMaybe + type_not_ends_with_nocase?: InputMaybe + type_not_in?: InputMaybe> + type_not_starts_with?: InputMaybe + type_not_starts_with_nocase?: InputMaybe + type_starts_with?: InputMaybe + type_starts_with_nocase?: InputMaybe +} + +export enum InterestRate_OrderBy { + BlockNumber = 'blockNumber', + Id = 'id', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Rate = 'rate', + Timestamp = 'timestamp', + Type = 'type', +} + +export type LenderEvent = { + __typename?: 'LenderEvent' + account?: Maybe + amount?: Maybe + blockNumber: Scalars['BigInt']['output'] + collateralToken: Token + collateralTokenPriceUSD: Scalars['BigDecimal']['output'] + earnPosition: EarnPosition + from?: Maybe + id: Scalars['ID']['output'] + index?: Maybe + kind: Scalars['String']['output'] + lender?: Maybe + lpAwarded?: Maybe + lpAwardedTo?: Maybe + lpRedeemed?: Maybe + lpRedeemedFrom?: Maybe + lup?: Maybe + pool: Pool + position: EarnPositionBucket + quoteAfter: Scalars['BigDecimal']['output'] + quoteBefore: Scalars['BigDecimal']['output'] + quoteDelta: Scalars['BigDecimal']['output'] + quoteToken: Token + quoteTokenPriceUSD: Scalars['BigDecimal']['output'] + timestamp: Scalars['BigInt']['output'] + to?: Maybe + txHash: Scalars['Bytes']['output'] +} + +export type LenderEvent_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + amount?: InputMaybe + amount_gt?: InputMaybe + amount_gte?: InputMaybe + amount_in?: InputMaybe> + amount_lt?: InputMaybe + amount_lte?: InputMaybe + amount_not?: InputMaybe + amount_not_in?: InputMaybe> + and?: InputMaybe>> + blockNumber?: InputMaybe + blockNumber_gt?: InputMaybe + blockNumber_gte?: InputMaybe + blockNumber_in?: InputMaybe> + blockNumber_lt?: InputMaybe + blockNumber_lte?: InputMaybe + blockNumber_not?: InputMaybe + blockNumber_not_in?: InputMaybe> + collateralToken?: InputMaybe + collateralTokenPriceUSD?: InputMaybe + collateralTokenPriceUSD_gt?: InputMaybe + collateralTokenPriceUSD_gte?: InputMaybe + collateralTokenPriceUSD_in?: InputMaybe> + collateralTokenPriceUSD_lt?: InputMaybe + collateralTokenPriceUSD_lte?: InputMaybe + collateralTokenPriceUSD_not?: InputMaybe + collateralTokenPriceUSD_not_in?: InputMaybe> + collateralToken_?: InputMaybe + collateralToken_contains?: InputMaybe + collateralToken_contains_nocase?: InputMaybe + collateralToken_ends_with?: InputMaybe + collateralToken_ends_with_nocase?: InputMaybe + collateralToken_gt?: InputMaybe + collateralToken_gte?: InputMaybe + collateralToken_in?: InputMaybe> + collateralToken_lt?: InputMaybe + collateralToken_lte?: InputMaybe + collateralToken_not?: InputMaybe + collateralToken_not_contains?: InputMaybe + collateralToken_not_contains_nocase?: InputMaybe + collateralToken_not_ends_with?: InputMaybe + collateralToken_not_ends_with_nocase?: InputMaybe + collateralToken_not_in?: InputMaybe> + collateralToken_not_starts_with?: InputMaybe + collateralToken_not_starts_with_nocase?: InputMaybe + collateralToken_starts_with?: InputMaybe + collateralToken_starts_with_nocase?: InputMaybe + earnPosition?: InputMaybe + earnPosition_?: InputMaybe + earnPosition_contains?: InputMaybe + earnPosition_contains_nocase?: InputMaybe + earnPosition_ends_with?: InputMaybe + earnPosition_ends_with_nocase?: InputMaybe + earnPosition_gt?: InputMaybe + earnPosition_gte?: InputMaybe + earnPosition_in?: InputMaybe> + earnPosition_lt?: InputMaybe + earnPosition_lte?: InputMaybe + earnPosition_not?: InputMaybe + earnPosition_not_contains?: InputMaybe + earnPosition_not_contains_nocase?: InputMaybe + earnPosition_not_ends_with?: InputMaybe + earnPosition_not_ends_with_nocase?: InputMaybe + earnPosition_not_in?: InputMaybe> + earnPosition_not_starts_with?: InputMaybe + earnPosition_not_starts_with_nocase?: InputMaybe + earnPosition_starts_with?: InputMaybe + earnPosition_starts_with_nocase?: InputMaybe + from?: InputMaybe + from_gt?: InputMaybe + from_gte?: InputMaybe + from_in?: InputMaybe> + from_lt?: InputMaybe + from_lte?: InputMaybe + from_not?: InputMaybe + from_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + index?: InputMaybe + index_gt?: InputMaybe + index_gte?: InputMaybe + index_in?: InputMaybe> + index_lt?: InputMaybe + index_lte?: InputMaybe + index_not?: InputMaybe + index_not_in?: InputMaybe> + kind?: InputMaybe + kind_contains?: InputMaybe + kind_contains_nocase?: InputMaybe + kind_ends_with?: InputMaybe + kind_ends_with_nocase?: InputMaybe + kind_gt?: InputMaybe + kind_gte?: InputMaybe + kind_in?: InputMaybe> + kind_lt?: InputMaybe + kind_lte?: InputMaybe + kind_not?: InputMaybe + kind_not_contains?: InputMaybe + kind_not_contains_nocase?: InputMaybe + kind_not_ends_with?: InputMaybe + kind_not_ends_with_nocase?: InputMaybe + kind_not_in?: InputMaybe> + kind_not_starts_with?: InputMaybe + kind_not_starts_with_nocase?: InputMaybe + kind_starts_with?: InputMaybe + kind_starts_with_nocase?: InputMaybe + lender?: InputMaybe + lender_contains?: InputMaybe + lender_contains_nocase?: InputMaybe + lender_ends_with?: InputMaybe + lender_ends_with_nocase?: InputMaybe + lender_gt?: InputMaybe + lender_gte?: InputMaybe + lender_in?: InputMaybe> + lender_lt?: InputMaybe + lender_lte?: InputMaybe + lender_not?: InputMaybe + lender_not_contains?: InputMaybe + lender_not_contains_nocase?: InputMaybe + lender_not_ends_with?: InputMaybe + lender_not_ends_with_nocase?: InputMaybe + lender_not_in?: InputMaybe> + lender_not_starts_with?: InputMaybe + lender_not_starts_with_nocase?: InputMaybe + lender_starts_with?: InputMaybe + lender_starts_with_nocase?: InputMaybe + lpAwarded?: InputMaybe + lpAwardedTo?: InputMaybe + lpAwardedTo_gt?: InputMaybe + lpAwardedTo_gte?: InputMaybe + lpAwardedTo_in?: InputMaybe> + lpAwardedTo_lt?: InputMaybe + lpAwardedTo_lte?: InputMaybe + lpAwardedTo_not?: InputMaybe + lpAwardedTo_not_in?: InputMaybe> + lpAwarded_gt?: InputMaybe + lpAwarded_gte?: InputMaybe + lpAwarded_in?: InputMaybe> + lpAwarded_lt?: InputMaybe + lpAwarded_lte?: InputMaybe + lpAwarded_not?: InputMaybe + lpAwarded_not_in?: InputMaybe> + lpRedeemed?: InputMaybe + lpRedeemedFrom?: InputMaybe + lpRedeemedFrom_gt?: InputMaybe + lpRedeemedFrom_gte?: InputMaybe + lpRedeemedFrom_in?: InputMaybe> + lpRedeemedFrom_lt?: InputMaybe + lpRedeemedFrom_lte?: InputMaybe + lpRedeemedFrom_not?: InputMaybe + lpRedeemedFrom_not_in?: InputMaybe> + lpRedeemed_gt?: InputMaybe + lpRedeemed_gte?: InputMaybe + lpRedeemed_in?: InputMaybe> + lpRedeemed_lt?: InputMaybe + lpRedeemed_lte?: InputMaybe + lpRedeemed_not?: InputMaybe + lpRedeemed_not_in?: InputMaybe> + lup?: InputMaybe + lup_gt?: InputMaybe + lup_gte?: InputMaybe + lup_in?: InputMaybe> + lup_lt?: InputMaybe + lup_lte?: InputMaybe + lup_not?: InputMaybe + lup_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + position?: InputMaybe + position_?: InputMaybe + position_contains?: InputMaybe + position_contains_nocase?: InputMaybe + position_ends_with?: InputMaybe + position_ends_with_nocase?: InputMaybe + position_gt?: InputMaybe + position_gte?: InputMaybe + position_in?: InputMaybe> + position_lt?: InputMaybe + position_lte?: InputMaybe + position_not?: InputMaybe + position_not_contains?: InputMaybe + position_not_contains_nocase?: InputMaybe + position_not_ends_with?: InputMaybe + position_not_ends_with_nocase?: InputMaybe + position_not_in?: InputMaybe> + position_not_starts_with?: InputMaybe + position_not_starts_with_nocase?: InputMaybe + position_starts_with?: InputMaybe + position_starts_with_nocase?: InputMaybe + quoteAfter?: InputMaybe + quoteAfter_gt?: InputMaybe + quoteAfter_gte?: InputMaybe + quoteAfter_in?: InputMaybe> + quoteAfter_lt?: InputMaybe + quoteAfter_lte?: InputMaybe + quoteAfter_not?: InputMaybe + quoteAfter_not_in?: InputMaybe> + quoteBefore?: InputMaybe + quoteBefore_gt?: InputMaybe + quoteBefore_gte?: InputMaybe + quoteBefore_in?: InputMaybe> + quoteBefore_lt?: InputMaybe + quoteBefore_lte?: InputMaybe + quoteBefore_not?: InputMaybe + quoteBefore_not_in?: InputMaybe> + quoteDelta?: InputMaybe + quoteDelta_gt?: InputMaybe + quoteDelta_gte?: InputMaybe + quoteDelta_in?: InputMaybe> + quoteDelta_lt?: InputMaybe + quoteDelta_lte?: InputMaybe + quoteDelta_not?: InputMaybe + quoteDelta_not_in?: InputMaybe> + quoteToken?: InputMaybe + quoteTokenPriceUSD?: InputMaybe + quoteTokenPriceUSD_gt?: InputMaybe + quoteTokenPriceUSD_gte?: InputMaybe + quoteTokenPriceUSD_in?: InputMaybe> + quoteTokenPriceUSD_lt?: InputMaybe + quoteTokenPriceUSD_lte?: InputMaybe + quoteTokenPriceUSD_not?: InputMaybe + quoteTokenPriceUSD_not_in?: InputMaybe> + quoteToken_?: InputMaybe + quoteToken_contains?: InputMaybe + quoteToken_contains_nocase?: InputMaybe + quoteToken_ends_with?: InputMaybe + quoteToken_ends_with_nocase?: InputMaybe + quoteToken_gt?: InputMaybe + quoteToken_gte?: InputMaybe + quoteToken_in?: InputMaybe> + quoteToken_lt?: InputMaybe + quoteToken_lte?: InputMaybe + quoteToken_not?: InputMaybe + quoteToken_not_contains?: InputMaybe + quoteToken_not_contains_nocase?: InputMaybe + quoteToken_not_ends_with?: InputMaybe + quoteToken_not_ends_with_nocase?: InputMaybe + quoteToken_not_in?: InputMaybe> + quoteToken_not_starts_with?: InputMaybe + quoteToken_not_starts_with_nocase?: InputMaybe + quoteToken_starts_with?: InputMaybe + quoteToken_starts_with_nocase?: InputMaybe + timestamp?: InputMaybe + timestamp_gt?: InputMaybe + timestamp_gte?: InputMaybe + timestamp_in?: InputMaybe> + timestamp_lt?: InputMaybe + timestamp_lte?: InputMaybe + timestamp_not?: InputMaybe + timestamp_not_in?: InputMaybe> + to?: InputMaybe + to_gt?: InputMaybe + to_gte?: InputMaybe + to_in?: InputMaybe> + to_lt?: InputMaybe + to_lte?: InputMaybe + to_not?: InputMaybe + to_not_in?: InputMaybe> + txHash?: InputMaybe + txHash_contains?: InputMaybe + txHash_gt?: InputMaybe + txHash_gte?: InputMaybe + txHash_in?: InputMaybe> + txHash_lt?: InputMaybe + txHash_lte?: InputMaybe + txHash_not?: InputMaybe + txHash_not_contains?: InputMaybe + txHash_not_in?: InputMaybe> +} + +export enum LenderEvent_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + Amount = 'amount', + BlockNumber = 'blockNumber', + CollateralToken = 'collateralToken', + CollateralTokenPriceUsd = 'collateralTokenPriceUSD', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + EarnPosition = 'earnPosition', + EarnPositionEarnCumulativeDepositInCollateralToken = 'earnPosition__earnCumulativeDepositInCollateralToken', + EarnPositionEarnCumulativeDepositInQuoteToken = 'earnPosition__earnCumulativeDepositInQuoteToken', + EarnPositionEarnCumulativeDepositUsd = 'earnPosition__earnCumulativeDepositUSD', + EarnPositionEarnCumulativeFeesInCollateralToken = 'earnPosition__earnCumulativeFeesInCollateralToken', + EarnPositionEarnCumulativeFeesInQuoteToken = 'earnPosition__earnCumulativeFeesInQuoteToken', + EarnPositionEarnCumulativeFeesUsd = 'earnPosition__earnCumulativeFeesUSD', + EarnPositionEarnCumulativeQuoteTokenDeposit = 'earnPosition__earnCumulativeQuoteTokenDeposit', + EarnPositionEarnCumulativeQuoteTokenWithdraw = 'earnPosition__earnCumulativeQuoteTokenWithdraw', + EarnPositionEarnCumulativeWithdrawInCollateralToken = 'earnPosition__earnCumulativeWithdrawInCollateralToken', + EarnPositionEarnCumulativeWithdrawInQuoteToken = 'earnPosition__earnCumulativeWithdrawInQuoteToken', + EarnPositionEarnCumulativeWithdrawUsd = 'earnPosition__earnCumulativeWithdrawUSD', + EarnPositionEarnDailyTokenBlocks = 'earnPosition__earnDailyTokenBlocks', + EarnPositionEarnIsEarning = 'earnPosition__earnIsEarning', + EarnPositionEarnLastUpdateBlock = 'earnPosition__earnLastUpdateBlock', + EarnPositionId = 'earnPosition__id', + From = 'from', + Id = 'id', + Index = 'index', + Kind = 'kind', + Lender = 'lender', + LpAwarded = 'lpAwarded', + LpAwardedTo = 'lpAwardedTo', + LpRedeemed = 'lpRedeemed', + LpRedeemedFrom = 'lpRedeemedFrom', + Lup = 'lup', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Position = 'position', + PositionDepositTime = 'position__depositTime', + PositionId = 'position__id', + PositionIndex = 'position__index', + PositionLps = 'position__lps', + QuoteAfter = 'quoteAfter', + QuoteBefore = 'quoteBefore', + QuoteDelta = 'quoteDelta', + QuoteToken = 'quoteToken', + QuoteTokenPriceUsd = 'quoteTokenPriceUSD', + QuoteTokenAddress = 'quoteToken__address', + QuoteTokenDecimals = 'quoteToken__decimals', + QuoteTokenId = 'quoteToken__id', + QuoteTokenPrecision = 'quoteToken__precision', + QuoteTokenSymbol = 'quoteToken__symbol', + Timestamp = 'timestamp', + To = 'to', + TxHash = 'txHash', +} + +export type ListOfPool = { + __typename?: 'ListOfPool' + id: Scalars['ID']['output'] + pools: Array +} + +export type ListOfPoolPoolsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type ListOfPool_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + and?: InputMaybe>> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + pools?: InputMaybe> + pools_?: InputMaybe + pools_contains?: InputMaybe> + pools_contains_nocase?: InputMaybe> + pools_not?: InputMaybe> + pools_not_contains?: InputMaybe> + pools_not_contains_nocase?: InputMaybe> +} + +export enum ListOfPool_OrderBy { + Id = 'id', + Pools = 'pools', +} + +export type Nft = { + __typename?: 'NFT' + account?: Maybe + buckets?: Maybe> + currentReward: Scalars['BigInt']['output'] + id: Scalars['ID']['output'] + pool: Pool + staked: Scalars['Boolean']['output'] + tokenId: Scalars['BigInt']['output'] + user?: Maybe +} + +export type NftBucketsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type Nft_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + buckets_?: InputMaybe + currentReward?: InputMaybe + currentReward_gt?: InputMaybe + currentReward_gte?: InputMaybe + currentReward_in?: InputMaybe> + currentReward_lt?: InputMaybe + currentReward_lte?: InputMaybe + currentReward_not?: InputMaybe + currentReward_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + staked?: InputMaybe + staked_in?: InputMaybe> + staked_not?: InputMaybe + staked_not_in?: InputMaybe> + tokenId?: InputMaybe + tokenId_gt?: InputMaybe + tokenId_gte?: InputMaybe + tokenId_in?: InputMaybe> + tokenId_lt?: InputMaybe + tokenId_lte?: InputMaybe + tokenId_not?: InputMaybe + tokenId_not_in?: InputMaybe> + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe +} + +export enum Nft_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + Buckets = 'buckets', + CurrentReward = 'currentReward', + Id = 'id', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + Staked = 'staked', + TokenId = 'tokenId', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', +} + +export type OasisEvent = { + __typename?: 'OasisEvent' + account: Account + addOrRemoveIndex?: Maybe + blockNumber: Scalars['BigInt']['output'] + borrowPosition?: Maybe + collateralAddress: Scalars['Bytes']['output'] + collateralAfter: Scalars['BigDecimal']['output'] + collateralBefore: Scalars['BigDecimal']['output'] + collateralDelta: Scalars['BigDecimal']['output'] + collateralLpsRemoved?: Maybe + collateralOraclePrice: Scalars['BigDecimal']['output'] + collateralToken?: Maybe + collateralTokenPriceUSD: Scalars['BigDecimal']['output'] + debtAddress: Scalars['Bytes']['output'] + debtAfter: Scalars['BigDecimal']['output'] + debtBefore: Scalars['BigDecimal']['output'] + debtDelta: Scalars['BigDecimal']['output'] + debtOraclePrice: Scalars['BigDecimal']['output'] + debtToken?: Maybe + debtTokenPriceUSD: Scalars['BigDecimal']['output'] + depositTransfers: Array + depositedInQuoteToken: Scalars['BigDecimal']['output'] + depositedUSD?: Maybe + earnPosition?: Maybe + ethPrice: Scalars['BigDecimal']['output'] + gasFeeInCollateralToken: Scalars['BigDecimal']['output'] + gasFeeInQuoteToken: Scalars['BigDecimal']['output'] + gasFeeUSD: Scalars['BigDecimal']['output'] + gasPrice: Scalars['BigInt']['output'] + gasUsed: Scalars['BigInt']['output'] + id: Scalars['Bytes']['output'] + interestRate?: Maybe + isOpen?: Maybe + kind: Scalars['String']['output'] + liquidationPriceAfter: Scalars['BigDecimal']['output'] + liquidationPriceBefore: Scalars['BigDecimal']['output'] + ltvAfter?: Maybe + ltvBefore?: Maybe + marketPrice?: Maybe + moveQuoteFromIndex?: Maybe + moveQuoteToIndex?: Maybe + multipleAfter?: Maybe + multipleBefore?: Maybe + netValueAfter?: Maybe + netValueBefore?: Maybe + oasisFee: Scalars['BigDecimal']['output'] + oasisFeeInCollateralToken: Scalars['BigDecimal']['output'] + oasisFeeInQuoteToken: Scalars['BigDecimal']['output'] + oasisFeeToken?: Maybe + oasisFeeUSD: Scalars['BigDecimal']['output'] + originationFee: Scalars['BigDecimal']['output'] + originationFeeInCollateralToken: Scalars['BigDecimal']['output'] + originationFeeInQuoteToken: Scalars['BigDecimal']['output'] + originationFeeUSD: Scalars['BigDecimal']['output'] + pool?: Maybe + quoteTokensAfter?: Maybe + quoteTokensBefore?: Maybe + quoteTokensDelta?: Maybe + quoteTokensMoved?: Maybe + swapFromAmount?: Maybe + swapFromToken?: Maybe + swapToAmount?: Maybe + swapToToken?: Maybe + timestamp: Scalars['BigInt']['output'] + totalFee: Scalars['BigDecimal']['output'] + totalFeeInCollateralToken: Scalars['BigDecimal']['output'] + totalFeeInQuoteToken: Scalars['BigDecimal']['output'] + totalFeeUSD: Scalars['BigDecimal']['output'] + txHash: Scalars['Bytes']['output'] + withdrawTransfers: Array + withdrawnInQuoteToken: Scalars['BigDecimal']['output'] + withdrawnUSD?: Maybe +} + +export type OasisEventDepositTransfersArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type OasisEventWithdrawTransfersArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type OasisEvent_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + addOrRemoveIndex?: InputMaybe + addOrRemoveIndex_gt?: InputMaybe + addOrRemoveIndex_gte?: InputMaybe + addOrRemoveIndex_in?: InputMaybe> + addOrRemoveIndex_lt?: InputMaybe + addOrRemoveIndex_lte?: InputMaybe + addOrRemoveIndex_not?: InputMaybe + addOrRemoveIndex_not_in?: InputMaybe> + and?: InputMaybe>> + blockNumber?: InputMaybe + blockNumber_gt?: InputMaybe + blockNumber_gte?: InputMaybe + blockNumber_in?: InputMaybe> + blockNumber_lt?: InputMaybe + blockNumber_lte?: InputMaybe + blockNumber_not?: InputMaybe + blockNumber_not_in?: InputMaybe> + borrowPosition?: InputMaybe + borrowPosition_?: InputMaybe + borrowPosition_contains?: InputMaybe + borrowPosition_contains_nocase?: InputMaybe + borrowPosition_ends_with?: InputMaybe + borrowPosition_ends_with_nocase?: InputMaybe + borrowPosition_gt?: InputMaybe + borrowPosition_gte?: InputMaybe + borrowPosition_in?: InputMaybe> + borrowPosition_lt?: InputMaybe + borrowPosition_lte?: InputMaybe + borrowPosition_not?: InputMaybe + borrowPosition_not_contains?: InputMaybe + borrowPosition_not_contains_nocase?: InputMaybe + borrowPosition_not_ends_with?: InputMaybe + borrowPosition_not_ends_with_nocase?: InputMaybe + borrowPosition_not_in?: InputMaybe> + borrowPosition_not_starts_with?: InputMaybe + borrowPosition_not_starts_with_nocase?: InputMaybe + borrowPosition_starts_with?: InputMaybe + borrowPosition_starts_with_nocase?: InputMaybe + collateralAddress?: InputMaybe + collateralAddress_contains?: InputMaybe + collateralAddress_gt?: InputMaybe + collateralAddress_gte?: InputMaybe + collateralAddress_in?: InputMaybe> + collateralAddress_lt?: InputMaybe + collateralAddress_lte?: InputMaybe + collateralAddress_not?: InputMaybe + collateralAddress_not_contains?: InputMaybe + collateralAddress_not_in?: InputMaybe> + collateralAfter?: InputMaybe + collateralAfter_gt?: InputMaybe + collateralAfter_gte?: InputMaybe + collateralAfter_in?: InputMaybe> + collateralAfter_lt?: InputMaybe + collateralAfter_lte?: InputMaybe + collateralAfter_not?: InputMaybe + collateralAfter_not_in?: InputMaybe> + collateralBefore?: InputMaybe + collateralBefore_gt?: InputMaybe + collateralBefore_gte?: InputMaybe + collateralBefore_in?: InputMaybe> + collateralBefore_lt?: InputMaybe + collateralBefore_lte?: InputMaybe + collateralBefore_not?: InputMaybe + collateralBefore_not_in?: InputMaybe> + collateralDelta?: InputMaybe + collateralDelta_gt?: InputMaybe + collateralDelta_gte?: InputMaybe + collateralDelta_in?: InputMaybe> + collateralDelta_lt?: InputMaybe + collateralDelta_lte?: InputMaybe + collateralDelta_not?: InputMaybe + collateralDelta_not_in?: InputMaybe> + collateralLpsRemoved?: InputMaybe + collateralLpsRemoved_gt?: InputMaybe + collateralLpsRemoved_gte?: InputMaybe + collateralLpsRemoved_in?: InputMaybe> + collateralLpsRemoved_lt?: InputMaybe + collateralLpsRemoved_lte?: InputMaybe + collateralLpsRemoved_not?: InputMaybe + collateralLpsRemoved_not_in?: InputMaybe> + collateralOraclePrice?: InputMaybe + collateralOraclePrice_gt?: InputMaybe + collateralOraclePrice_gte?: InputMaybe + collateralOraclePrice_in?: InputMaybe> + collateralOraclePrice_lt?: InputMaybe + collateralOraclePrice_lte?: InputMaybe + collateralOraclePrice_not?: InputMaybe + collateralOraclePrice_not_in?: InputMaybe> + collateralToken?: InputMaybe + collateralTokenPriceUSD?: InputMaybe + collateralTokenPriceUSD_gt?: InputMaybe + collateralTokenPriceUSD_gte?: InputMaybe + collateralTokenPriceUSD_in?: InputMaybe> + collateralTokenPriceUSD_lt?: InputMaybe + collateralTokenPriceUSD_lte?: InputMaybe + collateralTokenPriceUSD_not?: InputMaybe + collateralTokenPriceUSD_not_in?: InputMaybe> + collateralToken_?: InputMaybe + collateralToken_contains?: InputMaybe + collateralToken_contains_nocase?: InputMaybe + collateralToken_ends_with?: InputMaybe + collateralToken_ends_with_nocase?: InputMaybe + collateralToken_gt?: InputMaybe + collateralToken_gte?: InputMaybe + collateralToken_in?: InputMaybe> + collateralToken_lt?: InputMaybe + collateralToken_lte?: InputMaybe + collateralToken_not?: InputMaybe + collateralToken_not_contains?: InputMaybe + collateralToken_not_contains_nocase?: InputMaybe + collateralToken_not_ends_with?: InputMaybe + collateralToken_not_ends_with_nocase?: InputMaybe + collateralToken_not_in?: InputMaybe> + collateralToken_not_starts_with?: InputMaybe + collateralToken_not_starts_with_nocase?: InputMaybe + collateralToken_starts_with?: InputMaybe + collateralToken_starts_with_nocase?: InputMaybe + debtAddress?: InputMaybe + debtAddress_contains?: InputMaybe + debtAddress_gt?: InputMaybe + debtAddress_gte?: InputMaybe + debtAddress_in?: InputMaybe> + debtAddress_lt?: InputMaybe + debtAddress_lte?: InputMaybe + debtAddress_not?: InputMaybe + debtAddress_not_contains?: InputMaybe + debtAddress_not_in?: InputMaybe> + debtAfter?: InputMaybe + debtAfter_gt?: InputMaybe + debtAfter_gte?: InputMaybe + debtAfter_in?: InputMaybe> + debtAfter_lt?: InputMaybe + debtAfter_lte?: InputMaybe + debtAfter_not?: InputMaybe + debtAfter_not_in?: InputMaybe> + debtBefore?: InputMaybe + debtBefore_gt?: InputMaybe + debtBefore_gte?: InputMaybe + debtBefore_in?: InputMaybe> + debtBefore_lt?: InputMaybe + debtBefore_lte?: InputMaybe + debtBefore_not?: InputMaybe + debtBefore_not_in?: InputMaybe> + debtDelta?: InputMaybe + debtDelta_gt?: InputMaybe + debtDelta_gte?: InputMaybe + debtDelta_in?: InputMaybe> + debtDelta_lt?: InputMaybe + debtDelta_lte?: InputMaybe + debtDelta_not?: InputMaybe + debtDelta_not_in?: InputMaybe> + debtOraclePrice?: InputMaybe + debtOraclePrice_gt?: InputMaybe + debtOraclePrice_gte?: InputMaybe + debtOraclePrice_in?: InputMaybe> + debtOraclePrice_lt?: InputMaybe + debtOraclePrice_lte?: InputMaybe + debtOraclePrice_not?: InputMaybe + debtOraclePrice_not_in?: InputMaybe> + debtToken?: InputMaybe + debtTokenPriceUSD?: InputMaybe + debtTokenPriceUSD_gt?: InputMaybe + debtTokenPriceUSD_gte?: InputMaybe + debtTokenPriceUSD_in?: InputMaybe> + debtTokenPriceUSD_lt?: InputMaybe + debtTokenPriceUSD_lte?: InputMaybe + debtTokenPriceUSD_not?: InputMaybe + debtTokenPriceUSD_not_in?: InputMaybe> + debtToken_?: InputMaybe + debtToken_contains?: InputMaybe + debtToken_contains_nocase?: InputMaybe + debtToken_ends_with?: InputMaybe + debtToken_ends_with_nocase?: InputMaybe + debtToken_gt?: InputMaybe + debtToken_gte?: InputMaybe + debtToken_in?: InputMaybe> + debtToken_lt?: InputMaybe + debtToken_lte?: InputMaybe + debtToken_not?: InputMaybe + debtToken_not_contains?: InputMaybe + debtToken_not_contains_nocase?: InputMaybe + debtToken_not_ends_with?: InputMaybe + debtToken_not_ends_with_nocase?: InputMaybe + debtToken_not_in?: InputMaybe> + debtToken_not_starts_with?: InputMaybe + debtToken_not_starts_with_nocase?: InputMaybe + debtToken_starts_with?: InputMaybe + debtToken_starts_with_nocase?: InputMaybe + depositTransfers?: InputMaybe> + depositTransfers_?: InputMaybe + depositTransfers_contains?: InputMaybe> + depositTransfers_contains_nocase?: InputMaybe> + depositTransfers_not?: InputMaybe> + depositTransfers_not_contains?: InputMaybe> + depositTransfers_not_contains_nocase?: InputMaybe> + depositedInQuoteToken?: InputMaybe + depositedInQuoteToken_gt?: InputMaybe + depositedInQuoteToken_gte?: InputMaybe + depositedInQuoteToken_in?: InputMaybe> + depositedInQuoteToken_lt?: InputMaybe + depositedInQuoteToken_lte?: InputMaybe + depositedInQuoteToken_not?: InputMaybe + depositedInQuoteToken_not_in?: InputMaybe> + depositedUSD?: InputMaybe + depositedUSD_gt?: InputMaybe + depositedUSD_gte?: InputMaybe + depositedUSD_in?: InputMaybe> + depositedUSD_lt?: InputMaybe + depositedUSD_lte?: InputMaybe + depositedUSD_not?: InputMaybe + depositedUSD_not_in?: InputMaybe> + earnPosition?: InputMaybe + earnPosition_?: InputMaybe + earnPosition_contains?: InputMaybe + earnPosition_contains_nocase?: InputMaybe + earnPosition_ends_with?: InputMaybe + earnPosition_ends_with_nocase?: InputMaybe + earnPosition_gt?: InputMaybe + earnPosition_gte?: InputMaybe + earnPosition_in?: InputMaybe> + earnPosition_lt?: InputMaybe + earnPosition_lte?: InputMaybe + earnPosition_not?: InputMaybe + earnPosition_not_contains?: InputMaybe + earnPosition_not_contains_nocase?: InputMaybe + earnPosition_not_ends_with?: InputMaybe + earnPosition_not_ends_with_nocase?: InputMaybe + earnPosition_not_in?: InputMaybe> + earnPosition_not_starts_with?: InputMaybe + earnPosition_not_starts_with_nocase?: InputMaybe + earnPosition_starts_with?: InputMaybe + earnPosition_starts_with_nocase?: InputMaybe + ethPrice?: InputMaybe + ethPrice_gt?: InputMaybe + ethPrice_gte?: InputMaybe + ethPrice_in?: InputMaybe> + ethPrice_lt?: InputMaybe + ethPrice_lte?: InputMaybe + ethPrice_not?: InputMaybe + ethPrice_not_in?: InputMaybe> + gasFeeInCollateralToken?: InputMaybe + gasFeeInCollateralToken_gt?: InputMaybe + gasFeeInCollateralToken_gte?: InputMaybe + gasFeeInCollateralToken_in?: InputMaybe> + gasFeeInCollateralToken_lt?: InputMaybe + gasFeeInCollateralToken_lte?: InputMaybe + gasFeeInCollateralToken_not?: InputMaybe + gasFeeInCollateralToken_not_in?: InputMaybe> + gasFeeInQuoteToken?: InputMaybe + gasFeeInQuoteToken_gt?: InputMaybe + gasFeeInQuoteToken_gte?: InputMaybe + gasFeeInQuoteToken_in?: InputMaybe> + gasFeeInQuoteToken_lt?: InputMaybe + gasFeeInQuoteToken_lte?: InputMaybe + gasFeeInQuoteToken_not?: InputMaybe + gasFeeInQuoteToken_not_in?: InputMaybe> + gasFeeUSD?: InputMaybe + gasFeeUSD_gt?: InputMaybe + gasFeeUSD_gte?: InputMaybe + gasFeeUSD_in?: InputMaybe> + gasFeeUSD_lt?: InputMaybe + gasFeeUSD_lte?: InputMaybe + gasFeeUSD_not?: InputMaybe + gasFeeUSD_not_in?: InputMaybe> + gasPrice?: InputMaybe + gasPrice_gt?: InputMaybe + gasPrice_gte?: InputMaybe + gasPrice_in?: InputMaybe> + gasPrice_lt?: InputMaybe + gasPrice_lte?: InputMaybe + gasPrice_not?: InputMaybe + gasPrice_not_in?: InputMaybe> + gasUsed?: InputMaybe + gasUsed_gt?: InputMaybe + gasUsed_gte?: InputMaybe + gasUsed_in?: InputMaybe> + gasUsed_lt?: InputMaybe + gasUsed_lte?: InputMaybe + gasUsed_not?: InputMaybe + gasUsed_not_in?: InputMaybe> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + interestRate?: InputMaybe + interestRate_gt?: InputMaybe + interestRate_gte?: InputMaybe + interestRate_in?: InputMaybe> + interestRate_lt?: InputMaybe + interestRate_lte?: InputMaybe + interestRate_not?: InputMaybe + interestRate_not_in?: InputMaybe> + isOpen?: InputMaybe + isOpen_in?: InputMaybe> + isOpen_not?: InputMaybe + isOpen_not_in?: InputMaybe> + kind?: InputMaybe + kind_contains?: InputMaybe + kind_contains_nocase?: InputMaybe + kind_ends_with?: InputMaybe + kind_ends_with_nocase?: InputMaybe + kind_gt?: InputMaybe + kind_gte?: InputMaybe + kind_in?: InputMaybe> + kind_lt?: InputMaybe + kind_lte?: InputMaybe + kind_not?: InputMaybe + kind_not_contains?: InputMaybe + kind_not_contains_nocase?: InputMaybe + kind_not_ends_with?: InputMaybe + kind_not_ends_with_nocase?: InputMaybe + kind_not_in?: InputMaybe> + kind_not_starts_with?: InputMaybe + kind_not_starts_with_nocase?: InputMaybe + kind_starts_with?: InputMaybe + kind_starts_with_nocase?: InputMaybe + liquidationPriceAfter?: InputMaybe + liquidationPriceAfter_gt?: InputMaybe + liquidationPriceAfter_gte?: InputMaybe + liquidationPriceAfter_in?: InputMaybe> + liquidationPriceAfter_lt?: InputMaybe + liquidationPriceAfter_lte?: InputMaybe + liquidationPriceAfter_not?: InputMaybe + liquidationPriceAfter_not_in?: InputMaybe> + liquidationPriceBefore?: InputMaybe + liquidationPriceBefore_gt?: InputMaybe + liquidationPriceBefore_gte?: InputMaybe + liquidationPriceBefore_in?: InputMaybe> + liquidationPriceBefore_lt?: InputMaybe + liquidationPriceBefore_lte?: InputMaybe + liquidationPriceBefore_not?: InputMaybe + liquidationPriceBefore_not_in?: InputMaybe> + ltvAfter?: InputMaybe + ltvAfter_gt?: InputMaybe + ltvAfter_gte?: InputMaybe + ltvAfter_in?: InputMaybe> + ltvAfter_lt?: InputMaybe + ltvAfter_lte?: InputMaybe + ltvAfter_not?: InputMaybe + ltvAfter_not_in?: InputMaybe> + ltvBefore?: InputMaybe + ltvBefore_gt?: InputMaybe + ltvBefore_gte?: InputMaybe + ltvBefore_in?: InputMaybe> + ltvBefore_lt?: InputMaybe + ltvBefore_lte?: InputMaybe + ltvBefore_not?: InputMaybe + ltvBefore_not_in?: InputMaybe> + marketPrice?: InputMaybe + marketPrice_gt?: InputMaybe + marketPrice_gte?: InputMaybe + marketPrice_in?: InputMaybe> + marketPrice_lt?: InputMaybe + marketPrice_lte?: InputMaybe + marketPrice_not?: InputMaybe + marketPrice_not_in?: InputMaybe> + moveQuoteFromIndex?: InputMaybe + moveQuoteFromIndex_gt?: InputMaybe + moveQuoteFromIndex_gte?: InputMaybe + moveQuoteFromIndex_in?: InputMaybe> + moveQuoteFromIndex_lt?: InputMaybe + moveQuoteFromIndex_lte?: InputMaybe + moveQuoteFromIndex_not?: InputMaybe + moveQuoteFromIndex_not_in?: InputMaybe> + moveQuoteToIndex?: InputMaybe + moveQuoteToIndex_gt?: InputMaybe + moveQuoteToIndex_gte?: InputMaybe + moveQuoteToIndex_in?: InputMaybe> + moveQuoteToIndex_lt?: InputMaybe + moveQuoteToIndex_lte?: InputMaybe + moveQuoteToIndex_not?: InputMaybe + moveQuoteToIndex_not_in?: InputMaybe> + multipleAfter?: InputMaybe + multipleAfter_gt?: InputMaybe + multipleAfter_gte?: InputMaybe + multipleAfter_in?: InputMaybe> + multipleAfter_lt?: InputMaybe + multipleAfter_lte?: InputMaybe + multipleAfter_not?: InputMaybe + multipleAfter_not_in?: InputMaybe> + multipleBefore?: InputMaybe + multipleBefore_gt?: InputMaybe + multipleBefore_gte?: InputMaybe + multipleBefore_in?: InputMaybe> + multipleBefore_lt?: InputMaybe + multipleBefore_lte?: InputMaybe + multipleBefore_not?: InputMaybe + multipleBefore_not_in?: InputMaybe> + netValueAfter?: InputMaybe + netValueAfter_gt?: InputMaybe + netValueAfter_gte?: InputMaybe + netValueAfter_in?: InputMaybe> + netValueAfter_lt?: InputMaybe + netValueAfter_lte?: InputMaybe + netValueAfter_not?: InputMaybe + netValueAfter_not_in?: InputMaybe> + netValueBefore?: InputMaybe + netValueBefore_gt?: InputMaybe + netValueBefore_gte?: InputMaybe + netValueBefore_in?: InputMaybe> + netValueBefore_lt?: InputMaybe + netValueBefore_lte?: InputMaybe + netValueBefore_not?: InputMaybe + netValueBefore_not_in?: InputMaybe> + oasisFee?: InputMaybe + oasisFeeInCollateralToken?: InputMaybe + oasisFeeInCollateralToken_gt?: InputMaybe + oasisFeeInCollateralToken_gte?: InputMaybe + oasisFeeInCollateralToken_in?: InputMaybe> + oasisFeeInCollateralToken_lt?: InputMaybe + oasisFeeInCollateralToken_lte?: InputMaybe + oasisFeeInCollateralToken_not?: InputMaybe + oasisFeeInCollateralToken_not_in?: InputMaybe> + oasisFeeInQuoteToken?: InputMaybe + oasisFeeInQuoteToken_gt?: InputMaybe + oasisFeeInQuoteToken_gte?: InputMaybe + oasisFeeInQuoteToken_in?: InputMaybe> + oasisFeeInQuoteToken_lt?: InputMaybe + oasisFeeInQuoteToken_lte?: InputMaybe + oasisFeeInQuoteToken_not?: InputMaybe + oasisFeeInQuoteToken_not_in?: InputMaybe> + oasisFeeToken?: InputMaybe + oasisFeeToken_contains?: InputMaybe + oasisFeeToken_gt?: InputMaybe + oasisFeeToken_gte?: InputMaybe + oasisFeeToken_in?: InputMaybe> + oasisFeeToken_lt?: InputMaybe + oasisFeeToken_lte?: InputMaybe + oasisFeeToken_not?: InputMaybe + oasisFeeToken_not_contains?: InputMaybe + oasisFeeToken_not_in?: InputMaybe> + oasisFeeUSD?: InputMaybe + oasisFeeUSD_gt?: InputMaybe + oasisFeeUSD_gte?: InputMaybe + oasisFeeUSD_in?: InputMaybe> + oasisFeeUSD_lt?: InputMaybe + oasisFeeUSD_lte?: InputMaybe + oasisFeeUSD_not?: InputMaybe + oasisFeeUSD_not_in?: InputMaybe> + oasisFee_gt?: InputMaybe + oasisFee_gte?: InputMaybe + oasisFee_in?: InputMaybe> + oasisFee_lt?: InputMaybe + oasisFee_lte?: InputMaybe + oasisFee_not?: InputMaybe + oasisFee_not_in?: InputMaybe> + or?: InputMaybe>> + originationFee?: InputMaybe + originationFeeInCollateralToken?: InputMaybe + originationFeeInCollateralToken_gt?: InputMaybe + originationFeeInCollateralToken_gte?: InputMaybe + originationFeeInCollateralToken_in?: InputMaybe> + originationFeeInCollateralToken_lt?: InputMaybe + originationFeeInCollateralToken_lte?: InputMaybe + originationFeeInCollateralToken_not?: InputMaybe + originationFeeInCollateralToken_not_in?: InputMaybe> + originationFeeInQuoteToken?: InputMaybe + originationFeeInQuoteToken_gt?: InputMaybe + originationFeeInQuoteToken_gte?: InputMaybe + originationFeeInQuoteToken_in?: InputMaybe> + originationFeeInQuoteToken_lt?: InputMaybe + originationFeeInQuoteToken_lte?: InputMaybe + originationFeeInQuoteToken_not?: InputMaybe + originationFeeInQuoteToken_not_in?: InputMaybe> + originationFeeUSD?: InputMaybe + originationFeeUSD_gt?: InputMaybe + originationFeeUSD_gte?: InputMaybe + originationFeeUSD_in?: InputMaybe> + originationFeeUSD_lt?: InputMaybe + originationFeeUSD_lte?: InputMaybe + originationFeeUSD_not?: InputMaybe + originationFeeUSD_not_in?: InputMaybe> + originationFee_gt?: InputMaybe + originationFee_gte?: InputMaybe + originationFee_in?: InputMaybe> + originationFee_lt?: InputMaybe + originationFee_lte?: InputMaybe + originationFee_not?: InputMaybe + originationFee_not_in?: InputMaybe> + pool?: InputMaybe + pool_?: InputMaybe + pool_contains?: InputMaybe + pool_contains_nocase?: InputMaybe + pool_ends_with?: InputMaybe + pool_ends_with_nocase?: InputMaybe + pool_gt?: InputMaybe + pool_gte?: InputMaybe + pool_in?: InputMaybe> + pool_lt?: InputMaybe + pool_lte?: InputMaybe + pool_not?: InputMaybe + pool_not_contains?: InputMaybe + pool_not_contains_nocase?: InputMaybe + pool_not_ends_with?: InputMaybe + pool_not_ends_with_nocase?: InputMaybe + pool_not_in?: InputMaybe> + pool_not_starts_with?: InputMaybe + pool_not_starts_with_nocase?: InputMaybe + pool_starts_with?: InputMaybe + pool_starts_with_nocase?: InputMaybe + quoteTokensAfter?: InputMaybe + quoteTokensAfter_gt?: InputMaybe + quoteTokensAfter_gte?: InputMaybe + quoteTokensAfter_in?: InputMaybe> + quoteTokensAfter_lt?: InputMaybe + quoteTokensAfter_lte?: InputMaybe + quoteTokensAfter_not?: InputMaybe + quoteTokensAfter_not_in?: InputMaybe> + quoteTokensBefore?: InputMaybe + quoteTokensBefore_gt?: InputMaybe + quoteTokensBefore_gte?: InputMaybe + quoteTokensBefore_in?: InputMaybe> + quoteTokensBefore_lt?: InputMaybe + quoteTokensBefore_lte?: InputMaybe + quoteTokensBefore_not?: InputMaybe + quoteTokensBefore_not_in?: InputMaybe> + quoteTokensDelta?: InputMaybe + quoteTokensDelta_gt?: InputMaybe + quoteTokensDelta_gte?: InputMaybe + quoteTokensDelta_in?: InputMaybe> + quoteTokensDelta_lt?: InputMaybe + quoteTokensDelta_lte?: InputMaybe + quoteTokensDelta_not?: InputMaybe + quoteTokensDelta_not_in?: InputMaybe> + quoteTokensMoved?: InputMaybe + quoteTokensMoved_gt?: InputMaybe + quoteTokensMoved_gte?: InputMaybe + quoteTokensMoved_in?: InputMaybe> + quoteTokensMoved_lt?: InputMaybe + quoteTokensMoved_lte?: InputMaybe + quoteTokensMoved_not?: InputMaybe + quoteTokensMoved_not_in?: InputMaybe> + swapFromAmount?: InputMaybe + swapFromAmount_gt?: InputMaybe + swapFromAmount_gte?: InputMaybe + swapFromAmount_in?: InputMaybe> + swapFromAmount_lt?: InputMaybe + swapFromAmount_lte?: InputMaybe + swapFromAmount_not?: InputMaybe + swapFromAmount_not_in?: InputMaybe> + swapFromToken?: InputMaybe + swapFromToken_contains?: InputMaybe + swapFromToken_gt?: InputMaybe + swapFromToken_gte?: InputMaybe + swapFromToken_in?: InputMaybe> + swapFromToken_lt?: InputMaybe + swapFromToken_lte?: InputMaybe + swapFromToken_not?: InputMaybe + swapFromToken_not_contains?: InputMaybe + swapFromToken_not_in?: InputMaybe> + swapToAmount?: InputMaybe + swapToAmount_gt?: InputMaybe + swapToAmount_gte?: InputMaybe + swapToAmount_in?: InputMaybe> + swapToAmount_lt?: InputMaybe + swapToAmount_lte?: InputMaybe + swapToAmount_not?: InputMaybe + swapToAmount_not_in?: InputMaybe> + swapToToken?: InputMaybe + swapToToken_contains?: InputMaybe + swapToToken_gt?: InputMaybe + swapToToken_gte?: InputMaybe + swapToToken_in?: InputMaybe> + swapToToken_lt?: InputMaybe + swapToToken_lte?: InputMaybe + swapToToken_not?: InputMaybe + swapToToken_not_contains?: InputMaybe + swapToToken_not_in?: InputMaybe> + timestamp?: InputMaybe + timestamp_gt?: InputMaybe + timestamp_gte?: InputMaybe + timestamp_in?: InputMaybe> + timestamp_lt?: InputMaybe + timestamp_lte?: InputMaybe + timestamp_not?: InputMaybe + timestamp_not_in?: InputMaybe> + totalFee?: InputMaybe + totalFeeInCollateralToken?: InputMaybe + totalFeeInCollateralToken_gt?: InputMaybe + totalFeeInCollateralToken_gte?: InputMaybe + totalFeeInCollateralToken_in?: InputMaybe> + totalFeeInCollateralToken_lt?: InputMaybe + totalFeeInCollateralToken_lte?: InputMaybe + totalFeeInCollateralToken_not?: InputMaybe + totalFeeInCollateralToken_not_in?: InputMaybe> + totalFeeInQuoteToken?: InputMaybe + totalFeeInQuoteToken_gt?: InputMaybe + totalFeeInQuoteToken_gte?: InputMaybe + totalFeeInQuoteToken_in?: InputMaybe> + totalFeeInQuoteToken_lt?: InputMaybe + totalFeeInQuoteToken_lte?: InputMaybe + totalFeeInQuoteToken_not?: InputMaybe + totalFeeInQuoteToken_not_in?: InputMaybe> + totalFeeUSD?: InputMaybe + totalFeeUSD_gt?: InputMaybe + totalFeeUSD_gte?: InputMaybe + totalFeeUSD_in?: InputMaybe> + totalFeeUSD_lt?: InputMaybe + totalFeeUSD_lte?: InputMaybe + totalFeeUSD_not?: InputMaybe + totalFeeUSD_not_in?: InputMaybe> + totalFee_gt?: InputMaybe + totalFee_gte?: InputMaybe + totalFee_in?: InputMaybe> + totalFee_lt?: InputMaybe + totalFee_lte?: InputMaybe + totalFee_not?: InputMaybe + totalFee_not_in?: InputMaybe> + txHash?: InputMaybe + txHash_contains?: InputMaybe + txHash_gt?: InputMaybe + txHash_gte?: InputMaybe + txHash_in?: InputMaybe> + txHash_lt?: InputMaybe + txHash_lte?: InputMaybe + txHash_not?: InputMaybe + txHash_not_contains?: InputMaybe + txHash_not_in?: InputMaybe> + withdrawTransfers?: InputMaybe> + withdrawTransfers_?: InputMaybe + withdrawTransfers_contains?: InputMaybe> + withdrawTransfers_contains_nocase?: InputMaybe> + withdrawTransfers_not?: InputMaybe> + withdrawTransfers_not_contains?: InputMaybe> + withdrawTransfers_not_contains_nocase?: InputMaybe> + withdrawnInQuoteToken?: InputMaybe + withdrawnInQuoteToken_gt?: InputMaybe + withdrawnInQuoteToken_gte?: InputMaybe + withdrawnInQuoteToken_in?: InputMaybe> + withdrawnInQuoteToken_lt?: InputMaybe + withdrawnInQuoteToken_lte?: InputMaybe + withdrawnInQuoteToken_not?: InputMaybe + withdrawnInQuoteToken_not_in?: InputMaybe> + withdrawnUSD?: InputMaybe + withdrawnUSD_gt?: InputMaybe + withdrawnUSD_gte?: InputMaybe + withdrawnUSD_in?: InputMaybe> + withdrawnUSD_lt?: InputMaybe + withdrawnUSD_lte?: InputMaybe + withdrawnUSD_not?: InputMaybe + withdrawnUSD_not_in?: InputMaybe> +} + +export enum OasisEvent_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + AddOrRemoveIndex = 'addOrRemoveIndex', + BlockNumber = 'blockNumber', + BorrowPosition = 'borrowPosition', + BorrowPositionBorrowCumulativeCollateralDeposit = 'borrowPosition__borrowCumulativeCollateralDeposit', + BorrowPositionBorrowCumulativeCollateralWithdraw = 'borrowPosition__borrowCumulativeCollateralWithdraw', + BorrowPositionBorrowCumulativeDebtDeposit = 'borrowPosition__borrowCumulativeDebtDeposit', + BorrowPositionBorrowCumulativeDebtWithdraw = 'borrowPosition__borrowCumulativeDebtWithdraw', + BorrowPositionBorrowCumulativeDepositInCollateralToken = 'borrowPosition__borrowCumulativeDepositInCollateralToken', + BorrowPositionBorrowCumulativeDepositInQuoteToken = 'borrowPosition__borrowCumulativeDepositInQuoteToken', + BorrowPositionBorrowCumulativeDepositUsd = 'borrowPosition__borrowCumulativeDepositUSD', + BorrowPositionBorrowCumulativeFeesInCollateralToken = 'borrowPosition__borrowCumulativeFeesInCollateralToken', + BorrowPositionBorrowCumulativeFeesInQuoteToken = 'borrowPosition__borrowCumulativeFeesInQuoteToken', + BorrowPositionBorrowCumulativeFeesUsd = 'borrowPosition__borrowCumulativeFeesUSD', + BorrowPositionBorrowCumulativeWithdrawInCollateralToken = 'borrowPosition__borrowCumulativeWithdrawInCollateralToken', + BorrowPositionBorrowCumulativeWithdrawInQuoteToken = 'borrowPosition__borrowCumulativeWithdrawInQuoteToken', + BorrowPositionBorrowCumulativeWithdrawUsd = 'borrowPosition__borrowCumulativeWithdrawUSD', + BorrowPositionBorrowDailyTokenBlocks = 'borrowPosition__borrowDailyTokenBlocks', + BorrowPositionBorrowLastUpdateBlock = 'borrowPosition__borrowLastUpdateBlock', + BorrowPositionCollateral = 'borrowPosition__collateral', + BorrowPositionDebt = 'borrowPosition__debt', + BorrowPositionId = 'borrowPosition__id', + BorrowPositionLiquidationPrice = 'borrowPosition__liquidationPrice', + BorrowPositionT0Debt = 'borrowPosition__t0Debt', + BorrowPositionT0Np = 'borrowPosition__t0Np_', + CollateralAddress = 'collateralAddress', + CollateralAfter = 'collateralAfter', + CollateralBefore = 'collateralBefore', + CollateralDelta = 'collateralDelta', + CollateralLpsRemoved = 'collateralLpsRemoved', + CollateralOraclePrice = 'collateralOraclePrice', + CollateralToken = 'collateralToken', + CollateralTokenPriceUsd = 'collateralTokenPriceUSD', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + DebtAddress = 'debtAddress', + DebtAfter = 'debtAfter', + DebtBefore = 'debtBefore', + DebtDelta = 'debtDelta', + DebtOraclePrice = 'debtOraclePrice', + DebtToken = 'debtToken', + DebtTokenPriceUsd = 'debtTokenPriceUSD', + DebtTokenAddress = 'debtToken__address', + DebtTokenDecimals = 'debtToken__decimals', + DebtTokenId = 'debtToken__id', + DebtTokenPrecision = 'debtToken__precision', + DebtTokenSymbol = 'debtToken__symbol', + DepositTransfers = 'depositTransfers', + DepositedInQuoteToken = 'depositedInQuoteToken', + DepositedUsd = 'depositedUSD', + EarnPosition = 'earnPosition', + EarnPositionEarnCumulativeDepositInCollateralToken = 'earnPosition__earnCumulativeDepositInCollateralToken', + EarnPositionEarnCumulativeDepositInQuoteToken = 'earnPosition__earnCumulativeDepositInQuoteToken', + EarnPositionEarnCumulativeDepositUsd = 'earnPosition__earnCumulativeDepositUSD', + EarnPositionEarnCumulativeFeesInCollateralToken = 'earnPosition__earnCumulativeFeesInCollateralToken', + EarnPositionEarnCumulativeFeesInQuoteToken = 'earnPosition__earnCumulativeFeesInQuoteToken', + EarnPositionEarnCumulativeFeesUsd = 'earnPosition__earnCumulativeFeesUSD', + EarnPositionEarnCumulativeQuoteTokenDeposit = 'earnPosition__earnCumulativeQuoteTokenDeposit', + EarnPositionEarnCumulativeQuoteTokenWithdraw = 'earnPosition__earnCumulativeQuoteTokenWithdraw', + EarnPositionEarnCumulativeWithdrawInCollateralToken = 'earnPosition__earnCumulativeWithdrawInCollateralToken', + EarnPositionEarnCumulativeWithdrawInQuoteToken = 'earnPosition__earnCumulativeWithdrawInQuoteToken', + EarnPositionEarnCumulativeWithdrawUsd = 'earnPosition__earnCumulativeWithdrawUSD', + EarnPositionEarnDailyTokenBlocks = 'earnPosition__earnDailyTokenBlocks', + EarnPositionEarnIsEarning = 'earnPosition__earnIsEarning', + EarnPositionEarnLastUpdateBlock = 'earnPosition__earnLastUpdateBlock', + EarnPositionId = 'earnPosition__id', + EthPrice = 'ethPrice', + GasFeeInCollateralToken = 'gasFeeInCollateralToken', + GasFeeInQuoteToken = 'gasFeeInQuoteToken', + GasFeeUsd = 'gasFeeUSD', + GasPrice = 'gasPrice', + GasUsed = 'gasUsed', + Id = 'id', + InterestRate = 'interestRate', + IsOpen = 'isOpen', + Kind = 'kind', + LiquidationPriceAfter = 'liquidationPriceAfter', + LiquidationPriceBefore = 'liquidationPriceBefore', + LtvAfter = 'ltvAfter', + LtvBefore = 'ltvBefore', + MarketPrice = 'marketPrice', + MoveQuoteFromIndex = 'moveQuoteFromIndex', + MoveQuoteToIndex = 'moveQuoteToIndex', + MultipleAfter = 'multipleAfter', + MultipleBefore = 'multipleBefore', + NetValueAfter = 'netValueAfter', + NetValueBefore = 'netValueBefore', + OasisFee = 'oasisFee', + OasisFeeInCollateralToken = 'oasisFeeInCollateralToken', + OasisFeeInQuoteToken = 'oasisFeeInQuoteToken', + OasisFeeToken = 'oasisFeeToken', + OasisFeeUsd = 'oasisFeeUSD', + OriginationFee = 'originationFee', + OriginationFeeInCollateralToken = 'originationFeeInCollateralToken', + OriginationFeeInQuoteToken = 'originationFeeInQuoteToken', + OriginationFeeUsd = 'originationFeeUSD', + Pool = 'pool', + PoolAccuredDebt = 'pool__accuredDebt', + PoolAddress = 'pool__address', + PoolApr7dAverage = 'pool__apr7dAverage', + PoolApr30dAverage = 'pool__apr30dAverage', + PoolAuctionPrice = 'pool__auctionPrice', + PoolBorrowApr = 'pool__borrowApr', + PoolBorrowDailyTokenBlocks = 'pool__borrowDailyTokenBlocks', + PoolClaimableReserves = 'pool__claimableReserves', + PoolClaimableReservesRemaining = 'pool__claimableReservesRemaining', + PoolCollateralAddress = 'pool__collateralAddress', + PoolCollateralScale = 'pool__collateralScale', + PoolCurrentBurnEpoch = 'pool__currentBurnEpoch', + PoolDailyPercentageRate30dAverage = 'pool__dailyPercentageRate30dAverage', + PoolDebt = 'pool__debt', + PoolDebtInAuctions = 'pool__debtInAuctions', + PoolDepositSize = 'pool__depositSize', + PoolEarnDailyTokenBlocks = 'pool__earnDailyTokenBlocks', + PoolHpb = 'pool__hpb', + PoolHpbIndex = 'pool__hpbIndex', + PoolHtp = 'pool__htp', + PoolHtpIndex = 'pool__htpIndex', + PoolId = 'pool__id', + PoolInterestRate = 'pool__interestRate', + PoolLastInterestRateUpdate = 'pool__lastInterestRateUpdate', + PoolLendApr = 'pool__lendApr', + PoolLendApr7dAverage = 'pool__lendApr7dAverage', + PoolLendApr30dAverage = 'pool__lendApr30dAverage', + PoolLendDailyPercentageRate30dAverage = 'pool__lendDailyPercentageRate30dAverage', + PoolLendMonthlyPercentageRate30dAverage = 'pool__lendMonthlyPercentageRate30dAverage', + PoolLoansCount = 'pool__loansCount', + PoolLup = 'pool__lup', + PoolLupIndex = 'pool__lupIndex', + PoolMonthlyPercentageRate30dAverage = 'pool__monthlyPercentageRate30dAverage', + PoolName = 'pool__name', + PoolPoolActualUtilization = 'pool__poolActualUtilization', + PoolPoolCollateralization = 'pool__poolCollateralization', + PoolPoolMinDebtAmount = 'pool__poolMinDebtAmount', + PoolPoolTargetUtilization = 'pool__poolTargetUtilization', + PoolQuoteTokenAddress = 'pool__quoteTokenAddress', + PoolQuoteTokenScale = 'pool__quoteTokenScale', + PoolReserves = 'pool__reserves', + PoolSummerDepositAmountEarningInterest = 'pool__summerDepositAmountEarningInterest', + PoolT0debt = 'pool__t0debt', + PoolTimeRemaining = 'pool__timeRemaining', + PoolTotalAuctionsInPool = 'pool__totalAuctionsInPool', + QuoteTokensAfter = 'quoteTokensAfter', + QuoteTokensBefore = 'quoteTokensBefore', + QuoteTokensDelta = 'quoteTokensDelta', + QuoteTokensMoved = 'quoteTokensMoved', + SwapFromAmount = 'swapFromAmount', + SwapFromToken = 'swapFromToken', + SwapToAmount = 'swapToAmount', + SwapToToken = 'swapToToken', + Timestamp = 'timestamp', + TotalFee = 'totalFee', + TotalFeeInCollateralToken = 'totalFeeInCollateralToken', + TotalFeeInQuoteToken = 'totalFeeInQuoteToken', + TotalFeeUsd = 'totalFeeUSD', + TxHash = 'txHash', + WithdrawTransfers = 'withdrawTransfers', + WithdrawnInQuoteToken = 'withdrawnInQuoteToken', + WithdrawnUsd = 'withdrawnUSD', +} + +/** Defines the order direction, either ascending or descending */ +export enum OrderDirection { + Asc = 'asc', + Desc = 'desc', +} + +export type Permission = { + __typename?: 'Permission' + account: Account + id: Scalars['ID']['output'] + user: User +} + +export type Permission_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + account?: InputMaybe + account_?: InputMaybe + account_contains?: InputMaybe + account_contains_nocase?: InputMaybe + account_ends_with?: InputMaybe + account_ends_with_nocase?: InputMaybe + account_gt?: InputMaybe + account_gte?: InputMaybe + account_in?: InputMaybe> + account_lt?: InputMaybe + account_lte?: InputMaybe + account_not?: InputMaybe + account_not_contains?: InputMaybe + account_not_contains_nocase?: InputMaybe + account_not_ends_with?: InputMaybe + account_not_ends_with_nocase?: InputMaybe + account_not_in?: InputMaybe> + account_not_starts_with?: InputMaybe + account_not_starts_with_nocase?: InputMaybe + account_starts_with?: InputMaybe + account_starts_with_nocase?: InputMaybe + and?: InputMaybe>> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + user?: InputMaybe + user_?: InputMaybe + user_contains?: InputMaybe + user_contains_nocase?: InputMaybe + user_ends_with?: InputMaybe + user_ends_with_nocase?: InputMaybe + user_gt?: InputMaybe + user_gte?: InputMaybe + user_in?: InputMaybe> + user_lt?: InputMaybe + user_lte?: InputMaybe + user_not?: InputMaybe + user_not_contains?: InputMaybe + user_not_contains_nocase?: InputMaybe + user_not_ends_with?: InputMaybe + user_not_ends_with_nocase?: InputMaybe + user_not_in?: InputMaybe> + user_not_starts_with?: InputMaybe + user_not_starts_with_nocase?: InputMaybe + user_starts_with?: InputMaybe + user_starts_with_nocase?: InputMaybe +} + +export enum Permission_OrderBy { + Account = 'account', + AccountAddress = 'account__address', + AccountCollateralToken = 'account__collateralToken', + AccountDebtToken = 'account__debtToken', + AccountId = 'account__id', + AccountIsDpm = 'account__isDPM', + AccountPositionType = 'account__positionType', + AccountProtocol = 'account__protocol', + AccountVaultId = 'account__vaultId', + Id = 'id', + User = 'user', + UserAddress = 'user__address', + UserId = 'user__id', + UserVaultCount = 'user__vaultCount', +} + +export type Pool = { + __typename?: 'Pool' + accuredDebt: Scalars['BigInt']['output'] + address: Scalars['Bytes']['output'] + apr7dAverage?: Maybe + apr30dAverage: Scalars['BigInt']['output'] + auctionPrice: Scalars['BigInt']['output'] + borrowApr?: Maybe + borrowDailyTokenBlocks: Scalars['BigInt']['output'] + borrowPositions: Array + buckets?: Maybe> + claimableReserves: Scalars['BigInt']['output'] + claimableReservesRemaining: Scalars['BigInt']['output'] + collateralAddress: Scalars['Bytes']['output'] + collateralScale: Scalars['BigInt']['output'] + collateralToken?: Maybe + currentBurnEpoch: Scalars['BigInt']['output'] + dailyPercentageRate30dAverage: Scalars['BigInt']['output'] + debt: Scalars['BigInt']['output'] + debtInAuctions: Scalars['BigInt']['output'] + depositSize: Scalars['BigInt']['output'] + earnDailyTokenBlocks: Scalars['BigInt']['output'] + earnPositions: Array + hpb: Scalars['BigInt']['output'] + hpbIndex: Scalars['BigInt']['output'] + htp: Scalars['BigInt']['output'] + htpIndex: Scalars['BigInt']['output'] + id: Scalars['ID']['output'] + interestRate: Scalars['BigInt']['output'] + interestRatesHistory30d: Array + lastInterestRateUpdate: Scalars['BigInt']['output'] + lendApr?: Maybe + lendApr7dAverage?: Maybe + lendApr30dAverage: Scalars['BigInt']['output'] + lendAprHistory30d: Array + lendDailyPercentageRate30dAverage: Scalars['BigInt']['output'] + lendMonthlyPercentageRate30dAverage: Scalars['BigInt']['output'] + loansCount: Scalars['BigInt']['output'] + lup: Scalars['BigInt']['output'] + lupIndex: Scalars['BigInt']['output'] + monthlyPercentageRate30dAverage: Scalars['BigInt']['output'] + name?: Maybe + poolActualUtilization: Scalars['BigInt']['output'] + poolCollateralization: Scalars['BigInt']['output'] + poolMinDebtAmount: Scalars['BigInt']['output'] + poolTargetUtilization: Scalars['BigInt']['output'] + quoteToken?: Maybe + quoteTokenAddress: Scalars['Bytes']['output'] + quoteTokenScale: Scalars['BigInt']['output'] + reserves: Scalars['BigInt']['output'] + stakedNfts: Array + summerDepositAmountEarningInterest?: Maybe + t0debt: Scalars['BigInt']['output'] + timeRemaining: Scalars['BigInt']['output'] + totalAuctionsInPool: Scalars['BigInt']['output'] +} + +export type PoolBucketsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type PoolStakedNftsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type Pool_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + accuredDebt?: InputMaybe + accuredDebt_gt?: InputMaybe + accuredDebt_gte?: InputMaybe + accuredDebt_in?: InputMaybe> + accuredDebt_lt?: InputMaybe + accuredDebt_lte?: InputMaybe + accuredDebt_not?: InputMaybe + accuredDebt_not_in?: InputMaybe> + address?: InputMaybe + address_contains?: InputMaybe + address_gt?: InputMaybe + address_gte?: InputMaybe + address_in?: InputMaybe> + address_lt?: InputMaybe + address_lte?: InputMaybe + address_not?: InputMaybe + address_not_contains?: InputMaybe + address_not_in?: InputMaybe> + and?: InputMaybe>> + apr7dAverage?: InputMaybe + apr7dAverage_gt?: InputMaybe + apr7dAverage_gte?: InputMaybe + apr7dAverage_in?: InputMaybe> + apr7dAverage_lt?: InputMaybe + apr7dAverage_lte?: InputMaybe + apr7dAverage_not?: InputMaybe + apr7dAverage_not_in?: InputMaybe> + apr30dAverage?: InputMaybe + apr30dAverage_gt?: InputMaybe + apr30dAverage_gte?: InputMaybe + apr30dAverage_in?: InputMaybe> + apr30dAverage_lt?: InputMaybe + apr30dAverage_lte?: InputMaybe + apr30dAverage_not?: InputMaybe + apr30dAverage_not_in?: InputMaybe> + auctionPrice?: InputMaybe + auctionPrice_gt?: InputMaybe + auctionPrice_gte?: InputMaybe + auctionPrice_in?: InputMaybe> + auctionPrice_lt?: InputMaybe + auctionPrice_lte?: InputMaybe + auctionPrice_not?: InputMaybe + auctionPrice_not_in?: InputMaybe> + borrowApr?: InputMaybe + borrowApr_gt?: InputMaybe + borrowApr_gte?: InputMaybe + borrowApr_in?: InputMaybe> + borrowApr_lt?: InputMaybe + borrowApr_lte?: InputMaybe + borrowApr_not?: InputMaybe + borrowApr_not_in?: InputMaybe> + borrowDailyTokenBlocks?: InputMaybe + borrowDailyTokenBlocks_gt?: InputMaybe + borrowDailyTokenBlocks_gte?: InputMaybe + borrowDailyTokenBlocks_in?: InputMaybe> + borrowDailyTokenBlocks_lt?: InputMaybe + borrowDailyTokenBlocks_lte?: InputMaybe + borrowDailyTokenBlocks_not?: InputMaybe + borrowDailyTokenBlocks_not_in?: InputMaybe> + borrowPositions?: InputMaybe> + borrowPositions_contains?: InputMaybe> + borrowPositions_contains_nocase?: InputMaybe> + borrowPositions_not?: InputMaybe> + borrowPositions_not_contains?: InputMaybe> + borrowPositions_not_contains_nocase?: InputMaybe> + buckets_?: InputMaybe + claimableReserves?: InputMaybe + claimableReservesRemaining?: InputMaybe + claimableReservesRemaining_gt?: InputMaybe + claimableReservesRemaining_gte?: InputMaybe + claimableReservesRemaining_in?: InputMaybe> + claimableReservesRemaining_lt?: InputMaybe + claimableReservesRemaining_lte?: InputMaybe + claimableReservesRemaining_not?: InputMaybe + claimableReservesRemaining_not_in?: InputMaybe> + claimableReserves_gt?: InputMaybe + claimableReserves_gte?: InputMaybe + claimableReserves_in?: InputMaybe> + claimableReserves_lt?: InputMaybe + claimableReserves_lte?: InputMaybe + claimableReserves_not?: InputMaybe + claimableReserves_not_in?: InputMaybe> + collateralAddress?: InputMaybe + collateralAddress_contains?: InputMaybe + collateralAddress_gt?: InputMaybe + collateralAddress_gte?: InputMaybe + collateralAddress_in?: InputMaybe> + collateralAddress_lt?: InputMaybe + collateralAddress_lte?: InputMaybe + collateralAddress_not?: InputMaybe + collateralAddress_not_contains?: InputMaybe + collateralAddress_not_in?: InputMaybe> + collateralScale?: InputMaybe + collateralScale_gt?: InputMaybe + collateralScale_gte?: InputMaybe + collateralScale_in?: InputMaybe> + collateralScale_lt?: InputMaybe + collateralScale_lte?: InputMaybe + collateralScale_not?: InputMaybe + collateralScale_not_in?: InputMaybe> + collateralToken?: InputMaybe + collateralToken_?: InputMaybe + collateralToken_contains?: InputMaybe + collateralToken_contains_nocase?: InputMaybe + collateralToken_ends_with?: InputMaybe + collateralToken_ends_with_nocase?: InputMaybe + collateralToken_gt?: InputMaybe + collateralToken_gte?: InputMaybe + collateralToken_in?: InputMaybe> + collateralToken_lt?: InputMaybe + collateralToken_lte?: InputMaybe + collateralToken_not?: InputMaybe + collateralToken_not_contains?: InputMaybe + collateralToken_not_contains_nocase?: InputMaybe + collateralToken_not_ends_with?: InputMaybe + collateralToken_not_ends_with_nocase?: InputMaybe + collateralToken_not_in?: InputMaybe> + collateralToken_not_starts_with?: InputMaybe + collateralToken_not_starts_with_nocase?: InputMaybe + collateralToken_starts_with?: InputMaybe + collateralToken_starts_with_nocase?: InputMaybe + currentBurnEpoch?: InputMaybe + currentBurnEpoch_gt?: InputMaybe + currentBurnEpoch_gte?: InputMaybe + currentBurnEpoch_in?: InputMaybe> + currentBurnEpoch_lt?: InputMaybe + currentBurnEpoch_lte?: InputMaybe + currentBurnEpoch_not?: InputMaybe + currentBurnEpoch_not_in?: InputMaybe> + dailyPercentageRate30dAverage?: InputMaybe + dailyPercentageRate30dAverage_gt?: InputMaybe + dailyPercentageRate30dAverage_gte?: InputMaybe + dailyPercentageRate30dAverage_in?: InputMaybe> + dailyPercentageRate30dAverage_lt?: InputMaybe + dailyPercentageRate30dAverage_lte?: InputMaybe + dailyPercentageRate30dAverage_not?: InputMaybe + dailyPercentageRate30dAverage_not_in?: InputMaybe> + debt?: InputMaybe + debtInAuctions?: InputMaybe + debtInAuctions_gt?: InputMaybe + debtInAuctions_gte?: InputMaybe + debtInAuctions_in?: InputMaybe> + debtInAuctions_lt?: InputMaybe + debtInAuctions_lte?: InputMaybe + debtInAuctions_not?: InputMaybe + debtInAuctions_not_in?: InputMaybe> + debt_gt?: InputMaybe + debt_gte?: InputMaybe + debt_in?: InputMaybe> + debt_lt?: InputMaybe + debt_lte?: InputMaybe + debt_not?: InputMaybe + debt_not_in?: InputMaybe> + depositSize?: InputMaybe + depositSize_gt?: InputMaybe + depositSize_gte?: InputMaybe + depositSize_in?: InputMaybe> + depositSize_lt?: InputMaybe + depositSize_lte?: InputMaybe + depositSize_not?: InputMaybe + depositSize_not_in?: InputMaybe> + earnDailyTokenBlocks?: InputMaybe + earnDailyTokenBlocks_gt?: InputMaybe + earnDailyTokenBlocks_gte?: InputMaybe + earnDailyTokenBlocks_in?: InputMaybe> + earnDailyTokenBlocks_lt?: InputMaybe + earnDailyTokenBlocks_lte?: InputMaybe + earnDailyTokenBlocks_not?: InputMaybe + earnDailyTokenBlocks_not_in?: InputMaybe> + earnPositions?: InputMaybe> + earnPositions_contains?: InputMaybe> + earnPositions_contains_nocase?: InputMaybe> + earnPositions_not?: InputMaybe> + earnPositions_not_contains?: InputMaybe> + earnPositions_not_contains_nocase?: InputMaybe> + hpb?: InputMaybe + hpbIndex?: InputMaybe + hpbIndex_gt?: InputMaybe + hpbIndex_gte?: InputMaybe + hpbIndex_in?: InputMaybe> + hpbIndex_lt?: InputMaybe + hpbIndex_lte?: InputMaybe + hpbIndex_not?: InputMaybe + hpbIndex_not_in?: InputMaybe> + hpb_gt?: InputMaybe + hpb_gte?: InputMaybe + hpb_in?: InputMaybe> + hpb_lt?: InputMaybe + hpb_lte?: InputMaybe + hpb_not?: InputMaybe + hpb_not_in?: InputMaybe> + htp?: InputMaybe + htpIndex?: InputMaybe + htpIndex_gt?: InputMaybe + htpIndex_gte?: InputMaybe + htpIndex_in?: InputMaybe> + htpIndex_lt?: InputMaybe + htpIndex_lte?: InputMaybe + htpIndex_not?: InputMaybe + htpIndex_not_in?: InputMaybe> + htp_gt?: InputMaybe + htp_gte?: InputMaybe + htp_in?: InputMaybe> + htp_lt?: InputMaybe + htp_lte?: InputMaybe + htp_not?: InputMaybe + htp_not_in?: InputMaybe> + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + interestRate?: InputMaybe + interestRate_gt?: InputMaybe + interestRate_gte?: InputMaybe + interestRate_in?: InputMaybe> + interestRate_lt?: InputMaybe + interestRate_lte?: InputMaybe + interestRate_not?: InputMaybe + interestRate_not_in?: InputMaybe> + interestRatesHistory30d?: InputMaybe> + interestRatesHistory30d_contains?: InputMaybe> + interestRatesHistory30d_contains_nocase?: InputMaybe> + interestRatesHistory30d_not?: InputMaybe> + interestRatesHistory30d_not_contains?: InputMaybe> + interestRatesHistory30d_not_contains_nocase?: InputMaybe> + lastInterestRateUpdate?: InputMaybe + lastInterestRateUpdate_gt?: InputMaybe + lastInterestRateUpdate_gte?: InputMaybe + lastInterestRateUpdate_in?: InputMaybe> + lastInterestRateUpdate_lt?: InputMaybe + lastInterestRateUpdate_lte?: InputMaybe + lastInterestRateUpdate_not?: InputMaybe + lastInterestRateUpdate_not_in?: InputMaybe> + lendApr?: InputMaybe + lendApr7dAverage?: InputMaybe + lendApr7dAverage_gt?: InputMaybe + lendApr7dAverage_gte?: InputMaybe + lendApr7dAverage_in?: InputMaybe> + lendApr7dAverage_lt?: InputMaybe + lendApr7dAverage_lte?: InputMaybe + lendApr7dAverage_not?: InputMaybe + lendApr7dAverage_not_in?: InputMaybe> + lendApr30dAverage?: InputMaybe + lendApr30dAverage_gt?: InputMaybe + lendApr30dAverage_gte?: InputMaybe + lendApr30dAverage_in?: InputMaybe> + lendApr30dAverage_lt?: InputMaybe + lendApr30dAverage_lte?: InputMaybe + lendApr30dAverage_not?: InputMaybe + lendApr30dAverage_not_in?: InputMaybe> + lendAprHistory30d?: InputMaybe> + lendAprHistory30d_contains?: InputMaybe> + lendAprHistory30d_contains_nocase?: InputMaybe> + lendAprHistory30d_not?: InputMaybe> + lendAprHistory30d_not_contains?: InputMaybe> + lendAprHistory30d_not_contains_nocase?: InputMaybe> + lendApr_gt?: InputMaybe + lendApr_gte?: InputMaybe + lendApr_in?: InputMaybe> + lendApr_lt?: InputMaybe + lendApr_lte?: InputMaybe + lendApr_not?: InputMaybe + lendApr_not_in?: InputMaybe> + lendDailyPercentageRate30dAverage?: InputMaybe + lendDailyPercentageRate30dAverage_gt?: InputMaybe + lendDailyPercentageRate30dAverage_gte?: InputMaybe + lendDailyPercentageRate30dAverage_in?: InputMaybe> + lendDailyPercentageRate30dAverage_lt?: InputMaybe + lendDailyPercentageRate30dAverage_lte?: InputMaybe + lendDailyPercentageRate30dAverage_not?: InputMaybe + lendDailyPercentageRate30dAverage_not_in?: InputMaybe> + lendMonthlyPercentageRate30dAverage?: InputMaybe + lendMonthlyPercentageRate30dAverage_gt?: InputMaybe + lendMonthlyPercentageRate30dAverage_gte?: InputMaybe + lendMonthlyPercentageRate30dAverage_in?: InputMaybe> + lendMonthlyPercentageRate30dAverage_lt?: InputMaybe + lendMonthlyPercentageRate30dAverage_lte?: InputMaybe + lendMonthlyPercentageRate30dAverage_not?: InputMaybe + lendMonthlyPercentageRate30dAverage_not_in?: InputMaybe> + loansCount?: InputMaybe + loansCount_gt?: InputMaybe + loansCount_gte?: InputMaybe + loansCount_in?: InputMaybe> + loansCount_lt?: InputMaybe + loansCount_lte?: InputMaybe + loansCount_not?: InputMaybe + loansCount_not_in?: InputMaybe> + lup?: InputMaybe + lupIndex?: InputMaybe + lupIndex_gt?: InputMaybe + lupIndex_gte?: InputMaybe + lupIndex_in?: InputMaybe> + lupIndex_lt?: InputMaybe + lupIndex_lte?: InputMaybe + lupIndex_not?: InputMaybe + lupIndex_not_in?: InputMaybe> + lup_gt?: InputMaybe + lup_gte?: InputMaybe + lup_in?: InputMaybe> + lup_lt?: InputMaybe + lup_lte?: InputMaybe + lup_not?: InputMaybe + lup_not_in?: InputMaybe> + monthlyPercentageRate30dAverage?: InputMaybe + monthlyPercentageRate30dAverage_gt?: InputMaybe + monthlyPercentageRate30dAverage_gte?: InputMaybe + monthlyPercentageRate30dAverage_in?: InputMaybe> + monthlyPercentageRate30dAverage_lt?: InputMaybe + monthlyPercentageRate30dAverage_lte?: InputMaybe + monthlyPercentageRate30dAverage_not?: InputMaybe + monthlyPercentageRate30dAverage_not_in?: InputMaybe> + name?: InputMaybe + name_contains?: InputMaybe + name_contains_nocase?: InputMaybe + name_ends_with?: InputMaybe + name_ends_with_nocase?: InputMaybe + name_gt?: InputMaybe + name_gte?: InputMaybe + name_in?: InputMaybe> + name_lt?: InputMaybe + name_lte?: InputMaybe + name_not?: InputMaybe + name_not_contains?: InputMaybe + name_not_contains_nocase?: InputMaybe + name_not_ends_with?: InputMaybe + name_not_ends_with_nocase?: InputMaybe + name_not_in?: InputMaybe> + name_not_starts_with?: InputMaybe + name_not_starts_with_nocase?: InputMaybe + name_starts_with?: InputMaybe + name_starts_with_nocase?: InputMaybe + or?: InputMaybe>> + poolActualUtilization?: InputMaybe + poolActualUtilization_gt?: InputMaybe + poolActualUtilization_gte?: InputMaybe + poolActualUtilization_in?: InputMaybe> + poolActualUtilization_lt?: InputMaybe + poolActualUtilization_lte?: InputMaybe + poolActualUtilization_not?: InputMaybe + poolActualUtilization_not_in?: InputMaybe> + poolCollateralization?: InputMaybe + poolCollateralization_gt?: InputMaybe + poolCollateralization_gte?: InputMaybe + poolCollateralization_in?: InputMaybe> + poolCollateralization_lt?: InputMaybe + poolCollateralization_lte?: InputMaybe + poolCollateralization_not?: InputMaybe + poolCollateralization_not_in?: InputMaybe> + poolMinDebtAmount?: InputMaybe + poolMinDebtAmount_gt?: InputMaybe + poolMinDebtAmount_gte?: InputMaybe + poolMinDebtAmount_in?: InputMaybe> + poolMinDebtAmount_lt?: InputMaybe + poolMinDebtAmount_lte?: InputMaybe + poolMinDebtAmount_not?: InputMaybe + poolMinDebtAmount_not_in?: InputMaybe> + poolTargetUtilization?: InputMaybe + poolTargetUtilization_gt?: InputMaybe + poolTargetUtilization_gte?: InputMaybe + poolTargetUtilization_in?: InputMaybe> + poolTargetUtilization_lt?: InputMaybe + poolTargetUtilization_lte?: InputMaybe + poolTargetUtilization_not?: InputMaybe + poolTargetUtilization_not_in?: InputMaybe> + quoteToken?: InputMaybe + quoteTokenAddress?: InputMaybe + quoteTokenAddress_contains?: InputMaybe + quoteTokenAddress_gt?: InputMaybe + quoteTokenAddress_gte?: InputMaybe + quoteTokenAddress_in?: InputMaybe> + quoteTokenAddress_lt?: InputMaybe + quoteTokenAddress_lte?: InputMaybe + quoteTokenAddress_not?: InputMaybe + quoteTokenAddress_not_contains?: InputMaybe + quoteTokenAddress_not_in?: InputMaybe> + quoteTokenScale?: InputMaybe + quoteTokenScale_gt?: InputMaybe + quoteTokenScale_gte?: InputMaybe + quoteTokenScale_in?: InputMaybe> + quoteTokenScale_lt?: InputMaybe + quoteTokenScale_lte?: InputMaybe + quoteTokenScale_not?: InputMaybe + quoteTokenScale_not_in?: InputMaybe> + quoteToken_?: InputMaybe + quoteToken_contains?: InputMaybe + quoteToken_contains_nocase?: InputMaybe + quoteToken_ends_with?: InputMaybe + quoteToken_ends_with_nocase?: InputMaybe + quoteToken_gt?: InputMaybe + quoteToken_gte?: InputMaybe + quoteToken_in?: InputMaybe> + quoteToken_lt?: InputMaybe + quoteToken_lte?: InputMaybe + quoteToken_not?: InputMaybe + quoteToken_not_contains?: InputMaybe + quoteToken_not_contains_nocase?: InputMaybe + quoteToken_not_ends_with?: InputMaybe + quoteToken_not_ends_with_nocase?: InputMaybe + quoteToken_not_in?: InputMaybe> + quoteToken_not_starts_with?: InputMaybe + quoteToken_not_starts_with_nocase?: InputMaybe + quoteToken_starts_with?: InputMaybe + quoteToken_starts_with_nocase?: InputMaybe + reserves?: InputMaybe + reserves_gt?: InputMaybe + reserves_gte?: InputMaybe + reserves_in?: InputMaybe> + reserves_lt?: InputMaybe + reserves_lte?: InputMaybe + reserves_not?: InputMaybe + reserves_not_in?: InputMaybe> + stakedNfts?: InputMaybe> + stakedNfts_?: InputMaybe + stakedNfts_contains?: InputMaybe> + stakedNfts_contains_nocase?: InputMaybe> + stakedNfts_not?: InputMaybe> + stakedNfts_not_contains?: InputMaybe> + stakedNfts_not_contains_nocase?: InputMaybe> + summerDepositAmountEarningInterest?: InputMaybe + summerDepositAmountEarningInterest_gt?: InputMaybe + summerDepositAmountEarningInterest_gte?: InputMaybe + summerDepositAmountEarningInterest_in?: InputMaybe> + summerDepositAmountEarningInterest_lt?: InputMaybe + summerDepositAmountEarningInterest_lte?: InputMaybe + summerDepositAmountEarningInterest_not?: InputMaybe + summerDepositAmountEarningInterest_not_in?: InputMaybe> + t0debt?: InputMaybe + t0debt_gt?: InputMaybe + t0debt_gte?: InputMaybe + t0debt_in?: InputMaybe> + t0debt_lt?: InputMaybe + t0debt_lte?: InputMaybe + t0debt_not?: InputMaybe + t0debt_not_in?: InputMaybe> + timeRemaining?: InputMaybe + timeRemaining_gt?: InputMaybe + timeRemaining_gte?: InputMaybe + timeRemaining_in?: InputMaybe> + timeRemaining_lt?: InputMaybe + timeRemaining_lte?: InputMaybe + timeRemaining_not?: InputMaybe + timeRemaining_not_in?: InputMaybe> + totalAuctionsInPool?: InputMaybe + totalAuctionsInPool_gt?: InputMaybe + totalAuctionsInPool_gte?: InputMaybe + totalAuctionsInPool_in?: InputMaybe> + totalAuctionsInPool_lt?: InputMaybe + totalAuctionsInPool_lte?: InputMaybe + totalAuctionsInPool_not?: InputMaybe + totalAuctionsInPool_not_in?: InputMaybe> +} + +export enum Pool_OrderBy { + AccuredDebt = 'accuredDebt', + Address = 'address', + Apr7dAverage = 'apr7dAverage', + Apr30dAverage = 'apr30dAverage', + AuctionPrice = 'auctionPrice', + BorrowApr = 'borrowApr', + BorrowDailyTokenBlocks = 'borrowDailyTokenBlocks', + BorrowPositions = 'borrowPositions', + Buckets = 'buckets', + ClaimableReserves = 'claimableReserves', + ClaimableReservesRemaining = 'claimableReservesRemaining', + CollateralAddress = 'collateralAddress', + CollateralScale = 'collateralScale', + CollateralToken = 'collateralToken', + CollateralTokenAddress = 'collateralToken__address', + CollateralTokenDecimals = 'collateralToken__decimals', + CollateralTokenId = 'collateralToken__id', + CollateralTokenPrecision = 'collateralToken__precision', + CollateralTokenSymbol = 'collateralToken__symbol', + CurrentBurnEpoch = 'currentBurnEpoch', + DailyPercentageRate30dAverage = 'dailyPercentageRate30dAverage', + Debt = 'debt', + DebtInAuctions = 'debtInAuctions', + DepositSize = 'depositSize', + EarnDailyTokenBlocks = 'earnDailyTokenBlocks', + EarnPositions = 'earnPositions', + Hpb = 'hpb', + HpbIndex = 'hpbIndex', + Htp = 'htp', + HtpIndex = 'htpIndex', + Id = 'id', + InterestRate = 'interestRate', + InterestRatesHistory30d = 'interestRatesHistory30d', + LastInterestRateUpdate = 'lastInterestRateUpdate', + LendApr = 'lendApr', + LendApr7dAverage = 'lendApr7dAverage', + LendApr30dAverage = 'lendApr30dAverage', + LendAprHistory30d = 'lendAprHistory30d', + LendDailyPercentageRate30dAverage = 'lendDailyPercentageRate30dAverage', + LendMonthlyPercentageRate30dAverage = 'lendMonthlyPercentageRate30dAverage', + LoansCount = 'loansCount', + Lup = 'lup', + LupIndex = 'lupIndex', + MonthlyPercentageRate30dAverage = 'monthlyPercentageRate30dAverage', + Name = 'name', + PoolActualUtilization = 'poolActualUtilization', + PoolCollateralization = 'poolCollateralization', + PoolMinDebtAmount = 'poolMinDebtAmount', + PoolTargetUtilization = 'poolTargetUtilization', + QuoteToken = 'quoteToken', + QuoteTokenAddress = 'quoteTokenAddress', + QuoteTokenScale = 'quoteTokenScale', + // QuoteTokenAddress = 'quoteToken__address', + QuoteTokenDecimals = 'quoteToken__decimals', + QuoteTokenId = 'quoteToken__id', + QuoteTokenPrecision = 'quoteToken__precision', + QuoteTokenSymbol = 'quoteToken__symbol', + Reserves = 'reserves', + StakedNfts = 'stakedNfts', + SummerDepositAmountEarningInterest = 'summerDepositAmountEarningInterest', + T0debt = 't0debt', + TimeRemaining = 'timeRemaining', + TotalAuctionsInPool = 'totalAuctionsInPool', +} + +export type Query = { + __typename?: 'Query' + /** Access to subgraph metadata */ + _meta?: Maybe<_Meta_> + account?: Maybe + accounts: Array + assetSwap?: Maybe + assetSwaps: Array + auction?: Maybe + auctions: Array + borrowDailyReward?: Maybe + borrowDailyRewards: Array + borrowPosition?: Maybe + borrowPositions: Array + borrowerEvent?: Maybe + borrowerEvents: Array + bucket?: Maybe + buckets: Array + claimed?: Maybe + claimeds: Array + createPositionEvent?: Maybe + createPositionEvents: Array + day?: Maybe + days: Array + earnDailyReward?: Maybe + earnDailyRewards: Array + earnPosition?: Maybe + earnPositionBucket?: Maybe + earnPositionBuckets: Array + earnPositions: Array + feePaid?: Maybe + feePaids: Array + interestRate?: Maybe + interestRates: Array + lenderEvent?: Maybe + lenderEvents: Array + listOfPool?: Maybe + listOfPools: Array + nft?: Maybe + nfts: Array + oasisEvent?: Maybe + oasisEvents: Array + permission?: Maybe + permissions: Array + pool?: Maybe + pools: Array + slippageSaved?: Maybe + slippageSaveds: Array + state?: Maybe + states: Array + token?: Maybe + tokens: Array + transfer?: Maybe + transfers: Array + user?: Maybe + users: Array + week?: Maybe + weeks: Array +} + +export type Query_MetaArgs = { + block?: InputMaybe +} + +export type QueryAccountArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryAccountsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryAssetSwapArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryAssetSwapsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryAuctionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryAuctionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryBorrowDailyRewardArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryBorrowDailyRewardsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryBorrowPositionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryBorrowPositionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryBorrowerEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryBorrowerEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryBucketArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryBucketsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryClaimedArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryClaimedsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryCreatePositionEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryCreatePositionEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryDayArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryDaysArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryEarnDailyRewardArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryEarnDailyRewardsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryEarnPositionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryEarnPositionBucketArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryEarnPositionBucketsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryEarnPositionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryFeePaidArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryFeePaidsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryInterestRateArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryInterestRatesArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryLenderEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryLenderEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryListOfPoolArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryListOfPoolsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryNftArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryNftsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryOasisEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryOasisEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryPermissionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryPermissionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryPoolArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryPoolsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QuerySlippageSavedArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QuerySlippageSavedsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryStateArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryStatesArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryTokenArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryTokensArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryTransferArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryTransfersArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryUserArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryUsersArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type QueryWeekArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type QueryWeeksArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SlippageSaved = { + __typename?: 'SlippageSaved' + actualAmount: Scalars['BigInt']['output'] + /** + * id is a tx_hash-actionLogIndex + * it uses action log index to easily combine all swap events into one + * + */ + id: Scalars['Bytes']['output'] + minimumPossible: Scalars['BigInt']['output'] +} + +export type SlippageSaved_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + actualAmount?: InputMaybe + actualAmount_gt?: InputMaybe + actualAmount_gte?: InputMaybe + actualAmount_in?: InputMaybe> + actualAmount_lt?: InputMaybe + actualAmount_lte?: InputMaybe + actualAmount_not?: InputMaybe + actualAmount_not_in?: InputMaybe> + and?: InputMaybe>> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + minimumPossible?: InputMaybe + minimumPossible_gt?: InputMaybe + minimumPossible_gte?: InputMaybe + minimumPossible_in?: InputMaybe> + minimumPossible_lt?: InputMaybe + minimumPossible_lte?: InputMaybe + minimumPossible_not?: InputMaybe + minimumPossible_not_in?: InputMaybe> + or?: InputMaybe>> +} + +export enum SlippageSaved_OrderBy { + ActualAmount = 'actualAmount', + Id = 'id', + MinimumPossible = 'minimumPossible', +} + +export type State = { + __typename?: 'State' + id: Scalars['Bytes']['output'] + lastDay?: Maybe + lastWeek?: Maybe +} + +export type State_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + and?: InputMaybe>> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + lastDay?: InputMaybe + lastDay_gt?: InputMaybe + lastDay_gte?: InputMaybe + lastDay_in?: InputMaybe> + lastDay_lt?: InputMaybe + lastDay_lte?: InputMaybe + lastDay_not?: InputMaybe + lastDay_not_in?: InputMaybe> + lastWeek?: InputMaybe + lastWeek_gt?: InputMaybe + lastWeek_gte?: InputMaybe + lastWeek_in?: InputMaybe> + lastWeek_lt?: InputMaybe + lastWeek_lte?: InputMaybe + lastWeek_not?: InputMaybe + lastWeek_not_in?: InputMaybe> + or?: InputMaybe>> +} + +export enum State_OrderBy { + Id = 'id', + LastDay = 'lastDay', + LastWeek = 'lastWeek', +} + +export type Subscription = { + __typename?: 'Subscription' + /** Access to subgraph metadata */ + _meta?: Maybe<_Meta_> + account?: Maybe + accounts: Array + assetSwap?: Maybe + assetSwaps: Array + auction?: Maybe + auctions: Array + borrowDailyReward?: Maybe + borrowDailyRewards: Array + borrowPosition?: Maybe + borrowPositions: Array + borrowerEvent?: Maybe + borrowerEvents: Array + bucket?: Maybe + buckets: Array + claimed?: Maybe + claimeds: Array + createPositionEvent?: Maybe + createPositionEvents: Array + day?: Maybe + days: Array + earnDailyReward?: Maybe + earnDailyRewards: Array + earnPosition?: Maybe + earnPositionBucket?: Maybe + earnPositionBuckets: Array + earnPositions: Array + feePaid?: Maybe + feePaids: Array + interestRate?: Maybe + interestRates: Array + lenderEvent?: Maybe + lenderEvents: Array + listOfPool?: Maybe + listOfPools: Array + nft?: Maybe + nfts: Array + oasisEvent?: Maybe + oasisEvents: Array + permission?: Maybe + permissions: Array + pool?: Maybe + pools: Array + slippageSaved?: Maybe + slippageSaveds: Array + state?: Maybe + states: Array + token?: Maybe + tokens: Array + transfer?: Maybe + transfers: Array + user?: Maybe + users: Array + week?: Maybe + weeks: Array +} + +export type Subscription_MetaArgs = { + block?: InputMaybe +} + +export type SubscriptionAccountArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionAccountsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionAssetSwapArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionAssetSwapsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionAuctionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionAuctionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionBorrowDailyRewardArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionBorrowDailyRewardsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionBorrowPositionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionBorrowPositionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionBorrowerEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionBorrowerEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionBucketArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionBucketsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionClaimedArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionClaimedsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionCreatePositionEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionCreatePositionEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionDayArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionDaysArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionEarnDailyRewardArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionEarnDailyRewardsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionEarnPositionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionEarnPositionBucketArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionEarnPositionBucketsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionEarnPositionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionFeePaidArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionFeePaidsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionInterestRateArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionInterestRatesArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionLenderEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionLenderEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionListOfPoolArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionListOfPoolsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionNftArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionNftsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionOasisEventArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionOasisEventsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionPermissionArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionPermissionsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionPoolArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionPoolsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionSlippageSavedArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionSlippageSavedsArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionStateArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionStatesArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionTokenArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionTokensArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionTransferArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionTransfersArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionUserArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionUsersArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type SubscriptionWeekArgs = { + block?: InputMaybe + id: Scalars['ID']['input'] + subgraphError?: _SubgraphErrorPolicy_ +} + +export type SubscriptionWeeksArgs = { + block?: InputMaybe + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + subgraphError?: _SubgraphErrorPolicy_ + where?: InputMaybe +} + +export type Token = { + __typename?: 'Token' + address: Scalars['Bytes']['output'] + decimals: Scalars['BigInt']['output'] + id: Scalars['Bytes']['output'] + precision: Scalars['BigInt']['output'] + symbol: Scalars['String']['output'] +} + +export type Token_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + address?: InputMaybe + address_contains?: InputMaybe + address_gt?: InputMaybe + address_gte?: InputMaybe + address_in?: InputMaybe> + address_lt?: InputMaybe + address_lte?: InputMaybe + address_not?: InputMaybe + address_not_contains?: InputMaybe + address_not_in?: InputMaybe> + and?: InputMaybe>> + decimals?: InputMaybe + decimals_gt?: InputMaybe + decimals_gte?: InputMaybe + decimals_in?: InputMaybe> + decimals_lt?: InputMaybe + decimals_lte?: InputMaybe + decimals_not?: InputMaybe + decimals_not_in?: InputMaybe> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + precision?: InputMaybe + precision_gt?: InputMaybe + precision_gte?: InputMaybe + precision_in?: InputMaybe> + precision_lt?: InputMaybe + precision_lte?: InputMaybe + precision_not?: InputMaybe + precision_not_in?: InputMaybe> + symbol?: InputMaybe + symbol_contains?: InputMaybe + symbol_contains_nocase?: InputMaybe + symbol_ends_with?: InputMaybe + symbol_ends_with_nocase?: InputMaybe + symbol_gt?: InputMaybe + symbol_gte?: InputMaybe + symbol_in?: InputMaybe> + symbol_lt?: InputMaybe + symbol_lte?: InputMaybe + symbol_not?: InputMaybe + symbol_not_contains?: InputMaybe + symbol_not_contains_nocase?: InputMaybe + symbol_not_ends_with?: InputMaybe + symbol_not_ends_with_nocase?: InputMaybe + symbol_not_in?: InputMaybe> + symbol_not_starts_with?: InputMaybe + symbol_not_starts_with_nocase?: InputMaybe + symbol_starts_with?: InputMaybe + symbol_starts_with_nocase?: InputMaybe +} + +export enum Token_OrderBy { + Address = 'address', + Decimals = 'decimals', + Id = 'id', + Precision = 'precision', + Symbol = 'symbol', +} + +export type Transfer = { + __typename?: 'Transfer' + amount: Scalars['BigDecimal']['output'] + amountUSD: Scalars['BigDecimal']['output'] + event: OasisEvent + from: Scalars['Bytes']['output'] + id: Scalars['Bytes']['output'] + priceInUSD: Scalars['BigDecimal']['output'] + to: Scalars['Bytes']['output'] + token: Scalars['Bytes']['output'] + txHash: Scalars['String']['output'] +} + +export type Transfer_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + amount?: InputMaybe + amountUSD?: InputMaybe + amountUSD_gt?: InputMaybe + amountUSD_gte?: InputMaybe + amountUSD_in?: InputMaybe> + amountUSD_lt?: InputMaybe + amountUSD_lte?: InputMaybe + amountUSD_not?: InputMaybe + amountUSD_not_in?: InputMaybe> + amount_gt?: InputMaybe + amount_gte?: InputMaybe + amount_in?: InputMaybe> + amount_lt?: InputMaybe + amount_lte?: InputMaybe + amount_not?: InputMaybe + amount_not_in?: InputMaybe> + and?: InputMaybe>> + event?: InputMaybe + event_?: InputMaybe + event_contains?: InputMaybe + event_contains_nocase?: InputMaybe + event_ends_with?: InputMaybe + event_ends_with_nocase?: InputMaybe + event_gt?: InputMaybe + event_gte?: InputMaybe + event_in?: InputMaybe> + event_lt?: InputMaybe + event_lte?: InputMaybe + event_not?: InputMaybe + event_not_contains?: InputMaybe + event_not_contains_nocase?: InputMaybe + event_not_ends_with?: InputMaybe + event_not_ends_with_nocase?: InputMaybe + event_not_in?: InputMaybe> + event_not_starts_with?: InputMaybe + event_not_starts_with_nocase?: InputMaybe + event_starts_with?: InputMaybe + event_starts_with_nocase?: InputMaybe + from?: InputMaybe + from_contains?: InputMaybe + from_gt?: InputMaybe + from_gte?: InputMaybe + from_in?: InputMaybe> + from_lt?: InputMaybe + from_lte?: InputMaybe + from_not?: InputMaybe + from_not_contains?: InputMaybe + from_not_in?: InputMaybe> + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + priceInUSD?: InputMaybe + priceInUSD_gt?: InputMaybe + priceInUSD_gte?: InputMaybe + priceInUSD_in?: InputMaybe> + priceInUSD_lt?: InputMaybe + priceInUSD_lte?: InputMaybe + priceInUSD_not?: InputMaybe + priceInUSD_not_in?: InputMaybe> + to?: InputMaybe + to_contains?: InputMaybe + to_gt?: InputMaybe + to_gte?: InputMaybe + to_in?: InputMaybe> + to_lt?: InputMaybe + to_lte?: InputMaybe + to_not?: InputMaybe + to_not_contains?: InputMaybe + to_not_in?: InputMaybe> + token?: InputMaybe + token_contains?: InputMaybe + token_gt?: InputMaybe + token_gte?: InputMaybe + token_in?: InputMaybe> + token_lt?: InputMaybe + token_lte?: InputMaybe + token_not?: InputMaybe + token_not_contains?: InputMaybe + token_not_in?: InputMaybe> + txHash?: InputMaybe + txHash_contains?: InputMaybe + txHash_contains_nocase?: InputMaybe + txHash_ends_with?: InputMaybe + txHash_ends_with_nocase?: InputMaybe + txHash_gt?: InputMaybe + txHash_gte?: InputMaybe + txHash_in?: InputMaybe> + txHash_lt?: InputMaybe + txHash_lte?: InputMaybe + txHash_not?: InputMaybe + txHash_not_contains?: InputMaybe + txHash_not_contains_nocase?: InputMaybe + txHash_not_ends_with?: InputMaybe + txHash_not_ends_with_nocase?: InputMaybe + txHash_not_in?: InputMaybe> + txHash_not_starts_with?: InputMaybe + txHash_not_starts_with_nocase?: InputMaybe + txHash_starts_with?: InputMaybe + txHash_starts_with_nocase?: InputMaybe +} + +export enum Transfer_OrderBy { + Amount = 'amount', + AmountUsd = 'amountUSD', + Event = 'event', + EventAddOrRemoveIndex = 'event__addOrRemoveIndex', + EventBlockNumber = 'event__blockNumber', + EventCollateralAddress = 'event__collateralAddress', + EventCollateralAfter = 'event__collateralAfter', + EventCollateralBefore = 'event__collateralBefore', + EventCollateralDelta = 'event__collateralDelta', + EventCollateralLpsRemoved = 'event__collateralLpsRemoved', + EventCollateralOraclePrice = 'event__collateralOraclePrice', + EventCollateralTokenPriceUsd = 'event__collateralTokenPriceUSD', + EventDebtAddress = 'event__debtAddress', + EventDebtAfter = 'event__debtAfter', + EventDebtBefore = 'event__debtBefore', + EventDebtDelta = 'event__debtDelta', + EventDebtOraclePrice = 'event__debtOraclePrice', + EventDebtTokenPriceUsd = 'event__debtTokenPriceUSD', + EventDepositedInQuoteToken = 'event__depositedInQuoteToken', + EventDepositedUsd = 'event__depositedUSD', + EventEthPrice = 'event__ethPrice', + EventGasFeeInCollateralToken = 'event__gasFeeInCollateralToken', + EventGasFeeInQuoteToken = 'event__gasFeeInQuoteToken', + EventGasFeeUsd = 'event__gasFeeUSD', + EventGasPrice = 'event__gasPrice', + EventGasUsed = 'event__gasUsed', + EventId = 'event__id', + EventInterestRate = 'event__interestRate', + EventIsOpen = 'event__isOpen', + EventKind = 'event__kind', + EventLiquidationPriceAfter = 'event__liquidationPriceAfter', + EventLiquidationPriceBefore = 'event__liquidationPriceBefore', + EventLtvAfter = 'event__ltvAfter', + EventLtvBefore = 'event__ltvBefore', + EventMarketPrice = 'event__marketPrice', + EventMoveQuoteFromIndex = 'event__moveQuoteFromIndex', + EventMoveQuoteToIndex = 'event__moveQuoteToIndex', + EventMultipleAfter = 'event__multipleAfter', + EventMultipleBefore = 'event__multipleBefore', + EventNetValueAfter = 'event__netValueAfter', + EventNetValueBefore = 'event__netValueBefore', + EventOasisFee = 'event__oasisFee', + EventOasisFeeInCollateralToken = 'event__oasisFeeInCollateralToken', + EventOasisFeeInQuoteToken = 'event__oasisFeeInQuoteToken', + EventOasisFeeToken = 'event__oasisFeeToken', + EventOasisFeeUsd = 'event__oasisFeeUSD', + EventOriginationFee = 'event__originationFee', + EventOriginationFeeInCollateralToken = 'event__originationFeeInCollateralToken', + EventOriginationFeeInQuoteToken = 'event__originationFeeInQuoteToken', + EventOriginationFeeUsd = 'event__originationFeeUSD', + EventQuoteTokensAfter = 'event__quoteTokensAfter', + EventQuoteTokensBefore = 'event__quoteTokensBefore', + EventQuoteTokensDelta = 'event__quoteTokensDelta', + EventQuoteTokensMoved = 'event__quoteTokensMoved', + EventSwapFromAmount = 'event__swapFromAmount', + EventSwapFromToken = 'event__swapFromToken', + EventSwapToAmount = 'event__swapToAmount', + EventSwapToToken = 'event__swapToToken', + EventTimestamp = 'event__timestamp', + EventTotalFee = 'event__totalFee', + EventTotalFeeInCollateralToken = 'event__totalFeeInCollateralToken', + EventTotalFeeInQuoteToken = 'event__totalFeeInQuoteToken', + EventTotalFeeUsd = 'event__totalFeeUSD', + EventTxHash = 'event__txHash', + EventWithdrawnInQuoteToken = 'event__withdrawnInQuoteToken', + EventWithdrawnUsd = 'event__withdrawnUSD', + From = 'from', + Id = 'id', + PriceInUsd = 'priceInUSD', + To = 'to', + Token = 'token', + TxHash = 'txHash', +} + +export type User = { + __typename?: 'User' + address: Scalars['Bytes']['output'] + borrowPositions?: Maybe> + earnPositions?: Maybe> + id: Scalars['Bytes']['output'] + nfts?: Maybe> + oasisAjnaRewardClaims?: Maybe> + permittedProxys?: Maybe> + proxys?: Maybe> + vaultCount: Scalars['BigInt']['output'] +} + +export type UserBorrowPositionsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type UserEarnPositionsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type UserNftsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type UserOasisAjnaRewardClaimsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type UserPermittedProxysArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type UserProxysArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type User_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + address?: InputMaybe + address_contains?: InputMaybe + address_gt?: InputMaybe + address_gte?: InputMaybe + address_in?: InputMaybe> + address_lt?: InputMaybe + address_lte?: InputMaybe + address_not?: InputMaybe + address_not_contains?: InputMaybe + address_not_in?: InputMaybe> + and?: InputMaybe>> + borrowPositions_?: InputMaybe + earnPositions_?: InputMaybe + id?: InputMaybe + id_contains?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_contains?: InputMaybe + id_not_in?: InputMaybe> + nfts_?: InputMaybe + oasisAjnaRewardClaims_?: InputMaybe + or?: InputMaybe>> + permittedProxys_?: InputMaybe + proxys_?: InputMaybe + vaultCount?: InputMaybe + vaultCount_gt?: InputMaybe + vaultCount_gte?: InputMaybe + vaultCount_in?: InputMaybe> + vaultCount_lt?: InputMaybe + vaultCount_lte?: InputMaybe + vaultCount_not?: InputMaybe + vaultCount_not_in?: InputMaybe> +} + +export enum User_OrderBy { + Address = 'address', + BorrowPositions = 'borrowPositions', + EarnPositions = 'earnPositions', + Id = 'id', + Nfts = 'nfts', + OasisAjnaRewardClaims = 'oasisAjnaRewardClaims', + PermittedProxys = 'permittedProxys', + Proxys = 'proxys', + VaultCount = 'vaultCount', +} + +export type Week = { + __typename?: 'Week' + borrowWeeklyRewards?: Maybe> + days: Array + earnWeeklyRewards?: Maybe> + id: Scalars['ID']['output'] + week: Scalars['BigInt']['output'] + weekEndTimestamp?: Maybe + weekStartTimestamp: Scalars['BigInt']['output'] +} + +export type WeekBorrowWeeklyRewardsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type WeekDaysArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type WeekEarnWeeklyRewardsArgs = { + first?: InputMaybe + orderBy?: InputMaybe + orderDirection?: InputMaybe + skip?: InputMaybe + where?: InputMaybe +} + +export type Week_Filter = { + /** Filter for the block changed event. */ + _change_block?: InputMaybe + and?: InputMaybe>> + borrowWeeklyRewards_?: InputMaybe + days_?: InputMaybe + earnWeeklyRewards_?: InputMaybe + id?: InputMaybe + id_gt?: InputMaybe + id_gte?: InputMaybe + id_in?: InputMaybe> + id_lt?: InputMaybe + id_lte?: InputMaybe + id_not?: InputMaybe + id_not_in?: InputMaybe> + or?: InputMaybe>> + week?: InputMaybe + weekEndTimestamp?: InputMaybe + weekEndTimestamp_gt?: InputMaybe + weekEndTimestamp_gte?: InputMaybe + weekEndTimestamp_in?: InputMaybe> + weekEndTimestamp_lt?: InputMaybe + weekEndTimestamp_lte?: InputMaybe + weekEndTimestamp_not?: InputMaybe + weekEndTimestamp_not_in?: InputMaybe> + weekStartTimestamp?: InputMaybe + weekStartTimestamp_gt?: InputMaybe + weekStartTimestamp_gte?: InputMaybe + weekStartTimestamp_in?: InputMaybe> + weekStartTimestamp_lt?: InputMaybe + weekStartTimestamp_lte?: InputMaybe + weekStartTimestamp_not?: InputMaybe + weekStartTimestamp_not_in?: InputMaybe> + week_gt?: InputMaybe + week_gte?: InputMaybe + week_in?: InputMaybe> + week_lt?: InputMaybe + week_lte?: InputMaybe + week_not?: InputMaybe + week_not_in?: InputMaybe> +} + +export enum Week_OrderBy { + BorrowWeeklyRewards = 'borrowWeeklyRewards', + Days = 'days', + EarnWeeklyRewards = 'earnWeeklyRewards', + Id = 'id', + Week = 'week', + WeekEndTimestamp = 'weekEndTimestamp', + WeekStartTimestamp = 'weekStartTimestamp', +} + +export type _Block_ = { + __typename?: '_Block_' + /** The hash of the block */ + hash?: Maybe + /** The block number */ + number: Scalars['Int']['output'] + /** The hash of the parent block */ + parentHash?: Maybe + /** Integer representation of the timestamp stored in blocks for the chain */ + timestamp?: Maybe +} + +/** The type for the top-level _meta field */ +export type _Meta_ = { + __typename?: '_Meta_' + /** + * Information about a specific subgraph block. The hash of the block + * will be null if the _meta field has a block constraint that asks for + * a block number. It will be filled if the _meta field has no block constraint + * and therefore asks for the latest block + * + */ + block: _Block_ + /** The deployment ID */ + deployment: Scalars['String']['output'] + /** If `true`, the subgraph encountered indexing errors at some past block */ + hasIndexingErrors: Scalars['Boolean']['output'] +} + +export enum _SubgraphErrorPolicy_ { + /** Data will be returned even if the subgraph has indexing errors */ + Allow = 'allow', + /** If the subgraph has indexing errors, data will be omitted. The default. */ + Deny = 'deny', +} + +export type GetPositionQueryVariables = Exact<{ + id: Scalars['ID']['input'] +}> + +export type GetPositionQuery = { + __typename?: 'Query' + earnPosition?: { + __typename?: 'EarnPosition' + oasisEvents?: Array<{ + __typename?: 'OasisEvent' + kind: string + blockNumber: bigint + timestamp: bigint + swapToToken?: string | null + swapToAmount?: string | null + swapFromToken?: string | null + swapFromAmount?: string | null + collateralBefore: string + collateralAfter: string + collateralDelta: string + debtBefore: string + debtAfter: string + debtDelta: string + collateralToken?: { + __typename?: 'Token' + address: string + symbol: string + decimals: bigint + } | null + debtToken?: { __typename?: 'Token'; address: string; symbol: string; decimals: bigint } | null + }> | null + } | null +} + +export const GetPositionDocument = gql` + query GetPosition($id: ID!) { + earnPosition(id: $id) { + oasisEvents(first: 10000, orderBy: blockNumber, orderDirection: desc) { + kind + blockNumber + timestamp + collateralToken { + address + symbol + decimals + } + debtToken { + address + symbol + decimals + } + swapToToken + swapToAmount + swapFromToken + swapFromAmount + collateralBefore + collateralAfter + collateralDelta + debtBefore + debtAfter + debtDelta + } + } + } +` + +export type SdkFunctionWrapper = ( + action: (requestHeaders?: Record) => Promise, + operationName: string, + operationType?: string, + variables?: any, +) => Promise + +const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, _variables) => + action() + +export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { + return { + GetPosition( + variables: GetPositionQueryVariables, + requestHeaders?: GraphQLClientRequestHeaders, + ): Promise { + return withWrapper( + (wrappedRequestHeaders) => + client.request(GetPositionDocument, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'GetPosition', + 'query', + variables, + ) + }, + } +} +export type Sdk = ReturnType diff --git a/packages/dma-library/src/utils/fee-service/getEarnMultiplyFee.ts b/packages/dma-library/src/utils/fee-service/getEarnMultiplyFee.ts new file mode 100644 index 000000000..8048cc396 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/getEarnMultiplyFee.ts @@ -0,0 +1,40 @@ +import type { Network } from '@deploy-configurations/types/network' + +import { calculateFee } from './calculateFee' +import { createGraphQLClient } from './createGraphQLClient' +import { ProtocolId } from './ProtocolId' +import type { OasisPosition } from './types' + +export const getEarnMultiplyFee = async ({ + network: network, + protocolId, + proxyAddress, +}: { + network: Network + protocolId: ProtocolId + proxyAddress: string +}) => { + //set envs + const { SUBGRAPH_BASE: subgraphBase = process.env.SUBGRAPH_BASE } = process.env || {} + + if (!subgraphBase) { + throw new Error('Missing subgraphBase env in the running env') + } + + let position: OasisPosition | undefined + try { + const subgraphClient = createGraphQLClient(network, protocolId, subgraphBase) + position = await subgraphClient.GetPosition(proxyAddress) + } catch (error) { + throw new Error( + `Error fetching position with proxyAddress (${proxyAddress}) and protocol ${protocolId}`, + ) + } + + if (!position) { + throw Error(`Position with proxyAddress (${proxyAddress}) and protocol ${protocolId} not found`) + } + + const fee = calculateFee(position) + return fee +} diff --git a/packages/dma-library/src/utils/fee-service/getPositionData.ts b/packages/dma-library/src/utils/fee-service/getPositionData.ts new file mode 100644 index 000000000..30e6dfb8d --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/getPositionData.ts @@ -0,0 +1,18 @@ +import type { Network } from '@deploy-configurations/types/network' +import type { Address } from '@dma-common/types' +import type { AaveLikeProtocol } from '@dma-library/types/aave-like/aave-like-protocol-enum' + +import type { getEarnMultiplyFee } from './getEarnMultiplyFee' +import { ProtocolId } from './ProtocolId' + +export const getPositionDataAaveLike = (dependencies: { + proxy: Address + network: Network + protocolType: AaveLikeProtocol +}): Parameters[0] => { + return { + network: dependencies.network, + protocolId: ProtocolId[dependencies.protocolType], + proxyAddress: dependencies.proxy, + } +} diff --git a/packages/dma-library/src/utils/fee-service/index.ts b/packages/dma-library/src/utils/fee-service/index.ts new file mode 100644 index 000000000..b469effc0 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/index.ts @@ -0,0 +1 @@ +export { getPositionDataAaveLike } from './getPositionData' diff --git a/packages/dma-library/src/utils/fee-service/interfaces.ts b/packages/dma-library/src/utils/fee-service/interfaces.ts new file mode 100644 index 000000000..164989d85 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/interfaces.ts @@ -0,0 +1,5 @@ +import type { OasisPosition } from './types' + +export interface IFeeManagerClient { + GetPosition(proxyAddress: string): Promise +} diff --git a/packages/dma-library/src/utils/fee-service/isCloseEvent.ts b/packages/dma-library/src/utils/fee-service/isCloseEvent.ts new file mode 100644 index 000000000..0d7fb0353 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/isCloseEvent.ts @@ -0,0 +1,6 @@ +import { supportedCloseEvents } from './constants' +const regex = new RegExp(supportedCloseEvents.join('|')) + +export const isCloseEvent = (event: { kind: string }): boolean => { + return regex.test(event.kind) +} diff --git a/packages/dma-library/src/utils/fee-service/isDeriskEvent.ts b/packages/dma-library/src/utils/fee-service/isDeriskEvent.ts new file mode 100644 index 000000000..fa7edfd04 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/isDeriskEvent.ts @@ -0,0 +1,6 @@ +import { supportedDeriskEvents } from './constants' +const regex = new RegExp(supportedDeriskEvents.join('|')) + +export const isDeriskEvent = (event: { kind: string }): boolean => { + return regex.test(event.kind) +} diff --git a/packages/dma-library/src/utils/fee-service/isOpenEvent.ts b/packages/dma-library/src/utils/fee-service/isOpenEvent.ts new file mode 100644 index 000000000..ae939a7fb --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/isOpenEvent.ts @@ -0,0 +1,6 @@ +import { supportedOpenEvents } from './constants' +const regex = new RegExp(supportedOpenEvents.join('|')) + +export const isOpenEvent = (event: { kind: string }): boolean => { + return regex.test(event.kind) +} diff --git a/packages/dma-library/src/utils/fee-service/isWithdrawEvent.ts b/packages/dma-library/src/utils/fee-service/isWithdrawEvent.ts new file mode 100644 index 000000000..8378fcd82 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/isWithdrawEvent.ts @@ -0,0 +1,6 @@ +import { supportedWithdrawEvents } from './constants' +const regex = new RegExp(supportedWithdrawEvents.join('|')) + +export const isWithdrawEvent = (event: { kind: string }): boolean => { + return regex.test(event.kind) +} diff --git a/packages/dma-library/src/utils/fee-service/queries/aave-like.graphql b/packages/dma-library/src/utils/fee-service/queries/aave-like.graphql new file mode 100644 index 000000000..e696446b8 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/queries/aave-like.graphql @@ -0,0 +1,29 @@ +query GetPosition($id: ID!) { + position(id: $id) { + events(first: 10000, orderBy: blockNumber, orderDirection: desc) { + kind + blockNumber + timestamp + collateralToken { + address + symbol + decimals + } + debtToken { + address + symbol + decimals + } + swapToToken + swapToAmount + swapFromToken + swapFromAmount + collateralBefore + collateralAfter + collateralDelta + debtBefore + debtAfter + debtDelta + } + } +} diff --git a/packages/dma-library/src/utils/fee-service/queries/ajna-v2.graphql b/packages/dma-library/src/utils/fee-service/queries/ajna-v2.graphql new file mode 100644 index 000000000..acee8bb22 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/queries/ajna-v2.graphql @@ -0,0 +1,29 @@ +query GetPosition($id: ID!) { + earnPosition(id: $id) { + oasisEvents(first: 10000, orderBy: blockNumber, orderDirection: desc) { + kind + blockNumber + timestamp + collateralToken { + address + symbol + decimals + } + debtToken { + address + symbol + decimals + } + swapToToken + swapToAmount + swapFromToken + swapFromAmount + collateralBefore + collateralAfter + collateralDelta + debtBefore + debtAfter + debtDelta + } + } +} diff --git a/packages/dma-library/src/utils/fee-service/types.ts b/packages/dma-library/src/utils/fee-service/types.ts new file mode 100644 index 000000000..a7066d332 --- /dev/null +++ b/packages/dma-library/src/utils/fee-service/types.ts @@ -0,0 +1,17 @@ +export type OasisPosition = { + events: OasisEvent[] +} + +export type OasisEvent = { + kind: string + timestamp: bigint + swapFromToken?: string | null + swapToToken?: string | null + swapFromAmount?: string | null + swapToAmount?: string | null + debtToken?: { + address: string + symbol: string + decimals: bigint + } | null +} diff --git a/packages/dma-library/src/utils/swap/calculate-swap-fee-amount.ts b/packages/dma-library/src/utils/swap/calculate-swap-fee-amount.ts index b2aede3cc..e14670e6e 100644 --- a/packages/dma-library/src/utils/swap/calculate-swap-fee-amount.ts +++ b/packages/dma-library/src/utils/swap/calculate-swap-fee-amount.ts @@ -1,32 +1,77 @@ -import { DEFAULT_FEE, ZERO } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { DEFAULT_FEE, FEE_ESTIMATE_INFLATOR, ONE, ZERO } from '@dma-common/constants' +import { calculateFixedFee, calculatePercentageFee } from '@dma-common/utils/swap' +import { SwapFeeType } from '@dma-library/types' import BigNumber from 'bignumber.js' +/** + * Calculate the fee amount after the swap + */ export function calculatePostSwapFeeAmount( collectFeeFrom: 'sourceToken' | 'targetToken' | undefined, toTokenAmount: BigNumber, fee: BigNumber = new BigNumber(DEFAULT_FEE), + feeType: SwapFeeType, ) { - return collectFeeFrom === 'targetToken' ? calculateFee(toTokenAmount, fee.toNumber()) : ZERO + // if source token for post swap return zero + if (collectFeeFrom === 'sourceToken') { + return ZERO + } + + if (feeType === SwapFeeType.Fixed) { + return calculateFixedFee(toTokenAmount, fee.toString()) + } else { + return calculatePercentageFee(toTokenAmount, fee.toNumber()) + } } +/** + * Calculate the fee amount before the swap + */ export function calculatePreSwapFeeAmount( collectFeeFrom: 'sourceToken' | 'targetToken' | undefined, swapAmountBeforeFees: BigNumber, fee: BigNumber = new BigNumber(DEFAULT_FEE), + feeType: SwapFeeType, ) { - return collectFeeFrom === 'sourceToken' - ? calculateFee(swapAmountBeforeFees, fee.toNumber()) - : ZERO + // if target token for pre swap return zero + if (collectFeeFrom === 'targetToken') { + return ZERO + } + + if (feeType === SwapFeeType.Fixed) { + return calculateFixedFee(swapAmountBeforeFees, fee.toString()) + } else { + return calculatePercentageFee(swapAmountBeforeFees, fee.toNumber()) + } } +/** + * Calculate fee amount for the swap, based on the fee type + * and pre or post swap fees + */ export function calculateSwapFeeAmount( collectFeeFrom: 'sourceToken' | 'targetToken' | undefined, swapAmountBeforeFees: BigNumber, toTokenAmount: BigNumber, fee: BigNumber = new BigNumber(DEFAULT_FEE), + feeType: SwapFeeType, ) { - const feeAmount = calculatePreSwapFeeAmount(collectFeeFrom, swapAmountBeforeFees, fee) - const postSwapFeeAmount = calculatePostSwapFeeAmount(collectFeeFrom, toTokenAmount, fee) - return feeAmount.plus(postSwapFeeAmount) + const preSwapFee = calculatePreSwapFeeAmount(collectFeeFrom, swapAmountBeforeFees, fee, feeType) + const postSwapFee = calculatePostSwapFeeAmount(collectFeeFrom, toTokenAmount, fee, feeType) + return preSwapFee.plus(postSwapFee) +} + +/** + * Calculate the inflated token fee amount + */ +export function calculateInflatedTokenFee({ + preSwapFee, + postSwapFee, +}: { + preSwapFee: BigNumber + postSwapFee: BigNumber +}) { + return preSwapFee.plus( + postSwapFee.times(ONE.plus(FEE_ESTIMATE_INFLATOR)).integerValue(BigNumber.ROUND_DOWN), + ) } diff --git a/packages/dma-library/src/utils/swap/fee-resolver.ts b/packages/dma-library/src/utils/swap/fee-resolver.ts index 6069f5d51..e5ddfebe8 100644 --- a/packages/dma-library/src/utils/swap/fee-resolver.ts +++ b/packages/dma-library/src/utils/swap/fee-resolver.ts @@ -1,162 +1,39 @@ -import { DEFAULT_FEE, LOW_CORRELATED_ASSET_FEE, NO_FEE } from '@dma-common/constants' +import type { Network } from '@deploy-configurations/types/network' +import { SwapFeeType } from '@dma-library/types' import BigNumber from 'bignumber.js' -export const feeResolver = ( +import { getEarnMultiplyFee } from '../fee-service/getEarnMultiplyFee' +import { ProtocolId } from '../fee-service/ProtocolId' +import { isCorrelatedPosition } from './isCorrelatedPosition' +import { percentageFeeResolver } from './percentage-fee-resolver' + +export const feeResolver = async ( fromToken: T, toToken: T, - flags?: { + options?: { isIncreasingRisk?: boolean /** @deprecated Should rely on correlated asset matrix */ isEarnPosition?: boolean isEntrySwap?: boolean + positionData?: { + network: Network + protocolId: ProtocolId + proxyAddress: string + } }, -) => { - let type = 'defaultMultiply' - if (isCorrelatedPosition(fromToken, toToken) || flags?.isEarnPosition) { - type = 'earnMultiply' - } - // overrides earnMultiply type - if (isCorrelatedLowFeePosition(fromToken, toToken)) { - type = 'lowFeeMultiply' - } - if (flags?.isEntrySwap) { - // Should override multiply type given position type isn't relevant if the swap is an entry swap - type = 'entry' - } - const feesConfig = { - entry: { - onIncrease: new BigNumber(DEFAULT_FEE), - onDecrease: new BigNumber(DEFAULT_FEE), - }, - earnMultiply: { - onIncrease: new BigNumber(NO_FEE), - onDecrease: new BigNumber(NO_FEE), - }, - defaultMultiply: { - onIncrease: new BigNumber(DEFAULT_FEE), - onDecrease: new BigNumber(DEFAULT_FEE), - }, - lowFeeMultiply: { - onIncrease: new BigNumber(LOW_CORRELATED_ASSET_FEE), - onDecrease: new BigNumber(LOW_CORRELATED_ASSET_FEE), - }, - } - - const feeToCharge = feesConfig[type][flags?.isIncreasingRisk ? 'onIncrease' : 'onDecrease'] - if (!feeToCharge) { - throw new Error('No fee could be resolved') - } - - return feeToCharge -} - -export function isCorrelatedPosition(symbolA: string, symbolB: string) { - const correlatedAssetMatrix = [ - [ - 'WETH', - 'ETH', - 'WSTETH', - 'CBETH', - 'RETH', - 'STETH', - 'OSETH', - 'WEETH', - 'EZETH', - 'AWSTETH', - 'ASETH', - 'CWETHV3', - 'WOETH', - 'BSDETH', - 'RSETH', - 'RSWETH', - 'WSUPEROETHB', - ], // ETH correlated assets - ['WBTC', 'TBTC', 'SWBTC', 'LBTC'], // BTC correlated assets - ['USDC', 'DAI', 'GHO', 'SDAI', 'USDT', 'CDAI', 'AUSDC', 'PYUSD'], // USDC correlated assets - // Add more arrays here to expand the matrix in the future - ] - - // Iterate over each row in the matrix - for (let i = 0; i < correlatedAssetMatrix.length; i++) { - // Check if both symbols are in the same row - if ( - correlatedAssetMatrix[i].includes(symbolA.toUpperCase()) && - correlatedAssetMatrix[i].includes(symbolB.toUpperCase()) - ) { - return true +): Promise<{ + feeType: SwapFeeType + feeToCharge: BigNumber +}> => { + if (isCorrelatedPosition(fromToken, toToken) || options?.isEarnPosition) { + if (options?.positionData === undefined) { + throw new Error('Position data is required for earn multiply fee calculation') } - } - - // If we haven't found both symbols in the same row, they're not correlated - return false -} - -/** - * Checks if two symbols are in a correlated low fee position. - * @param symbolA - The first symbol. - * @param symbolB - The second symbol. - * @returns True if the symbols are in a correlated low fee position, false otherwise. - */ -export function isCorrelatedLowFeePosition(symbolA: string, symbolB: string) { - const correlatedAssetMatrix = [ - [ - 'DAI', - 'USDT', - 'USDC', - 'PYUSD', - 'FRAX', - 'LUSD', - 'GUSD', - 'CRVUSD', - 'SDAI', - 'SUSDE', - 'USDE', - 'AETHSDAI', - 'AETHUSDC', - 'AETHUSDT', - 'AETHDAI', - 'AETHPYUSD', - 'AETHLUSD', - 'AUSDC', - 'ADAI', - 'AUSDT', - 'CUSDCV3', - 'CDAI', - 'CUSDC', - 'SUSD', - 'USDC.E', - ], - [ - 'WSTETH', - 'RETH', - 'CBETH', - 'STETH', - 'AETHWSTETH', - 'AETHWETH', - 'AETHRETH', - 'AETHCBETH', - 'ASETH', - 'AWETH', - 'CETH', - 'CWETHV3', - 'WEETH', - 'WETH', - ], - ['WBTC', 'TBTC', 'AWBTC', 'AETHWBTC'], - // Add more arrays here to expand the matrix in the future - ] - - // Iterate over each row in the matrix - for (let i = 0; i < correlatedAssetMatrix.length; i++) { - // Check if both symbols are in the same row - if ( - correlatedAssetMatrix[i].includes(symbolA.toUpperCase()) && - correlatedAssetMatrix[i].includes(symbolB.toUpperCase()) - ) { - return true + return { + feeType: SwapFeeType.Fixed, + feeToCharge: new BigNumber(await getEarnMultiplyFee(options.positionData)), } + } else { + return percentageFeeResolver(fromToken, toToken, options) } - - // If we haven't found both symbols in the same row, they're not correlated - return false } diff --git a/packages/dma-library/src/utils/swap/get-swap-data.ts b/packages/dma-library/src/utils/swap/get-swap-data.ts index 059f621b8..bf51770b1 100644 --- a/packages/dma-library/src/utils/swap/get-swap-data.ts +++ b/packages/dma-library/src/utils/swap/get-swap-data.ts @@ -1,5 +1,5 @@ import { Address } from '@deploy-configurations/types/address' -import { SwapData } from '@dma-library/types' +import { SwapData, SwapFeeType } from '@dma-library/types' import BigNumber from 'bignumber.js' import { acceptedFeeTokenByAddress } from './accepted-fee-token' @@ -11,6 +11,7 @@ type GetSwapDataArgs = { toToken: { symbol: Tokens; address?: Address; precision?: number } slippage: BigNumber fee?: BigNumber + feeType: SwapFeeType } export async function getSwapDataHelper({ @@ -45,7 +46,12 @@ export async function getSwapDataHelper({ toTokenAddress, }) - const preSwapFee = calculatePreSwapFeeAmount(collectFeeFrom, args.swapAmountBeforeFees, args?.fee) + const preSwapFee = calculatePreSwapFeeAmount( + collectFeeFrom, + args.swapAmountBeforeFees, + args?.fee, + args.feeType, + ) const swapAmountAfterFees = args.swapAmountBeforeFees .minus(preSwapFee) .integerValue(BigNumber.ROUND_DOWN) diff --git a/packages/dma-library/src/utils/swap/index.ts b/packages/dma-library/src/utils/swap/index.ts index f18f7bd56..69faf5a20 100644 --- a/packages/dma-library/src/utils/swap/index.ts +++ b/packages/dma-library/src/utils/swap/index.ts @@ -1,15 +1,14 @@ +export { acceptedFeeTokenByAddress, acceptedFeeTokenBySymbol } from './accepted-fee-token' export { - acceptedFeeToken, - acceptedFeeTokenByAddress, - acceptedFeeTokenBySymbol, -} from './accepted-fee-token' -export { + calculateInflatedTokenFee, calculatePostSwapFeeAmount, calculatePreSwapFeeAmount, calculateSwapFeeAmount, } from './calculate-swap-fee-amount' -export { feeResolver, isCorrelatedPosition } from './fee-resolver' +export { feeResolver } from './fee-resolver' export { getSwapDataHelper } from './get-swap-data' export { getSwapInputToken } from './get-swap-input-token' export { getZeroSwap } from './get-zero-swap' export { getIsSwapNeeded } from './is-swap-needed' +export { isCorrelatedPosition } from './isCorrelatedPosition' +export { isCorrelatedLowFeePosition, percentageFeeResolver } from './percentage-fee-resolver' diff --git a/packages/dma-library/src/utils/swap/is-swap-needed.ts b/packages/dma-library/src/utils/swap/is-swap-needed.ts index c89ddf12f..e64efb3c1 100644 --- a/packages/dma-library/src/utils/swap/is-swap-needed.ts +++ b/packages/dma-library/src/utils/swap/is-swap-needed.ts @@ -1,6 +1,9 @@ import { Address } from '@deploy-configurations/types/address' import * as AddressesUtils from '@dma-common/utils/addresses/index' +/** + * Check if a swap is needed between two tokens + **/ export function getIsSwapNeeded( entryTokenAddress: Address, depositTokenAddress: Address, diff --git a/packages/dma-library/src/utils/swap/isCorrelatedPosition.ts b/packages/dma-library/src/utils/swap/isCorrelatedPosition.ts new file mode 100644 index 000000000..42a0ab537 --- /dev/null +++ b/packages/dma-library/src/utils/swap/isCorrelatedPosition.ts @@ -0,0 +1,40 @@ +export function isCorrelatedPosition(symbolA: string, symbolB: string) { + const correlatedAssetMatrix = [ + [ + 'WETH', + 'ETH', + 'WSTETH', + 'CBETH', + 'RETH', + 'STETH', + 'OSETH', + 'WEETH', + 'EZETH', + 'AWSTETH', + 'ASETH', + 'CWETHV3', + 'WOETH', + 'BSDETH', + 'RSETH', + 'RSWETH', + 'WSUPEROETHB', + ], // ETH correlated assets + ['WBTC', 'TBTC', 'SWBTC', 'LBTC'], // BTC correlated assets + ['USDC', 'DAI', 'GHO', 'SDAI', 'USDT', 'CDAI', 'AUSDC', 'PYUSD'], // USDC correlated assets + // Add more arrays here to expand the matrix in the future + ] + + // Iterate over each row in the matrix + for (let i = 0; i < correlatedAssetMatrix.length; i++) { + // Check if both symbols are in the same row + if ( + correlatedAssetMatrix[i].includes(symbolA.toUpperCase()) && + correlatedAssetMatrix[i].includes(symbolB.toUpperCase()) + ) { + return true + } + } + + // If we haven't found both symbols in the same row, they're not correlated + return false +} diff --git a/packages/dma-library/src/utils/swap/percentage-fee-resolver.ts b/packages/dma-library/src/utils/swap/percentage-fee-resolver.ts new file mode 100644 index 000000000..565d5ad45 --- /dev/null +++ b/packages/dma-library/src/utils/swap/percentage-fee-resolver.ts @@ -0,0 +1,131 @@ +import { DEFAULT_FEE, LOW_CORRELATED_ASSET_FEE } from '@dma-common/constants' +import { SwapFeeType } from '@dma-library/types' +import BigNumber from 'bignumber.js' + +import { isCorrelatedPosition } from './isCorrelatedPosition' + +export const percentageFeeResolver = ( + fromToken: T, + toToken: T, + options?: { + isIncreasingRisk?: boolean + /** @deprecated Should rely on correlated asset matrix */ + isEarnPosition?: boolean + isEntrySwap?: boolean + }, +): { + feeType: SwapFeeType + feeToCharge: BigNumber +} => { + let type = 'defaultMultiply' + if (isCorrelatedPosition(fromToken, toToken) || options?.isEarnPosition) { + type = 'earnMultiply' + } + // overrides earnMultiply type + if (isCorrelatedLowFeePosition(fromToken, toToken)) { + type = 'lowFeeMultiply' + } + if (options?.isEntrySwap) { + // Should override multiply type given position type isn't relevant if the swap is an entry swap + type = 'entry' + } + const feesConfig = { + entry: { + onIncrease: new BigNumber(DEFAULT_FEE), + onDecrease: new BigNumber(DEFAULT_FEE), + }, + defaultMultiply: { + onIncrease: new BigNumber(DEFAULT_FEE), + onDecrease: new BigNumber(DEFAULT_FEE), + }, + lowFeeMultiply: { + onIncrease: new BigNumber(LOW_CORRELATED_ASSET_FEE), + onDecrease: new BigNumber(LOW_CORRELATED_ASSET_FEE), + }, + } + + const feeType = SwapFeeType.Percentage + + let feeToCharge + if (type === 'earnMultiply') { + // new AUM type fee for yield loops + throw new Error('AUM fee is required for earn multiply correlated assets') + } else { + feeToCharge = feesConfig[type][options?.isIncreasingRisk ? 'onIncrease' : 'onDecrease'] + if (!feeToCharge) { + throw new Error('No fee could be resolved') + } + } + + return { feeType, feeToCharge } +} + +/** + * Checks if two symbols are in a correlated low fee position. + * @param symbolA - The first symbol. + * @param symbolB - The second symbol. + * @returns True if the symbols are in a correlated low fee position, false otherwise. + */ +export function isCorrelatedLowFeePosition(symbolA: string, symbolB: string) { + const correlatedAssetMatrix = [ + [ + 'DAI', + 'USDT', + 'USDC', + 'PYUSD', + 'FRAX', + 'LUSD', + 'GUSD', + 'CRVUSD', + 'SDAI', + 'SUSDE', + 'USDE', + 'AETHSDAI', + 'AETHUSDC', + 'AETHUSDT', + 'AETHDAI', + 'AETHPYUSD', + 'AETHLUSD', + 'AUSDC', + 'ADAI', + 'AUSDT', + 'CUSDCV3', + 'CDAI', + 'CUSDC', + 'SUSD', + 'USDC.E', + ], + [ + 'WSTETH', + 'RETH', + 'CBETH', + 'STETH', + 'AETHWSTETH', + 'AETHWETH', + 'AETHRETH', + 'AETHCBETH', + 'ASETH', + 'AWETH', + 'CETH', + 'CWETHV3', + 'WEETH', + 'WETH', + ], + ['WBTC', 'TBTC', 'AWBTC', 'AETHWBTC'], + // Add more arrays here to expand the matrix in the future + ] + + // Iterate over each row in the matrix + for (let i = 0; i < correlatedAssetMatrix.length; i++) { + // Check if both symbols are in the same row + if ( + correlatedAssetMatrix[i].includes(symbolA.toUpperCase()) && + correlatedAssetMatrix[i].includes(symbolB.toUpperCase()) + ) { + return true + } + } + + // If we haven't found both symbols in the same row, they're not correlated + return false +} diff --git a/packages/dma-library/test/fee-resolver.test.ts b/packages/dma-library/test/fee-resolver.test.ts index cec72bc3f..7cee4f9d8 100644 --- a/packages/dma-library/test/fee-resolver.test.ts +++ b/packages/dma-library/test/fee-resolver.test.ts @@ -1,31 +1,35 @@ -import { DEFAULT_FEE, LOW_CORRELATED_ASSET_FEE, NO_FEE } from '@dma-common/constants' -import { feeResolver } from '@dma-library/utils/swap' -import { isCorrelatedPosition } from '@dma-library/utils/swap/fee-resolver' +import { DEFAULT_FEE, LOW_CORRELATED_ASSET_FEE } from '@dma-common/constants' +import { SwapFeeType } from '@dma-library/types' +import { percentageFeeResolver } from '@dma-library/utils/swap' +import { isCorrelatedPosition } from '@dma-library/utils/swap/isCorrelatedPosition' import BigNumber from 'bignumber.js' -import { assert } from 'chai' +import { assert, expect } from 'chai' describe('feeResolver', function () { it('should return DEFAULT_FEE if isEntrySwap flag is set', function () { - const fee = feeResolver('WSTETH', 'ETH', { isEntrySwap: true }) - assert(fee.isEqualTo(new BigNumber(DEFAULT_FEE))) - }) - it('should return LOW_CORRELATED_ASSET_FEE for DAI and SUSDE', function () { - const fee = feeResolver('SUSDE', 'DAI', { isEntrySwap: false }) - assert(fee.isEqualTo(new BigNumber(LOW_CORRELATED_ASSET_FEE))) - }) - it('should return NO_FEE when decreasing risk and token pair are correlated', function () { - const fee = feeResolver('WSTETH', 'ETH') - assert(fee.isEqualTo(new BigNumber(NO_FEE))) + const { feeToCharge, feeType } = percentageFeeResolver('WSTETH', 'ETH', { + isEntrySwap: true, + }) + assert(feeToCharge.isEqualTo(new BigNumber(DEFAULT_FEE))) + assert(feeType === SwapFeeType.Percentage) + }) + it('should return LOW_CORRELATED_ASSET_FEE for DAI and SUSDE', function () { + const { feeToCharge, feeType } = percentageFeeResolver('SUSDE', 'DAI', { + isEntrySwap: false, + }) + assert(feeToCharge.isEqualTo(new BigNumber(LOW_CORRELATED_ASSET_FEE))) + assert(feeType === SwapFeeType.Percentage) }) - it('should return NO_FEE when increasing risk and token pair are correlated', function () { - const fee = feeResolver('ETH', 'WSTETH', { isIncreasingRisk: true }) - assert(fee.isEqualTo(new BigNumber(NO_FEE))) + it('should throw when trying to take NO_FEE for correlated assets, take AUM fee instead', function () { + const fail = () => percentageFeeResolver('WSTETH', 'ETH') + expect(fail).to.throw('Cannot take NO_FEE for correlated assets') }) it('should return DEFAULT_FEE for all other cases', function () { - const fee = feeResolver('ETH', 'USDC') - assert(fee.isEqualTo(new BigNumber(DEFAULT_FEE))) + const { feeToCharge, feeType } = percentageFeeResolver('ETH', 'USDC', {} as any) + assert(feeToCharge.isEqualTo(new BigNumber(DEFAULT_FEE))) + assert(feeType === SwapFeeType.Percentage) }) }) diff --git a/packages/dma-library/tsconfig.json b/packages/dma-library/tsconfig.json index aead6ad99..7d21c3ed0 100644 --- a/packages/dma-library/tsconfig.json +++ b/packages/dma-library/tsconfig.json @@ -3,9 +3,7 @@ "compilerOptions": { "outDir": "./lib", "types": ["node", "mocha"], - "typeRoots": [ - "../../node_modules/@types" - ], + "typeRoots": ["../../node_modules/@types"], "paths": { "@abis/external/*": ["../abis/external/*"], "@abis/system/*": ["../abis/system/*"], @@ -26,8 +24,10 @@ "@domain": ["../domain/src/index.ts"], "@deploy-configurations/*": ["../deploy-configurations/*"], "@deploy-configurations/addresses": ["../deploy-configurations/addresses/index.ts"], - "@deploy-configurations/operation-definitions": ["../deploy-configurations/operation-definitions/index.ts"], - }, + "@deploy-configurations/operation-definitions": [ + "../deploy-configurations/operation-definitions/index.ts" + ] + } }, "references": [ { @@ -46,11 +46,5 @@ "path": "../domain" } ], - "include": [ - "./src", - "./src/strategies/ajna/earn/buckets.json", - "test", - "../abis/types", - "../dma-contracts/typechain", - ] + "include": ["./src", "./src/strategies/ajna/earn/buckets.json", "test"] } diff --git a/packages/domain/src/adjust-position.ts b/packages/domain/src/adjust-position.ts index b00a7493c..945197801 100644 --- a/packages/domain/src/adjust-position.ts +++ b/packages/domain/src/adjust-position.ts @@ -1,5 +1,5 @@ import { FEE_BASE, ONE, TYPICAL_PRECISION, ZERO } from '@dma-common/constants' -import { calculateFee } from '@dma-common/utils/swap' +import { calculatePercentageFee } from '@dma-common/utils/swap' import { revertToTokenSpecificPrecision, standardiseAmountTo18Decimals } from '@domain/utils' import { isRiskIncreasing } from '@domain/utils/risk-direction' import BigNumber from 'bignumber.js' @@ -291,13 +291,13 @@ function determineFee( const normalisedSourceFee = ( isIncreasingRisk - ? calculateFee(debtDelta, oazoFee.toNumber()) - : calculateFee(collateralDelta, oazoFee.toNumber()) + ? calculatePercentageFee(debtDelta, oazoFee.toNumber()) + : calculatePercentageFee(collateralDelta, oazoFee.toNumber()) ).integerValue(BigNumber.ROUND_DOWN) const normalisedTargetFee = ( isIncreasingRisk - ? calculateFee(collateralDelta, oazoFee.toNumber()) - : calculateFee(debtDelta, oazoFee.toNumber()) + ? calculatePercentageFee(collateralDelta, oazoFee.toNumber()) + : calculatePercentageFee(debtDelta, oazoFee.toNumber()) ).integerValue(BigNumber.ROUND_DOWN) const sourceFee = revertToTokenSpecificPrecision( normalisedSourceFee, diff --git a/yarn.lock b/yarn.lock index b3bc0ab17..d30dd01a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1844,6 +1844,11 @@ open "^7.0.3" server-destroy "^1.0.1" +"@graphql-typed-document-node/core@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" + integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== + "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz" @@ -2452,6 +2457,30 @@ "@lezer/lr" "^0.15.4" json5 "^2.2.1" +"@molt/command@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@molt/command/-/command-0.9.0.tgz#3c77efe435beb6062da8ba96097f8f82e9bee51c" + integrity sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g== + dependencies: + "@molt/types" "0.2.0" + alge "0.8.1" + chalk "^5.3.0" + lodash.camelcase "^4.3.0" + lodash.snakecase "^4.1.1" + readline-sync "^1.4.10" + string-length "^6.0.0" + strip-ansi "^7.1.0" + ts-toolbelt "^9.6.0" + type-fest "^4.3.1" + zod "^3.22.2" + +"@molt/types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@molt/types/-/types-0.2.0.tgz#be19a4c16d944deb93c3d8221170b88eeb9a3085" + integrity sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g== + dependencies: + ts-toolbelt "^9.6.0" + "@morgan-stanley/ts-mocking-bird@^0.6.2": version "0.6.4" resolved "https://registry.npmjs.org/@morgan-stanley/ts-mocking-bird/-/ts-mocking-bird-0.6.4.tgz" @@ -5530,6 +5559,16 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" +alge@0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/alge/-/alge-0.8.1.tgz#f3d8a9ceecaf6d56981ecb2a4804a0e6dd7f4e6b" + integrity sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ== + dependencies: + lodash.ismatch "^4.4.0" + remeda "^1.0.0" + ts-toolbelt "^9.6.0" + zod "^3.17.3" + amazon-cognito-identity-js@^6.0.1: version "6.3.12" resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.3.12.tgz#af73df033094ad4c679c19cf6122b90058021619" @@ -7292,6 +7331,11 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + char-regex@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -11109,6 +11153,22 @@ grapheme-splitter@^1.0.4: resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphql-request@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.1.0.tgz#7b4840f977508f616f22c4168f2347c1dc580868" + integrity sha512-Ouu/lYVFhARS1aXeZoVJWnGT6grFJXTLwXJuK4mUGGRo0EUk1JkyYp43mdGmRgUVezpRm6V5Sq3t8jBDQcajng== + dependencies: + "@graphql-typed-document-node/core" "^3.2.0" + "@molt/command" "^0.9.0" + zod "^3.23.8" + +graphql-tag@^2.12.6: + version "2.12.6" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" + integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== + dependencies: + tslib "^2.1.0" + growl@1.10.5: version "1.10.5" resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" @@ -13715,6 +13775,11 @@ lodash.merge@^4.6.2: resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.snakecase@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== + lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz" @@ -16759,6 +16824,11 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +readline-sync@^1.4.10: + version "1.4.10" + resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" + integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" @@ -16903,6 +16973,11 @@ relateurl@^0.2.7: resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz" integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== +remeda@^1.0.0: + version "1.61.0" + resolved "https://registry.yarnpkg.com/remeda/-/remeda-1.61.0.tgz#dccd31ab75d0f02865f3ef89e4f0ce0076096464" + integrity sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A== + renderkid@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz" @@ -18083,6 +18158,13 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" +string-length@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-6.0.0.tgz#1c7342bbf032129b2f80003e69f889c70231d791" + integrity sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg== + dependencies: + strip-ansi "^7.1.0" + "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -18217,7 +18299,7 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-ansi@^7.0.1: +strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== @@ -19006,6 +19088,11 @@ type-fest@^2.19.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== +type-fest@^4.3.1: + version "4.26.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.1.tgz#a4a17fa314f976dd3e6d6675ef6c775c16d7955e" + integrity sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz" @@ -21267,3 +21354,8 @@ zksync-web3@^0.14.3: version "0.14.3" resolved "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.3.tgz" integrity sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ== + +zod@^3.17.3, zod@^3.22.2, zod@^3.23.8: + version "3.23.8" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" + integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==