From a564daab70176dba760d8f65dd89c65294f6eb9c Mon Sep 17 00:00:00 2001 From: Gareth Fuller Date: Thu, 21 Dec 2023 09:35:19 +0000 Subject: [PATCH 1/5] refactor: Reduce fetching of SOR pools (#4959) --- src/composables/swap/useSor.ts | 20 +++++++------------- src/lib/balancer.sdk.ts | 4 ++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/composables/swap/useSor.ts b/src/composables/swap/useSor.ts index 44ad9325b7..15c6234089 100644 --- a/src/composables/swap/useSor.ts +++ b/src/composables/swap/useSor.ts @@ -149,6 +149,12 @@ export function calcPriceImpact( return priceImpact; } +const sorManager = new SorManager( + rpcProviderService.jsonProvider, + BigNumber.from(GAS_PRICE), + Number(MAX_POOLS) +); + export default function useSor({ exactIn, tokenInAddressInput, @@ -166,7 +172,6 @@ export default function useSor({ slippageBufferRate, isCowswapSwap, }: Props) { - let sorManager: SorManager | undefined = undefined; const pools = ref([]); const sorReturn = ref({ hasSwaps: false, @@ -214,7 +219,7 @@ export default function useSor({ unknownAssets.push(tokenOutAddressInput.value); } await injectTokens(unknownAssets); - await initSor(); + await fetchPools(); await handleAmountChange(); }); @@ -225,16 +230,6 @@ export default function useSor({ state.submissionError = null; } - async function initSor(): Promise { - sorManager = new SorManager( - rpcProviderService.jsonProvider, - BigNumber.from(GAS_PRICE), - Number(MAX_POOLS) - ); - - fetchPools(); - } - async function fetchPools(): Promise { if (!sorManager) { return; @@ -829,7 +824,6 @@ export default function useSor({ sorManager, sorReturn, pools, - initSor, handleAmountChange, exactIn, swap, diff --git a/src/lib/balancer.sdk.ts b/src/lib/balancer.sdk.ts index e1b8273f5c..7bcded3185 100644 --- a/src/lib/balancer.sdk.ts +++ b/src/lib/balancer.sdk.ts @@ -2,7 +2,7 @@ import { BalancerSDK } from '@balancer-labs/sdk'; import { Network } from '@/lib/config/types'; import { configService } from '@/services/config/config.service'; import { ref } from 'vue'; -import { isTestMode } from '@/plugins/modes'; +// import { isTestMode } from '@/plugins/modes'; export const balancer = new BalancerSDK({ network: configService.network.chainId as Network, @@ -21,4 +21,4 @@ export async function fetchPoolsForSor() { console.timeEnd('fetchPoolsForSor'); } -if (!isTestMode()) fetchPoolsForSor(); +// if (!isTestMode()) fetchPoolsForSor(); From b6037e5ba665442885c636d67f26b43d86878e90 Mon Sep 17 00:00:00 2001 From: Gareth Fuller Date: Thu, 21 Dec 2023 14:38:32 +0000 Subject: [PATCH 2/5] Hotfix: remove SOR conditionals (dm) (#4961) * chore: Add 12wstETH-15oRETRO-12stMATIC-37SP-12miMATIC-12liveRetro/V-G7.2/StarSeeds_Protocol pool to polygon allowlist (#4948) Co-authored-by: balopco * 1.138.1 * chore: Add 50BAL-50WETH pool to base allowlist (#4947) Co-authored-by: balopco * 1.138.2 * chore: Add 50FRACTION-50WETH pool to arbitrum allowlist (#4944) Co-authored-by: balopco * 1.138.3 * chore: Add 50WETH-50FRACTION pool to polygon allowlist (#4942) Co-authored-by: balopco Co-authored-by: Alberto Gualis * 1.138.4 * chore: Add 33WBTC-33QI-33SP pool to polygon allowlist (#4945) Co-authored-by: balopco Co-authored-by: Alberto Gualis * 1.138.5 * Add stakable pool * Update pools.ts * 1.138.6 * chore: Add 50USDT-50MaticX pool to polygon allowlist (#4950) Co-authored-by: balopco * 1.138.7 * chore: Add 95XEQ-5USDT pool to polygon allowlist (#4955) Co-authored-by: balopco * 1.138.8 * chore: Add 50LINK-50LDO pool to polygon allowlist (#4956) Co-authored-by: balopco Co-authored-by: Alberto Gualis * 1.138.9 * chore: Add 50WBTC-50LINK pool to polygon allowlist (#4951) Co-authored-by: balopco Co-authored-by: Alberto Gualis * 1.138.10 * Migrate from GqlPoolMinimalType to GqlPoolType (#4776) * Alias GqlPoolType to prepare for type breaking change * Prepare api change * Add GqlTokenPrice cast to fix typecheck * 1.138.11 * chore: Add 10stMATIC-90SP pool to polygon allowlist (#4958) Co-authored-by: balopco * 1.138.12 * chore: Add 50cbETH-50WETH pool to base allowlist (#4957) Co-authored-by: balopco * 1.138.13 * refactor: Reduce fetching of SOR pools (#4941) * 1.138.14 * chore: Remove conditionals waiting for SOR pools --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: balopco Co-authored-by: Automated Version Bump Co-authored-by: Alberto Gualis Co-authored-by: ZeKraken <79888567+zekraken-bot@users.noreply.github.com> Co-authored-by: Zen-Maxi <85650601+Zen-Maxi@users.noreply.github.com> --- package-lock.json | 4 +- package.json | 2 +- .../vebal/LMVoting/testnet-voting-pools.ts | 6 +- src/composables/queries/mappers.spec.ts | 29 +- .../queries/useTokenPricesQuery.ts | 2 +- src/constants/queryKeys.ts | 11 +- src/lib/config/arbitrum/pools.ts | 4 + src/lib/config/base/pools.ts | 2 + src/lib/config/polygon/pools.ts | 8 + src/pages/pool/add-liquidity.vue | 13 +- src/pages/pool/withdraw.vue | 11 +- src/providers/local/exit-pool.provider.ts | 14 +- src/providers/local/join-pool.provider.ts | 5 - .../api/graphql/generated/api-schema.graphql | 466 +++++++++++---- .../api/graphql/generated/api-types.ts | 546 ++++++++++++++---- src/services/api/graphql/mappers.ts | 31 +- 16 files changed, 848 insertions(+), 306 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c2a45fed7..94721f08f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@balancer/frontend-v2", - "version": "1.138.0", + "version": "1.138.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@balancer/frontend-v2", - "version": "1.138.0", + "version": "1.138.14", "license": "MIT", "devDependencies": { "@aave/protocol-js": "^4.3.0", diff --git a/package.json b/package.json index 30611b855a..2ae254e253 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer/frontend-v2", - "version": "1.138.0", + "version": "1.138.14", "engines": { "node": "=16", "npm": ">=8" diff --git a/src/components/contextual/pages/vebal/LMVoting/testnet-voting-pools.ts b/src/components/contextual/pages/vebal/LMVoting/testnet-voting-pools.ts index 0c0be9de7f..7c25e5b54b 100644 --- a/src/components/contextual/pages/vebal/LMVoting/testnet-voting-pools.ts +++ b/src/components/contextual/pages/vebal/LMVoting/testnet-voting-pools.ts @@ -1,6 +1,6 @@ import { GqlChain, - GqlPoolMinimalType, + GqlPoolType, } from '@/services/api/graphql/generated/api-types'; import { ApiVotingPool } from '@/services/balancer/gauges/gauge-controller.decorator'; @@ -14,7 +14,7 @@ export function testnetVotingPools( chain: testnet as GqlChain, id: '0xf8a0623ab66f985effc1c69d05f1af4badb01b00000200000000000000000060', address: '0xf8a0623ab66F985EfFc1C69D05F1af4BaDB01b00', - type: GqlPoolMinimalType.Stable, + type: GqlPoolType.Stable, symbol: 'veBAL', tokens: [ { @@ -37,7 +37,7 @@ export function testnetVotingPools( chain: testnet as GqlChain, id: '0x16faf9f73748013155b7bc116a3008b57332d1e600020000000000000000005b', address: '0x16faF9f73748013155B7bC116a3008b57332D1e6', - type: GqlPoolMinimalType.Weighted, + type: GqlPoolType.Weighted, symbol: 'B-50WBTC-50WETH', tokens: [ { diff --git a/src/composables/queries/mappers.spec.ts b/src/composables/queries/mappers.spec.ts index f03a3d78a7..43d86a842e 100644 --- a/src/composables/queries/mappers.spec.ts +++ b/src/composables/queries/mappers.spec.ts @@ -1,7 +1,7 @@ import { Network } from '@/lib/config/types'; import { GqlChain, - GqlPoolMinimalType, + GqlPoolType, } from '@/services/api/graphql/generated/api-types'; import { mapApiChain, mapApiPoolType } from '@/services/api/graphql/mappers'; import { PoolType } from '@/services/pool/types'; @@ -22,23 +22,22 @@ test('Maps API Chains', async () => { }); test('Maps API pool types', async () => { - expect(mapApiPoolType(GqlPoolMinimalType.Element)).toBe(PoolType.Element); - expect(mapApiPoolType(GqlPoolMinimalType.Gyro3)).toBe(PoolType.Gyro3); - expect(mapApiPoolType(GqlPoolMinimalType.Gyroe)).toBe(PoolType.GyroE); - expect(mapApiPoolType(GqlPoolMinimalType.Investment)).toBe( - PoolType.Investment - ); - expect(mapApiPoolType(GqlPoolMinimalType.Linear)).toBe(PoolType.Linear); - expect(mapApiPoolType(GqlPoolMinimalType.LiquidityBootstrapping)).toBe( + expect(mapApiPoolType(GqlPoolType.Element)).toBe(PoolType.Element); + expect(mapApiPoolType(GqlPoolType.Gyro3)).toBe(PoolType.Gyro3); + expect(mapApiPoolType(GqlPoolType.Gyroe)).toBe(PoolType.GyroE); + expect(mapApiPoolType(GqlPoolType.Investment)).toBe(PoolType.Investment); + expect(mapApiPoolType(GqlPoolType.Linear)).toBe(PoolType.Linear); + expect(mapApiPoolType(GqlPoolType.LiquidityBootstrapping)).toBe( PoolType.LiquidityBootstrapping ); - expect(mapApiPoolType(GqlPoolMinimalType.MetaStable)).toBe( - PoolType.MetaStable + expect(mapApiPoolType(GqlPoolType.MetaStable)).toBe(PoolType.MetaStable); + expect(mapApiPoolType(GqlPoolType.PhantomStable)).toBe( + PoolType.StablePhantom ); - expect(mapApiPoolType(GqlPoolMinimalType.PhantomStable)).toBe( + expect(mapApiPoolType(GqlPoolType.Stable)).toBe(PoolType.Stable); + expect(mapApiPoolType(GqlPoolType.Unknown)).toBeNull(); + expect(mapApiPoolType(GqlPoolType.Weighted)).toBe(PoolType.Weighted); + expect(mapApiPoolType(GqlPoolType.ComposableStable)).toBe( PoolType.StablePhantom ); - expect(mapApiPoolType(GqlPoolMinimalType.Stable)).toBe(PoolType.Stable); - expect(mapApiPoolType(GqlPoolMinimalType.Unknown)).toBeNull(); - expect(mapApiPoolType(GqlPoolMinimalType.Weighted)).toBe(PoolType.Weighted); }); diff --git a/src/composables/queries/useTokenPricesQuery.ts b/src/composables/queries/useTokenPricesQuery.ts index b8f3f8054c..6fb0a61861 100644 --- a/src/composables/queries/useTokenPricesQuery.ts +++ b/src/composables/queries/useTokenPricesQuery.ts @@ -47,7 +47,7 @@ export default function useTokenPricesQuery( const queryFn = async () => { const { prices } = await api.GetCurrentTokenPrices(); - let pricesMap = priceArrayToMap(prices); + let pricesMap = priceArrayToMap(prices as GqlTokenPrice[]); pricesMap = injectCustomTokens(pricesMap, pricesToInject.value); console.log('Fetching', Object.values(prices).length, 'prices'); diff --git a/src/constants/queryKeys.ts b/src/constants/queryKeys.ts index bb9b25a1bc..09dcd389d5 100644 --- a/src/constants/queryKeys.ts +++ b/src/constants/queryKeys.ts @@ -68,15 +68,10 @@ const QUERY_KEYS = { { networkId, id }, ], Joins: { - QueryJoin: ( - amountsIn: Ref, - hasFetchedPoolsForSor: Ref, - isSingleAssetJoin: Ref - ) => [ + QueryJoin: (amountsIn: Ref, isSingleAssetJoin: Ref) => [ ...QUERY_JOIN_ROOT_KEY, { amountsIn, - hasFetchedPoolsForSor, isSingleAssetJoin, }, ], @@ -85,7 +80,6 @@ const QUERY_KEYS = { QueryExit: ( account: Ref, bptIn: Ref, - hasFetchedPoolsForSor: Ref, isSingleAssetExit: Ref, singleAmountOut: unknown, relayerSignature: Ref @@ -94,7 +88,6 @@ const QUERY_KEYS = { { account, bptIn, - hasFetchedPoolsForSor, isSingleAssetExit, singleAmountOut, relayerSignature, @@ -102,7 +95,6 @@ const QUERY_KEYS = { ], SingleAssetMax: ( bptBalance: Ref, - hasFetchedPoolsForSor: Ref, isSingleAssetExit: Ref, singleAmountOut: unknown ) => [ @@ -110,7 +102,6 @@ const QUERY_KEYS = { 'singleAssetMax', { bptBalance, - hasFetchedPoolsForSor, isSingleAssetExit, singleAmountOut, }, diff --git a/src/lib/config/arbitrum/pools.ts b/src/lib/config/arbitrum/pools.ts index 2ae37e8cbb..f5f95d9361 100644 --- a/src/lib/config/arbitrum/pools.ts +++ b/src/lib/config/arbitrum/pools.ts @@ -147,6 +147,7 @@ const pools: Pools = { '0xb01df7b9337c9264b2e60afc08946975b8fd010f0002000000000000000004db', // 50BAL-50ARB '0xec727cfc37277260677875620c35eb176b7df4bf0002000000000000000004dd', // 50wstETH/50sDAI '0xc757f12694f550d0985ad6e1019c4db4a803f1600002000000000000000004de', // 50wstETH/50sFRAX + '0x0ce6bb7108406ec73e5af03047cb859de56702490002000000000000000004df', // 50FRACTION-50WETH ], }, Factories: { @@ -244,6 +245,8 @@ const pools: Pools = { '0xa1a8bf131571a2139feb79401aa4a2e9482df6270002000000000000000004b4', '0xdacf5fa19b1f720111609043ac67a9818262850c000000000000000000000635', '0x451b0afd69ace11ec0ac339033d54d2543b088a80000000000000000000004d5', // plsRDNT-Stable + '0xc757f12694f550d0985ad6e1019c4db4a803f1600002000000000000000004de', + '0x2ce4457acac29da4736ae6f5cd9f583a6b335c270000000000000000000004dc', ], }, Metadata: {}, @@ -268,6 +271,7 @@ const pools: Pools = { '0xa1ea76c42b2938cfa9abea12357881006c52851300000000000000000000048f', // DUSD/bbausd '0x3cdf30e36154a66a4478e15ed41659b5bb0738f100000000000000000000049b', // DUSD-4POOL-BPT '0xa1a8bf131571a2139feb79401aa4a2e9482df6270002000000000000000004b4', + '0x2ce4457acac29da4736ae6f5cd9f583a6b335c270000000000000000000004dc', ], Deprecated: { '0x567ecfcb22205d279bb8eed3e066989902bf03d5000000000000000000000452': { diff --git a/src/lib/config/base/pools.ts b/src/lib/config/base/pools.ts index 0361357227..d1739fbb9c 100644 --- a/src/lib/config/base/pools.ts +++ b/src/lib/config/base/pools.ts @@ -146,6 +146,8 @@ const pools: Pools = { '0x2650d8d8167faa125a9156d533703a2af5d9f4e10001000000000000000000ce', // 8AURA-8BAL-33GOLD-50COIN '0x43037cb21cf259efa87febb844cc1179c13f8efc0002000000000000000000d1', // 30USDbC-70WELL '0xdd2a31355a7a478fe43233b41b978b5286cdb7c90002000000000000000000d2', // 50WETH-50USDbC + '0x32b494056a118c1d43ad823fa650557a5a2870ab0002000000000000000000d5', // 50BAL-50WETH + '0xb8773cd299b5e1319f6d06fe76f6d94e7b17c4ab0002000000000000000000d6', // 50cbETH-50WETH ], }, Factories: { diff --git a/src/lib/config/polygon/pools.ts b/src/lib/config/polygon/pools.ts index 9eb6b4a088..6efa7cc86d 100644 --- a/src/lib/config/polygon/pools.ts +++ b/src/lib/config/polygon/pools.ts @@ -392,6 +392,14 @@ const pools: Pools = { '0xff56b4ecca40f03a6e318eb8d00b5db306a92375000100000000000000000d49', // 15wstETH-12WBTC-8stMATIC-5PAXG-60VINU '0x9abb5ff9fbb1b5d2d2c6a65be5f2fdf9ac1d2a7b000100000000000000000d4a', // 15WMATIC-15WBTC-15USDC-15WETH-25STARV3-15STARV3-M/V-G7/StarSeeds_Protocol '0x97df6ba8a1ffc15ea410218212ca1de34f314748000100000000000000000d4b', // 22WMATIC-22WBTC-22WETH-34STARV3/V-G7.1/StarSeeds_Protocol + '0xf64f6ab5cac83a464403a4f331a4fee73cd3fc36000100000000000000000d4e', // 33WBTC-33QI-33SP + '0x37a4b3d215199971c171ebd5ba16f5fc82fb5c13000200000000000000000d4c', // 50WETH-50FRACTION + '0xc1039c2e5ac873f4736057b20c7811d2a572fa78000100000000000000000d4f', // 12wstETH-15oRETRO-12stMATIC-37SP-12miMATIC-12liveRetro/V-G7.2/StarSeeds_Protocol + '0x541a59c0019750aada67678daf4150ae5b0bde56000200000000000000000d50', // 50USDT-50MaticX + '0xb7167bcfe2df6950ea32bdfc8adfa451026a3c62000200000000000000000d51', // 50WBTC-50LINK + '0x97bfa798025505367266b1804b30a5dcd3f38bc3000200000000000000000d56', // 50LINK-50LDO + '0x769109e27c8a5d9b12b445f1de56980744811f71000200000000000000000d55', // 95XEQ-5USDT + '0xd559c09e48d9882bc2da98de3d885c21bd130676000200000000000000000d57', // 10stMATIC-90SP ], }, Factories: { diff --git a/src/pages/pool/add-liquidity.vue b/src/pages/pool/add-liquidity.vue index 05e054ae71..4e9b3031ff 100644 --- a/src/pages/pool/add-liquidity.vue +++ b/src/pages/pool/add-liquidity.vue @@ -2,8 +2,6 @@ import Page from '@/components/contextual/pages/pool/add-liquidity/Page.vue'; import { useIntervalFn } from '@vueuse/core'; import { oneSecondInMs } from '@/composables/useTime'; -import { hasFetchedPoolsForSor } from '@/lib/balancer.sdk'; -import { usePoolHelpers } from '@/composables/usePoolHelpers'; import { usePool } from '@/providers/local/pool.provider'; import Col2Layout from '@/components/layouts/Col2Layout.vue'; import useBreakpoints from '@/composables/useBreakpoints'; @@ -25,20 +23,13 @@ providePoolStaking(poolId); * COMPOSABLES */ const { pool, isLoadingPool, refetchOnchainPoolData } = usePool(); -const { isDeepPool } = usePoolHelpers(pool); const { isMobile } = useBreakpoints(); /** * COMPUTED */ -// We only need to wait for SOR if it's a deep pool. -const isLoadingSor = computed( - (): boolean => isDeepPool.value && !hasFetchedPoolsForSor.value -); - -const isLoading = computed( - (): boolean => isLoadingPool.value || isLoadingSor.value -); + +const isLoading = computed((): boolean => isLoadingPool.value); // Instead of refetching pool data on every block, we refetch every 20s to prevent // overfetching a request on short blocktime networks like Polygon. diff --git a/src/pages/pool/withdraw.vue b/src/pages/pool/withdraw.vue index 8ca956e6c4..7942d192a1 100644 --- a/src/pages/pool/withdraw.vue +++ b/src/pages/pool/withdraw.vue @@ -1,8 +1,6 @@ diff --git a/src/providers/local/exit-pool.provider.ts b/src/providers/local/exit-pool.provider.ts index 3320eee703..45b51b6b81 100644 --- a/src/providers/local/exit-pool.provider.ts +++ b/src/providers/local/exit-pool.provider.ts @@ -22,7 +22,6 @@ import { } from '@/constants/poolLiquidity'; import QUERY_KEYS from '@/constants/queryKeys'; import symbolKeys from '@/constants/symbol.keys'; -import { hasFetchedPoolsForSor } from '@/lib/balancer.sdk'; import { bnSum, bnum, @@ -128,7 +127,6 @@ export const exitPoolProvider = ( QUERY_KEYS.Pools.Exits.QueryExit( account, bptIn, - hasFetchedPoolsForSor, isSingleAssetExit, singleAmountOut, relayerSignature @@ -143,7 +141,6 @@ export const exitPoolProvider = ( >( QUERY_KEYS.Pools.Exits.SingleAssetMax( bptBalance, - hasFetchedPoolsForSor, isSingleAssetExit, toRef(singleAmountOut, 'address') ), @@ -155,8 +152,7 @@ export const exitPoolProvider = ( * COMPUTED */ const isLoadingQuery = computed( - (): boolean => - !hasFetchedPoolsForSor.value || queryExitQuery.isFetching.value + (): boolean => queryExitQuery.isFetching.value ); const queryError = computed( @@ -164,10 +160,7 @@ export const exitPoolProvider = ( ); const isLoadingMax = computed( - (): boolean => - singleAssetMaxQuery.isFetching.value || - !queriesEnabled.value || - !hasFetchedPoolsForSor.value + (): boolean => singleAssetMaxQuery.isFetching.value || !queriesEnabled.value ); const maxError = computed( @@ -357,8 +350,6 @@ export const exitPoolProvider = ( // This is so we can render - in UI instead of 0. If we set to 0 then it can be misleading. priceImpactValid.value = false; - if (!hasFetchedPoolsForSor.value) return null; - // Single asset exit, and token out amount is 0 or less if (isSingleAssetExit.value && !validAmounts.value) return null; @@ -406,7 +397,6 @@ export const exitPoolProvider = ( */ async function getSingleAssetMax() { singleAmountOut.max = '0'; - if (!hasFetchedPoolsForSor.value) return null; if (!isSingleAssetExit.value) return null; // If the user has no BPT, there is no maximum amount out. diff --git a/src/providers/local/join-pool.provider.ts b/src/providers/local/join-pool.provider.ts index 2e9d147242..f9997294ff 100644 --- a/src/providers/local/join-pool.provider.ts +++ b/src/providers/local/join-pool.provider.ts @@ -16,7 +16,6 @@ import { } from '@/constants/poolLiquidity'; import QUERY_KEYS from '@/constants/queryKeys'; import symbolKeys from '@/constants/symbol.keys'; -import { hasFetchedPoolsForSor } from '@/lib/balancer.sdk'; import { bnSum, bnum, isSameAddress } from '@/lib/utils'; import { safeInject } from '@/providers/inject'; import { useTokens } from '@/providers/tokens.provider'; @@ -91,10 +90,6 @@ export const joinPoolProvider = ( QUERY_KEYS.Pools.Joins.QueryJoin( // If amountsIn change we should call queryJoin to get expected output. amountsIn, - // If the global pool fetching for the SOR changes it's been set to true. In - // this case we should re-trigger queryJoin to fetch the expected output for - // any existing input. - hasFetchedPoolsForSor, isSingleAssetJoin ), debounceQueryJoin, diff --git a/src/services/api/graphql/generated/api-schema.graphql b/src/services/api/graphql/generated/api-schema.graphql index 98d6caa9a6..b399acde86 100644 --- a/src/services/api/graphql/generated/api-schema.graphql +++ b/src/services/api/graphql/generated/api-schema.graphql @@ -51,6 +51,19 @@ enum GqlContentNewsItemSource { twitter } +type GqlCowSwapApiResponse { + marketSp: String! + returnAmount: String! + returnAmountConsideringFees: String! + returnAmountFromSwaps: String! + swapAmount: String! + swapAmountForSwaps: String! + swaps: [GqlSwap!]! + tokenAddresses: [String!]! + tokenIn: String! + tokenOut: String! +} + type GqlFeaturePoolGroupItemExternalLink { buttonText: String! buttonUrl: String! @@ -58,6 +71,38 @@ type GqlFeaturePoolGroupItemExternalLink { image: String! } +"""Configuration options for SOR V2""" +input GqlGraphTraversalConfigInput { + """ + Max number of paths to return (can be less) + + Default: 5 + """ + approxPathsToReturn: Int + + """ + The max hops in a path. + + Default: 6 + """ + maxDepth: Int + + """ + Limit non boosted hop tokens in a boosted path. + + Default: 2 + """ + maxNonBoostedHopTokensInBoostedPath: Int + + """ + Limit of "non-boosted" pools for efficiency. + + Default: 6 + """ + maxNonBoostedPathDepth: Int + poolIdsToInclude: [String] +} + type GqlHistoricalTokenPrice { address: String! prices: [GqlHistoricalTokenPriceEntry!]! @@ -109,10 +154,14 @@ interface GqlPoolBase { owner: Bytes staking: GqlPoolStaking symbol: String! + type: GqlPoolType! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! } type GqlPoolBatchSwap { + chain: GqlChain! id: ID! swaps: [GqlPoolBatchSwapSwap!]! timestamp: Int! @@ -145,6 +194,50 @@ type GqlPoolBatchSwapSwap { valueUSD: Float! } +type GqlPoolComposableStable implements GqlPoolBase { + address: Bytes! + allTokens: [GqlPoolTokenExpanded!]! + amp: BigInt! + bptPriceRate: BigDecimal! + chain: GqlChain! + createTime: Int! + decimals: Int! + displayTokens: [GqlPoolTokenDisplay!]! + dynamicData: GqlPoolDynamicData! + factory: Bytes + id: ID! + investConfig: GqlPoolInvestConfig! + name: String! + nestingType: GqlPoolNestingType! + owner: Bytes! + staking: GqlPoolStaking + symbol: String! + tokens: [GqlPoolTokenUnion!]! + type: GqlPoolType! + userBalance: GqlPoolUserBalance + version: Int! + withdrawConfig: GqlPoolWithdrawConfig! +} + +type GqlPoolComposableStableNested { + address: Bytes! + amp: BigInt! + bptPriceRate: BigDecimal! + createTime: Int! + factory: Bytes + id: ID! + name: String! + nestingType: GqlPoolNestingType! + owner: Bytes! + swapFee: BigDecimal! + symbol: String! + tokens: [GqlPoolTokenComposableStableNestedUnion!]! + totalLiquidity: BigDecimal! + totalShares: BigDecimal! + type: GqlPoolType! + version: Int! +} + type GqlPoolDynamicData { apr: GqlPoolApr! fees24h: BigDecimal! @@ -200,7 +293,10 @@ type GqlPoolElement implements GqlPoolBase { staking: GqlPoolStaking symbol: String! tokens: [GqlPoolToken!]! + type: GqlPoolType! unitSeconds: BigInt! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! } @@ -218,14 +314,16 @@ input GqlPoolFilter { categoryNotIn: [GqlPoolFilterCategory!] chainIn: [GqlChain!] chainNotIn: [GqlChain!] + createTime: GqlPoolTimePeriod filterIn: [String!] filterNotIn: [String!] idIn: [String!] idNotIn: [String!] - poolTypeIn: [GqlPoolFilterType!] - poolTypeNotIn: [GqlPoolFilterType!] + poolTypeIn: [GqlPoolType!] + poolTypeNotIn: [GqlPoolType!] tokensIn: [String!] tokensNotIn: [String!] + userAddress: String } enum GqlPoolFilterCategory { @@ -238,42 +336,44 @@ type GqlPoolFilterDefinition { title: String! } -enum GqlPoolFilterType { - ELEMENT - GYRO - GYRO3 - GYROE - INVESTMENT - LINEAR - LIQUIDITY_BOOTSTRAPPING - META_STABLE - PHANTOM_STABLE - STABLE - UNKNOWN - WEIGHTED -} - type GqlPoolGyro implements GqlPoolBase { address: Bytes! allTokens: [GqlPoolTokenExpanded!]! alpha: String! beta: String! + c: String! chain: GqlChain! createTime: Int! + dSq: String! decimals: Int! displayTokens: [GqlPoolTokenDisplay!]! dynamicData: GqlPoolDynamicData! factory: Bytes id: ID! investConfig: GqlPoolInvestConfig! + lambda: String! name: String! nestingType: GqlPoolNestingType! owner: Bytes! + root3Alpha: String! + s: String! + sqrtAlpha: String! + sqrtBeta: String! staking: GqlPoolStaking symbol: String! + tauAlphaX: String! + tauAlphaY: String! + tauBetaX: String! + tauBetaY: String! tokens: [GqlPoolTokenUnion!]! - type: String! + type: GqlPoolType! + u: String! + userBalance: GqlPoolUserBalance + v: String! + version: Int! + w: String! withdrawConfig: GqlPoolWithdrawConfig! + z: String! } type GqlPoolInvestConfig { @@ -290,6 +390,7 @@ type GqlPoolInvestOption { type GqlPoolJoinExit { amounts: [GqlPoolJoinExitAmount!]! + chain: GqlChain! id: ID! poolId: String! sender: String! @@ -305,6 +406,7 @@ type GqlPoolJoinExitAmount { } input GqlPoolJoinExitFilter { + chainIn: [GqlChain!] poolIdIn: [String!] } @@ -332,7 +434,10 @@ type GqlPoolLinear implements GqlPoolBase { staking: GqlPoolStaking symbol: String! tokens: [GqlPoolToken!]! + type: GqlPoolType! upperTarget: BigInt! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! wrappedIndex: Int! } @@ -351,7 +456,9 @@ type GqlPoolLinearNested { tokens: [GqlPoolToken!]! totalLiquidity: BigDecimal! totalShares: BigDecimal! + type: GqlPoolType! upperTarget: BigInt! + version: Int! wrappedIndex: Int! } @@ -407,6 +514,9 @@ type GqlPoolLiquidityBootstrapping implements GqlPoolBase { staking: GqlPoolStaking symbol: String! tokens: [GqlPoolTokenUnion!]! + type: GqlPoolType! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! } @@ -427,6 +537,9 @@ type GqlPoolMetaStable implements GqlPoolBase { staking: GqlPoolStaking symbol: String! tokens: [GqlPoolToken!]! + type: GqlPoolType! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! } @@ -444,26 +557,12 @@ type GqlPoolMinimal { owner: Bytes staking: GqlPoolStaking symbol: String! - type: GqlPoolMinimalType! + type: GqlPoolType! + userBalance: GqlPoolUserBalance version: Int! } -enum GqlPoolMinimalType { - ELEMENT - GYRO - GYRO3 - GYROE - INVESTMENT - LINEAR - LIQUIDITY_BOOTSTRAPPING - META_STABLE - PHANTOM_STABLE - STABLE - UNKNOWN - WEIGHTED -} - -union GqlPoolNestedUnion = GqlPoolLinearNested | GqlPoolPhantomStableNested +union GqlPoolNestedUnion = GqlPoolComposableStableNested | GqlPoolLinearNested enum GqlPoolNestingType { HAS_ONLY_PHANTOM_BPT @@ -476,6 +575,7 @@ enum GqlPoolOrderBy { fees24h totalLiquidity totalShares + userbalanceUsd volume24h } @@ -484,47 +584,9 @@ enum GqlPoolOrderDirection { desc } -type GqlPoolPhantomStable implements GqlPoolBase { - address: Bytes! - allTokens: [GqlPoolTokenExpanded!]! - amp: BigInt! - bptPriceRate: BigDecimal! - chain: GqlChain! - createTime: Int! - decimals: Int! - displayTokens: [GqlPoolTokenDisplay!]! - dynamicData: GqlPoolDynamicData! - factory: Bytes - id: ID! - investConfig: GqlPoolInvestConfig! - name: String! - nestingType: GqlPoolNestingType! - owner: Bytes! - staking: GqlPoolStaking - symbol: String! - tokens: [GqlPoolTokenUnion!]! - withdrawConfig: GqlPoolWithdrawConfig! -} - -type GqlPoolPhantomStableNested { - address: Bytes! - amp: BigInt! - bptPriceRate: BigDecimal! - createTime: Int! - factory: Bytes - id: ID! - name: String! - nestingType: GqlPoolNestingType! - owner: Bytes! - swapFee: BigDecimal! - symbol: String! - tokens: [GqlPoolTokenPhantomStableNestedUnion!]! - totalLiquidity: BigDecimal! - totalShares: BigDecimal! -} - type GqlPoolSnapshot { amounts: [String!]! + chain: GqlChain! fees24h: String! holdersCount: String! id: ID! @@ -564,10 +626,13 @@ type GqlPoolStable implements GqlPoolBase { staking: GqlPoolStaking symbol: String! tokens: [GqlPoolToken!]! + type: GqlPoolType! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! } -type GqlPoolStablePhantomPoolData { +type GqlPoolStableComposablePoolData { address: String! balance: String! id: ID! @@ -578,11 +643,21 @@ type GqlPoolStablePhantomPoolData { type GqlPoolStaking { address: String! + chain: GqlChain! + farm: GqlPoolStakingMasterChefFarm gauge: GqlPoolStakingGauge id: ID! + reliquary: GqlPoolStakingReliquaryFarm type: GqlPoolStakingType! } +type GqlPoolStakingFarmRewarder { + address: String! + id: ID! + rewardPerSecond: String! + tokenAddress: String! +} + type GqlPoolStakingGauge { gaugeAddress: String! id: ID! @@ -590,6 +665,7 @@ type GqlPoolStakingGauge { rewards: [GqlPoolStakingGaugeReward!]! status: GqlPoolStakingGaugeStatus! version: Int! + workingSupply: String! } type GqlPoolStakingGaugeReward { @@ -604,6 +680,12 @@ enum GqlPoolStakingGaugeStatus { PREFERRED } +type GqlPoolStakingMasterChefFarm { + beetsPerBlock: String! + id: ID! + rewarders: [GqlPoolStakingFarmRewarder!] +} + type GqlPoolStakingOtherGauge { gaugeAddress: String! id: ID! @@ -612,11 +694,32 @@ type GqlPoolStakingOtherGauge { version: Int! } +type GqlPoolStakingReliquaryFarm { + beetsPerSecond: String! + id: ID! + levels: [GqlPoolStakingReliquaryFarmLevel!] + totalBalance: String! + totalWeightedBalance: String! +} + +type GqlPoolStakingReliquaryFarmLevel { + allocationPoints: Int! + apr: BigDecimal! + balance: BigDecimal! + id: ID! + level: Int! + requiredMaturity: Int! +} + enum GqlPoolStakingType { + FRESH_BEETS GAUGE + MASTER_CHEF + RELIQUARY } type GqlPoolSwap { + chain: GqlChain! id: ID! poolId: String! timestamp: Int! @@ -630,11 +733,17 @@ type GqlPoolSwap { } input GqlPoolSwapFilter { + chainIn: [GqlChain!] poolIdIn: [String!] tokenInIn: [String!] tokenOutIn: [String!] } +input GqlPoolTimePeriod { + gt: Int + lt: Int +} + type GqlPoolToken implements GqlPoolTokenBase { address: String! balance: BigDecimal! @@ -661,6 +770,22 @@ interface GqlPoolTokenBase { weight: BigDecimal } +type GqlPoolTokenComposableStable implements GqlPoolTokenBase { + address: String! + balance: BigDecimal! + decimals: Int! + id: ID! + index: Int! + name: String! + pool: GqlPoolComposableStableNested! + priceRate: BigDecimal! + symbol: String! + totalBalance: BigDecimal! + weight: BigDecimal +} + +union GqlPoolTokenComposableStableNestedUnion = GqlPoolToken | GqlPoolTokenLinear + type GqlPoolTokenDisplay { address: String! id: ID! @@ -699,25 +824,35 @@ type GqlPoolTokenLinear implements GqlPoolTokenBase { wrappedTokenBalance: BigDecimal! } -type GqlPoolTokenPhantomStable implements GqlPoolTokenBase { - address: String! - balance: BigDecimal! - decimals: Int! - id: ID! - index: Int! - name: String! - pool: GqlPoolPhantomStableNested! - priceRate: BigDecimal! - symbol: String! - totalBalance: BigDecimal! - weight: BigDecimal -} +union GqlPoolTokenUnion = GqlPoolToken | GqlPoolTokenComposableStable | GqlPoolTokenLinear -union GqlPoolTokenPhantomStableNestedUnion = GqlPoolToken | GqlPoolTokenLinear +enum GqlPoolType { + COMPOSABLE_STABLE + ELEMENT + FX + GYRO + GYRO3 + GYROE + INVESTMENT + LINEAR + LIQUIDITY_BOOTSTRAPPING + META_STABLE + PHANTOM_STABLE + STABLE + UNKNOWN + WEIGHTED +} -union GqlPoolTokenUnion = GqlPoolToken | GqlPoolTokenLinear | GqlPoolTokenPhantomStable +union GqlPoolUnion = GqlPoolComposableStable | GqlPoolElement | GqlPoolGyro | GqlPoolLinear | GqlPoolLiquidityBootstrapping | GqlPoolMetaStable | GqlPoolStable | GqlPoolWeighted -union GqlPoolUnion = GqlPoolElement | GqlPoolGyro | GqlPoolLinear | GqlPoolLiquidityBootstrapping | GqlPoolMetaStable | GqlPoolPhantomStable | GqlPoolStable | GqlPoolWeighted +type GqlPoolUserBalance { + stakedBalance: AmountHumanReadable! + stakedBalanceUsd: Float! + totalBalance: AmountHumanReadable! + totalBalanceUsd: Float! + walletBalance: AmountHumanReadable! + walletBalanceUsd: Float! +} type GqlPoolUserSwapVolume { swapVolumeUSD: BigDecimal! @@ -741,6 +876,9 @@ type GqlPoolWeighted implements GqlPoolBase { staking: GqlPoolStaking symbol: String! tokens: [GqlPoolTokenUnion!]! + type: GqlPoolType! + userBalance: GqlPoolUserBalance + version: Int! withdrawConfig: GqlPoolWithdrawConfig! } @@ -784,6 +922,43 @@ type GqlProtocolMetricsChain { yieldCapture24h: BigDecimal! } +type GqlRelicSnapshot { + balance: String! + entryTimestamp: Int! + farmId: String! + level: Int! + relicId: Int! +} + +type GqlReliquaryFarmLevelSnapshot { + balance: String! + id: ID! + level: String! +} + +type GqlReliquaryFarmSnapshot { + dailyDeposited: String! + dailyWithdrawn: String! + farmId: String! + id: ID! + levelBalances: [GqlReliquaryFarmLevelSnapshot!]! + relicCount: String! + timestamp: Int! + tokenBalances: [GqlReliquaryTokenBalanceSnapshot!]! + totalBalance: String! + totalLiquidity: String! + userCount: String! +} + +type GqlReliquaryTokenBalanceSnapshot { + address: String! + balance: String! + decimals: Int! + id: ID! + name: String! + symbol: String! +} + type GqlSorGetBatchSwapForTokensInResponse { assets: [String!]! swaps: [GqlSorSwap!]! @@ -849,8 +1024,17 @@ enum GqlSorSwapType { EXACT_OUT } +type GqlSwap { + amount: String! + assetInIndex: Int! + assetOutIndex: Int! + poolId: String! + userData: String! +} + type GqlToken { address: String! + chain: GqlChain! chainId: Int! decimals: Int! description: String @@ -880,6 +1064,7 @@ type GqlTokenCandlestickChartDataItem { } enum GqlTokenChartDataRange { + NINETY_DAY SEVEN_DAY THIRTY_DAY } @@ -914,6 +1099,7 @@ type GqlTokenDynamicData { type GqlTokenPrice { address: String! + chain: GqlChain! price: Float! } @@ -930,7 +1116,15 @@ enum GqlTokenType { WHITE_LISTED } +type GqlUserFbeetsBalance { + id: String! + stakedBalance: AmountHumanReadable! + totalBalance: AmountHumanReadable! + walletBalance: AmountHumanReadable! +} + type GqlUserPoolBalance { + chain: GqlChain! poolId: String! stakedBalance: AmountHumanReadable! tokenAddress: String! @@ -939,15 +1133,59 @@ type GqlUserPoolBalance { walletBalance: AmountHumanReadable! } +type GqlUserPoolSnapshot { + farmBalance: AmountHumanReadable! + fees24h: AmountHumanReadable! + gaugeBalance: AmountHumanReadable! + percentShare: Float! + timestamp: Int! + totalBalance: AmountHumanReadable! + totalValueUSD: AmountHumanReadable! + walletBalance: AmountHumanReadable! +} + +type GqlUserPortfolioSnapshot { + farmBalance: AmountHumanReadable! + fees24h: AmountHumanReadable! + gaugeBalance: AmountHumanReadable! + pools: [GqlUserPoolSnapshot!]! + timestamp: Int! + totalBalance: AmountHumanReadable! + totalFees: AmountHumanReadable! + totalValueUSD: AmountHumanReadable! + walletBalance: AmountHumanReadable! +} + +type GqlUserRelicSnapshot { + relicCount: Int! + relicSnapshots: [GqlRelicSnapshot!]! + timestamp: Int! + totalBalance: String! +} + +enum GqlUserSnapshotDataRange { + ALL_TIME + NINETY_DAYS + ONE_HUNDRED_EIGHTY_DAYS + ONE_YEAR + THIRTY_DAYS +} + input GqlUserSwapVolumeFilter { poolIdIn: [String!] tokenInIn: [String!] tokenOutIn: [String!] } +type GqlVeBalUserData { + balance: AmountHumanReadable! + rank: Int +} + type GqlVotingGauge { addedTimestamp: Int address: Bytes! + childGaugeAddress: Bytes isKilled: Boolean! relativeWeightCap: String } @@ -966,7 +1204,7 @@ type GqlVotingPool { id: ID! symbol: String! tokens: [GqlVotingGaugeToken!]! - type: GqlPoolMinimalType! + type: GqlPoolType! } """ @@ -976,10 +1214,13 @@ scalar JSON type Mutation { balancerMutationTest: String! + beetsPoolLoadReliquarySnapshotsForAllFarms: String! + beetsSyncFbeetsRatio: String! cacheAverageBlockTime: String! poolBlackListAddPool(poolId: String!): String! poolBlackListRemovePool(poolId: String!): String! poolDeletePool(poolId: String!): String! + poolInitOnChainDataForAllPools: String! poolInitializeSnapshotsForPool(poolId: String!): String! poolLoadOnChainDataForAllPools: String! poolLoadOnChainDataForPoolsWithActiveUpdates: String! @@ -991,7 +1232,7 @@ type Mutation { poolReloadPoolTokenIndexes(poolId: String!): String! poolReloadStakingForAllPools(stakingTypes: [GqlPoolStakingType!]!): String! poolSetPoolsWithPreferredGaugesAsIncentivized: String! - poolSyncAllPoolVersions: String! + poolSyncAllPoolTypesVersions: String! poolSyncAllPoolsFromSubgraph: [String!]! poolSyncLatestSnapshotsForAllPools(daysToSync: Int): String! poolSyncNewPoolsFromSubgraph: [String!]! @@ -1017,6 +1258,7 @@ type Mutation { userInitStakedBalances(stakingTypes: [GqlPoolStakingType!]!): String! userInitWalletBalancesForAllPools: String! userInitWalletBalancesForPool(poolId: String!): String! + userLoadAllRelicSnapshots: String! userSyncBalance(poolId: String!): String! userSyncBalanceAllPools: String! userSyncChangedStakedBalances: String! @@ -1026,45 +1268,51 @@ type Mutation { } type Query { - balancerQueryTest: String! + beetsGetFbeetsRatio: String! + beetsPoolGetReliquaryFarmSnapshots(id: String!, range: GqlPoolSnapshotDataRange!): [GqlReliquaryFarmSnapshot!]! blocksGetAverageBlockTime: Float! blocksGetBlocksPerDay: Float! blocksGetBlocksPerSecond: Float! blocksGetBlocksPerYear: Float! contentGetNewsItems: [GqlContentNewsItem!]! latestSyncedBlocks: GqlLatestSyncedBlocks! - poolGetAllPoolsSnapshots(range: GqlPoolSnapshotDataRange!): [GqlPoolSnapshot!]! + poolGetAllPoolsSnapshots(chains: [GqlChain!], range: GqlPoolSnapshotDataRange!): [GqlPoolSnapshot!]! poolGetBatchSwaps(first: Int, skip: Int, where: GqlPoolSwapFilter): [GqlPoolBatchSwap!]! poolGetFeaturedPoolGroups: [GqlPoolFeaturedPoolGroup!]! + poolGetGyroPools(chains: [GqlChain!]): [GqlPoolGyro!]! poolGetJoinExits(first: Int, skip: Int, where: GqlPoolJoinExitFilter): [GqlPoolJoinExit!]! - poolGetLinearPools: [GqlPoolLinear!]! - poolGetPool(id: String!): GqlPoolBase! - poolGetPoolFilters: [GqlPoolFilterDefinition!]! + poolGetLinearPools(chains: [GqlChain!]): [GqlPoolLinear!]! + poolGetPool(chain: GqlChain, id: String!, userAddress: String): GqlPoolBase! poolGetPools(first: Int, orderBy: GqlPoolOrderBy, orderDirection: GqlPoolOrderDirection, skip: Int, textSearch: String, where: GqlPoolFilter): [GqlPoolMinimal!]! poolGetPoolsCount(first: Int, orderBy: GqlPoolOrderBy, orderDirection: GqlPoolOrderDirection, skip: Int, textSearch: String, where: GqlPoolFilter): Int! - poolGetSnapshots(id: String!, range: GqlPoolSnapshotDataRange!): [GqlPoolSnapshot!]! + poolGetSnapshots(chain: GqlChain, id: String!, range: GqlPoolSnapshotDataRange!): [GqlPoolSnapshot!]! poolGetSwaps(first: Int, skip: Int, where: GqlPoolSwapFilter): [GqlPoolSwap!]! - poolGetUserSwapVolume(first: Int, skip: Int, where: GqlUserSwapVolumeFilter): [GqlPoolUserSwapVolume!]! - protocolMetricsAggregated(chainIds: [String!]!): GqlProtocolMetricsAggregated! - protocolMetricsChain: GqlProtocolMetricsChain! + protocolMetricsAggregated(chains: [GqlChain!]): GqlProtocolMetricsAggregated! + protocolMetricsChain(chain: GqlChain): GqlProtocolMetricsChain! sorGetBatchSwapForTokensIn(swapOptions: GqlSorSwapOptionsInput!, tokenOut: String!, tokensIn: [GqlTokenAmountHumanReadable!]!): GqlSorGetBatchSwapForTokensInResponse! - sorGetSwaps(swapAmount: BigDecimal!, swapOptions: GqlSorSwapOptionsInput!, swapType: GqlSorSwapType!, tokenIn: String!, tokenOut: String!): GqlSorGetSwapsResponse! + sorGetCowSwaps(chain: GqlChain!, swapAmount: BigDecimal!, swapType: GqlSorSwapType!, tokenIn: String!, tokenOut: String!): GqlCowSwapApiResponse! + sorGetSwaps(chain: GqlChain, swapAmount: BigDecimal!, swapOptions: GqlSorSwapOptionsInput!, swapType: GqlSorSwapType!, tokenIn: String!, tokenOut: String!): GqlSorGetSwapsResponse! tokenGetCandlestickChartData(address: String!, range: GqlTokenChartDataRange!): [GqlTokenCandlestickChartDataItem!]! - tokenGetCurrentPrices: [GqlTokenPrice!]! + tokenGetCurrentPrices(chains: [GqlChain!]): [GqlTokenPrice!]! tokenGetHistoricalPrices(addresses: [String!]!): [GqlHistoricalTokenPrice!]! tokenGetPriceChartData(address: String!, range: GqlTokenChartDataRange!): [GqlTokenPriceChartDataItem!]! tokenGetProtocolTokenPrice: AmountHumanReadable! tokenGetRelativePriceChartData(range: GqlTokenChartDataRange!, tokenIn: String!, tokenOut: String!): [GqlTokenPriceChartDataItem!]! tokenGetTokenData(address: String!): GqlTokenData tokenGetTokenDynamicData(address: String!): GqlTokenDynamicData - tokenGetTokens: [GqlToken!]! + tokenGetTokens(chains: [GqlChain!]): [GqlToken!]! tokenGetTokensData(addresses: [String!]!): [GqlTokenData!]! tokenGetTokensDynamicData(addresses: [String!]!): [GqlTokenDynamicData!]! - userGetPoolBalances: [GqlUserPoolBalance!]! - userGetPoolJoinExits(first: Int = 10, poolId: String!, skip: Int = 0): [GqlPoolJoinExit!]! - userGetStaking: [GqlPoolStaking!]! - userGetSwaps(first: Int = 10, poolId: String!, skip: Int = 0): [GqlPoolSwap!]! + userGetFbeetsBalance: GqlUserFbeetsBalance! + userGetPoolBalances(address: String, chains: [GqlChain!]): [GqlUserPoolBalance!]! + userGetPoolJoinExits(address: String, chain: GqlChain, first: Int = 10, poolId: String!, skip: Int = 0): [GqlPoolJoinExit!]! + userGetPoolSnapshots(chain: GqlChain!, poolId: String!, range: GqlUserSnapshotDataRange!): [GqlUserPoolSnapshot!]! + userGetPortfolioSnapshots(days: Int!): [GqlUserPortfolioSnapshot!]! + userGetRelicSnapshots(farmId: String!, range: GqlUserSnapshotDataRange!): [GqlUserRelicSnapshot!]! + userGetStaking(address: String, chains: [GqlChain!]): [GqlPoolStaking!]! + userGetSwaps(address: String, chain: GqlChain, first: Int = 10, poolId: String!, skip: Int = 0): [GqlPoolSwap!]! veBalGetTotalSupply: AmountHumanReadable! + veBalGetUser: GqlVeBalUserData! veBalGetUserBalance: AmountHumanReadable! veBalGetVotingList: [GqlVotingPool!]! } diff --git a/src/services/api/graphql/generated/api-types.ts b/src/services/api/graphql/generated/api-types.ts index 6c1f3a5d5e..23eac16f86 100644 --- a/src/services/api/graphql/generated/api-types.ts +++ b/src/services/api/graphql/generated/api-types.ts @@ -72,6 +72,20 @@ export enum GqlContentNewsItemSource { Twitter = 'twitter', } +export type GqlCowSwapApiResponse = { + __typename?: 'GqlCowSwapApiResponse'; + marketSp: Scalars['String']; + returnAmount: Scalars['String']; + returnAmountConsideringFees: Scalars['String']; + returnAmountFromSwaps: Scalars['String']; + swapAmount: Scalars['String']; + swapAmountForSwaps: Scalars['String']; + swaps: Array; + tokenAddresses: Array; + tokenIn: Scalars['String']; + tokenOut: Scalars['String']; +}; + export type GqlFeaturePoolGroupItemExternalLink = { __typename?: 'GqlFeaturePoolGroupItemExternalLink'; buttonText: Scalars['String']; @@ -80,6 +94,35 @@ export type GqlFeaturePoolGroupItemExternalLink = { image: Scalars['String']; }; +/** Configuration options for SOR V2 */ +export type GqlGraphTraversalConfigInput = { + /** + * Max number of paths to return (can be less) + * + * Default: 5 + */ + approxPathsToReturn?: InputMaybe; + /** + * The max hops in a path. + * + * Default: 6 + */ + maxDepth?: InputMaybe; + /** + * Limit non boosted hop tokens in a boosted path. + * + * Default: 2 + */ + maxNonBoostedHopTokensInBoostedPath?: InputMaybe; + /** + * Limit of "non-boosted" pools for efficiency. + * + * Default: 6 + */ + maxNonBoostedPathDepth?: InputMaybe; + poolIdsToInclude?: InputMaybe>>; +}; + export type GqlHistoricalTokenPrice = { __typename?: 'GqlHistoricalTokenPrice'; address: Scalars['String']; @@ -137,11 +180,15 @@ export type GqlPoolBase = { owner?: Maybe; staking?: Maybe; symbol: Scalars['String']; + type: GqlPoolType; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; }; export type GqlPoolBatchSwap = { __typename?: 'GqlPoolBatchSwap'; + chain: GqlChain; id: Scalars['ID']; swaps: Array; timestamp: Scalars['Int']; @@ -176,6 +223,52 @@ export type GqlPoolBatchSwapSwap = { valueUSD: Scalars['Float']; }; +export type GqlPoolComposableStable = GqlPoolBase & { + __typename?: 'GqlPoolComposableStable'; + address: Scalars['Bytes']; + allTokens: Array; + amp: Scalars['BigInt']; + bptPriceRate: Scalars['BigDecimal']; + chain: GqlChain; + createTime: Scalars['Int']; + decimals: Scalars['Int']; + displayTokens: Array; + dynamicData: GqlPoolDynamicData; + factory?: Maybe; + id: Scalars['ID']; + investConfig: GqlPoolInvestConfig; + name: Scalars['String']; + nestingType: GqlPoolNestingType; + owner: Scalars['Bytes']; + staking?: Maybe; + symbol: Scalars['String']; + tokens: Array; + type: GqlPoolType; + userBalance?: Maybe; + version: Scalars['Int']; + withdrawConfig: GqlPoolWithdrawConfig; +}; + +export type GqlPoolComposableStableNested = { + __typename?: 'GqlPoolComposableStableNested'; + address: Scalars['Bytes']; + amp: Scalars['BigInt']; + bptPriceRate: Scalars['BigDecimal']; + createTime: Scalars['Int']; + factory?: Maybe; + id: Scalars['ID']; + name: Scalars['String']; + nestingType: GqlPoolNestingType; + owner: Scalars['Bytes']; + swapFee: Scalars['BigDecimal']; + symbol: Scalars['String']; + tokens: Array; + totalLiquidity: Scalars['BigDecimal']; + totalShares: Scalars['BigDecimal']; + type: GqlPoolType; + version: Scalars['Int']; +}; + export type GqlPoolDynamicData = { __typename?: 'GqlPoolDynamicData'; apr: GqlPoolApr; @@ -233,7 +326,10 @@ export type GqlPoolElement = GqlPoolBase & { staking?: Maybe; symbol: Scalars['String']; tokens: Array; + type: GqlPoolType; unitSeconds: Scalars['BigInt']; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; }; @@ -254,14 +350,16 @@ export type GqlPoolFilter = { categoryNotIn?: InputMaybe>; chainIn?: InputMaybe>; chainNotIn?: InputMaybe>; + createTime?: InputMaybe; filterIn?: InputMaybe>; filterNotIn?: InputMaybe>; idIn?: InputMaybe>; idNotIn?: InputMaybe>; - poolTypeIn?: InputMaybe>; - poolTypeNotIn?: InputMaybe>; + poolTypeIn?: InputMaybe>; + poolTypeNotIn?: InputMaybe>; tokensIn?: InputMaybe>; tokensNotIn?: InputMaybe>; + userAddress?: InputMaybe; }; export enum GqlPoolFilterCategory { @@ -275,43 +373,45 @@ export type GqlPoolFilterDefinition = { title: Scalars['String']; }; -export enum GqlPoolFilterType { - Element = 'ELEMENT', - Gyro = 'GYRO', - Gyro3 = 'GYRO3', - Gyroe = 'GYROE', - Investment = 'INVESTMENT', - Linear = 'LINEAR', - LiquidityBootstrapping = 'LIQUIDITY_BOOTSTRAPPING', - MetaStable = 'META_STABLE', - PhantomStable = 'PHANTOM_STABLE', - Stable = 'STABLE', - Unknown = 'UNKNOWN', - Weighted = 'WEIGHTED', -} - export type GqlPoolGyro = GqlPoolBase & { __typename?: 'GqlPoolGyro'; address: Scalars['Bytes']; allTokens: Array; alpha: Scalars['String']; beta: Scalars['String']; + c: Scalars['String']; chain: GqlChain; createTime: Scalars['Int']; + dSq: Scalars['String']; decimals: Scalars['Int']; displayTokens: Array; dynamicData: GqlPoolDynamicData; factory?: Maybe; id: Scalars['ID']; investConfig: GqlPoolInvestConfig; + lambda: Scalars['String']; name: Scalars['String']; nestingType: GqlPoolNestingType; owner: Scalars['Bytes']; + root3Alpha: Scalars['String']; + s: Scalars['String']; + sqrtAlpha: Scalars['String']; + sqrtBeta: Scalars['String']; staking?: Maybe; symbol: Scalars['String']; + tauAlphaX: Scalars['String']; + tauAlphaY: Scalars['String']; + tauBetaX: Scalars['String']; + tauBetaY: Scalars['String']; tokens: Array; - type: Scalars['String']; + type: GqlPoolType; + u: Scalars['String']; + userBalance?: Maybe; + v: Scalars['String']; + version: Scalars['Int']; + w: Scalars['String']; withdrawConfig: GqlPoolWithdrawConfig; + z: Scalars['String']; }; export type GqlPoolInvestConfig = { @@ -331,6 +431,7 @@ export type GqlPoolInvestOption = { export type GqlPoolJoinExit = { __typename?: 'GqlPoolJoinExit'; amounts: Array; + chain: GqlChain; id: Scalars['ID']; poolId: Scalars['String']; sender: Scalars['String']; @@ -347,6 +448,7 @@ export type GqlPoolJoinExitAmount = { }; export type GqlPoolJoinExitFilter = { + chainIn?: InputMaybe>; poolIdIn?: InputMaybe>; }; @@ -375,7 +477,10 @@ export type GqlPoolLinear = GqlPoolBase & { staking?: Maybe; symbol: Scalars['String']; tokens: Array; + type: GqlPoolType; upperTarget: Scalars['BigInt']; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; wrappedIndex: Scalars['Int']; }; @@ -395,7 +500,9 @@ export type GqlPoolLinearNested = { tokens: Array; totalLiquidity: Scalars['BigDecimal']; totalShares: Scalars['BigDecimal']; + type: GqlPoolType; upperTarget: Scalars['BigInt']; + version: Scalars['Int']; wrappedIndex: Scalars['Int']; }; @@ -455,6 +562,9 @@ export type GqlPoolLiquidityBootstrapping = GqlPoolBase & { staking?: Maybe; symbol: Scalars['String']; tokens: Array; + type: GqlPoolType; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; }; @@ -476,6 +586,9 @@ export type GqlPoolMetaStable = GqlPoolBase & { staking?: Maybe; symbol: Scalars['String']; tokens: Array; + type: GqlPoolType; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; }; @@ -494,28 +607,14 @@ export type GqlPoolMinimal = { owner?: Maybe; staking?: Maybe; symbol: Scalars['String']; - type: GqlPoolMinimalType; + type: GqlPoolType; + userBalance?: Maybe; version: Scalars['Int']; }; -export enum GqlPoolMinimalType { - Element = 'ELEMENT', - Gyro = 'GYRO', - Gyro3 = 'GYRO3', - Gyroe = 'GYROE', - Investment = 'INVESTMENT', - Linear = 'LINEAR', - LiquidityBootstrapping = 'LIQUIDITY_BOOTSTRAPPING', - MetaStable = 'META_STABLE', - PhantomStable = 'PHANTOM_STABLE', - Stable = 'STABLE', - Unknown = 'UNKNOWN', - Weighted = 'WEIGHTED', -} - export type GqlPoolNestedUnion = - | GqlPoolLinearNested - | GqlPoolPhantomStableNested; + | GqlPoolComposableStableNested + | GqlPoolLinearNested; export enum GqlPoolNestingType { HasOnlyPhantomBpt = 'HAS_ONLY_PHANTOM_BPT', @@ -528,6 +627,7 @@ export enum GqlPoolOrderBy { Fees24h = 'fees24h', TotalLiquidity = 'totalLiquidity', TotalShares = 'totalShares', + UserbalanceUsd = 'userbalanceUsd', Volume24h = 'volume24h', } @@ -536,50 +636,10 @@ export enum GqlPoolOrderDirection { Desc = 'desc', } -export type GqlPoolPhantomStable = GqlPoolBase & { - __typename?: 'GqlPoolPhantomStable'; - address: Scalars['Bytes']; - allTokens: Array; - amp: Scalars['BigInt']; - bptPriceRate: Scalars['BigDecimal']; - chain: GqlChain; - createTime: Scalars['Int']; - decimals: Scalars['Int']; - displayTokens: Array; - dynamicData: GqlPoolDynamicData; - factory?: Maybe; - id: Scalars['ID']; - investConfig: GqlPoolInvestConfig; - name: Scalars['String']; - nestingType: GqlPoolNestingType; - owner: Scalars['Bytes']; - staking?: Maybe; - symbol: Scalars['String']; - tokens: Array; - withdrawConfig: GqlPoolWithdrawConfig; -}; - -export type GqlPoolPhantomStableNested = { - __typename?: 'GqlPoolPhantomStableNested'; - address: Scalars['Bytes']; - amp: Scalars['BigInt']; - bptPriceRate: Scalars['BigDecimal']; - createTime: Scalars['Int']; - factory?: Maybe; - id: Scalars['ID']; - name: Scalars['String']; - nestingType: GqlPoolNestingType; - owner: Scalars['Bytes']; - swapFee: Scalars['BigDecimal']; - symbol: Scalars['String']; - tokens: Array; - totalLiquidity: Scalars['BigDecimal']; - totalShares: Scalars['BigDecimal']; -}; - export type GqlPoolSnapshot = { __typename?: 'GqlPoolSnapshot'; amounts: Array; + chain: GqlChain; fees24h: Scalars['String']; holdersCount: Scalars['String']; id: Scalars['ID']; @@ -620,11 +680,14 @@ export type GqlPoolStable = GqlPoolBase & { staking?: Maybe; symbol: Scalars['String']; tokens: Array; + type: GqlPoolType; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; }; -export type GqlPoolStablePhantomPoolData = { - __typename?: 'GqlPoolStablePhantomPoolData'; +export type GqlPoolStableComposablePoolData = { + __typename?: 'GqlPoolStableComposablePoolData'; address: Scalars['String']; balance: Scalars['String']; id: Scalars['ID']; @@ -636,11 +699,22 @@ export type GqlPoolStablePhantomPoolData = { export type GqlPoolStaking = { __typename?: 'GqlPoolStaking'; address: Scalars['String']; + chain: GqlChain; + farm?: Maybe; gauge?: Maybe; id: Scalars['ID']; + reliquary?: Maybe; type: GqlPoolStakingType; }; +export type GqlPoolStakingFarmRewarder = { + __typename?: 'GqlPoolStakingFarmRewarder'; + address: Scalars['String']; + id: Scalars['ID']; + rewardPerSecond: Scalars['String']; + tokenAddress: Scalars['String']; +}; + export type GqlPoolStakingGauge = { __typename?: 'GqlPoolStakingGauge'; gaugeAddress: Scalars['String']; @@ -649,6 +723,7 @@ export type GqlPoolStakingGauge = { rewards: Array; status: GqlPoolStakingGaugeStatus; version: Scalars['Int']; + workingSupply: Scalars['String']; }; export type GqlPoolStakingGaugeReward = { @@ -664,6 +739,13 @@ export enum GqlPoolStakingGaugeStatus { Preferred = 'PREFERRED', } +export type GqlPoolStakingMasterChefFarm = { + __typename?: 'GqlPoolStakingMasterChefFarm'; + beetsPerBlock: Scalars['String']; + id: Scalars['ID']; + rewarders?: Maybe>; +}; + export type GqlPoolStakingOtherGauge = { __typename?: 'GqlPoolStakingOtherGauge'; gaugeAddress: Scalars['String']; @@ -673,12 +755,35 @@ export type GqlPoolStakingOtherGauge = { version: Scalars['Int']; }; +export type GqlPoolStakingReliquaryFarm = { + __typename?: 'GqlPoolStakingReliquaryFarm'; + beetsPerSecond: Scalars['String']; + id: Scalars['ID']; + levels?: Maybe>; + totalBalance: Scalars['String']; + totalWeightedBalance: Scalars['String']; +}; + +export type GqlPoolStakingReliquaryFarmLevel = { + __typename?: 'GqlPoolStakingReliquaryFarmLevel'; + allocationPoints: Scalars['Int']; + apr: Scalars['BigDecimal']; + balance: Scalars['BigDecimal']; + id: Scalars['ID']; + level: Scalars['Int']; + requiredMaturity: Scalars['Int']; +}; + export enum GqlPoolStakingType { + FreshBeets = 'FRESH_BEETS', Gauge = 'GAUGE', + MasterChef = 'MASTER_CHEF', + Reliquary = 'RELIQUARY', } export type GqlPoolSwap = { __typename?: 'GqlPoolSwap'; + chain: GqlChain; id: Scalars['ID']; poolId: Scalars['String']; timestamp: Scalars['Int']; @@ -692,11 +797,17 @@ export type GqlPoolSwap = { }; export type GqlPoolSwapFilter = { + chainIn?: InputMaybe>; poolIdIn?: InputMaybe>; tokenInIn?: InputMaybe>; tokenOutIn?: InputMaybe>; }; +export type GqlPoolTimePeriod = { + gt?: InputMaybe; + lt?: InputMaybe; +}; + export type GqlPoolToken = GqlPoolTokenBase & { __typename?: 'GqlPoolToken'; address: Scalars['String']; @@ -724,6 +835,25 @@ export type GqlPoolTokenBase = { weight?: Maybe; }; +export type GqlPoolTokenComposableStable = GqlPoolTokenBase & { + __typename?: 'GqlPoolTokenComposableStable'; + address: Scalars['String']; + balance: Scalars['BigDecimal']; + decimals: Scalars['Int']; + id: Scalars['ID']; + index: Scalars['Int']; + name: Scalars['String']; + pool: GqlPoolComposableStableNested; + priceRate: Scalars['BigDecimal']; + symbol: Scalars['String']; + totalBalance: Scalars['BigDecimal']; + weight?: Maybe; +}; + +export type GqlPoolTokenComposableStableNestedUnion = + | GqlPoolToken + | GqlPoolTokenLinear; + export type GqlPoolTokenDisplay = { __typename?: 'GqlPoolTokenDisplay'; address: Scalars['String']; @@ -765,40 +895,48 @@ export type GqlPoolTokenLinear = GqlPoolTokenBase & { wrappedTokenBalance: Scalars['BigDecimal']; }; -export type GqlPoolTokenPhantomStable = GqlPoolTokenBase & { - __typename?: 'GqlPoolTokenPhantomStable'; - address: Scalars['String']; - balance: Scalars['BigDecimal']; - decimals: Scalars['Int']; - id: Scalars['ID']; - index: Scalars['Int']; - name: Scalars['String']; - pool: GqlPoolPhantomStableNested; - priceRate: Scalars['BigDecimal']; - symbol: Scalars['String']; - totalBalance: Scalars['BigDecimal']; - weight?: Maybe; -}; - -export type GqlPoolTokenPhantomStableNestedUnion = +export type GqlPoolTokenUnion = | GqlPoolToken + | GqlPoolTokenComposableStable | GqlPoolTokenLinear; -export type GqlPoolTokenUnion = - | GqlPoolToken - | GqlPoolTokenLinear - | GqlPoolTokenPhantomStable; +export enum GqlPoolType { + ComposableStable = 'COMPOSABLE_STABLE', + Element = 'ELEMENT', + Fx = 'FX', + Gyro = 'GYRO', + Gyro3 = 'GYRO3', + Gyroe = 'GYROE', + Investment = 'INVESTMENT', + Linear = 'LINEAR', + LiquidityBootstrapping = 'LIQUIDITY_BOOTSTRAPPING', + MetaStable = 'META_STABLE', + PhantomStable = 'PHANTOM_STABLE', + Stable = 'STABLE', + Unknown = 'UNKNOWN', + Weighted = 'WEIGHTED', +} export type GqlPoolUnion = + | GqlPoolComposableStable | GqlPoolElement | GqlPoolGyro | GqlPoolLinear | GqlPoolLiquidityBootstrapping | GqlPoolMetaStable - | GqlPoolPhantomStable | GqlPoolStable | GqlPoolWeighted; +export type GqlPoolUserBalance = { + __typename?: 'GqlPoolUserBalance'; + stakedBalance: Scalars['AmountHumanReadable']; + stakedBalanceUsd: Scalars['Float']; + totalBalance: Scalars['AmountHumanReadable']; + totalBalanceUsd: Scalars['Float']; + walletBalance: Scalars['AmountHumanReadable']; + walletBalanceUsd: Scalars['Float']; +}; + export type GqlPoolUserSwapVolume = { __typename?: 'GqlPoolUserSwapVolume'; swapVolumeUSD: Scalars['BigDecimal']; @@ -823,6 +961,9 @@ export type GqlPoolWeighted = GqlPoolBase & { staking?: Maybe; symbol: Scalars['String']; tokens: Array; + type: GqlPoolType; + userBalance?: Maybe; + version: Scalars['Int']; withdrawConfig: GqlPoolWithdrawConfig; }; @@ -870,6 +1011,47 @@ export type GqlProtocolMetricsChain = { yieldCapture24h: Scalars['BigDecimal']; }; +export type GqlRelicSnapshot = { + __typename?: 'GqlRelicSnapshot'; + balance: Scalars['String']; + entryTimestamp: Scalars['Int']; + farmId: Scalars['String']; + level: Scalars['Int']; + relicId: Scalars['Int']; +}; + +export type GqlReliquaryFarmLevelSnapshot = { + __typename?: 'GqlReliquaryFarmLevelSnapshot'; + balance: Scalars['String']; + id: Scalars['ID']; + level: Scalars['String']; +}; + +export type GqlReliquaryFarmSnapshot = { + __typename?: 'GqlReliquaryFarmSnapshot'; + dailyDeposited: Scalars['String']; + dailyWithdrawn: Scalars['String']; + farmId: Scalars['String']; + id: Scalars['ID']; + levelBalances: Array; + relicCount: Scalars['String']; + timestamp: Scalars['Int']; + tokenBalances: Array; + totalBalance: Scalars['String']; + totalLiquidity: Scalars['String']; + userCount: Scalars['String']; +}; + +export type GqlReliquaryTokenBalanceSnapshot = { + __typename?: 'GqlReliquaryTokenBalanceSnapshot'; + address: Scalars['String']; + balance: Scalars['String']; + decimals: Scalars['Int']; + id: Scalars['ID']; + name: Scalars['String']; + symbol: Scalars['String']; +}; + export type GqlSorGetBatchSwapForTokensInResponse = { __typename?: 'GqlSorGetBatchSwapForTokensInResponse'; assets: Array; @@ -940,9 +1122,19 @@ export enum GqlSorSwapType { ExactOut = 'EXACT_OUT', } +export type GqlSwap = { + __typename?: 'GqlSwap'; + amount: Scalars['String']; + assetInIndex: Scalars['Int']; + assetOutIndex: Scalars['Int']; + poolId: Scalars['String']; + userData: Scalars['String']; +}; + export type GqlToken = { __typename?: 'GqlToken'; address: Scalars['String']; + chain: GqlChain; chainId: Scalars['Int']; decimals: Scalars['Int']; description?: Maybe; @@ -973,6 +1165,7 @@ export type GqlTokenCandlestickChartDataItem = { }; export enum GqlTokenChartDataRange { + NinetyDay = 'NINETY_DAY', SevenDay = 'SEVEN_DAY', ThirtyDay = 'THIRTY_DAY', } @@ -1010,6 +1203,7 @@ export type GqlTokenDynamicData = { export type GqlTokenPrice = { __typename?: 'GqlTokenPrice'; address: Scalars['String']; + chain: GqlChain; price: Scalars['Float']; }; @@ -1027,8 +1221,17 @@ export enum GqlTokenType { WhiteListed = 'WHITE_LISTED', } +export type GqlUserFbeetsBalance = { + __typename?: 'GqlUserFbeetsBalance'; + id: Scalars['String']; + stakedBalance: Scalars['AmountHumanReadable']; + totalBalance: Scalars['AmountHumanReadable']; + walletBalance: Scalars['AmountHumanReadable']; +}; + export type GqlUserPoolBalance = { __typename?: 'GqlUserPoolBalance'; + chain: GqlChain; poolId: Scalars['String']; stakedBalance: Scalars['AmountHumanReadable']; tokenAddress: Scalars['String']; @@ -1037,16 +1240,64 @@ export type GqlUserPoolBalance = { walletBalance: Scalars['AmountHumanReadable']; }; +export type GqlUserPoolSnapshot = { + __typename?: 'GqlUserPoolSnapshot'; + farmBalance: Scalars['AmountHumanReadable']; + fees24h: Scalars['AmountHumanReadable']; + gaugeBalance: Scalars['AmountHumanReadable']; + percentShare: Scalars['Float']; + timestamp: Scalars['Int']; + totalBalance: Scalars['AmountHumanReadable']; + totalValueUSD: Scalars['AmountHumanReadable']; + walletBalance: Scalars['AmountHumanReadable']; +}; + +export type GqlUserPortfolioSnapshot = { + __typename?: 'GqlUserPortfolioSnapshot'; + farmBalance: Scalars['AmountHumanReadable']; + fees24h: Scalars['AmountHumanReadable']; + gaugeBalance: Scalars['AmountHumanReadable']; + pools: Array; + timestamp: Scalars['Int']; + totalBalance: Scalars['AmountHumanReadable']; + totalFees: Scalars['AmountHumanReadable']; + totalValueUSD: Scalars['AmountHumanReadable']; + walletBalance: Scalars['AmountHumanReadable']; +}; + +export type GqlUserRelicSnapshot = { + __typename?: 'GqlUserRelicSnapshot'; + relicCount: Scalars['Int']; + relicSnapshots: Array; + timestamp: Scalars['Int']; + totalBalance: Scalars['String']; +}; + +export enum GqlUserSnapshotDataRange { + AllTime = 'ALL_TIME', + NinetyDays = 'NINETY_DAYS', + OneHundredEightyDays = 'ONE_HUNDRED_EIGHTY_DAYS', + OneYear = 'ONE_YEAR', + ThirtyDays = 'THIRTY_DAYS', +} + export type GqlUserSwapVolumeFilter = { poolIdIn?: InputMaybe>; tokenInIn?: InputMaybe>; tokenOutIn?: InputMaybe>; }; +export type GqlVeBalUserData = { + __typename?: 'GqlVeBalUserData'; + balance: Scalars['AmountHumanReadable']; + rank?: Maybe; +}; + export type GqlVotingGauge = { __typename?: 'GqlVotingGauge'; addedTimestamp?: Maybe; address: Scalars['Bytes']; + childGaugeAddress?: Maybe; isKilled: Scalars['Boolean']; relativeWeightCap?: Maybe; }; @@ -1067,16 +1318,19 @@ export type GqlVotingPool = { id: Scalars['ID']; symbol: Scalars['String']; tokens: Array; - type: GqlPoolMinimalType; + type: GqlPoolType; }; export type Mutation = { __typename?: 'Mutation'; balancerMutationTest: Scalars['String']; + beetsPoolLoadReliquarySnapshotsForAllFarms: Scalars['String']; + beetsSyncFbeetsRatio: Scalars['String']; cacheAverageBlockTime: Scalars['String']; poolBlackListAddPool: Scalars['String']; poolBlackListRemovePool: Scalars['String']; poolDeletePool: Scalars['String']; + poolInitOnChainDataForAllPools: Scalars['String']; poolInitializeSnapshotsForPool: Scalars['String']; poolLoadOnChainDataForAllPools: Scalars['String']; poolLoadOnChainDataForPoolsWithActiveUpdates: Scalars['String']; @@ -1088,7 +1342,7 @@ export type Mutation = { poolReloadPoolTokenIndexes: Scalars['String']; poolReloadStakingForAllPools: Scalars['String']; poolSetPoolsWithPreferredGaugesAsIncentivized: Scalars['String']; - poolSyncAllPoolVersions: Scalars['String']; + poolSyncAllPoolTypesVersions: Scalars['String']; poolSyncAllPoolsFromSubgraph: Array; poolSyncLatestSnapshotsForAllPools: Scalars['String']; poolSyncNewPoolsFromSubgraph: Array; @@ -1114,6 +1368,7 @@ export type Mutation = { userInitStakedBalances: Scalars['String']; userInitWalletBalancesForAllPools: Scalars['String']; userInitWalletBalancesForPool: Scalars['String']; + userLoadAllRelicSnapshots: Scalars['String']; userSyncBalance: Scalars['String']; userSyncBalanceAllPools: Scalars['String']; userSyncChangedStakedBalances: Scalars['String']; @@ -1191,7 +1446,8 @@ export type MutationUserSyncBalanceArgs = { export type Query = { __typename?: 'Query'; - balancerQueryTest: Scalars['String']; + beetsGetFbeetsRatio: Scalars['String']; + beetsPoolGetReliquaryFarmSnapshots: Array; blocksGetAverageBlockTime: Scalars['Float']; blocksGetBlocksPerDay: Scalars['Float']; blocksGetBlocksPerSecond: Scalars['Float']; @@ -1201,18 +1457,18 @@ export type Query = { poolGetAllPoolsSnapshots: Array; poolGetBatchSwaps: Array; poolGetFeaturedPoolGroups: Array; + poolGetGyroPools: Array; poolGetJoinExits: Array; poolGetLinearPools: Array; poolGetPool: GqlPoolBase; - poolGetPoolFilters: Array; poolGetPools: Array; poolGetPoolsCount: Scalars['Int']; poolGetSnapshots: Array; poolGetSwaps: Array; - poolGetUserSwapVolume: Array; protocolMetricsAggregated: GqlProtocolMetricsAggregated; protocolMetricsChain: GqlProtocolMetricsChain; sorGetBatchSwapForTokensIn: GqlSorGetBatchSwapForTokensInResponse; + sorGetCowSwaps: GqlCowSwapApiResponse; sorGetSwaps: GqlSorGetSwapsResponse; tokenGetCandlestickChartData: Array; tokenGetCurrentPrices: Array; @@ -1225,16 +1481,27 @@ export type Query = { tokenGetTokens: Array; tokenGetTokensData: Array; tokenGetTokensDynamicData: Array; + userGetFbeetsBalance: GqlUserFbeetsBalance; userGetPoolBalances: Array; userGetPoolJoinExits: Array; + userGetPoolSnapshots: Array; + userGetPortfolioSnapshots: Array; + userGetRelicSnapshots: Array; userGetStaking: Array; userGetSwaps: Array; veBalGetTotalSupply: Scalars['AmountHumanReadable']; + veBalGetUser: GqlVeBalUserData; veBalGetUserBalance: Scalars['AmountHumanReadable']; veBalGetVotingList: Array; }; +export type QueryBeetsPoolGetReliquaryFarmSnapshotsArgs = { + id: Scalars['String']; + range: GqlPoolSnapshotDataRange; +}; + export type QueryPoolGetAllPoolsSnapshotsArgs = { + chains?: InputMaybe>; range: GqlPoolSnapshotDataRange; }; @@ -1244,14 +1511,24 @@ export type QueryPoolGetBatchSwapsArgs = { where?: InputMaybe; }; +export type QueryPoolGetGyroPoolsArgs = { + chains?: InputMaybe>; +}; + export type QueryPoolGetJoinExitsArgs = { first?: InputMaybe; skip?: InputMaybe; where?: InputMaybe; }; +export type QueryPoolGetLinearPoolsArgs = { + chains?: InputMaybe>; +}; + export type QueryPoolGetPoolArgs = { + chain?: InputMaybe; id: Scalars['String']; + userAddress?: InputMaybe; }; export type QueryPoolGetPoolsArgs = { @@ -1273,6 +1550,7 @@ export type QueryPoolGetPoolsCountArgs = { }; export type QueryPoolGetSnapshotsArgs = { + chain?: InputMaybe; id: Scalars['String']; range: GqlPoolSnapshotDataRange; }; @@ -1283,14 +1561,12 @@ export type QueryPoolGetSwapsArgs = { where?: InputMaybe; }; -export type QueryPoolGetUserSwapVolumeArgs = { - first?: InputMaybe; - skip?: InputMaybe; - where?: InputMaybe; +export type QueryProtocolMetricsAggregatedArgs = { + chains?: InputMaybe>; }; -export type QueryProtocolMetricsAggregatedArgs = { - chainIds: Array; +export type QueryProtocolMetricsChainArgs = { + chain?: InputMaybe; }; export type QuerySorGetBatchSwapForTokensInArgs = { @@ -1299,7 +1575,16 @@ export type QuerySorGetBatchSwapForTokensInArgs = { tokensIn: Array; }; +export type QuerySorGetCowSwapsArgs = { + chain: GqlChain; + swapAmount: Scalars['BigDecimal']; + swapType: GqlSorSwapType; + tokenIn: Scalars['String']; + tokenOut: Scalars['String']; +}; + export type QuerySorGetSwapsArgs = { + chain?: InputMaybe; swapAmount: Scalars['BigDecimal']; swapOptions: GqlSorSwapOptionsInput; swapType: GqlSorSwapType; @@ -1312,6 +1597,10 @@ export type QueryTokenGetCandlestickChartDataArgs = { range: GqlTokenChartDataRange; }; +export type QueryTokenGetCurrentPricesArgs = { + chains?: InputMaybe>; +}; + export type QueryTokenGetHistoricalPricesArgs = { addresses: Array; }; @@ -1335,6 +1624,10 @@ export type QueryTokenGetTokenDynamicDataArgs = { address: Scalars['String']; }; +export type QueryTokenGetTokensArgs = { + chains?: InputMaybe>; +}; + export type QueryTokenGetTokensDataArgs = { addresses: Array; }; @@ -1343,13 +1636,42 @@ export type QueryTokenGetTokensDynamicDataArgs = { addresses: Array; }; +export type QueryUserGetPoolBalancesArgs = { + address?: InputMaybe; + chains?: InputMaybe>; +}; + export type QueryUserGetPoolJoinExitsArgs = { + address?: InputMaybe; + chain?: InputMaybe; first?: InputMaybe; poolId: Scalars['String']; skip?: InputMaybe; }; +export type QueryUserGetPoolSnapshotsArgs = { + chain: GqlChain; + poolId: Scalars['String']; + range: GqlUserSnapshotDataRange; +}; + +export type QueryUserGetPortfolioSnapshotsArgs = { + days: Scalars['Int']; +}; + +export type QueryUserGetRelicSnapshotsArgs = { + farmId: Scalars['String']; + range: GqlUserSnapshotDataRange; +}; + +export type QueryUserGetStakingArgs = { + address?: InputMaybe; + chains?: InputMaybe>; +}; + export type QueryUserGetSwapsArgs = { + address?: InputMaybe; + chain?: InputMaybe; first?: InputMaybe; poolId: Scalars['String']; skip?: InputMaybe; @@ -1378,7 +1700,7 @@ export type VeBalGetVotingListQuery = { id: string; address: string; symbol: string; - type: GqlPoolMinimalType; + type: GqlPoolType; gauge: { __typename?: 'GqlVotingGauge'; address: string; diff --git a/src/services/api/graphql/mappers.ts b/src/services/api/graphql/mappers.ts index 31b18da62f..a79557d5ec 100644 --- a/src/services/api/graphql/mappers.ts +++ b/src/services/api/graphql/mappers.ts @@ -1,6 +1,6 @@ import { Network } from '@/lib/config/types'; import { PoolType } from '@/services/pool/types'; -import { GqlChain, GqlPoolMinimalType } from './generated/api-types'; +import { GqlChain, GqlPoolType } from './generated/api-types'; export function mapApiChain( apiChain: GqlChain | 'SEPOLIA' | 'GOERLI' @@ -34,30 +34,31 @@ export function mapApiChain( } } -export function mapApiPoolType( - apiPoolType: GqlPoolMinimalType -): PoolType | null { +export function mapApiPoolType(apiPoolType: GqlPoolType): PoolType | null { switch (apiPoolType) { - case GqlPoolMinimalType.Element: + case GqlPoolType.Element: return PoolType.Element; - case GqlPoolMinimalType.Gyro3: + case GqlPoolType.Gyro3: return PoolType.Gyro3; - case GqlPoolMinimalType.Gyroe: + case GqlPoolType.Gyroe: return PoolType.GyroE; - case GqlPoolMinimalType.Investment: + case GqlPoolType.Investment: return PoolType.Investment; - case GqlPoolMinimalType.Linear: + case GqlPoolType.Linear: return PoolType.Linear; - case GqlPoolMinimalType.LiquidityBootstrapping: + case GqlPoolType.LiquidityBootstrapping: return PoolType.LiquidityBootstrapping; - case GqlPoolMinimalType.MetaStable: + case GqlPoolType.MetaStable: return PoolType.MetaStable; - case GqlPoolMinimalType.PhantomStable: - return PoolType.StablePhantom; - case GqlPoolMinimalType.Stable: + case GqlPoolType.Stable: return PoolType.Stable; - case GqlPoolMinimalType.Weighted: + case GqlPoolType.Weighted: return PoolType.Weighted; + case GqlPoolType.PhantomStable: + return PoolType.StablePhantom; + case GqlPoolType.ComposableStable: // 20 Dec 2023: API change moving from PhantomStable to ComposableStable + return PoolType.StablePhantom; // We can change this to PoolType.ComposableStable once our partners are ok + default: return null; } From 0b80e33e6acfa15660ecfe18ac0898a8e11f3201 Mon Sep 17 00:00:00 2001 From: Zen-Maxi <85650601+Zen-Maxi@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:56:54 -0500 Subject: [PATCH 3/5] Add weETH-rETH as stakabel (#4985) * Add weETH-rETH as stakabel Adds 0x05ff47afada98a98982113758878f9a8b9fdda0a000000000000000000000645 to the stakable list. Currently not on stable list. * Allowlist: weETH-rETH Adding '0x05ff47afada98a98982113758878f9a8b9fdda0a000000000000000000000645', under Allowlist also. * Update pools.ts --------- Co-authored-by: ZeKraken <79888567+zekraken-bot@users.noreply.github.com> --- src/lib/config/mainnet/pools.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/config/mainnet/pools.ts b/src/lib/config/mainnet/pools.ts index 2044a69d6a..28939cd2cb 100644 --- a/src/lib/config/mainnet/pools.ts +++ b/src/lib/config/mainnet/pools.ts @@ -475,6 +475,7 @@ const pools: Pools = { '0x35c5c8c7b77942f9d44b535fa590d8b503b2b00c00000000000000000000060d', // sdai/dusd '0x73f8e7a9a19e284a9ac85704af58454cfe75f059000200000000000000000631', '0x5f8b11995d7f95faa59ca6fd5ffa1c0dbbe0ec7b000200000000000000000630', + '0x05ff47afada98a98982113758878f9a8b9fdda0a000000000000000000000645', // weETH/rETH ], }, Metadata: {}, From abaa69ea5dee7b0d5a7d152cb924316ec93b6bc0 Mon Sep 17 00:00:00 2001 From: David Derhy Date: Tue, 2 Jan 2024 16:37:51 +0100 Subject: [PATCH 4/5] Update pools.ts (#5017) * Update pools.ts * Fix lint --------- Co-authored-by: Alberto Gualis --- src/lib/config/optimism/pools.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/config/optimism/pools.ts b/src/lib/config/optimism/pools.ts index f10c779822..d3444a6318 100644 --- a/src/lib/config/optimism/pools.ts +++ b/src/lib/config/optimism/pools.ts @@ -42,7 +42,8 @@ const pools: Pools = { '0xd6e5824b54f64ce6f1161210bc17eebffc77e031000100000000000000000006', // OP/BEETS/BAL '0x39965c9dab5448482cf7e002f583c812ceb53046000100000000000000000003', // WETH/OP/USDC '0xc1f46ce83439886f0ea9c21512b36e7e67239d2c000200000000000000000108', // beets/reth - ], + '0xbc80540bb282e7724be7f1e0b92b4ea51340ddbf00010000000000000000010e', // LINK/OP/wstETH/wBTC/LDO + ], }, Factories: { '0xb08e16cfc07c684daa2f93c70323badb2a6cbfd2': 'metaStable', From 2a144285614d02c3a52cd3f143476689f20f2cdf Mon Sep 17 00:00:00 2001 From: Alberto Gualis Date: Tue, 2 Jan 2024 16:55:03 +0100 Subject: [PATCH 5/5] 1.139.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e6e2e9840..dcd21ee83b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@balancer/frontend-v2", - "version": "1.138.64", + "version": "1.139.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@balancer/frontend-v2", - "version": "1.138.64", + "version": "1.139.0", "license": "MIT", "devDependencies": { "@aave/protocol-js": "^4.3.0", diff --git a/package.json b/package.json index 8594159f67..2482a55b73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer/frontend-v2", - "version": "1.138.64", + "version": "1.139.0", "engines": { "node": "=16", "npm": ">=8"