@merkl/api 0.21.46 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cache/index.d.ts +1 -1
- package/dist/src/constants.d.ts +8 -8
- package/dist/src/eden/index.d.ts +16937 -8167
- package/dist/src/eden/index.js +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Ajna.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Badger.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Clamm.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Compound.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/CompoundV3.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Dolomite.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/ERC721.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/ERCMultiToken.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/EigenLayer.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Encompassing.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20.d.ts +105 -3
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20Snapshot.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/EventBased.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Hyperdrive.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/implementations/Morpho.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Radiant.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Silo.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/UniswapV4.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/Vest.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/implementations/default.d.ts +2 -2
- package/dist/src/engine/deprecated/dynamicData/utils/fetchA51Strategies.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/fetchClamInfo.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/fetchLogs.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getCompV2ForksVaults.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getDolomiteMarkets.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getEulerV2Vaults.d.ts +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getFixedApr.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/GenericProcessor.d.ts +6 -6
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/hardcoded.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/treasuryFinder.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BeefyProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BunniV2Processor.d.ts +4 -4
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/CompoundProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FluidProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaALMProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HourglassProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MetamorphoProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RadiantProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/Satlayer.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/StabilityProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TempestVaultProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TemplateProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveNPoolProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/processorMapping.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesPrices.d.ts +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound1.d.ts +1 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound2.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound3.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound4.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeStruct.d.ts +2 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.d.ts +3 -3
- package/dist/src/engine/implementations/Ajna/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Ajna/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Ambient/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Ambient/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Badger/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Clamm/metadata.d.ts +22 -22
- package/dist/src/engine/implementations/Compound/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/CompoundV3/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Default/metadata.d.ts +3 -3
- package/dist/src/engine/implementations/Dolomite/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/EigenLayer/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/EigenLayer/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Encompassing/metadata.d.ts +3 -3
- package/dist/src/engine/implementations/Erc20/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/detect.d.ts +2 -2
- package/dist/src/engine/implementations/Erc20/subTypes/factories.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/metamorpho/metadata.d.ts +17 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/metamorpho/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmaxVault/metadata.d.ts +18 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmaxVault/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20/subTypes/index.d.ts +3 -2
- package/dist/src/engine/implementations/Erc20/tvl.d.ts +4 -4
- package/dist/src/engine/implementations/Erc20Snapshot/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Erc721/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/ErcMultiToken/metadata.d.ts +6 -6
- package/dist/src/engine/implementations/EventBased/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/FraxLend/metadataBorrow.d.ts +24 -0
- package/dist/src/engine/implementations/FraxLend/metadataCollateral.d.ts +18 -0
- package/dist/src/engine/implementations/FraxLend/tvlBorrow.d.ts +7 -0
- package/dist/src/engine/implementations/FraxLend/tvlCollateral.d.ts +7 -0
- package/dist/src/engine/implementations/Hyperdrive/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Invalid/metadata.d.ts +2 -2
- package/dist/src/engine/implementations/Ion/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/JsonAirdrop/metadata.d.ts +7 -7
- package/dist/src/engine/implementations/Locker/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/Locker/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Morpho/metadata.d.ts +7 -7
- package/dist/src/engine/implementations/MultiLog/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/MultiLog/tvl.d.ts +3 -3
- package/dist/src/engine/implementations/Radiant/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/Silo/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/UniswapV4/metadata.d.ts +5 -5
- package/dist/src/engine/implementations/UniswapV4/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/Vest/metadata.d.ts +4 -4
- package/dist/src/engine/implementations/morphoBorrow/metadata.d.ts +20 -0
- package/dist/src/engine/implementations/morphoBorrow/tvl.d.ts +7 -0
- package/dist/src/engine/implementations/morphoCollateral/metadata.d.ts +20 -0
- package/dist/src/engine/implementations/morphoCollateral/tvl.d.ts +7 -0
- package/dist/src/engine/implementations/morphoSupply/metadata.d.ts +20 -0
- package/dist/src/engine/implementations/morphoSupply/tvl.d.ts +7 -0
- package/dist/src/engine/metadata/factory.d.ts +1 -1
- package/dist/src/engine/tvl/factory.d.ts +2 -2
- package/dist/src/engine/tvl/logStates.d.ts +1 -1
- package/dist/src/hooks/checkQueryAddressValidity.d.ts +6 -2
- package/dist/src/hooks/checkQueryChainIdValidity.d.ts +6 -2
- package/dist/src/index.d.ts +5548 -2626
- package/dist/src/jobs/{dynamic-data.d.ts → update-v3-caches.d.ts} +4 -1
- package/dist/src/libs/computeFee.d.ts +1 -1
- package/dist/src/libs/deprecated-merklv3/index.d.ts +3 -3
- package/dist/src/libs/merklChainData.d.ts +1 -1
- package/dist/src/libs/parse/marketsWithCache.d.ts +1 -1
- package/dist/src/libs/positions/EigenLayer/index.d.ts +2 -2
- package/dist/src/libs/positions/ajna/index.d.ts +2 -2
- package/dist/src/libs/positions/badger/index.d.ts +2 -2
- package/dist/src/libs/positions/clamm/index.d.ts +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.d.ts +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.d.ts +1 -1
- package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.d.ts +1 -1
- package/dist/src/libs/positions/compound/index.d.ts +2 -2
- package/dist/src/libs/positions/dolomite/index.d.ts +2 -2
- package/dist/src/libs/positions/erc20/index.d.ts +2 -2
- package/dist/src/libs/positions/euler/index.d.ts +2 -2
- package/dist/src/libs/positions/index.d.ts +1 -1
- package/dist/src/libs/positions/morpho/index.d.ts +2 -2
- package/dist/src/libs/positions/prepareFetch.d.ts +1 -1
- package/dist/src/libs/positions/silo/index.d.ts +2 -2
- package/dist/src/libs/positions/types.d.ts +1 -1
- package/dist/src/libs/staticCampaigns.d.ts +1 -1
- package/dist/src/libs/tokens/balances.d.ts +1 -1
- package/dist/src/libs/tokens/tokenInfo.d.ts +1 -1
- package/dist/src/modules/v4/accounting/accounting.controller.d.ts +98 -33
- package/dist/src/modules/v4/accounting/accounting.repository.d.ts +41 -41
- package/dist/src/modules/v4/accounting/accounting.service.d.ts +7 -7
- package/dist/src/modules/v4/apr/apr.model.d.ts +8 -8
- package/dist/src/modules/v4/apr/apr.service.d.ts +1 -1
- package/dist/src/modules/v4/authentication/authentication.controller.d.ts +24 -2
- package/dist/src/modules/v4/blacklist/blacklist.controller.d.ts +64 -37
- package/dist/src/modules/v4/blacklist/blacklist.repository.d.ts +4 -4
- package/dist/src/modules/v4/blacklist/blacklist.service.d.ts +5 -5
- package/dist/src/modules/v4/boost/boost.controller.d.ts +25 -3
- package/dist/src/modules/v4/cache/cache.repository.d.ts +1 -1
- package/dist/src/modules/v4/cache/cache.service.d.ts +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +665 -504
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +30 -9
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +191 -191
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +415 -319
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +352 -282
- package/dist/src/modules/v4/chain/chain.controller.d.ts +91 -47
- package/dist/src/modules/v4/chain/chain.model.d.ts +11 -3
- package/dist/src/modules/v4/chain/chain.repository.d.ts +10 -10
- package/dist/src/modules/v4/chain/chain.service.d.ts +10 -10
- package/dist/src/modules/v4/chainInteraction/chainInteraction.service.d.ts +1 -1
- package/dist/src/modules/v4/claims/claims.controller.d.ts +15 -2
- package/dist/src/modules/v4/claims/claims.repository.d.ts +1 -1
- package/dist/src/modules/v4/claims/claims.service.d.ts +3 -3
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +47 -7
- package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +2 -2
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +2 -2
- package/dist/src/modules/v4/creator/creator.controller.d.ts +160 -88
- package/dist/src/modules/v4/creator/creator.model.d.ts +1 -1
- package/dist/src/modules/v4/creator/creator.repository.d.ts +20 -20
- package/dist/src/modules/v4/creator/creator.service.d.ts +47 -47
- package/dist/src/modules/v4/dynamicData/dynamicData.model.d.ts +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +1 -1
- package/dist/src/modules/v4/enso/enso.service.d.ts +17 -17
- package/dist/src/modules/v4/explorer/explorer.controller.d.ts +19 -6
- package/dist/src/modules/v4/explorer/explorer.model.d.ts +2 -2
- package/dist/src/modules/v4/explorer/explorer.repository.d.ts +5 -5
- package/dist/src/modules/v4/explorer/explorer.service.d.ts +7 -7
- package/dist/src/modules/v4/interaction/interaction.controller.d.ts +39 -8
- package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -1
- package/dist/src/modules/v4/interaction/interaction.service.d.ts +2 -2
- package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
- package/dist/src/modules/v4/liquidity/implementations/AjnaPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/BadgerPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/ClammPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/DolomitePositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/implementations/ERC20PositionFetcher.d.ts +3 -3
- package/dist/src/modules/v4/liquidity/implementations/EulerPositionFetcher.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/liquidity.controller.d.ts +24 -13
- package/dist/src/modules/v4/liquidity/liquidity.model.d.ts +2 -2
- package/dist/src/modules/v4/liquidity/liquidity.repository.d.ts +1 -1
- package/dist/src/modules/v4/merklRoot/merklRoot.controller.d.ts +42 -22
- package/dist/src/modules/v4/merklRoot/merklRoot.repository.d.ts +7 -7
- package/dist/src/modules/v4/merklRoot/merklRoot.service.d.ts +18 -8
- package/dist/src/modules/v4/nodes/node.controller.d.ts +65 -0
- package/dist/src/modules/v4/nodes/node.model.d.ts +21 -0
- package/dist/src/modules/v4/nodes/node.repository.d.ts +21 -0
- package/dist/src/modules/v4/nodes/node.service.d.ts +21 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +743 -644
- package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +111 -5
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +116 -81
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +408 -408
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +489 -459
- package/dist/src/modules/v4/parse/parse.controller.d.ts +64 -0
- package/dist/src/modules/v4/parse/parse.model.d.ts +10 -0
- package/dist/src/modules/v4/payload/payload.controller.d.ts +125 -0
- package/dist/src/modules/v4/payload/payload.model.d.ts +307 -0
- package/dist/src/modules/v4/payload/payload.service.d.ts +27 -0
- package/dist/src/modules/v4/price/price.controller.d.ts +93 -50
- package/dist/src/modules/v4/price/price.model.d.ts +16 -16
- package/dist/src/modules/v4/price/price.repository.d.ts +11 -11
- package/dist/src/modules/v4/price/price.service.d.ts +9 -9
- package/dist/src/modules/v4/prisma/index.d.ts +1 -1
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +939 -146
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +12 -14
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +451 -362
- package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +40 -19
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +117 -67
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +2 -2
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +29 -29
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +9 -6
- package/dist/src/modules/v4/referral/referral.controller.d.ts +29 -7
- package/dist/src/modules/v4/referral/referral.service.d.ts +8 -8
- package/dist/src/modules/v4/reward/reward.controller.d.ts +261 -93
- package/dist/src/modules/v4/reward/reward.converter.d.ts +1 -1
- package/dist/src/modules/v4/reward/reward.model.d.ts +3 -3
- package/dist/src/modules/v4/reward/reward.repository.d.ts +55 -54
- package/dist/src/modules/v4/reward/reward.service.d.ts +260 -260
- package/dist/src/modules/v4/router.d.ts +4706 -2394
- package/dist/src/modules/v4/status/status.controller.d.ts +127 -64
- package/dist/src/modules/v4/status/status.model.d.ts +10 -10
- package/dist/src/modules/v4/status/status.repository.d.ts +35 -35
- package/dist/src/modules/v4/status/status.service.d.ts +23 -23
- package/dist/src/modules/v4/token/token.controller.d.ts +224 -130
- package/dist/src/modules/v4/token/token.model.d.ts +1 -1
- package/dist/src/modules/v4/token/token.repository.d.ts +41 -37
- package/dist/src/modules/v4/token/token.service.d.ts +106 -101
- package/dist/src/modules/v4/turtle/turtle.controller.d.ts +15 -2
- package/dist/src/modules/v4/tvl/tvl.model.d.ts +5 -5
- package/dist/src/modules/v4/tvl/tvl.service.d.ts +1 -1
- package/dist/src/modules/v4/uniswap/uniswap.controller.d.ts +248 -11
- package/dist/src/modules/v4/uniswap/uniswap.model.d.ts +3 -3
- package/dist/src/modules/v4/uniswap/uniswap.repository.d.ts +4 -4
- package/dist/src/modules/v4/uniswap/uniswap.service.d.ts +3 -3
- package/dist/src/modules/v4/user/user.controller.d.ts +175 -164
- package/dist/src/modules/v4/user/user.model.d.ts +10 -1
- package/dist/src/modules/v4/user/user.repository.d.ts +7 -7
- package/dist/src/modules/v4/user/user.service.d.ts +7 -7
- package/dist/src/plugins/error-handling.plugin.d.ts +7 -3
- package/dist/src/routes/v1/allowances.d.ts +18 -5
- package/dist/src/routes/v1/balances.d.ts +16 -3
- package/dist/src/routes/v1/prices.d.ts +15 -2
- package/dist/src/routes/v1/router.d.ts +44 -4
- package/dist/src/routes/v1/tokens.d.ts +15 -2
- package/dist/src/routes/v2/merkl.d.ts +41 -4
- package/dist/src/routes/v2/router.d.ts +41 -4
- package/dist/src/routes/v3/app.d.ts +15 -2
- package/dist/src/routes/v3/blacklist.d.ts +15 -2
- package/dist/src/routes/v3/campaign/delay.d.ts +27 -16
- package/dist/src/routes/v3/campaignClaims.d.ts +15 -2
- package/dist/src/routes/v3/campaignUnclaimed.d.ts +15 -2
- package/dist/src/routes/v3/campaigns.d.ts +17 -4
- package/dist/src/routes/v3/campaignsForMainParameter.d.ts +15 -2
- package/dist/src/routes/v3/campaignsRewardsReport.d.ts +15 -2
- package/dist/src/routes/v3/claims.d.ts +15 -2
- package/dist/src/routes/v3/compoundV2.d.ts +15 -2
- package/dist/src/routes/v3/createCampaign.d.ts +16 -3
- package/dist/src/routes/v3/dolomite.d.ts +15 -2
- package/dist/src/routes/v3/euler.d.ts +43 -14
- package/dist/src/routes/v3/fetch.d.ts +15 -2
- package/dist/src/routes/v3/health.d.ts +15 -2
- package/dist/src/routes/v3/lostyield.d.ts +15 -2
- package/dist/src/routes/v3/merkl.d.ts +34 -6
- package/dist/src/routes/v3/morphoMarkets.d.ts +15 -2
- package/dist/src/routes/v3/morphoVaults.d.ts +15 -2
- package/dist/src/routes/v3/multiChainPositions.d.ts +15 -2
- package/dist/src/routes/v3/opportunity.d.ts +72 -6
- package/dist/src/routes/v3/overview.d.ts +15 -2
- package/dist/src/routes/v3/parse.d.ts +15 -2
- package/dist/src/routes/v3/payload.d.ts +19 -6
- package/dist/src/routes/v3/poolInfo.d.ts +18 -5
- package/dist/src/routes/v3/positions.d.ts +15 -2
- package/dist/src/routes/v3/radiant.d.ts +15 -2
- package/dist/src/routes/v3/recipients.d.ts +15 -2
- package/dist/src/routes/v3/rewards.d.ts +18 -5
- package/dist/src/routes/v3/rewardsReport.d.ts +16 -3
- package/dist/src/routes/v3/router.d.ts +608 -55
- package/dist/src/routes/v3/silo.d.ts +15 -2
- package/dist/src/routes/v3/token.d.ts +16 -3
- package/dist/src/routes/v3/twt/participants.d.ts +24 -13
- package/dist/src/routes/v3/uniswapv4.d.ts +192 -19
- package/dist/src/routes/v3/updates.d.ts +15 -2
- package/dist/src/routes/v3/userRewards.d.ts +18 -5
- package/dist/src/utils/decodeCalls.d.ts +1 -1
- package/dist/src/utils/encodeCalls.d.ts +2 -2
- package/dist/src/utils/error.d.ts +8 -4
- package/dist/src/utils/generateCardName.d.ts +2 -2
- package/dist/src/utils/generic.d.ts +2 -2
- package/dist/src/utils/lastBlockBefore.d.ts +1 -1
- package/dist/src/utils/logger.d.ts +0 -8
- package/dist/src/utils/pricer.d.ts +1 -1
- package/dist/src/utils/prices/chainlinkRead.d.ts +1 -1
- package/dist/src/utils/prices/curveVirtualPrice.d.ts +1 -1
- package/dist/src/utils/prices/getDQUICK.d.ts +1 -1
- package/dist/src/utils/prices/priceFetcherFactory.d.ts +1 -1
- package/dist/src/utils/prices/services/OnChainCallService.d.ts +1 -1
- package/dist/src/utils/prices/services/coinGeckoService.d.ts +1 -1
- package/dist/src/utils/prices/services/defillamaService.d.ts +1 -1
- package/dist/src/utils/prices/services/dexScreenerService.d.ts +1 -1
- package/dist/src/utils/prices/services/erc4626Service.d.ts +1 -1
- package/dist/src/utils/prices/services/getERC4626.d.ts +1 -1
- package/dist/src/utils/prices/services/indexCoopService.d.ts +1 -1
- package/dist/src/utils/prices/services/priceFetcher.d.ts +1 -1
- package/dist/src/utils/prices/uniV2Price.d.ts +1 -1
- package/dist/src/utils/providers.d.ts +113 -2
- package/dist/src/utils/queries/allCampaigns.d.ts +1 -2
- package/dist/src/utils/sanitizeChain.d.ts +2 -2
- package/dist/src/utils/stryke.d.ts +1 -1
- package/dist/src/utils/throw.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +28 -48
- package/dist/database/api/.generated/default.d.ts +0 -1
- package/dist/database/api/.generated/default.js +0 -1
- package/dist/database/api/.generated/drizzle/schema.d.ts +0 -3342
- package/dist/database/api/.generated/drizzle/schema.js +0 -928
- package/dist/database/api/.generated/drizzle/schema.ts +0 -989
- package/dist/database/api/.generated/edge.d.ts +0 -1
- package/dist/database/api/.generated/edge.js +0 -725
- package/dist/database/api/.generated/index-browser.js +0 -696
- package/dist/database/api/.generated/index.d.ts +0 -48645
- package/dist/database/api/.generated/index.js +0 -758
- package/dist/database/api/.generated/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/api/.generated/package.json +0 -97
- package/dist/database/api/.generated/runtime/edge-esm.js +0 -31
- package/dist/database/api/.generated/runtime/edge.js +0 -31
- package/dist/database/api/.generated/runtime/index-browser.d.ts +0 -365
- package/dist/database/api/.generated/runtime/index-browser.js +0 -13
- package/dist/database/api/.generated/runtime/library.d.ts +0 -3447
- package/dist/database/api/.generated/runtime/library.js +0 -143
- package/dist/database/api/.generated/runtime/react-native.js +0 -80
- package/dist/database/api/.generated/runtime/wasm.js +0 -32
- package/dist/database/api/.generated/schema.prisma +0 -482
- package/dist/database/api/.generated/wasm.d.ts +0 -1
- package/dist/database/api/.generated/wasm.js +0 -696
- package/dist/database/engine/.generated/default.d.ts +0 -1
- package/dist/database/engine/.generated/default.js +0 -1
- package/dist/database/engine/.generated/edge.d.ts +0 -1
- package/dist/database/engine/.generated/edge.js +0 -485
- package/dist/database/engine/.generated/index-browser.js +0 -456
- package/dist/database/engine/.generated/index.d.ts +0 -22107
- package/dist/database/engine/.generated/index.js +0 -518
- package/dist/database/engine/.generated/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
- package/dist/database/engine/.generated/package.json +0 -97
- package/dist/database/engine/.generated/runtime/edge-esm.js +0 -31
- package/dist/database/engine/.generated/runtime/edge.js +0 -31
- package/dist/database/engine/.generated/runtime/index-browser.d.ts +0 -365
- package/dist/database/engine/.generated/runtime/index-browser.js +0 -13
- package/dist/database/engine/.generated/runtime/library.d.ts +0 -3447
- package/dist/database/engine/.generated/runtime/library.js +0 -143
- package/dist/database/engine/.generated/runtime/react-native.js +0 -80
- package/dist/database/engine/.generated/runtime/wasm.js +0 -32
- package/dist/database/engine/.generated/schema.prisma +0 -248
- package/dist/database/engine/.generated/wasm.d.ts +0 -1
- package/dist/database/engine/.generated/wasm.js +0 -456
- package/dist/database/index.d.ts +0 -29
- package/dist/database/index.js +0 -17
- package/dist/src/cache/declaration.js +0 -121
- package/dist/src/cache/index.js +0 -161
- package/dist/src/cache/redis.js +0 -57
- package/dist/src/constants.js +0 -93
- package/dist/src/engine/deprecated/dynamicData/implementations/Ajna.js +0 -107
- package/dist/src/engine/deprecated/dynamicData/implementations/Badger.js +0 -90
- package/dist/src/engine/deprecated/dynamicData/implementations/Clamm.js +0 -975
- package/dist/src/engine/deprecated/dynamicData/implementations/Compound.js +0 -139
- package/dist/src/engine/deprecated/dynamicData/implementations/CompoundV3.js +0 -101
- package/dist/src/engine/deprecated/dynamicData/implementations/Dolomite.js +0 -59
- package/dist/src/engine/deprecated/dynamicData/implementations/ERC721.js +0 -87
- package/dist/src/engine/deprecated/dynamicData/implementations/ERCMultiToken.js +0 -161
- package/dist/src/engine/deprecated/dynamicData/implementations/EigenLayer.js +0 -67
- package/dist/src/engine/deprecated/dynamicData/implementations/Encompassing.js +0 -26
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20.js +0 -162
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20Snapshot.js +0 -32
- package/dist/src/engine/deprecated/dynamicData/implementations/EventBased.js +0 -129
- package/dist/src/engine/deprecated/dynamicData/implementations/Hyperdrive.js +0 -112
- package/dist/src/engine/deprecated/dynamicData/implementations/Morpho.js +0 -132
- package/dist/src/engine/deprecated/dynamicData/implementations/Radiant.js +0 -123
- package/dist/src/engine/deprecated/dynamicData/implementations/Silo.js +0 -112
- package/dist/src/engine/deprecated/dynamicData/implementations/UniswapV4.js +0 -255
- package/dist/src/engine/deprecated/dynamicData/implementations/Vest.js +0 -61
- package/dist/src/engine/deprecated/dynamicData/implementations/default.js +0 -5
- package/dist/src/engine/deprecated/dynamicData/utils/fetchA51Strategies.js +0 -44
- package/dist/src/engine/deprecated/dynamicData/utils/fetchClamInfo.js +0 -27
- package/dist/src/engine/deprecated/dynamicData/utils/fetchLogs.js +0 -149
- package/dist/src/engine/deprecated/dynamicData/utils/getCompV2ForksVaults.js +0 -141
- package/dist/src/engine/deprecated/dynamicData/utils/getContractCreationBlock.js +0 -44
- package/dist/src/engine/deprecated/dynamicData/utils/getDolomiteMarkets.js +0 -53
- package/dist/src/engine/deprecated/dynamicData/utils/getEulerV2Vaults.js +0 -266
- package/dist/src/engine/deprecated/dynamicData/utils/getFixedApr.js +0 -27
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/GenericProcessor.js +0 -335
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/eulerVaultNames.js +0 -13
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.js +0 -47
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/getBlacklistedSupply.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/getCrossCurveTokenPrice.js +0 -13
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/hardcoded.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/metamorphoTvl.d.ts +0 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/metamorphoTvl.js +0 -35
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/ownerFinder.js +0 -16
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/spliceTVL.js +0 -23
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/treasuryFinder.js +0 -10
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AaveProcessor.js +0 -26
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AnglesLiquid.js +0 -51
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AssetProcessor.js +0 -48
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/AuraProcessor.js +0 -113
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +0 -111
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +0 -86
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +0 -101
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +0 -81
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BeefyProcessor.js +0 -54
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/BunniV2Processor.js +0 -91
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/CompoundProcessor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ERC4626Processor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +0 -52
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +0 -54
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +0 -51
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +0 -58
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FluidProcessor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/FraxProcessor.js +0 -42
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaALMProcessor.js +0 -52
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GammaProcessor.js +0 -67
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/GearboxProcessor.js +0 -58
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +0 -63
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HoldStationProcessor.js +0 -35
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/HourglassProcessor.js +0 -35
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MaverickBPProcessor.js +0 -78
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/MetamorphoProcessor.js +0 -48
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +0 -82
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleProcessor.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/PendleYTProcessor.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RadiantProcessor.js +0 -59
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/RfxProcessor.js +0 -71
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/Satlayer.js +0 -28
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraProcessor.js +0 -42
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +0 -40
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SpliceProcessor.js +0 -37
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/StabilityProcessor.js +0 -30
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +0 -38
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +0 -83
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TemplateProcessor.js +0 -40
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/TorosProcessor.js +0 -34
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/UniswapProcessor.js +0 -72
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/VicunaProcessor.js +0 -36
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/WoofiProcessor.js +0 -41
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.js +0 -60
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +0 -102
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveProcessor.js +0 -85
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/processorMapping.js +0 -159
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +0 -88
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/xU308Processor.js +0 -42
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesPrices.js +0 -28
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound1.js +0 -353
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound2.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound3.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/subtypesRound4.js +0 -22
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeStruct.js +0 -1
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.js +0 -155
- package/dist/src/engine/implementations/Ajna/metadata.js +0 -59
- package/dist/src/engine/implementations/Ajna/tvl.js +0 -91
- package/dist/src/engine/implementations/Ambient/metadata.js +0 -36
- package/dist/src/engine/implementations/Ambient/tvl.js +0 -178
- package/dist/src/engine/implementations/Badger/metadata.js +0 -31
- package/dist/src/engine/implementations/Clamm/metadata.js +0 -176
- package/dist/src/engine/implementations/Compound/metadata.js +0 -23
- package/dist/src/engine/implementations/CompoundV3/metadata.js +0 -23
- package/dist/src/engine/implementations/Default/metadata.js +0 -12
- package/dist/src/engine/implementations/Dolomite/metadata.js +0 -20
- package/dist/src/engine/implementations/EigenLayer/metadata.js +0 -12
- package/dist/src/engine/implementations/EigenLayer/tvl.js +0 -60
- package/dist/src/engine/implementations/Encompassing/metadata.js +0 -43
- package/dist/src/engine/implementations/Erc20/metadata.js +0 -64
- package/dist/src/engine/implementations/Erc20/subTypes/detect.js +0 -170
- package/dist/src/engine/implementations/Erc20/subTypes/factories.js +0 -69
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/metadata.js +0 -46
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/tvl.js +0 -51
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.js +0 -35
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/tvl.js +0 -59
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.js +0 -21
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/tvl.js +0 -46
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/metadata.js +0 -40
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/tvl.js +0 -57
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.js +0 -20
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/tvl.js +0 -52
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.js +0 -38
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/tvl.js +0 -83
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/metadata.js +0 -24
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/tvl.js +0 -69
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.js +0 -65
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/tvl.js +0 -94
- package/dist/src/engine/implementations/Erc20/subTypes/index.js +0 -119
- package/dist/src/engine/implementations/Erc20/tvl.js +0 -99
- package/dist/src/engine/implementations/Erc20Snapshot/metadata.js +0 -11
- package/dist/src/engine/implementations/Erc721/metadata.js +0 -13
- package/dist/src/engine/implementations/ErcMultiToken/metadata.js +0 -63
- package/dist/src/engine/implementations/EventBased/metadata.js +0 -181
- package/dist/src/engine/implementations/Hyperdrive/metadata.js +0 -29
- package/dist/src/engine/implementations/Invalid/metadata.js +0 -10
- package/dist/src/engine/implementations/Ion/metadata.js +0 -16
- package/dist/src/engine/implementations/JsonAirdrop/metadata.js +0 -43
- package/dist/src/engine/implementations/Locker/metadata.js +0 -36
- package/dist/src/engine/implementations/Locker/tvl.js +0 -26
- package/dist/src/engine/implementations/Morpho/metadata.js +0 -63
- package/dist/src/engine/implementations/MultiLog/metadata.js +0 -36
- package/dist/src/engine/implementations/MultiLog/tvl.js +0 -59
- package/dist/src/engine/implementations/Radiant/metadata.js +0 -33
- package/dist/src/engine/implementations/Silo/metadata.js +0 -20
- package/dist/src/engine/implementations/UniswapV4/metadata.js +0 -36
- package/dist/src/engine/implementations/UniswapV4/tvl.js +0 -158
- package/dist/src/engine/implementations/Vest/metadata.js +0 -13
- package/dist/src/engine/metadata/factory.js +0 -76
- package/dist/src/engine/tvl/factory.js +0 -87
- package/dist/src/engine/tvl/logStates.js +0 -106
- package/dist/src/errors/BadRequest.error.js +0 -7
- package/dist/src/errors/Conflict.error.js +0 -7
- package/dist/src/errors/HttpError.js +0 -17
- package/dist/src/errors/InvalidParameter.error.js +0 -7
- package/dist/src/errors/NotFound.error.js +0 -12
- package/dist/src/errors/Opportunity.error.js +0 -11
- package/dist/src/errors/UnableToFindPrice.error.js +0 -7
- package/dist/src/errors/Unauthorized.error.js +0 -7
- package/dist/src/errors/VoidString.error.js +0 -7
- package/dist/src/errors/index.js +0 -6
- package/dist/src/guards/BackOffice.guard.js +0 -10
- package/dist/src/guards/Engine.guard.js +0 -9
- package/dist/src/guards/TokenAuth.guard.js +0 -10
- package/dist/src/guards/VerifyJwt.guard.js +0 -13
- package/dist/src/hooks/checkQueryAddressValidity.js +0 -7
- package/dist/src/hooks/checkQueryChainIdValidity.js +0 -7
- package/dist/src/index.js +0 -113
- package/dist/src/jobs/dynamic-data.js +0 -159
- package/dist/src/jobs/pendings.js +0 -238
- package/dist/src/jobs/prices.js +0 -10
- package/dist/src/jobs/reward-breakdowns.js +0 -163
- package/dist/src/jobs/rewards.js +0 -112
- package/dist/src/jobs/set-dungeon-keeper.js +0 -90
- package/dist/src/jobs/update-analytics.js +0 -548
- package/dist/src/jobs/update-dynamic-data.js +0 -57
- package/dist/src/jobs/update-euler-vaults.js +0 -18
- package/dist/src/jobs/update-rpc-calls-cache.js +0 -30
- package/dist/src/jobs/update-uniswap-v4-pools.js +0 -15
- package/dist/src/libs/computeFee.js +0 -34
- package/dist/src/libs/deprecated-merklv3/index.js +0 -183
- package/dist/src/libs/getTokensList.js +0 -19
- package/dist/src/libs/merklChainData.js +0 -116
- package/dist/src/libs/parse/marketsWithCache.js +0 -8
- package/dist/src/libs/positions/EigenLayer/index.js +0 -54
- package/dist/src/libs/positions/ajna/index.js +0 -107
- package/dist/src/libs/positions/badger/index.js +0 -80
- package/dist/src/libs/positions/clamm/index.js +0 -412
- package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.js +0 -36
- package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.js +0 -36
- package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.js +0 -42
- package/dist/src/libs/positions/clamm/thegraph/index.js +0 -163
- package/dist/src/libs/positions/compound/index.js +0 -91
- package/dist/src/libs/positions/dolomite/index.js +0 -51
- package/dist/src/libs/positions/erc20/index.js +0 -55
- package/dist/src/libs/positions/euler/index.js +0 -56
- package/dist/src/libs/positions/index.js +0 -56
- package/dist/src/libs/positions/morpho/index.js +0 -177
- package/dist/src/libs/positions/prepareFetch.js +0 -392
- package/dist/src/libs/positions/silo/index.js +0 -68
- package/dist/src/libs/positions/types.js +0 -1
- package/dist/src/libs/staticCampaigns.js +0 -15
- package/dist/src/libs/tokens/allowances.js +0 -18
- package/dist/src/libs/tokens/balances.js +0 -128
- package/dist/src/libs/tokens/tokenInfo.js +0 -22
- package/dist/src/modules/v4/accounting/accounting.controller.js +0 -61
- package/dist/src/modules/v4/accounting/accounting.model.js +0 -32
- package/dist/src/modules/v4/accounting/accounting.repository.js +0 -154
- package/dist/src/modules/v4/accounting/accounting.service.js +0 -107
- package/dist/src/modules/v4/airflow/airflow.service.js +0 -20
- package/dist/src/modules/v4/apr/apr.model.js +0 -13
- package/dist/src/modules/v4/apr/apr.service.js +0 -52
- package/dist/src/modules/v4/authentication/authentication.controller.js +0 -23
- package/dist/src/modules/v4/authentication/authentication.model.js +0 -6
- package/dist/src/modules/v4/authentication/authentication.service.js +0 -31
- package/dist/src/modules/v4/blacklist/blacklist.controller.js +0 -42
- package/dist/src/modules/v4/blacklist/blacklist.model.js +0 -13
- package/dist/src/modules/v4/blacklist/blacklist.repository.js +0 -50
- package/dist/src/modules/v4/blacklist/blacklist.service.js +0 -31
- package/dist/src/modules/v4/boost/boost.controller.js +0 -15
- package/dist/src/modules/v4/boost/boost.model.js +0 -14
- package/dist/src/modules/v4/boost/boost.service.js +0 -20
- package/dist/src/modules/v4/bucket/bucket.model.js +0 -85
- package/dist/src/modules/v4/bucket/bucket.service.js +0 -178
- package/dist/src/modules/v4/cache/cache.model.js +0 -14
- package/dist/src/modules/v4/cache/cache.repository.js +0 -22
- package/dist/src/modules/v4/cache/cache.service.js +0 -59
- package/dist/src/modules/v4/campaign/campaign.controller.js +0 -174
- package/dist/src/modules/v4/campaign/campaign.model.js +0 -140
- package/dist/src/modules/v4/campaign/campaign.repository.js +0 -535
- package/dist/src/modules/v4/campaign/campaign.service.js +0 -455
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +0 -127
- package/dist/src/modules/v4/chain/chain.controller.js +0 -44
- package/dist/src/modules/v4/chain/chain.model.js +0 -36
- package/dist/src/modules/v4/chain/chain.repository.js +0 -79
- package/dist/src/modules/v4/chain/chain.service.js +0 -55
- package/dist/src/modules/v4/chainInteraction/chainInteraction.service.js +0 -4
- package/dist/src/modules/v4/claims/claims.controller.js +0 -19
- package/dist/src/modules/v4/claims/claims.model.js +0 -1
- package/dist/src/modules/v4/claims/claims.repository.js +0 -39
- package/dist/src/modules/v4/claims/claims.service.js +0 -40
- package/dist/src/modules/v4/coingecko/coingecko.model.js +0 -1
- package/dist/src/modules/v4/coingecko/coingecko.repository.js +0 -9
- package/dist/src/modules/v4/coingecko/coingecko.service.js +0 -65
- package/dist/src/modules/v4/computedValue/computedValue.controller.js +0 -46
- package/dist/src/modules/v4/computedValue/computedValue.model.js +0 -30
- package/dist/src/modules/v4/computedValue/computedValue.repository.js +0 -48
- package/dist/src/modules/v4/computedValue/computedValue.service.js +0 -23
- package/dist/src/modules/v4/creator/creator.controller.js +0 -43
- package/dist/src/modules/v4/creator/creator.model.js +0 -42
- package/dist/src/modules/v4/creator/creator.repository.js +0 -69
- package/dist/src/modules/v4/creator/creator.service.js +0 -92
- package/dist/src/modules/v4/dynamicData/dynamicData.model.js +0 -56
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +0 -263
- package/dist/src/modules/v4/enso/enso.model.js +0 -147
- package/dist/src/modules/v4/enso/enso.service.js +0 -116
- package/dist/src/modules/v4/explorer/explorer.controller.js +0 -13
- package/dist/src/modules/v4/explorer/explorer.model.js +0 -8
- package/dist/src/modules/v4/explorer/explorer.repository.js +0 -23
- package/dist/src/modules/v4/explorer/explorer.service.js +0 -24
- package/dist/src/modules/v4/icon/icon.model.js +0 -1
- package/dist/src/modules/v4/icon/icon.service.js +0 -16
- package/dist/src/modules/v4/interaction/interaction.controller.js +0 -45
- package/dist/src/modules/v4/interaction/interaction.model.js +0 -25
- package/dist/src/modules/v4/interaction/interaction.service.js +0 -95
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +0 -83
- package/dist/src/modules/v4/kyberzap/kyberzap.service.js +0 -176
- package/dist/src/modules/v4/liquidity/implementations/AjnaPositionFetcher.js +0 -90
- package/dist/src/modules/v4/liquidity/implementations/BadgerPositionFetcher.js +0 -69
- package/dist/src/modules/v4/liquidity/implementations/ClammPositionFetcher.js +0 -61
- package/dist/src/modules/v4/liquidity/implementations/DolomitePositionFetcher.js +0 -45
- package/dist/src/modules/v4/liquidity/implementations/ERC20PositionFetcher.js +0 -47
- package/dist/src/modules/v4/liquidity/implementations/EulerPositionFetcher.js +0 -40
- package/dist/src/modules/v4/liquidity/liquidity.controller.js +0 -16
- package/dist/src/modules/v4/liquidity/liquidity.model.js +0 -5
- package/dist/src/modules/v4/liquidity/liquidity.repository.js +0 -6
- package/dist/src/modules/v4/liquidity/liquidity.service.js +0 -34
- package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +0 -31
- package/dist/src/modules/v4/merklRoot/merklRoot.model.js +0 -12
- package/dist/src/modules/v4/merklRoot/merklRoot.repository.js +0 -56
- package/dist/src/modules/v4/merklRoot/merklRoot.service.js +0 -48
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +0 -189
- package/dist/src/modules/v4/opportunity/opportunity.converter.js +0 -174
- package/dist/src/modules/v4/opportunity/opportunity.model.js +0 -132
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +0 -515
- package/dist/src/modules/v4/opportunity/opportunity.service.js +0 -380
- package/dist/src/modules/v4/opportunity/transform-id.pipe.js +0 -6
- package/dist/src/modules/v4/opportunity/validate-id.pipe.js +0 -12
- package/dist/src/modules/v4/price/price.controller.js +0 -56
- package/dist/src/modules/v4/price/price.model.js +0 -12
- package/dist/src/modules/v4/price/price.repository.js +0 -22
- package/dist/src/modules/v4/price/price.service.js +0 -63
- package/dist/src/modules/v4/prisma/index.js +0 -1
- package/dist/src/modules/v4/programPayload/programPayload.controller.js +0 -85
- package/dist/src/modules/v4/programPayload/programPayload.model.js +0 -179
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +0 -7553
- package/dist/src/modules/v4/programPayload/programPayload.service.js +0 -240
- package/dist/src/modules/v4/protocol/protocol.controller.js +0 -42
- package/dist/src/modules/v4/protocol/protocol.model.js +0 -186
- package/dist/src/modules/v4/protocol/protocol.repository.js +0 -175
- package/dist/src/modules/v4/protocol/protocol.service.js +0 -73
- package/dist/src/modules/v4/referral/referral.controller.js +0 -25
- package/dist/src/modules/v4/referral/referral.model.js +0 -12
- package/dist/src/modules/v4/referral/referral.service.js +0 -171
- package/dist/src/modules/v4/reward/reward.controller.js +0 -140
- package/dist/src/modules/v4/reward/reward.converter.js +0 -124
- package/dist/src/modules/v4/reward/reward.model.js +0 -153
- package/dist/src/modules/v4/reward/reward.repository.js +0 -350
- package/dist/src/modules/v4/reward/reward.service.js +0 -406
- package/dist/src/modules/v4/router.js +0 -93
- package/dist/src/modules/v4/status/status.controller.js +0 -68
- package/dist/src/modules/v4/status/status.model.js +0 -34
- package/dist/src/modules/v4/status/status.repository.js +0 -146
- package/dist/src/modules/v4/status/status.service.js +0 -150
- package/dist/src/modules/v4/token/token.controller.js +0 -118
- package/dist/src/modules/v4/token/token.model.js +0 -87
- package/dist/src/modules/v4/token/token.repository.js +0 -192
- package/dist/src/modules/v4/token/token.service.js +0 -410
- package/dist/src/modules/v4/tracer/tracer.service.js +0 -30
- package/dist/src/modules/v4/turtle/turtle.controller.js +0 -20
- package/dist/src/modules/v4/turtle/turtle.repository.js +0 -40
- package/dist/src/modules/v4/turtle/turtle.service.js +0 -28
- package/dist/src/modules/v4/tvl/tvl.model.js +0 -13
- package/dist/src/modules/v4/tvl/tvl.service.js +0 -63
- package/dist/src/modules/v4/uniswap/uniswap.controller.js +0 -100
- package/dist/src/modules/v4/uniswap/uniswap.model.js +0 -46
- package/dist/src/modules/v4/uniswap/uniswap.repository.js +0 -12
- package/dist/src/modules/v4/uniswap/uniswap.service.js +0 -245
- package/dist/src/modules/v4/user/user.controller.js +0 -77
- package/dist/src/modules/v4/user/user.model.js +0 -66
- package/dist/src/modules/v4/user/user.repository.js +0 -41
- package/dist/src/modules/v4/user/user.service.js +0 -102
- package/dist/src/plugins/error-handling.plugin.js +0 -34
- package/dist/src/routes/v1/allowances.js +0 -115
- package/dist/src/routes/v1/balances.js +0 -25
- package/dist/src/routes/v1/prices.js +0 -9
- package/dist/src/routes/v1/router.js +0 -6
- package/dist/src/routes/v1/tokens.js +0 -17
- package/dist/src/routes/v2/merkl.js +0 -13
- package/dist/src/routes/v2/router.js +0 -3
- package/dist/src/routes/v3/app.js +0 -43
- package/dist/src/routes/v3/blacklist.js +0 -19
- package/dist/src/routes/v3/campaign/delay.js +0 -81
- package/dist/src/routes/v3/campaignClaims.js +0 -29
- package/dist/src/routes/v3/campaignUnclaimed.js +0 -28
- package/dist/src/routes/v3/campaigns.js +0 -136
- package/dist/src/routes/v3/campaignsForMainParameter.js +0 -33
- package/dist/src/routes/v3/campaignsRewardsReport.js +0 -48
- package/dist/src/routes/v3/claims.js +0 -16
- package/dist/src/routes/v3/compoundV2.js +0 -9
- package/dist/src/routes/v3/createCampaign.js +0 -66
- package/dist/src/routes/v3/dolomite.js +0 -12
- package/dist/src/routes/v3/euler.js +0 -52
- package/dist/src/routes/v3/fetch.js +0 -27
- package/dist/src/routes/v3/health.js +0 -13
- package/dist/src/routes/v3/lostyield.js +0 -101
- package/dist/src/routes/v3/merkl.js +0 -119
- package/dist/src/routes/v3/morphoMarkets.js +0 -27
- package/dist/src/routes/v3/morphoVaults.js +0 -22
- package/dist/src/routes/v3/multiChainPositions.js +0 -70
- package/dist/src/routes/v3/opportunity.js +0 -28
- package/dist/src/routes/v3/overview.js +0 -72
- package/dist/src/routes/v3/parse.js +0 -23
- package/dist/src/routes/v3/payload.js +0 -40
- package/dist/src/routes/v3/poolInfo.js +0 -88
- package/dist/src/routes/v3/positions.js +0 -62
- package/dist/src/routes/v3/radiant.js +0 -26
- package/dist/src/routes/v3/recipients.js +0 -29
- package/dist/src/routes/v3/rewards.js +0 -36
- package/dist/src/routes/v3/rewardsReport.js +0 -40
- package/dist/src/routes/v3/router.js +0 -70
- package/dist/src/routes/v3/silo.js +0 -20
- package/dist/src/routes/v3/token.js +0 -24
- package/dist/src/routes/v3/twt/participants.js +0 -63
- package/dist/src/routes/v3/uniswapv4.js +0 -29
- package/dist/src/routes/v3/updates.js +0 -47
- package/dist/src/routes/v3/userRewards.js +0 -63
- package/dist/src/scripts/fill-coingecko-data.js +0 -3
- package/dist/src/scripts/fill-descriptions.js +0 -101
- package/dist/src/scripts/fill-unknown-tokens.js +0 -58
- package/dist/src/scripts/reparse-opportunities.js +0 -75
- package/dist/src/types/external/spectraAPI.js +0 -1
- package/dist/src/types/index.js +0 -1
- package/dist/src/utils/TailSampler.js +0 -23
- package/dist/src/utils/bigintToString.js +0 -20
- package/dist/src/utils/caseChanges.js +0 -15
- package/dist/src/utils/decodeCalls.js +0 -340
- package/dist/src/utils/encodeCalls.js +0 -506
- package/dist/src/utils/error.js +0 -114
- package/dist/src/utils/execute.js +0 -117
- package/dist/src/utils/generateCardName.js +0 -209
- package/dist/src/utils/generic.js +0 -43
- package/dist/src/utils/hashArray.js +0 -7
- package/dist/src/utils/lastBlockBefore.js +0 -78
- package/dist/src/utils/logger.js +0 -52
- package/dist/src/utils/parseDistributionType.js +0 -16
- package/dist/src/utils/pricer.js +0 -189
- package/dist/src/utils/prices/chainlinkRead.js +0 -8
- package/dist/src/utils/prices/curveVirtualPrice.js +0 -7
- package/dist/src/utils/prices/getDQUICK.js +0 -8
- package/dist/src/utils/prices/priceFetcherFactory.js +0 -32
- package/dist/src/utils/prices/priceService.js +0 -274
- package/dist/src/utils/prices/services/OnChainCallService.js +0 -38
- package/dist/src/utils/prices/services/coinGeckoService.js +0 -63
- package/dist/src/utils/prices/services/defillamaService.js +0 -53
- package/dist/src/utils/prices/services/dexScreenerService.js +0 -62
- package/dist/src/utils/prices/services/erc4626Service.js +0 -38
- package/dist/src/utils/prices/services/getERC4626.js +0 -11
- package/dist/src/utils/prices/services/indexCoopService.js +0 -55
- package/dist/src/utils/prices/services/priceFetcher.js +0 -1
- package/dist/src/utils/prices/uniV2Price.js +0 -40
- package/dist/src/utils/providers.js +0 -37
- package/dist/src/utils/queries/allCampaigns.js +0 -12
- package/dist/src/utils/sanitizeChain.js +0 -6
- package/dist/src/utils/stryke.js +0 -4
- package/dist/src/utils/throw.js +0 -55
- package/dist/tsconfig.package.tsbuildinfo +0 -1
@@ -1,412 +0,0 @@
|
|
1
|
-
import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
2
|
-
// @ts-nocheck
|
3
|
-
import { CacheService } from "@/modules/v4/cache/cache.service";
|
4
|
-
import { ChainInteractionService } from "@/modules/v4/chainInteraction/chainInteraction.service";
|
5
|
-
import { log } from "@/utils/logger";
|
6
|
-
import { Pricer } from "@/utils/pricer";
|
7
|
-
import { providers } from "@/utils/providers";
|
8
|
-
import { ALM, AMMAlgorithmMapping, BN2Number, NETWORK_LABELS, NFTManagerAddress, NonFungiblePositionManagerInterface, PoolInterface, PoolState, SqrtPrice, YEAR, getAmountsForLiquidity, getSupportedNFPWrapperMapping, getTickAtSqrtRatio, spNFTInterface, } from "@sdk";
|
9
|
-
import { BigNumber, Contract, utils } from "ethers";
|
10
|
-
import JSBI from "jsbi";
|
11
|
-
import { fetchAlmPositions } from "./thegraph/fetchAlmPositions";
|
12
|
-
import { fetchAmmPositions } from "./thegraph/fetchAmmPositions";
|
13
|
-
import { fetchFarmedPositions } from "./thegraph/fetchFarmedPositions";
|
14
|
-
export async function getClammUserPositions(user, chainId, poolsByAmm, withIndividualAPRs = true) {
|
15
|
-
const pricer = await Pricer.load();
|
16
|
-
/**
|
17
|
-
* Fetch user positions
|
18
|
-
*/
|
19
|
-
const promisePositions = [
|
20
|
-
fetchAmmPositions(chainId, user, (!!poolsByAmm ? Object.keys(poolsByAmm) : []).map(x => Number(x))),
|
21
|
-
fetchAlmPositions(chainId, user),
|
22
|
-
];
|
23
|
-
/**
|
24
|
-
* Per pool mapping to store all ids of positions that were wrapped into a farm
|
25
|
-
* @notice see line 110 for more context
|
26
|
-
*/
|
27
|
-
const farmedTokenIds = {};
|
28
|
-
const calls = [];
|
29
|
-
const callsByAmm = {};
|
30
|
-
let startingIndex = 0;
|
31
|
-
/** Add on onchain calls at the pool level */
|
32
|
-
if (!!poolsByAmm) {
|
33
|
-
for (const [amm, poolDatas] of Object.entries(poolsByAmm)) {
|
34
|
-
const pools = Object.keys(poolDatas);
|
35
|
-
if (!callsByAmm[amm]) {
|
36
|
-
callsByAmm[amm] = {
|
37
|
-
start: startingIndex,
|
38
|
-
poolCalls: pools.length,
|
39
|
-
wrapperCalls: {},
|
40
|
-
};
|
41
|
-
}
|
42
|
-
for (const pool of pools) {
|
43
|
-
calls.push({
|
44
|
-
allowFailure: true,
|
45
|
-
callData: PoolInterface[AMMAlgorithmMapping[amm]].encodeFunctionData(PoolState[AMMAlgorithmMapping[amm]]),
|
46
|
-
target: pool,
|
47
|
-
});
|
48
|
-
startingIndex++;
|
49
|
-
}
|
50
|
-
if (getSupportedNFPWrapperMapping(chainId, amm).length > 0) {
|
51
|
-
farmedTokenIds[amm] = await CacheService.wrap(TTLPresets.MIN_5, fetchFarmedPositions, chainId, [user], Number(amm));
|
52
|
-
}
|
53
|
-
for (const wrapper of getSupportedNFPWrapperMapping(chainId, amm)) {
|
54
|
-
if (!!farmedTokenIds &&
|
55
|
-
!!farmedTokenIds?.[amm] &&
|
56
|
-
!!farmedTokenIds?.[amm]?.[wrapper] &&
|
57
|
-
farmedTokenIds?.[amm]?.[wrapper].length > 0) {
|
58
|
-
if (!callsByAmm[amm].wrapperCalls[wrapper]) {
|
59
|
-
callsByAmm[amm].wrapperCalls[wrapper] = 0;
|
60
|
-
}
|
61
|
-
farmedTokenIds?.[amm]?.[wrapper]
|
62
|
-
?.map((pos) => pos.id)
|
63
|
-
?.forEach((tokenId) => {
|
64
|
-
calls.push({
|
65
|
-
allowFailure: true,
|
66
|
-
callData: NonFungiblePositionManagerInterface[AMMAlgorithmMapping[amm]].encodeFunctionData("positions", [tokenId]),
|
67
|
-
target: NFTManagerAddress[chainId][amm],
|
68
|
-
});
|
69
|
-
callsByAmm[amm].wrapperCalls[wrapper]++;
|
70
|
-
startingIndex++;
|
71
|
-
});
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
const result = await ChainInteractionService(chainId).fetchState(calls);
|
77
|
-
const [promisePosition, promiseALMPosition] = await Promise.all(promisePositions);
|
78
|
-
const positions = Object.values((await Promise.resolve(promisePosition))).reduce((acc, val) => {
|
79
|
-
return acc.concat(val.nft).concat(val.direct);
|
80
|
-
}, []);
|
81
|
-
/** Fill user positions */
|
82
|
-
const finalRes = {};
|
83
|
-
if (!!poolsByAmm) {
|
84
|
-
for (const [amm, poolDatas] of Object.entries(poolsByAmm)) {
|
85
|
-
const pools = Object.keys(poolDatas);
|
86
|
-
let i = callsByAmm[amm].start;
|
87
|
-
for (const p of pools) {
|
88
|
-
try {
|
89
|
-
const res = {
|
90
|
-
userPositions: [],
|
91
|
-
apr: {},
|
92
|
-
userTVL: 0,
|
93
|
-
userBalanceToken0: 0,
|
94
|
-
userBalanceToken1: 0,
|
95
|
-
userTotalLiquidity: 0,
|
96
|
-
userInRangeLiquidity: 0,
|
97
|
-
};
|
98
|
-
const updateUserPosition = (x) => {
|
99
|
-
res.userPositions?.push(x);
|
100
|
-
// Update global data logic
|
101
|
-
res.userTVL += x.tvl ?? 0;
|
102
|
-
res.userBalanceToken0 += x.balance0 ?? 0;
|
103
|
-
res.userBalanceToken1 += x.balance1 ?? 0;
|
104
|
-
res.userTotalLiquidity += x.totalLiquidity ?? 0;
|
105
|
-
res.userInRangeLiquidity += x.inRangeLiquidity ?? 0;
|
106
|
-
};
|
107
|
-
const sqrtPriceX96 = PoolInterface[AMMAlgorithmMapping[amm]]
|
108
|
-
.decodeFunctionResult(PoolState[AMMAlgorithmMapping[amm]], result[i++].returnData)[SqrtPrice[AMMAlgorithmMapping[amm]]].toString();
|
109
|
-
res.tick = getTickAtSqrtRatio(JSBI.BigInt(sqrtPriceX96));
|
110
|
-
res.userTVL = 0;
|
111
|
-
res.userBalanceToken0 = 0;
|
112
|
-
res.userBalanceToken1 = 0;
|
113
|
-
res.userTotalLiquidity = 0;
|
114
|
-
res.userInRangeLiquidity = 0;
|
115
|
-
const priceToken0 = (await pricer.get({
|
116
|
-
address: poolDatas[p].token0,
|
117
|
-
chainId,
|
118
|
-
symbol: poolDatas[p].symbolToken0,
|
119
|
-
}));
|
120
|
-
const priceToken1 = (await pricer.get({
|
121
|
-
address: poolDatas[p].token1,
|
122
|
-
chainId,
|
123
|
-
symbol: poolDatas[p].symbolToken1,
|
124
|
-
}));
|
125
|
-
/** 1_ User Liquidity Positions */
|
126
|
-
const userNonALMPositions = positions?.filter((x) => utils.getAddress(x.pool.id) === utils.getAddress(p));
|
127
|
-
for (const pos of userNonALMPositions) {
|
128
|
-
try {
|
129
|
-
const [amount0, amount1] = getAmountsForLiquidity(sqrtPriceX96, Number.parseInt(pos.tickLower), Number.parseInt(pos.tickUpper), BigNumber.from(pos.liquidity));
|
130
|
-
const balance0 = BN2Number(amount0, poolDatas[p].decimalsToken0);
|
131
|
-
const balance1 = BN2Number(amount1, poolDatas[p].decimalsToken1);
|
132
|
-
const tvl = balance0 * priceToken0 + balance1 * priceToken1;
|
133
|
-
updateUserPosition({
|
134
|
-
balance0,
|
135
|
-
balance1,
|
136
|
-
id: pos.id,
|
137
|
-
inRangeLiquidity: balance0 > 0 && balance1 > 0 ? BN2Number(pos.liquidity) : 0,
|
138
|
-
lowerTick: Number.parseInt(pos.tickLower),
|
139
|
-
origin: -1,
|
140
|
-
totalLiquidity: BN2Number(pos.liquidity),
|
141
|
-
tvl,
|
142
|
-
upperTick: Number.parseInt(pos.tickUpper),
|
143
|
-
});
|
144
|
-
}
|
145
|
-
catch {
|
146
|
-
log.local(`Merkl User Data: error handling positions for pool ${NETWORK_LABELS[chainId]}-${p}`);
|
147
|
-
}
|
148
|
-
}
|
149
|
-
/** 2_ User Positions through ALMs */
|
150
|
-
for (const almAddress of Object.keys(promiseALMPosition).filter(almAddress => !!poolDatas[p].forwarders[utils.getAddress(almAddress)])) {
|
151
|
-
try {
|
152
|
-
const almDetail = poolDatas[p].forwarders[utils.getAddress(almAddress)];
|
153
|
-
let balance;
|
154
|
-
if (almDetail.origin === ALM.spNFT) {
|
155
|
-
const tokenId = promiseALMPosition[almAddress];
|
156
|
-
balance = (await new Contract(almAddress, spNFTInterface, providers[chainId]).getStakingPosition(tokenId))[0];
|
157
|
-
}
|
158
|
-
else {
|
159
|
-
balance = promiseALMPosition[almAddress];
|
160
|
-
}
|
161
|
-
for (const pos of almDetail.positions) {
|
162
|
-
updateUserPosition({
|
163
|
-
almAddress: almAddress, // FIXME: typing is bypassed here
|
164
|
-
balance0: (BN2Number(balance) * pos?.balance0) / almDetail.totalSupply,
|
165
|
-
balance1: (BN2Number(balance) * pos?.balance1) / almDetail.totalSupply,
|
166
|
-
id: pos.id,
|
167
|
-
inRangeLiquidity: (BN2Number(balance) * pos?.inRangeLiquidity) / almDetail.totalSupply,
|
168
|
-
lowerTick: pos.lowerTick,
|
169
|
-
origin: almDetail.origin,
|
170
|
-
totalLiquidity: (BN2Number(balance) * pos?.totalLiquidity) / almDetail.totalSupply,
|
171
|
-
tvl: (BN2Number(balance) * pos?.tvl) / almDetail.totalSupply,
|
172
|
-
upperTick: pos.upperTick,
|
173
|
-
});
|
174
|
-
}
|
175
|
-
}
|
176
|
-
catch (_error) {
|
177
|
-
log.local(`Merkl User Data: error handling alm positions for pool ${NETWORK_LABELS[chainId]}-${p}`);
|
178
|
-
}
|
179
|
-
}
|
180
|
-
/** 3_ User positions that were deposited on non fungible positions wrapper contracts (eg. farms) */
|
181
|
-
let j = callsByAmm[amm].start + callsByAmm[amm].poolCalls;
|
182
|
-
if (getSupportedNFPWrapperMapping(chainId, amm).length > 0) {
|
183
|
-
const nonFungiblePositionManagerInterface = NonFungiblePositionManagerInterface[AMMAlgorithmMapping[amm]];
|
184
|
-
for (const wrapper of getSupportedNFPWrapperMapping(chainId, amm)) {
|
185
|
-
if (!!farmedTokenIds?.[amm] && farmedTokenIds?.[amm][wrapper].length > 0) {
|
186
|
-
for (let k = 0; k < farmedTokenIds[amm][wrapper].length; k++) {
|
187
|
-
if (farmedTokenIds[amm][wrapper][k].pool !== p.toLowerCase()) {
|
188
|
-
j++;
|
189
|
-
continue;
|
190
|
-
}
|
191
|
-
const posLiquidity = nonFungiblePositionManagerInterface.decodeFunctionResult("positions", result[j].returnData).liquidity;
|
192
|
-
const tickLower = Number.parseFloat(nonFungiblePositionManagerInterface
|
193
|
-
.decodeFunctionResult("positions", result[j].returnData)
|
194
|
-
.tickLower.toString());
|
195
|
-
const tickUpper = Number.parseFloat(nonFungiblePositionManagerInterface
|
196
|
-
.decodeFunctionResult("positions", result[j++].returnData)
|
197
|
-
.tickUpper.toString());
|
198
|
-
try {
|
199
|
-
const [amount0, amount1] = getAmountsForLiquidity(sqrtPriceX96, tickLower, tickUpper, posLiquidity);
|
200
|
-
const balance0 = BN2Number(amount0, poolDatas[p].decimalsToken0);
|
201
|
-
const balance1 = BN2Number(amount1, poolDatas[p].decimalsToken1);
|
202
|
-
const priceToken0 = (await pricer.get({
|
203
|
-
address: poolDatas[p].token0,
|
204
|
-
chainId,
|
205
|
-
symbol: poolDatas[p].symbolToken0,
|
206
|
-
}));
|
207
|
-
const priceToken1 = (await pricer.get({
|
208
|
-
address: poolDatas[p].token1,
|
209
|
-
chainId,
|
210
|
-
symbol: poolDatas[p].symbolToken1,
|
211
|
-
}));
|
212
|
-
const tvl = balance0 * priceToken0 + balance1 * priceToken1;
|
213
|
-
updateUserPosition({
|
214
|
-
almAddress: farmedTokenIds[amm][wrapper][k].farmAddress,
|
215
|
-
balance0,
|
216
|
-
balance1,
|
217
|
-
id: farmedTokenIds[amm][wrapper][k].id,
|
218
|
-
inRangeLiquidity: balance0 > 0 && balance1 > 0 ? BN2Number(posLiquidity) : 0,
|
219
|
-
lowerTick: tickLower,
|
220
|
-
origin: -2 - Number.parseInt(String(wrapper)), // -2 - X means NFT Wrapper
|
221
|
-
totalLiquidity: BN2Number(posLiquidity),
|
222
|
-
tvl,
|
223
|
-
upperTick: tickUpper,
|
224
|
-
});
|
225
|
-
}
|
226
|
-
catch (_e) {
|
227
|
-
log.local(`Merkl User Data: error handling positions for pool ${NETWORK_LABELS[chainId]}-${p}`);
|
228
|
-
}
|
229
|
-
}
|
230
|
-
}
|
231
|
-
}
|
232
|
-
}
|
233
|
-
if (withIndividualAPRs) {
|
234
|
-
/** Individual APRs */
|
235
|
-
let individualApr = 0;
|
236
|
-
const oneDistributionIsBoosted = false;
|
237
|
-
for (const campaignDatas of Object.values(poolDatas[p].campaigns)) {
|
238
|
-
const campaignData = campaignDatas;
|
239
|
-
let userBalance0 = res.userBalanceToken0;
|
240
|
-
let userBalance1 = res.userBalanceToken1;
|
241
|
-
let userInRangeLiquidity = res.userInRangeLiquidity;
|
242
|
-
let userTotalLiquidity = res.userTotalLiquidity;
|
243
|
-
const priceRewardToken = (await pricer.get({
|
244
|
-
address: campaignData.rewardToken,
|
245
|
-
chainId,
|
246
|
-
symbol: campaignData.symbolRewardToken,
|
247
|
-
}));
|
248
|
-
/** Handle whitelist to compute APR */
|
249
|
-
if (campaignData.whitelist.length > 0) {
|
250
|
-
const aux = campaignData.whitelist.reduce((acc, whitelistedAddress) => {
|
251
|
-
/** 1_ User is whitelisted */
|
252
|
-
if (user.toLowerCase() === whitelistedAddress.toLowerCase()) {
|
253
|
-
acc.balance0 += res.userBalanceToken0;
|
254
|
-
acc.balance1 += res.userBalanceToken1;
|
255
|
-
acc.inRangeLiquidity += res.userInRangeLiquidity;
|
256
|
-
acc.totalLiquidity += res.userTotalLiquidity;
|
257
|
-
}
|
258
|
-
else if (res.userPositions
|
259
|
-
.map((w) => (!!w?.almAddress ? w?.almAddress?.toLowerCase() : null))
|
260
|
-
?.filter((a) => !!a)
|
261
|
-
.includes(whitelistedAddress.toLowerCase())) {
|
262
|
-
/**
|
263
|
-
* 2_ ALM is whitelisted and/or Nf positions vault is whitelisted
|
264
|
-
* @dev for simplicity purposes, vault address is marked as `almAddress`
|
265
|
-
*/
|
266
|
-
let index = -1;
|
267
|
-
const positionsAddresses = res.userPositions.map((w) => w.almAddress?.toLowerCase());
|
268
|
-
while (true) {
|
269
|
-
const newIndex = positionsAddresses.slice(index + 1).indexOf(whitelistedAddress.toLowerCase());
|
270
|
-
if (newIndex === -1)
|
271
|
-
break;
|
272
|
-
index = index + 1 + newIndex;
|
273
|
-
acc.balance0 += res.userPositions[index].balance0;
|
274
|
-
acc.balance1 += res.userPositions[index].balance1;
|
275
|
-
acc.inRangeLiquidity += res.userPositions[index].inRangeLiquidity;
|
276
|
-
acc.totalLiquidity += res.userPositions[index].totalLiquidity;
|
277
|
-
}
|
278
|
-
}
|
279
|
-
else if (res.userPositions
|
280
|
-
.map((w) => !!w?.almAddress
|
281
|
-
? poolDatas[p].forwarders[utils.getAddress(w?.almAddress)]?.target?.toLowerCase()
|
282
|
-
: null)
|
283
|
-
?.filter((a) => !!a)
|
284
|
-
.includes(whitelistedAddress?.toLowerCase())) {
|
285
|
-
/** 3_ ALM target is whitelisted */
|
286
|
-
let index = -1;
|
287
|
-
const positionsAddresses = res.userPositions.map((w) => !!w?.almAddress &&
|
288
|
-
poolDatas[p].forwarders[utils.getAddress(w?.almAddress)]?.target.toLowerCase());
|
289
|
-
while (true) {
|
290
|
-
const newIndex = positionsAddresses.slice(index + 1).indexOf(whitelistedAddress.toLowerCase());
|
291
|
-
if (newIndex === -1)
|
292
|
-
break;
|
293
|
-
index = index + 1 + newIndex;
|
294
|
-
acc.balance0 += res.userPositions[index].balance0;
|
295
|
-
acc.balance1 += res.userPositions[index].balance1;
|
296
|
-
acc.inRangeLiquidity += res.userPositions[index].inRangeLiquidity;
|
297
|
-
acc.totalLiquidity += res.userPositions[index].totalLiquidity;
|
298
|
-
}
|
299
|
-
}
|
300
|
-
return acc;
|
301
|
-
}, {
|
302
|
-
balance0: 0,
|
303
|
-
balance1: 0,
|
304
|
-
inRangeLiquidity: 0,
|
305
|
-
totalLiquidity: 0,
|
306
|
-
});
|
307
|
-
userBalance0 = Math.max(0, aux.balance0);
|
308
|
-
userBalance1 = Math.max(0, aux.balance1);
|
309
|
-
userInRangeLiquidity = Math.max(0, aux.inRangeLiquidity);
|
310
|
-
userTotalLiquidity = Math.max(0, aux.inRangeLiquidity);
|
311
|
-
}
|
312
|
-
else if (campaignData.blacklist.length > 0) {
|
313
|
-
/** Handle blacklist to compute APR */
|
314
|
-
const aux = campaignData.blacklist.reduce((acc, blacklistedAddress) => {
|
315
|
-
/** 1_ User is blacklisted */
|
316
|
-
if (user.toLowerCase() === blacklistedAddress.toLowerCase()) {
|
317
|
-
acc.balance0 -= res.userBalanceToken0;
|
318
|
-
acc.balance1 -= res.userBalanceToken1;
|
319
|
-
acc.inRangeLiquidity -= res.userInRangeLiquidity;
|
320
|
-
}
|
321
|
-
else if (res.userPositions
|
322
|
-
.map((w) => (!!w?.almAddress ? w?.almAddress?.toLowerCase() : null))
|
323
|
-
?.filter((a) => !!a)
|
324
|
-
.includes(blacklistedAddress.toLowerCase())) {
|
325
|
-
/** 2_ ALM and/or NFP vault is blacklisted */
|
326
|
-
let index = -1;
|
327
|
-
const positionsAddresses = res.userPositions.map((w) => w.almAddress?.toLowerCase());
|
328
|
-
while (true) {
|
329
|
-
const newIndex = positionsAddresses.slice(index + 1).indexOf(blacklistedAddress.toLowerCase());
|
330
|
-
if (newIndex === -1)
|
331
|
-
break;
|
332
|
-
index = index + 1 + newIndex;
|
333
|
-
acc.balance0 -= res.userPositions[index].balance0;
|
334
|
-
acc.balance1 -= res.userPositions[index].balance1;
|
335
|
-
acc.inRangeLiquidity -= res.userPositions[index].inRangeLiquidity;
|
336
|
-
acc.totalLiquidity -= res.userPositions[index].totalLiquidity;
|
337
|
-
}
|
338
|
-
}
|
339
|
-
else if (
|
340
|
-
/** 3_ Target is blacklisted */
|
341
|
-
res.userPositions
|
342
|
-
.map((w) => !!w?.almAddress
|
343
|
-
? poolDatas[p].forwarders[utils.getAddress(w?.almAddress)]?.target?.toLowerCase()
|
344
|
-
: null)
|
345
|
-
?.filter((a) => !!a)
|
346
|
-
.includes(blacklistedAddress.toLowerCase())) {
|
347
|
-
let index = -1;
|
348
|
-
const positionsAddresses = res.userPositions.map((w) => !!w?.almAddress &&
|
349
|
-
poolDatas[p].forwarders[utils.getAddress(w?.almAddress)]?.target.toLowerCase());
|
350
|
-
while (true) {
|
351
|
-
const newIndex = positionsAddresses.slice(index + 1).indexOf(blacklistedAddress.toLowerCase());
|
352
|
-
if (newIndex === -1)
|
353
|
-
break;
|
354
|
-
index = index + 1 + newIndex;
|
355
|
-
acc.balance0 -= res.userPositions[index].balance0;
|
356
|
-
acc.balance1 -= res.userPositions[index].balance1;
|
357
|
-
acc.inRangeLiquidity -= res.userPositions[index].inRangeLiquidity;
|
358
|
-
acc.totalLiquidity -= res.userPositions[index].totalLiquidity;
|
359
|
-
}
|
360
|
-
}
|
361
|
-
return acc;
|
362
|
-
}, {
|
363
|
-
balance0: res.userBalanceToken0,
|
364
|
-
balance1: res.userBalanceToken1,
|
365
|
-
inRangeLiquidity: res.userInRangeLiquidity,
|
366
|
-
totalLiquidity: 0,
|
367
|
-
});
|
368
|
-
userBalance0 = Math.max(0, aux.balance0);
|
369
|
-
userBalance1 = Math.max(0, aux.balance1);
|
370
|
-
userInRangeLiquidity = Math.max(0, aux.inRangeLiquidity);
|
371
|
-
userTotalLiquidity = Math.max(0, aux.inRangeLiquidity);
|
372
|
-
}
|
373
|
-
/** Yearly rewards in $ */
|
374
|
-
const distributionDuration = campaignData.endTimestamp - campaignData.startTimestamp;
|
375
|
-
const yearlyAmountDistributed = priceRewardToken * campaignData.amount * YEAR;
|
376
|
-
const yearlyToken0Rewards = (campaignData.propToken0 * yearlyAmountDistributed) / distributionDuration;
|
377
|
-
const yearlyToken1Rewards = (campaignData.propToken1 * yearlyAmountDistributed) / distributionDuration;
|
378
|
-
const yearlyFeeRewards = (campaignData.propFees * yearlyAmountDistributed) / distributionDuration;
|
379
|
-
// Approximation because it uses `poolTotalLiquidity` which may contain out of range liquidity
|
380
|
-
// Approximation as well because the out of range / in range is for all positions and not "per position"
|
381
|
-
let campaignIndividualAPR = !campaignData.isOutOfRangeIncentivized && (!userBalance0 || !userBalance1)
|
382
|
-
? 0
|
383
|
-
: ((yearlyToken0Rewards * userBalance0) /
|
384
|
-
(poolDatas[p].poolBalanceToken0 - (campaignData.blacklistedBalance0 ?? 0)) +
|
385
|
-
(yearlyToken1Rewards * userBalance1) /
|
386
|
-
(poolDatas[p].poolBalanceToken1 - (campaignData.blacklistedBalance1 ?? 0)) +
|
387
|
-
(yearlyFeeRewards *
|
388
|
-
(campaignData.isOutOfRangeIncentivized ? userTotalLiquidity : userInRangeLiquidity)) /
|
389
|
-
(poolDatas[p].poolTotalLiquidity - (campaignData.blacklistedLiquidity ?? 0))) /
|
390
|
-
res.userTVL;
|
391
|
-
campaignIndividualAPR =
|
392
|
-
!campaignIndividualAPR || Number.isNaN(campaignIndividualAPR) ? 0 : campaignIndividualAPR;
|
393
|
-
individualApr += campaignIndividualAPR;
|
394
|
-
}
|
395
|
-
if (!!individualApr) {
|
396
|
-
res.apr[`User current APR ${oneDistributionIsBoosted ? "(based on last distribution boost)" : ""}`] =
|
397
|
-
individualApr;
|
398
|
-
}
|
399
|
-
}
|
400
|
-
if (res.userPositions.length > 0) {
|
401
|
-
finalRes[`2_${poolDatas[p].mainParameter ?? p}`] = { ...res };
|
402
|
-
}
|
403
|
-
}
|
404
|
-
catch (_e) {
|
405
|
-
console.error(_e);
|
406
|
-
log.local(`merkl User Data: error for pool ${NETWORK_LABELS[chainId]}-${p}`);
|
407
|
-
}
|
408
|
-
}
|
409
|
-
}
|
410
|
-
}
|
411
|
-
return finalRes;
|
412
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { log } from "@/utils/logger";
|
2
|
-
// @ts-nocheck
|
3
|
-
import { ALM, NETWORK_LABELS, merklSubgraphALMEndpoints, withTimeout } from "@sdk";
|
4
|
-
import { BigNumber } from "ethers";
|
5
|
-
import { request } from "graphql-request";
|
6
|
-
import { almBalancesQuery, almNFTBalancesQuery } from ".";
|
7
|
-
import { MERKL_USER_POSITION_FETCHING_TIMEOUT } from "../../../../constants";
|
8
|
-
export async function fetchAlmPositions(chainId, user) {
|
9
|
-
const res = {};
|
10
|
-
const availableALMEndpoints = merklSubgraphALMEndpoints[chainId];
|
11
|
-
if (Object.keys(availableALMEndpoints).length > 0) {
|
12
|
-
const almPromises = Object.keys(availableALMEndpoints).map(async (alm) => {
|
13
|
-
// FIXME: find another way to assess this issue
|
14
|
-
const tgURL = availableALMEndpoints[alm];
|
15
|
-
if (!!tgURL) {
|
16
|
-
const query = Number.parseInt(alm) === ALM.spNFT ||
|
17
|
-
Number.parseInt(alm) === ALM.ConcentricStaker ||
|
18
|
-
Number.parseInt(alm) === ALM.GammaChef
|
19
|
-
? almNFTBalancesQuery
|
20
|
-
: almBalancesQuery;
|
21
|
-
await withTimeout(request(tgURL, query, {
|
22
|
-
owner: user.toLowerCase(),
|
23
|
-
}).then(requestRes => {
|
24
|
-
requestRes.holders.forEach(holder => {
|
25
|
-
res[holder.token] = BigNumber.from(Number.parseInt(alm) === ALM.spNFT ? holder.tokenId : holder.balance);
|
26
|
-
});
|
27
|
-
}), MERKL_USER_POSITION_FETCHING_TIMEOUT).catch(error => {
|
28
|
-
const service = `Merkl ALM Subgraph for ${NETWORK_LABELS[chainId]} ${ALM[alm]}`;
|
29
|
-
log.error(service, error, service, tgURL);
|
30
|
-
});
|
31
|
-
}
|
32
|
-
});
|
33
|
-
await Promise.all(almPromises);
|
34
|
-
}
|
35
|
-
return res;
|
36
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { log } from "@/utils/logger";
|
2
|
-
// @ts-nocheck
|
3
|
-
import { AMM, NETWORK_LABELS, merklSubgraphAMMEndpoints, withTimeout } from "@sdk";
|
4
|
-
import { request } from "graphql-request";
|
5
|
-
import { positionsQuery } from ".";
|
6
|
-
import { MERKL_USER_POSITION_FETCHING_TIMEOUT } from "../../../../constants";
|
7
|
-
export async function fetchAmmPositions(chainId, user, amms) {
|
8
|
-
const res = {};
|
9
|
-
const promises = amms.map(async (amm) => {
|
10
|
-
const tgURL = merklSubgraphAMMEndpoints[chainId][amm];
|
11
|
-
if (!!tgURL && tgURL !== "") {
|
12
|
-
await withTimeout(request(tgURL, positionsQuery, {
|
13
|
-
owner: user?.toLowerCase(),
|
14
|
-
}), MERKL_USER_POSITION_FETCHING_TIMEOUT)
|
15
|
-
.then(fetchedData => {
|
16
|
-
res[amm] = { nft: [], direct: [] };
|
17
|
-
res[amm].nft = fetchedData?.nft?.reduce((prev, curr) => {
|
18
|
-
if (!prev.map(i => i.id).includes(curr.id))
|
19
|
-
prev.push(curr);
|
20
|
-
return prev;
|
21
|
-
}, []);
|
22
|
-
res[amm].direct = fetchedData?.direct?.reduce((prev, curr) => {
|
23
|
-
if (!prev.map(i => i.id).includes(curr.id))
|
24
|
-
prev.push(curr);
|
25
|
-
return prev;
|
26
|
-
}, []);
|
27
|
-
})
|
28
|
-
.catch(error => {
|
29
|
-
const service = `Merkl AMM Subgraph for ${NETWORK_LABELS[chainId]} ${AMM[amm]}`;
|
30
|
-
log.error(service, error, service, tgURL);
|
31
|
-
});
|
32
|
-
}
|
33
|
-
});
|
34
|
-
await Promise.all(promises);
|
35
|
-
return res;
|
36
|
-
}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
// @ts-nocheck
|
2
|
-
import { MERKL_USER_POSITION_FETCHING_TIMEOUT } from "@/constants";
|
3
|
-
import { log } from "@/utils/logger";
|
4
|
-
import { AMM, NETWORK_LABELS, getSupportedNFPWrapperMapping, merklSubgraphNFPWrapperEndpoints, withTimeout, } from "@sdk";
|
5
|
-
import { request } from "graphql-request";
|
6
|
-
import { nftWrapperPositionsQuery } from ".";
|
7
|
-
export async function fetchFarmedPositions(chainId, owners, amm) {
|
8
|
-
const res = {};
|
9
|
-
const promises = getSupportedNFPWrapperMapping(chainId, amm).map(async (wrapper) => {
|
10
|
-
const tgURL = merklSubgraphNFPWrapperEndpoints[chainId][wrapper];
|
11
|
-
if (!!tgURL) {
|
12
|
-
await withTimeout((async () => {
|
13
|
-
let hasFollowingPage = true;
|
14
|
-
let skip = 0;
|
15
|
-
while (hasFollowingPage) {
|
16
|
-
const auxRes = await request(tgURL, nftWrapperPositionsQuery, {
|
17
|
-
first: 1_000,
|
18
|
-
owners: owners.map(owner => owner.toLowerCase()),
|
19
|
-
skip,
|
20
|
-
});
|
21
|
-
if (auxRes.holderNFTs.length < 1000) {
|
22
|
-
hasFollowingPage = false;
|
23
|
-
}
|
24
|
-
skip += 1000;
|
25
|
-
res[wrapper] = (res[wrapper] ?? []).concat(auxRes.holderNFTs.map(p => {
|
26
|
-
return {
|
27
|
-
farmAddress: p.id.split("_")[2],
|
28
|
-
id: p.tokenId,
|
29
|
-
pool: p.token,
|
30
|
-
holder: p.holder,
|
31
|
-
};
|
32
|
-
}));
|
33
|
-
}
|
34
|
-
})(), MERKL_USER_POSITION_FETCHING_TIMEOUT).catch(error => {
|
35
|
-
const service = `merkl non fungible pos wrapper subgraph for ${NETWORK_LABELS[chainId]} ${AMM[amm]}`;
|
36
|
-
log.error(service, error, service, tgURL);
|
37
|
-
});
|
38
|
-
}
|
39
|
-
});
|
40
|
-
await Promise.all(promises);
|
41
|
-
return res;
|
42
|
-
}
|