@merkl/api 0.21.47 → 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 +450 -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 -7567
- 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
package/dist/src/utils/pricer.js
DELETED
@@ -1,189 +0,0 @@
|
|
1
|
-
import { Redis } from "@/cache";
|
2
|
-
import { ChainId, NETWORK_LABELS } from "@sdk";
|
3
|
-
import axios from "axios";
|
4
|
-
import { log } from "./logger";
|
5
|
-
import PriceService from "./prices/priceService";
|
6
|
-
const defiLamaChains = {
|
7
|
-
[ChainId.MAINNET]: "ethereum",
|
8
|
-
[ChainId.POLYGON]: "polygon",
|
9
|
-
[ChainId.FANTOM]: "fantom",
|
10
|
-
[ChainId.AVALANCHE]: "avax",
|
11
|
-
[ChainId.BSC]: "bsc",
|
12
|
-
[ChainId.OPTIMISM]: "optimism",
|
13
|
-
[ChainId.ARBITRUM]: "arbitrum",
|
14
|
-
[ChainId.BASE]: "base",
|
15
|
-
[ChainId.GNOSIS]: "gnosis",
|
16
|
-
};
|
17
|
-
export var PRICING_METHODS;
|
18
|
-
(function (PRICING_METHODS) {
|
19
|
-
PRICING_METHODS[PRICING_METHODS["defillama"] = 0] = "defillama";
|
20
|
-
PRICING_METHODS[PRICING_METHODS["quickswap"] = 1] = "quickswap";
|
21
|
-
PRICING_METHODS[PRICING_METHODS["abandonned"] = -1] = "abandonned";
|
22
|
-
})(PRICING_METHODS || (PRICING_METHODS = {}));
|
23
|
-
export class Pricer {
|
24
|
-
prices;
|
25
|
-
extraPricesData;
|
26
|
-
constructor(prices, extraPricesData) {
|
27
|
-
this.prices = prices;
|
28
|
-
this.extraPricesData = extraPricesData;
|
29
|
-
}
|
30
|
-
static async load() {
|
31
|
-
try {
|
32
|
-
const { prices, extraPricesData } = await Redis.get("Prices");
|
33
|
-
const pricer = new Pricer(prices ?? {}, extraPricesData ?? []);
|
34
|
-
if (!prices) {
|
35
|
-
log.error("Pricer", "prices not found in cache when instanciating class");
|
36
|
-
await pricer.update();
|
37
|
-
}
|
38
|
-
return pricer;
|
39
|
-
}
|
40
|
-
catch (e) {
|
41
|
-
log.error("Pricer", "Failed to load prices from cache");
|
42
|
-
const pricer = new Pricer({}, []);
|
43
|
-
await pricer.update();
|
44
|
-
return pricer;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
getArray() {
|
48
|
-
return Object.keys(this.prices)
|
49
|
-
.filter(t => this.prices[t] >= 0)
|
50
|
-
.map(t => {
|
51
|
-
return {
|
52
|
-
rate: this.prices[t],
|
53
|
-
token: t,
|
54
|
-
};
|
55
|
-
});
|
56
|
-
}
|
57
|
-
/** Tries to fetch a given price sequentially using a given method */
|
58
|
-
async fetchPerMethod(x, method) {
|
59
|
-
switch (method) {
|
60
|
-
case PRICING_METHODS.abandonned:
|
61
|
-
return 0;
|
62
|
-
case PRICING_METHODS.defillama: {
|
63
|
-
let defillamaId;
|
64
|
-
if (!!x.chainId && !!x.address) {
|
65
|
-
defillamaId = `${defiLamaChains[x.chainId] ?? NETWORK_LABELS[x.chainId].toLowerCase()}:${x.address}`;
|
66
|
-
}
|
67
|
-
else {
|
68
|
-
defillamaId = `coingecko:${x.symbol}`;
|
69
|
-
}
|
70
|
-
const defillamaUrl = `https://coins.llama.fi/prices/current/${defillamaId}`;
|
71
|
-
try {
|
72
|
-
return (await axios.get(defillamaUrl, { timeout: 1000 })).data.coins[defillamaId].price;
|
73
|
-
}
|
74
|
-
catch { }
|
75
|
-
break;
|
76
|
-
}
|
77
|
-
case PRICING_METHODS.quickswap:
|
78
|
-
if (!!x.chainId && !!x.address) {
|
79
|
-
const quickswapUrl = `https://leaderboard.quickswap.exchange/utils/token-prices/v3?chainId=${x.chainId}&addresses=${x.address}`;
|
80
|
-
try {
|
81
|
-
return (await axios.get(quickswapUrl, { timeout: 1000 })).data?.[0].price;
|
82
|
-
}
|
83
|
-
catch { }
|
84
|
-
}
|
85
|
-
break;
|
86
|
-
}
|
87
|
-
return 0;
|
88
|
-
}
|
89
|
-
/** Tries to fetch a given price sequentially using all available methods */
|
90
|
-
async fetch(x) {
|
91
|
-
if (!!x.symbol && x.symbol?.toLowerCase().includes("test"))
|
92
|
-
return { method: PRICING_METHODS.abandonned, price: 0 };
|
93
|
-
for (const method of Object.values(PRICING_METHODS)) {
|
94
|
-
if (method === Number.parseInt(method.toString())) {
|
95
|
-
const price = await this.fetchPerMethod(x, method);
|
96
|
-
if (!!price)
|
97
|
-
return { method, price };
|
98
|
-
}
|
99
|
-
}
|
100
|
-
return { method: PRICING_METHODS.abandonned, price: 0 };
|
101
|
-
}
|
102
|
-
/** Returns the price if possible, otherwise tries to fetch it */
|
103
|
-
async get(x) {
|
104
|
-
if (x.symbol === "test")
|
105
|
-
return 0; // FIXME
|
106
|
-
// Normalize address
|
107
|
-
x.address = x?.address?.toLowerCase();
|
108
|
-
if (!!x.address && !!this.prices[x.address]) {
|
109
|
-
if (this.prices[x.address] !== -1)
|
110
|
-
return this.prices[x.address];
|
111
|
-
}
|
112
|
-
if (!!x.symbol && !!this.prices[x.symbol]) {
|
113
|
-
if (this.prices[x.symbol] === -1)
|
114
|
-
return undefined;
|
115
|
-
return this.prices[x.symbol];
|
116
|
-
}
|
117
|
-
if (!!x.symbol && x.symbol.toLowerCase().startsWith("w")) {
|
118
|
-
const symbol = x.symbol.slice(1);
|
119
|
-
if (!!this.prices[symbol]) {
|
120
|
-
if (this.prices[symbol] === -1)
|
121
|
-
return undefined;
|
122
|
-
return this.prices[symbol];
|
123
|
-
}
|
124
|
-
}
|
125
|
-
if (!!x.symbol && x.symbol.toLowerCase().startsWith("r")) {
|
126
|
-
const symbol = x.symbol.slice(1);
|
127
|
-
if (!!this.prices[symbol]) {
|
128
|
-
if (this.prices[symbol] === -1)
|
129
|
-
return undefined;
|
130
|
-
return this.prices[symbol];
|
131
|
-
}
|
132
|
-
}
|
133
|
-
if (!!x.symbol && x.symbol.toLowerCase().startsWith("r") && x.symbol.toLowerCase().endsWith("n")) {
|
134
|
-
const symbol = x.symbol.slice(1, -1);
|
135
|
-
if (!!this.prices[symbol]) {
|
136
|
-
if (this.prices[symbol] === -1)
|
137
|
-
return undefined;
|
138
|
-
return this.prices[symbol];
|
139
|
-
}
|
140
|
-
}
|
141
|
-
if (!!x.symbol && x.symbol.toLowerCase().startsWith("variableDebt")) {
|
142
|
-
const symbol = x.symbol.slice(12);
|
143
|
-
if (!!this.prices[symbol]) {
|
144
|
-
if (this.prices[symbol] === -1)
|
145
|
-
return undefined;
|
146
|
-
return this.prices[symbol];
|
147
|
-
}
|
148
|
-
}
|
149
|
-
if (!!x.symbol && x.symbol.toLowerCase().startsWith("variableDebt") && x.symbol.toLowerCase().endsWith("n")) {
|
150
|
-
const symbol = x.symbol.slice(12, -1);
|
151
|
-
if (!!this.prices[symbol]) {
|
152
|
-
if (this.prices[symbol] === -1)
|
153
|
-
return undefined;
|
154
|
-
return this.prices[symbol];
|
155
|
-
}
|
156
|
-
}
|
157
|
-
}
|
158
|
-
/** Saves the current price data in the cache */
|
159
|
-
async save() {
|
160
|
-
await Redis.safeSet("Prices", {
|
161
|
-
extraPricesData: this.extraPricesData,
|
162
|
-
prices: this.prices,
|
163
|
-
});
|
164
|
-
}
|
165
|
-
/** Recomputes all prices and saves them in the cache */
|
166
|
-
async update() {
|
167
|
-
// Update prices
|
168
|
-
this.prices = await PriceService.instance.fetchPrices();
|
169
|
-
// Update extra prices
|
170
|
-
this.extraPricesData = this.extraPricesData.filter(x => !!x.symbol && this.prices[x.symbol] === undefined && !!x.address && this.prices[x.address] === undefined);
|
171
|
-
for (const x of this.extraPricesData) {
|
172
|
-
try {
|
173
|
-
const price = await this.fetchPerMethod({ address: x.address, chainId: x.chainId, symbol: x.symbol }, x.method);
|
174
|
-
if (!!price) {
|
175
|
-
log.info(`price for ${x.symbol} - ${x.address} on ${NETWORK_LABELS[x.chainId ?? 1]}: ${price} added to cache`);
|
176
|
-
if (!!x.address && this.prices[x.address] === undefined)
|
177
|
-
this.prices[x.address] = price;
|
178
|
-
if (!!x.symbol && this.prices[x.symbol] === undefined)
|
179
|
-
this.prices[x.symbol] = price;
|
180
|
-
}
|
181
|
-
}
|
182
|
-
catch (e) {
|
183
|
-
log.error("pricer update", e);
|
184
|
-
}
|
185
|
-
} // Update extraPricesData
|
186
|
-
await this.save();
|
187
|
-
return this.prices;
|
188
|
-
}
|
189
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { BN2Number } from "@sdk";
|
2
|
-
import { Contract, utils } from "ethers";
|
3
|
-
import { providers } from "../providers";
|
4
|
-
export async function getChainlinkLatestPrice(chainId, oracle) {
|
5
|
-
const abi = new utils.Interface(["function latestAnswer() external view returns(int256)"]);
|
6
|
-
const contract = new Contract(oracle, abi, providers[chainId]);
|
7
|
-
return BN2Number(await contract.latestAnswer(), 8);
|
8
|
-
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { BN2Number } from "@sdk";
|
2
|
-
import { Contract } from "ethers";
|
3
|
-
import { providers } from "../providers";
|
4
|
-
export async function getVirtualPrice(chainId, pool) {
|
5
|
-
const contract = new Contract(pool, ["function get_virtual_price() external view returns(uint256)"], providers[chainId]);
|
6
|
-
return BN2Number(await contract.get_virtual_price());
|
7
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { BN2Number } from "@sdk";
|
2
|
-
import { Contract, utils } from "ethers";
|
3
|
-
import { providers } from "../providers";
|
4
|
-
export async function getDQUICKPrice(chainId, contractAddress, assetDecimals = 18, vaultDecimals = 18) {
|
5
|
-
const contract = new Contract(contractAddress, ["function dQUICKForQUICK(uint256) external view returns(uint256)"], providers[chainId]);
|
6
|
-
const assetAmount = await contract.dQUICKForQUICK(utils.parseUnits("1", vaultDecimals));
|
7
|
-
return BN2Number(assetAmount, assetDecimals);
|
8
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { PriceSourceMethod } from "@db/api";
|
2
|
-
import OnChainCall from "./services/OnChainCallService";
|
3
|
-
import CoingeckoService from "./services/coinGeckoService";
|
4
|
-
import DefillamaService from "./services/defillamaService";
|
5
|
-
import DexScreenerService from "./services/dexScreenerService";
|
6
|
-
import ERC4626Service from "./services/erc4626Service";
|
7
|
-
import IndexCoop from "./services/indexCoopService";
|
8
|
-
/**
|
9
|
-
* @description Factory pattern to get the correct price fetcher
|
10
|
-
*/
|
11
|
-
export default class PriceFetcherFactory {
|
12
|
-
static instance = new PriceFetcherFactory();
|
13
|
-
constructor() { }
|
14
|
-
get(type) {
|
15
|
-
switch (type) {
|
16
|
-
case PriceSourceMethod.COINGECKO:
|
17
|
-
return CoingeckoService.instance;
|
18
|
-
case PriceSourceMethod.DEFILLAMA:
|
19
|
-
return DefillamaService.instance;
|
20
|
-
case PriceSourceMethod.ERC4626:
|
21
|
-
return ERC4626Service.instance;
|
22
|
-
case PriceSourceMethod.DEXSCREENER:
|
23
|
-
return DexScreenerService.instance;
|
24
|
-
case PriceSourceMethod.INDEXCOOP:
|
25
|
-
return IndexCoop.instance;
|
26
|
-
case PriceSourceMethod.ONCHAIN_CALL:
|
27
|
-
return OnChainCall.instance;
|
28
|
-
default:
|
29
|
-
throw new Error(`Price reader service not found for ${type}`);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
@@ -1,274 +0,0 @@
|
|
1
|
-
import { getTokensListWithCache } from "@/libs/getTokensList";
|
2
|
-
import { PriceService as PriceSourceService } from "@/modules/v4/price/price.service";
|
3
|
-
import { PriceSourceMethod } from "@db/api";
|
4
|
-
import { BN2Number, ChainId, Stable, registry } from "@sdk";
|
5
|
-
import axios from "axios";
|
6
|
-
import { Contract } from "ethers";
|
7
|
-
import { constantChain } from "../../constants";
|
8
|
-
import { log } from "../logger";
|
9
|
-
import { providers } from "../providers";
|
10
|
-
import { getChainlinkLatestPrice } from "./chainlinkRead";
|
11
|
-
import { getVirtualPrice } from "./curveVirtualPrice";
|
12
|
-
import { getDQUICKPrice } from "./getDQUICK";
|
13
|
-
import PriceFetcherFactory from "./priceFetcherFactory";
|
14
|
-
import { getERC4626Price } from "./services/getERC4626";
|
15
|
-
import { getCurveV2Price, getUniV2Price } from "./uniV2Price";
|
16
|
-
export default class PriceService {
|
17
|
-
static instance = new PriceService();
|
18
|
-
_prices = {};
|
19
|
-
constructor() { }
|
20
|
-
get prices() {
|
21
|
-
return this._prices;
|
22
|
-
}
|
23
|
-
setPrices = (res) => {
|
24
|
-
res.forEach(tokenPrice => {
|
25
|
-
this._prices[tokenPrice.token] = tokenPrice.rate;
|
26
|
-
});
|
27
|
-
};
|
28
|
-
async fetchPrices() {
|
29
|
-
const tokenPriceSources = await PriceSourceService.findManyPriceSources({});
|
30
|
-
/**
|
31
|
-
* @description Factory pricer's call to get prices from different sources
|
32
|
-
*/
|
33
|
-
try {
|
34
|
-
for (const method of Object.values(PriceSourceMethod)) {
|
35
|
-
if (method !== PriceSourceMethod.CONSTANT && method !== PriceSourceMethod.EQUAL_TO) {
|
36
|
-
await PriceFetcherFactory.instance
|
37
|
-
.get(PriceSourceMethod[method])
|
38
|
-
.getPrice(tokenPriceSources)
|
39
|
-
.then(this.setPrices);
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
|
-
catch (e) {
|
44
|
-
log.error("Error fetching prices", e);
|
45
|
-
}
|
46
|
-
/** San Token Prices */
|
47
|
-
this._prices["sanUSDC_EUR"] = 1.2120307 * this._prices["USDC"];
|
48
|
-
this._prices["sanDAI_EUR"] = 1.0926287 * this._prices["DAI"];
|
49
|
-
this._prices["sanFRAX_EUR"] = 1.077969 * this._prices["FRAX"];
|
50
|
-
this._prices["sanFEI_EUR"] = 1.02814 * this._prices["FEI"];
|
51
|
-
this._prices["sanWETH_EUR"] = 6.732341 * this._prices["ETH"];
|
52
|
-
const promises = [];
|
53
|
-
/** Sushiswap & UniV2 Prices */
|
54
|
-
promises.push(getUniV2Price(ChainId.MAINNET, this._prices[Stable.EUR], this._prices["ANGLE"], "0x1f4c763bde1d4832b3ea0640e66da00b98831355").then(sushiEURA_ANGLE => {
|
55
|
-
if (!!sushiEURA_ANGLE) {
|
56
|
-
this._prices["Sushi EURA-ANGLE LP"] = sushiEURA_ANGLE;
|
57
|
-
}
|
58
|
-
}));
|
59
|
-
promises.push(getUniV2Price(ChainId.MAINNET, this._prices["ANGLE"], this._prices["ETH"], "0xfb55af0ef0dcdec92bd3752e7a9237dfefb8acc0").then(sushiANGLE_ETH => {
|
60
|
-
if (!!sushiANGLE_ETH) {
|
61
|
-
this._prices["Sushi ANGLE-ETH LP"] = sushiANGLE_ETH;
|
62
|
-
}
|
63
|
-
}));
|
64
|
-
promises.push(getUniV2Price(ChainId.MAINNET, this._prices[Stable.EUR], this._prices["FEI"], "0xf89ce5ed65737da8440411544b0499c9fad323b2").then(uni_EURA_FEI => {
|
65
|
-
if (!!uni_EURA_FEI) {
|
66
|
-
this._prices["Uni-V2 EURA-FEI LP"] = uni_EURA_FEI;
|
67
|
-
}
|
68
|
-
}));
|
69
|
-
promises.push(getUniV2Price(ChainId.MAINNET, this._prices["stTAO"], this._prices["WETH"], "0xAe57eB8DD23C90769962d413A8802Ba68181aD0F").then(uni_stTAO_WETH => {
|
70
|
-
if (!!uni_stTAO_WETH) {
|
71
|
-
this._prices["0xAe57eB8DD23C90769962d413A8802Ba68181aD0F"] = uni_stTAO_WETH;
|
72
|
-
}
|
73
|
-
}));
|
74
|
-
promises.push(getUniV2Price(ChainId.BLAST, this._prices["WETH"], this._prices["YIELD"], "0x3Df8AAC90Eb2FeeA4378368D46a72AF47eBDc268").then(uni_WETH_YIELD => {
|
75
|
-
if (!!uni_WETH_YIELD) {
|
76
|
-
this._prices["0x3Df8AAC90Eb2FeeA4378368D46a72AF47eBDc268"] = uni_WETH_YIELD;
|
77
|
-
}
|
78
|
-
}));
|
79
|
-
this.setConstantPrices(tokenPriceSources);
|
80
|
-
this.setEqualsToPrices(tokenPriceSources);
|
81
|
-
/** Hardcoded prices */
|
82
|
-
this._prices["oICL"] = 0.5 * this._prices["ICL"];
|
83
|
-
this._prices["$ERA"] = 0.001;
|
84
|
-
this._prices["Bridged mstETH"] = this._prices["mstETH"];
|
85
|
-
// Mock collats
|
86
|
-
this._prices["MockCollat0"] = this._prices["EUR"];
|
87
|
-
this._prices["MockCollat1"] = this._prices["EUR"];
|
88
|
-
this._prices["MockCollat2"] = this._prices["EUR"];
|
89
|
-
// USDA price
|
90
|
-
this._prices[Stable.USD] = 1;
|
91
|
-
this._prices["agUSD"] = 1;
|
92
|
-
// veANGLE price
|
93
|
-
this._prices["veANGLE"] = this._prices["ANGLE"];
|
94
|
-
// Hardcoded prices
|
95
|
-
this._prices["KAI"] = 0.015;
|
96
|
-
this._prices["USSD"] = 1;
|
97
|
-
this._prices["crvUSD"] = 1;
|
98
|
-
for (const id in ChainId) {
|
99
|
-
const chainId = Number(id);
|
100
|
-
const savingsAddressUSD = registry(chainId)?.USD?.Savings;
|
101
|
-
const savingsAddressEUR = registry(chainId)?.EUR?.Savings;
|
102
|
-
if (!!savingsAddressUSD) {
|
103
|
-
promises.push(getERC4626Price(chainId, savingsAddressUSD).then(sharePrice => {
|
104
|
-
this._prices[`stUSD-${chainId}`] = sharePrice * this._prices[Stable.USD];
|
105
|
-
this._prices[`STUSD-${chainId}`] = this._prices[`stUSD-${chainId}`];
|
106
|
-
}));
|
107
|
-
}
|
108
|
-
if (!!savingsAddressEUR) {
|
109
|
-
promises.push(getERC4626Price(chainId, savingsAddressEUR).then(sharePrice => {
|
110
|
-
this._prices[`stEUR-${chainId}`] = sharePrice * this._prices[Stable.EUR];
|
111
|
-
this._prices[`STEUR-${chainId}`] = this._prices[`stEUR-${chainId}`];
|
112
|
-
}));
|
113
|
-
}
|
114
|
-
}
|
115
|
-
promises.push(getERC4626Price(ChainId.MAINNET, "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB", 6, 18).then(sharePrice => {
|
116
|
-
this._prices["steakUSDC"] = sharePrice * this._prices["USDC"];
|
117
|
-
this._prices["STEAKUSDC"] = this._prices["steakUSDC"];
|
118
|
-
this._prices["Steakhouse USDC"] = this._prices["steakUSDC"];
|
119
|
-
}));
|
120
|
-
promises.push(getERC4626Price(ChainId.BASE, "0xbEEfa1aBfEbE621DF50ceaEF9f54FdB73648c92C", 18, 18).then(sharePrice => {
|
121
|
-
this._prices["steakUSDA"] = sharePrice * this._prices["USDA"];
|
122
|
-
this._prices["STEAKUSDA"] = this._prices["steakUSDA"];
|
123
|
-
this._prices["Steakhouse USDA"] = this._prices["steakUSDA"];
|
124
|
-
}));
|
125
|
-
promises.push(getERC4626Price(ChainId.BASE, "0xBEeFA28D5e56d41D35df760AB53B94D9FfD7051F", 18, 18).then(sharePrice => {
|
126
|
-
this._prices["steakEURA"] = sharePrice * this._prices["EURA"];
|
127
|
-
this._prices["STEAKEURA"] = this._prices["steakEURA"];
|
128
|
-
this._prices["Steakhouse EURA"] = this._prices["steakEURA"];
|
129
|
-
}));
|
130
|
-
promises.push(getERC4626Price(ChainId.MAINNET, "0x125D41A6e5dbf455cD9Df8F80BCC6fd172D52Cc6", 18, 18).then(sharePrice => {
|
131
|
-
this._prices["gtUSDAcore"] = sharePrice;
|
132
|
-
this._prices["Gauntlet USDA Core"] = sharePrice;
|
133
|
-
}));
|
134
|
-
promises.push(getERC4626Price(ChainId.MAINNET, "0x89D80f5e9BC88d8021b352064ae73F0eAf79EBd8", 18, 18).then(sharePrice => {
|
135
|
-
this._prices["Re7USDA"] = sharePrice;
|
136
|
-
this._prices["Re7 USDA"] = sharePrice;
|
137
|
-
}));
|
138
|
-
promises.push(getDQUICKPrice(ChainId.POLYGON, "0x958d208Cdf087843e9AD98d23823d32E17d723A1").then(sharePrice => {
|
139
|
-
this._prices["dQUICK"] = sharePrice * this._prices["QUICK"];
|
140
|
-
this._prices["DQUICK"] = this._prices["dQUICK"];
|
141
|
-
}));
|
142
|
-
promises.push(getVirtualPrice(ChainId.MAINNET, "0xb9446c4Ef5EBE66268dA6700D26f96273DE3d571").then(virtualPrice => {
|
143
|
-
this._prices["Curve 3EUR LP"] = virtualPrice * this._prices[Stable.EUR];
|
144
|
-
}));
|
145
|
-
promises.push(getVirtualPrice(ChainId.MAINNET, "0xB37D6c07482Bc11cd28a1f11f1a6ad7b66Dec933").then(virtualPrice => {
|
146
|
-
this._prices["Curve EURA-ibEUR LP"] = virtualPrice * this._prices[Stable.EUR];
|
147
|
-
}));
|
148
|
-
promises.push(getVirtualPrice(ChainId.MAINNET, constantChain[ChainId.MAINNET].crvANGLESDANGLE).then(virtualPrice => {
|
149
|
-
this._prices["Curve sdANGLE-ANGLE LP"] = virtualPrice * this._prices["ANGLE"];
|
150
|
-
}));
|
151
|
-
promises.push(getVirtualPrice(ChainId.MAINNET, constantChain[ChainId.MAINNET].crvEuropool).then(virtualPrice => {
|
152
|
-
this._prices["Curve Europool LP"] = virtualPrice * this._prices[Stable.EUR];
|
153
|
-
}));
|
154
|
-
promises.push(getVirtualPrice(ChainId.MAINNET, constantChain[ChainId.MAINNET].crvEURAEUROC).then(virtualPrice => {
|
155
|
-
this._prices["Curve EURA-EUROC LP"] = virtualPrice * this._prices[Stable.EUR];
|
156
|
-
}));
|
157
|
-
promises.push(getVirtualPrice(ChainId.MAINNET, constantChain[ChainId.MAINNET].crvEURAEURe).then(virtualPrice => {
|
158
|
-
this._prices["Curve EURA-EURe LP"] = virtualPrice * this._prices[Stable.EUR];
|
159
|
-
}));
|
160
|
-
promises.push(getChainlinkLatestPrice(ChainId.MAINNET, "0x32d1463EB53b73C095625719Afa544D5426354cB").then(chainlinkPrice => {
|
161
|
-
this._prices["bIB01"] = chainlinkPrice;
|
162
|
-
this._prices["IB01"] = chainlinkPrice;
|
163
|
-
}));
|
164
|
-
promises.push(getChainlinkLatestPrice(ChainId.ARBITRUM, "0x1940fEd49cDBC397941f2D336eb4994D599e568B").then(chainlinkPrice => {
|
165
|
-
this._prices["zZRO"] = chainlinkPrice;
|
166
|
-
}));
|
167
|
-
promises.push(getChainlinkLatestPrice(ChainId.MAINNET, "0x9E8E794ad6Ecdb6d5c7eaBE059D30E907F58859b").then(chainlinkPrice => {
|
168
|
-
this._prices["bHIGH"] = chainlinkPrice * this._prices["EUR"];
|
169
|
-
this._prices["HIGH"] = chainlinkPrice * this._prices["EUR"];
|
170
|
-
}));
|
171
|
-
promises.push(getChainlinkLatestPrice(ChainId.MAINNET, "0x6E27A25999B3C665E44D903B2139F5a4Be2B6C26").then(chainlinkPrice => {
|
172
|
-
this._prices["bC3M"] = chainlinkPrice * this._prices["EUR"];
|
173
|
-
this._prices["C3M"] = chainlinkPrice * this._prices["EUR"];
|
174
|
-
}));
|
175
|
-
promises.push(getChainlinkLatestPrice(ChainId.MAINNET, "0x475855DAe09af1e3f2d380d766b9E630926ad3CE").then(chainlinkPrice => {
|
176
|
-
this._prices["bERNX"] = chainlinkPrice * this._prices["EUR"];
|
177
|
-
this._prices["ERNX"] = chainlinkPrice * this._prices["EUR"];
|
178
|
-
}));
|
179
|
-
promises.push(getChainlinkLatestPrice(ChainId.MAINNET, "0x2674Cc47786740432b895a70D92CFDfB1d5BF798").then(chainlinkPrice => {
|
180
|
-
this._prices["bERNA"] = chainlinkPrice;
|
181
|
-
this._prices["ERNA"] = chainlinkPrice;
|
182
|
-
}));
|
183
|
-
promises.push(getChainlinkLatestPrice(ChainId.ARBITRUM, "0x395D5c5D552Df670dc4B2B1cef0c4EABfFba492f").then(chainlinkPrice => {
|
184
|
-
this._prices["gmBTC"] = chainlinkPrice;
|
185
|
-
}));
|
186
|
-
promises.push(getChainlinkLatestPrice(ChainId.ARBITRUM, "0xfB3264D1129824933a52374c2C1696F4470D041e").then(chainlinkPrice => {
|
187
|
-
this._prices["gmETH"] = chainlinkPrice;
|
188
|
-
}));
|
189
|
-
promises.push(getCurveV2Price(ChainId.MAINNET, this._prices, "0x58257e4291F95165184b4beA7793a1d6F8e7b627", constantChain[ChainId.MAINNET].crvFRAXEURA).then(virtualPrice => {
|
190
|
-
this._prices["Curve EURA-FRAXBP LP"] = virtualPrice * this._prices[Stable.EUR];
|
191
|
-
}));
|
192
|
-
await Promise.allSettled(promises);
|
193
|
-
/** Camelot API price completion */
|
194
|
-
try {
|
195
|
-
await axios
|
196
|
-
.get("https://api.camelot.exchange/tokens")
|
197
|
-
.then(res => {
|
198
|
-
if (!!res.data.data.tokens) {
|
199
|
-
for (const x of Object.values(res.data.data.tokens)) {
|
200
|
-
if (this._prices[x.symbol] === undefined || this._prices[x.symbol] === null) {
|
201
|
-
this._prices[x.symbol] = x.price;
|
202
|
-
}
|
203
|
-
}
|
204
|
-
}
|
205
|
-
});
|
206
|
-
}
|
207
|
-
catch (error) {
|
208
|
-
log.error("❌ call to fetch camelot api price failed", error);
|
209
|
-
}
|
210
|
-
/** Flux price completion */
|
211
|
-
promises.push((async () => {
|
212
|
-
try {
|
213
|
-
const d = await new Contract("0x465a5a630482f3abD6d3b84B39B29b07214d19e5", ["function exchangeRateStored() external view returns(uint256)"], providers[ChainId.MAINNET]).exchangeRateStored();
|
214
|
-
this._prices["fUSDC"] = this._prices["USDC"] * BN2Number(d) * 100;
|
215
|
-
this._prices["FUSDC"] = this._prices["fUSDC"];
|
216
|
-
}
|
217
|
-
catch (e) { }
|
218
|
-
})());
|
219
|
-
// Radiant prices
|
220
|
-
this._prices["rUSDCn"] = this._prices["USDC"];
|
221
|
-
for (const x of ["USDC", "USDT", "wstETH", "ARB", "wBTC", "DAI", "ETH"]) {
|
222
|
-
this._prices[`r${x}n`] = this._prices[x];
|
223
|
-
this._prices[`variableDebt${x}n`] = this._prices[x];
|
224
|
-
this._prices[`r${x}`] = this._prices[x];
|
225
|
-
this._prices[`variableDebt${x}`] = this._prices[x];
|
226
|
-
const xUpper = x.toUpperCase();
|
227
|
-
this._prices[`r${xUpper}n`] = this._prices[x];
|
228
|
-
this._prices[`variableDebt${xUpper}n`] = this._prices[x];
|
229
|
-
this._prices[`r${xUpper}`] = this._prices[x];
|
230
|
-
this._prices[`variableDebt${xUpper}`] = this._prices[x];
|
231
|
-
}
|
232
|
-
/**
|
233
|
-
* @deprecated - Fill all BorrowStaker prices
|
234
|
-
*/
|
235
|
-
const tokens = await getTokensListWithCache();
|
236
|
-
for (const chainIdString of Object.keys(tokens)) {
|
237
|
-
const chainId = Number.parseInt(chainIdString);
|
238
|
-
for (const token of Object.values(tokens?.[chainId] ?? {})) {
|
239
|
-
if (token.wrappingMethod === "BorrowStaker" && !!token.underlyingTokens) {
|
240
|
-
this._prices[token.address] = this._prices[token.underlyingTokens[0]];
|
241
|
-
}
|
242
|
-
}
|
243
|
-
}
|
244
|
-
return this._prices;
|
245
|
-
}
|
246
|
-
setConstantPrices(tokens) {
|
247
|
-
const filteredTokens = tokens.filter(token => token.method === PriceSourceMethod.CONSTANT);
|
248
|
-
if (filteredTokens.length === 0)
|
249
|
-
return [];
|
250
|
-
return filteredTokens.forEach(token => {
|
251
|
-
const args = token.args;
|
252
|
-
if (args.value !== null && args.value !== undefined) {
|
253
|
-
this._prices[token.symbol] = args.value;
|
254
|
-
}
|
255
|
-
else
|
256
|
-
log.warn(`❌ constant price ${token.symbol} has incorrect value in database`);
|
257
|
-
});
|
258
|
-
}
|
259
|
-
setEqualsToPrices(tokens) {
|
260
|
-
const filteredTokens = tokens.filter(tokenPriceSource => tokenPriceSource.method === PriceSourceMethod.EQUAL_TO);
|
261
|
-
if (filteredTokens.length === 0)
|
262
|
-
return [];
|
263
|
-
return filteredTokens
|
264
|
-
.filter(token => token.method === PriceSourceMethod.EQUAL_TO)
|
265
|
-
.forEach(token => {
|
266
|
-
const args = token.args;
|
267
|
-
if (args.token !== null && args.token !== undefined) {
|
268
|
-
this._prices[token.symbol] = this._prices[args.token];
|
269
|
-
}
|
270
|
-
else
|
271
|
-
log.warn(`❌ equalsTo price ${token.symbol} has incorrect value in database`);
|
272
|
-
});
|
273
|
-
}
|
274
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { PriceService } from "@/modules/v4/price/price.service";
|
2
|
-
import { PriceSourceMethod } from "@db/api";
|
3
|
-
import { BN2Number, ChainInteractionService } from "@sdk";
|
4
|
-
import { Contract } from "ethers";
|
5
|
-
import { log } from "../../logger";
|
6
|
-
export default class OnChainCallService {
|
7
|
-
static instance = new OnChainCallService();
|
8
|
-
constructor() { }
|
9
|
-
async getPrice(tokens) {
|
10
|
-
const pricePromises = tokens
|
11
|
-
.filter(tokenPriceSource => tokenPriceSource.method === PriceSourceMethod.ONCHAIN_CALL)
|
12
|
-
.map(async (token) => {
|
13
|
-
const args = token.args;
|
14
|
-
if (!args?.chainId || !args.address || !args.abi || !args.call) {
|
15
|
-
log.warn(`❌ ONCHAIN_CALL price source incorrectly implemented for ${token.symbol}`);
|
16
|
-
return undefined;
|
17
|
-
}
|
18
|
-
try {
|
19
|
-
const onChainCall = await new Contract(args.address, args.abi, ChainInteractionService(args.chainId).provider())[args.call]();
|
20
|
-
const multiplicator = BN2Number(onChainCall, args.decimals ?? 18);
|
21
|
-
const base = await PriceService.fetchPriceBySymbol(args.base);
|
22
|
-
const price = base * multiplicator;
|
23
|
-
// 2 returned tokens as stUSD and STUSD (business requirement)
|
24
|
-
const res = [
|
25
|
-
{ token: token.symbol, rate: price },
|
26
|
-
{ token: token.symbol.toUpperCase(), rate: price },
|
27
|
-
];
|
28
|
-
return res;
|
29
|
-
}
|
30
|
-
catch (error) {
|
31
|
-
log.warn(`❌ ONCHAIN_CALL price source failed for ${token.symbol} with error: ${error}`);
|
32
|
-
return undefined;
|
33
|
-
}
|
34
|
-
});
|
35
|
-
const resolvedPrices = (await Promise.all(pricePromises)).filter(result => !!result);
|
36
|
-
return resolvedPrices.flat();
|
37
|
-
}
|
38
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { PriceSourceMethod } from "@db/api";
|
2
|
-
import axios from "axios";
|
3
|
-
import { log } from "../../logger";
|
4
|
-
export default class CoingeckoService {
|
5
|
-
static instance = new CoingeckoService();
|
6
|
-
constructor() { }
|
7
|
-
baseUrl = "https://coins.llama.fi/prices/current/";
|
8
|
-
async getPrice(tickers) {
|
9
|
-
const filteredTokens = tickers.filter(tokenPriceSource => tokenPriceSource.method === PriceSourceMethod.COINGECKO);
|
10
|
-
if (filteredTokens.length === 0)
|
11
|
-
return [];
|
12
|
-
return await this.fetchPrices(filteredTokens);
|
13
|
-
}
|
14
|
-
buildUrl(tokens) {
|
15
|
-
const tickerParams = tokens
|
16
|
-
.map(token => {
|
17
|
-
const args = token.args;
|
18
|
-
if (!args?.ticker)
|
19
|
-
return log.warn(`❌ CoingeckoService ticker not found for ${token.symbol}`);
|
20
|
-
return `coingecko:${args.ticker}`;
|
21
|
-
})
|
22
|
-
.join(",");
|
23
|
-
return this.baseUrl.concat(tickerParams);
|
24
|
-
}
|
25
|
-
async fetchPrices(tickers) {
|
26
|
-
const chunkSize = 200;
|
27
|
-
const chunks = [];
|
28
|
-
for (let i = 0; i < tickers.length; i += chunkSize) {
|
29
|
-
chunks.push(tickers.slice(i, Math.min(tickers.length, i + chunkSize)));
|
30
|
-
}
|
31
|
-
const promises = (await Promise.allSettled(chunks.map(async (chunk) => {
|
32
|
-
const url = this.buildUrl(chunk);
|
33
|
-
return axios
|
34
|
-
.get(url, { timeout: 10000 })
|
35
|
-
.then(res => this.formatResponse(res, chunk))
|
36
|
-
.catch(err => {
|
37
|
-
log.error("❌ CoingeckoService not responding", err);
|
38
|
-
throw "❌ CoingeckoService not responding";
|
39
|
-
});
|
40
|
-
})))
|
41
|
-
.filter(result => result.status === "fulfilled")
|
42
|
-
.map(result => result.value);
|
43
|
-
return promises.reduce((acc, val) => acc.concat(val), []);
|
44
|
-
}
|
45
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation> Need to be typed according to coinguekko answer type
|
46
|
-
formatResponse(data, tokens) {
|
47
|
-
return tokens
|
48
|
-
.map(token => {
|
49
|
-
const args = token.args;
|
50
|
-
if (!args?.ticker)
|
51
|
-
return;
|
52
|
-
if (!data.data.coins[`coingecko:${args.ticker}`]?.price) {
|
53
|
-
log.warn(`❌ CoinGecko data failed for ${token.symbol} with ticker ${args.ticker}`);
|
54
|
-
return;
|
55
|
-
}
|
56
|
-
return {
|
57
|
-
token: token.symbol,
|
58
|
-
rate: data.data.coins[`coingecko:${args.ticker}`].price ?? -1,
|
59
|
-
};
|
60
|
-
})
|
61
|
-
.filter(item => !!item);
|
62
|
-
}
|
63
|
-
}
|