diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6ecf68b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,26 @@ +name: CI +on: [push, workflow_dispatch] + +jobs: + lint-and-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Run codegen against ponder dev + run: bun run codegen + + - name: Build + run: bun run build + + # TODO: fix linting errors + # - name: Lint + # run: bun run lint diff --git a/README.md b/README.md index 613e222..cad31e2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ A React-based mini application built with Vite, TypeScript, and Tailwind CSS. This project provides an easy to get started with UI for interacting with the [Doppler liquidity bootstrapping protocol](https://docs.doppler.lol/). +## Quick Start +```bash +cp .env.example .env.local && \ +bun install && \ +bun dev +``` + ## Tech Stack - React diff --git a/bun.lockb b/bun.lockb index ab9dcdb..6524e98 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 965e6bf..2d4796b 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "codegen": "graphql-codegen --config codegen.ts" }, "dependencies": { - "@delvtech/drift": "^0.9.1", - "@delvtech/drift-viem": "^0.9.1", + "@delvtech/drift": "^0.8.4", + "@delvtech/drift-viem": "^0.8.4", "@radix-ui/react-checkbox": "^1.1.3", "@radix-ui/react-dialog": "^1.1.5", "@radix-ui/react-label": "^2.1.1", diff --git a/src/gql/gql.ts b/src/gql/gql.ts index cf34317..20c9838 100644 --- a/src/gql/gql.ts +++ b/src/gql/gql.ts @@ -20,7 +20,7 @@ const documents = { "\n query Token($address: String!) {\n token(address: $address) {\n address\n name\n symbol\n decimals\n isDerc20\n totalSupply\n firstSeenAt\n }\n }\n": types.TokenDocument, "\n query Positions($pool: String!) {\n positions(where: { pool: $pool }) {\n items {\n liquidity\n tickLower\n tickUpper\n }\n }\n }\n": types.PositionsDocument, "\n query Asset($address: String!) {\n asset(address: $address) {\n numeraire\n timelock\n pool {\n address\n liquidity\n price\n tick\n baseToken {\n address\n name\n symbol\n decimals\n }\n quoteToken {\n address\n name\n symbol\n decimals\n }\n }\n createdAt\n migratedAt\n }\n }\n": types.AssetDocument, - "\n query Pools(\n $orderBy: String\n $orderDirection: String\n $limit: Int\n $where: poolFilter \n ) {\n pools(\n orderBy: $orderBy\n orderDirection: $orderDirection\n limit: $limit\n where: $where\n ) {\n items {\n address\n chainId\n tick\n sqrtPrice\n liquidity\n createdAt\n asset {\n marketCapUsd\n }\n baseToken {\n address\n name\n symbol\n }\n quoteToken {\n address\n name\n symbol\n }\n price\n fee\n type\n dollarLiquidity\n dailyVolume {\n volumeUsd\n }\n volumeUsd\n percentDayChange\n totalFee0\n totalFee1\n graduationThreshold\n graduationBalance\n isToken0\n lastRefreshed\n lastSwapTimestamp\n reserves0\n reserves1\n marketCapUsd\n }\n }\n }\n": types.PoolsDocument, + "\n query Pools(\n $orderBy: String\n $orderDirection: String\n $limit: Int\n $where: poolFilter \n ) {\n pools(\n orderBy: $orderBy\n orderDirection: $orderDirection\n limit: $limit\n where: $where\n ) {\n items {\n address\n chainId\n tick\n sqrtPrice\n liquidity\n createdAt\n asset {\n marketCapUsd\n }\n baseToken {\n address\n name\n symbol\n }\n quoteToken {\n address\n name\n symbol\n }\n price\n fee\n type\n dollarLiquidity\n dailyVolume {\n volumeUsd\n }\n volumeUsd\n percentDayChange\n totalFee0\n totalFee1\n minThreshold\n maxThreshold\n graduationBalance\n isToken0\n lastRefreshed\n lastSwapTimestamp\n reserves0\n reserves1\n marketCapUsd\n }\n }\n }\n": types.PoolsDocument, }; /** @@ -64,7 +64,7 @@ export function graphql(source: "\n query Asset($address: String!) {\n asset /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query Pools(\n $orderBy: String\n $orderDirection: String\n $limit: Int\n $where: poolFilter \n ) {\n pools(\n orderBy: $orderBy\n orderDirection: $orderDirection\n limit: $limit\n where: $where\n ) {\n items {\n address\n chainId\n tick\n sqrtPrice\n liquidity\n createdAt\n asset {\n marketCapUsd\n }\n baseToken {\n address\n name\n symbol\n }\n quoteToken {\n address\n name\n symbol\n }\n price\n fee\n type\n dollarLiquidity\n dailyVolume {\n volumeUsd\n }\n volumeUsd\n percentDayChange\n totalFee0\n totalFee1\n graduationThreshold\n graduationBalance\n isToken0\n lastRefreshed\n lastSwapTimestamp\n reserves0\n reserves1\n marketCapUsd\n }\n }\n }\n"): (typeof documents)["\n query Pools(\n $orderBy: String\n $orderDirection: String\n $limit: Int\n $where: poolFilter \n ) {\n pools(\n orderBy: $orderBy\n orderDirection: $orderDirection\n limit: $limit\n where: $where\n ) {\n items {\n address\n chainId\n tick\n sqrtPrice\n liquidity\n createdAt\n asset {\n marketCapUsd\n }\n baseToken {\n address\n name\n symbol\n }\n quoteToken {\n address\n name\n symbol\n }\n price\n fee\n type\n dollarLiquidity\n dailyVolume {\n volumeUsd\n }\n volumeUsd\n percentDayChange\n totalFee0\n totalFee1\n graduationThreshold\n graduationBalance\n isToken0\n lastRefreshed\n lastSwapTimestamp\n reserves0\n reserves1\n marketCapUsd\n }\n }\n }\n"]; +export function graphql(source: "\n query Pools(\n $orderBy: String\n $orderDirection: String\n $limit: Int\n $where: poolFilter \n ) {\n pools(\n orderBy: $orderBy\n orderDirection: $orderDirection\n limit: $limit\n where: $where\n ) {\n items {\n address\n chainId\n tick\n sqrtPrice\n liquidity\n createdAt\n asset {\n marketCapUsd\n }\n baseToken {\n address\n name\n symbol\n }\n quoteToken {\n address\n name\n symbol\n }\n price\n fee\n type\n dollarLiquidity\n dailyVolume {\n volumeUsd\n }\n volumeUsd\n percentDayChange\n totalFee0\n totalFee1\n minThreshold\n maxThreshold\n graduationBalance\n isToken0\n lastRefreshed\n lastSwapTimestamp\n reserves0\n reserves1\n marketCapUsd\n }\n }\n }\n"): (typeof documents)["\n query Pools(\n $orderBy: String\n $orderDirection: String\n $limit: Int\n $where: poolFilter \n ) {\n pools(\n orderBy: $orderBy\n orderDirection: $orderDirection\n limit: $limit\n where: $where\n ) {\n items {\n address\n chainId\n tick\n sqrtPrice\n liquidity\n createdAt\n asset {\n marketCapUsd\n }\n baseToken {\n address\n name\n symbol\n }\n quoteToken {\n address\n name\n symbol\n }\n price\n fee\n type\n dollarLiquidity\n dailyVolume {\n volumeUsd\n }\n volumeUsd\n percentDayChange\n totalFee0\n totalFee1\n minThreshold\n maxThreshold\n graduationBalance\n isToken0\n lastRefreshed\n lastSwapTimestamp\n reserves0\n reserves1\n marketCapUsd\n }\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/src/gql/graphql.ts b/src/gql/graphql.ts index 6d84c8e..eb5e4d5 100644 --- a/src/gql/graphql.ts +++ b/src/gql/graphql.ts @@ -49,6 +49,8 @@ export type Query = { hourBuckets: HourBucketPage; module?: Maybe; modules: ModulePage; + pendingTokenImages?: Maybe; + pendingTokenImagess: PendingTokenImagesPage; pool?: Maybe; pools: PoolPage; position?: Maybe; @@ -69,6 +71,8 @@ export type Query = { v4PoolConfigs: V4PoolConfigPage; v4PoolPriceHistory?: Maybe; v4PoolPriceHistorys: V4PoolPriceHistoryPage; + v4pools?: Maybe; + v4poolss: V4poolsPage; }; @@ -181,6 +185,21 @@ export type QueryModulesArgs = { }; +export type QueryPendingTokenImagesArgs = { + chainId: Scalars['BigInt']['input']; +}; + + +export type QueryPendingTokenImagessArgs = { + after?: InputMaybe; + before?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; +}; + + export type QueryPoolArgs = { address: Scalars['String']['input']; chainId: Scalars['BigInt']['input']; @@ -336,6 +355,22 @@ export type QueryV4PoolPriceHistorysArgs = { where?: InputMaybe; }; + +export type QueryV4poolsArgs = { + chainId: Scalars['BigInt']['input']; + poolId: Scalars['String']['input']; +}; + + +export type QueryV4poolssArgs = { + after?: InputMaybe; + before?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; +}; + export type ActivePoolsBlob = { __typename?: 'activePoolsBlob'; activePools: Scalars['JSON']['output']; @@ -943,6 +978,32 @@ export type ModulePage = { totalCount: Scalars['Int']['output']; }; +export type PendingTokenImages = { + __typename?: 'pendingTokenImages'; + chainId: Scalars['BigInt']['output']; + tokens: Scalars['JSON']['output']; +}; + +export type PendingTokenImagesFilter = { + AND?: InputMaybe>>; + OR?: InputMaybe>>; + chainId?: InputMaybe; + chainId_gt?: InputMaybe; + chainId_gte?: InputMaybe; + chainId_in?: InputMaybe>>; + chainId_lt?: InputMaybe; + chainId_lte?: InputMaybe; + chainId_not?: InputMaybe; + chainId_not_in?: InputMaybe>>; +}; + +export type PendingTokenImagesPage = { + __typename?: 'pendingTokenImagesPage'; + items: Array; + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + export type Pool = { __typename?: 'pool'; address: Scalars['String']['output']; @@ -954,17 +1015,24 @@ export type Pool = { dollarLiquidity: Scalars['BigInt']['output']; fee: Scalars['Int']['output']; graduationBalance: Scalars['BigInt']['output']; - graduationThreshold: Scalars['BigInt']['output']; + graduationPercentage: Scalars['Float']['output']; holderCount: Scalars['Int']['output']; hourBucketUsds?: Maybe; hourBuckets?: Maybe; + isQuoteEth: Scalars['Boolean']['output']; + isStreaming: Scalars['Boolean']['output']; isToken0: Scalars['Boolean']['output']; lastRefreshed?: Maybe; lastSwapTimestamp?: Maybe; liquidity: Scalars['BigInt']['output']; marketCapUsd: Scalars['BigInt']['output']; + maxThreshold: Scalars['BigInt']['output']; migrated: Scalars['Boolean']['output']; migratedAt?: Maybe; + migratedFromPool?: Maybe; + migratedToPool?: Maybe; + migratedToV4PoolId?: Maybe; + minThreshold?: Maybe; percentDayChange: Scalars['Float']['output']; positions?: Maybe; price: Scalars['BigInt']['output']; @@ -1105,14 +1173,14 @@ export type PoolFilter = { graduationBalance_lte?: InputMaybe; graduationBalance_not?: InputMaybe; graduationBalance_not_in?: InputMaybe>>; - graduationThreshold?: InputMaybe; - graduationThreshold_gt?: InputMaybe; - graduationThreshold_gte?: InputMaybe; - graduationThreshold_in?: InputMaybe>>; - graduationThreshold_lt?: InputMaybe; - graduationThreshold_lte?: InputMaybe; - graduationThreshold_not?: InputMaybe; - graduationThreshold_not_in?: InputMaybe>>; + graduationPercentage?: InputMaybe; + graduationPercentage_gt?: InputMaybe; + graduationPercentage_gte?: InputMaybe; + graduationPercentage_in?: InputMaybe>>; + graduationPercentage_lt?: InputMaybe; + graduationPercentage_lte?: InputMaybe; + graduationPercentage_not?: InputMaybe; + graduationPercentage_not_in?: InputMaybe>>; holderCount?: InputMaybe; holderCount_gt?: InputMaybe; holderCount_gte?: InputMaybe; @@ -1121,6 +1189,14 @@ export type PoolFilter = { holderCount_lte?: InputMaybe; holderCount_not?: InputMaybe; holderCount_not_in?: InputMaybe>>; + isQuoteEth?: InputMaybe; + isQuoteEth_in?: InputMaybe>>; + isQuoteEth_not?: InputMaybe; + isQuoteEth_not_in?: InputMaybe>>; + isStreaming?: InputMaybe; + isStreaming_in?: InputMaybe>>; + isStreaming_not?: InputMaybe; + isStreaming_not_in?: InputMaybe>>; isToken0?: InputMaybe; isToken0_in?: InputMaybe>>; isToken0_not?: InputMaybe; @@ -1157,6 +1233,14 @@ export type PoolFilter = { marketCapUsd_lte?: InputMaybe; marketCapUsd_not?: InputMaybe; marketCapUsd_not_in?: InputMaybe>>; + maxThreshold?: InputMaybe; + maxThreshold_gt?: InputMaybe; + maxThreshold_gte?: InputMaybe; + maxThreshold_in?: InputMaybe>>; + maxThreshold_lt?: InputMaybe; + maxThreshold_lte?: InputMaybe; + maxThreshold_not?: InputMaybe; + maxThreshold_not_in?: InputMaybe>>; migrated?: InputMaybe; migratedAt?: InputMaybe; migratedAt_gt?: InputMaybe; @@ -1166,9 +1250,47 @@ export type PoolFilter = { migratedAt_lte?: InputMaybe; migratedAt_not?: InputMaybe; migratedAt_not_in?: InputMaybe>>; + migratedFromPool?: InputMaybe; + migratedFromPool_contains?: InputMaybe; + migratedFromPool_ends_with?: InputMaybe; + migratedFromPool_in?: InputMaybe>>; + migratedFromPool_not?: InputMaybe; + migratedFromPool_not_contains?: InputMaybe; + migratedFromPool_not_ends_with?: InputMaybe; + migratedFromPool_not_in?: InputMaybe>>; + migratedFromPool_not_starts_with?: InputMaybe; + migratedFromPool_starts_with?: InputMaybe; + migratedToPool?: InputMaybe; + migratedToPool_contains?: InputMaybe; + migratedToPool_ends_with?: InputMaybe; + migratedToPool_in?: InputMaybe>>; + migratedToPool_not?: InputMaybe; + migratedToPool_not_contains?: InputMaybe; + migratedToPool_not_ends_with?: InputMaybe; + migratedToPool_not_in?: InputMaybe>>; + migratedToPool_not_starts_with?: InputMaybe; + migratedToPool_starts_with?: InputMaybe; + migratedToV4PoolId?: InputMaybe; + migratedToV4PoolId_contains?: InputMaybe; + migratedToV4PoolId_ends_with?: InputMaybe; + migratedToV4PoolId_in?: InputMaybe>>; + migratedToV4PoolId_not?: InputMaybe; + migratedToV4PoolId_not_contains?: InputMaybe; + migratedToV4PoolId_not_ends_with?: InputMaybe; + migratedToV4PoolId_not_in?: InputMaybe>>; + migratedToV4PoolId_not_starts_with?: InputMaybe; + migratedToV4PoolId_starts_with?: InputMaybe; migrated_in?: InputMaybe>>; migrated_not?: InputMaybe; migrated_not_in?: InputMaybe>>; + minThreshold?: InputMaybe; + minThreshold_gt?: InputMaybe; + minThreshold_gte?: InputMaybe; + minThreshold_in?: InputMaybe>>; + minThreshold_lt?: InputMaybe; + minThreshold_lte?: InputMaybe; + minThreshold_not?: InputMaybe; + minThreshold_not_in?: InputMaybe>>; percentDayChange?: InputMaybe; percentDayChange_gt?: InputMaybe; percentDayChange_gte?: InputMaybe; @@ -2108,6 +2230,304 @@ export type V4PoolPriceHistoryPage = { totalCount: Scalars['Int']['output']; }; +export type V4pools = { + __typename?: 'v4pools'; + asset?: Maybe; + baseToken?: Maybe; + chainId: Scalars['BigInt']['output']; + createdAt: Scalars['BigInt']['output']; + currency0: Scalars['String']['output']; + currency1: Scalars['String']['output']; + dailyVolume?: Maybe; + dollarLiquidity: Scalars['BigInt']['output']; + fee: Scalars['Int']['output']; + hooks: Scalars['String']['output']; + isQuoteEth: Scalars['Boolean']['output']; + isToken0: Scalars['Boolean']['output']; + lastRefreshed?: Maybe; + lastSwapTimestamp?: Maybe; + liquidity: Scalars['BigInt']['output']; + migratedAt: Scalars['BigInt']['output']; + migratedFromPool?: Maybe; + migratorVersion: Scalars['String']['output']; + percentDayChange: Scalars['Float']['output']; + poolId: Scalars['String']['output']; + price: Scalars['BigInt']['output']; + quoteToken?: Maybe; + reserves0: Scalars['BigInt']['output']; + reserves1: Scalars['BigInt']['output']; + sqrtPriceX96: Scalars['BigInt']['output']; + tick: Scalars['Int']['output']; + tickSpacing: Scalars['Int']['output']; + totalFee0: Scalars['BigInt']['output']; + totalFee1: Scalars['BigInt']['output']; + volumeUsd: Scalars['BigInt']['output']; +}; + +export type V4poolsFilter = { + AND?: InputMaybe>>; + OR?: InputMaybe>>; + asset?: InputMaybe; + asset_contains?: InputMaybe; + asset_ends_with?: InputMaybe; + asset_in?: InputMaybe>>; + asset_not?: InputMaybe; + asset_not_contains?: InputMaybe; + asset_not_ends_with?: InputMaybe; + asset_not_in?: InputMaybe>>; + asset_not_starts_with?: InputMaybe; + asset_starts_with?: InputMaybe; + baseToken?: InputMaybe; + baseToken_contains?: InputMaybe; + baseToken_ends_with?: InputMaybe; + baseToken_in?: InputMaybe>>; + baseToken_not?: InputMaybe; + baseToken_not_contains?: InputMaybe; + baseToken_not_ends_with?: InputMaybe; + baseToken_not_in?: InputMaybe>>; + baseToken_not_starts_with?: InputMaybe; + baseToken_starts_with?: InputMaybe; + chainId?: InputMaybe; + chainId_gt?: InputMaybe; + chainId_gte?: InputMaybe; + chainId_in?: InputMaybe>>; + chainId_lt?: InputMaybe; + chainId_lte?: InputMaybe; + chainId_not?: InputMaybe; + chainId_not_in?: InputMaybe>>; + createdAt?: InputMaybe; + createdAt_gt?: InputMaybe; + createdAt_gte?: InputMaybe; + createdAt_in?: InputMaybe>>; + createdAt_lt?: InputMaybe; + createdAt_lte?: InputMaybe; + createdAt_not?: InputMaybe; + createdAt_not_in?: InputMaybe>>; + currency0?: InputMaybe; + currency0_contains?: InputMaybe; + currency0_ends_with?: InputMaybe; + currency0_in?: InputMaybe>>; + currency0_not?: InputMaybe; + currency0_not_contains?: InputMaybe; + currency0_not_ends_with?: InputMaybe; + currency0_not_in?: InputMaybe>>; + currency0_not_starts_with?: InputMaybe; + currency0_starts_with?: InputMaybe; + currency1?: InputMaybe; + currency1_contains?: InputMaybe; + currency1_ends_with?: InputMaybe; + currency1_in?: InputMaybe>>; + currency1_not?: InputMaybe; + currency1_not_contains?: InputMaybe; + currency1_not_ends_with?: InputMaybe; + currency1_not_in?: InputMaybe>>; + currency1_not_starts_with?: InputMaybe; + currency1_starts_with?: InputMaybe; + dailyVolume?: InputMaybe; + dailyVolume_contains?: InputMaybe; + dailyVolume_ends_with?: InputMaybe; + dailyVolume_in?: InputMaybe>>; + dailyVolume_not?: InputMaybe; + dailyVolume_not_contains?: InputMaybe; + dailyVolume_not_ends_with?: InputMaybe; + dailyVolume_not_in?: InputMaybe>>; + dailyVolume_not_starts_with?: InputMaybe; + dailyVolume_starts_with?: InputMaybe; + dollarLiquidity?: InputMaybe; + dollarLiquidity_gt?: InputMaybe; + dollarLiquidity_gte?: InputMaybe; + dollarLiquidity_in?: InputMaybe>>; + dollarLiquidity_lt?: InputMaybe; + dollarLiquidity_lte?: InputMaybe; + dollarLiquidity_not?: InputMaybe; + dollarLiquidity_not_in?: InputMaybe>>; + fee?: InputMaybe; + fee_gt?: InputMaybe; + fee_gte?: InputMaybe; + fee_in?: InputMaybe>>; + fee_lt?: InputMaybe; + fee_lte?: InputMaybe; + fee_not?: InputMaybe; + fee_not_in?: InputMaybe>>; + hooks?: InputMaybe; + hooks_contains?: InputMaybe; + hooks_ends_with?: InputMaybe; + hooks_in?: InputMaybe>>; + hooks_not?: InputMaybe; + hooks_not_contains?: InputMaybe; + hooks_not_ends_with?: InputMaybe; + hooks_not_in?: InputMaybe>>; + hooks_not_starts_with?: InputMaybe; + hooks_starts_with?: InputMaybe; + isQuoteEth?: InputMaybe; + isQuoteEth_in?: InputMaybe>>; + isQuoteEth_not?: InputMaybe; + isQuoteEth_not_in?: InputMaybe>>; + isToken0?: InputMaybe; + isToken0_in?: InputMaybe>>; + isToken0_not?: InputMaybe; + isToken0_not_in?: InputMaybe>>; + lastRefreshed?: InputMaybe; + lastRefreshed_gt?: InputMaybe; + lastRefreshed_gte?: InputMaybe; + lastRefreshed_in?: InputMaybe>>; + lastRefreshed_lt?: InputMaybe; + lastRefreshed_lte?: InputMaybe; + lastRefreshed_not?: InputMaybe; + lastRefreshed_not_in?: InputMaybe>>; + lastSwapTimestamp?: InputMaybe; + lastSwapTimestamp_gt?: InputMaybe; + lastSwapTimestamp_gte?: InputMaybe; + lastSwapTimestamp_in?: InputMaybe>>; + lastSwapTimestamp_lt?: InputMaybe; + lastSwapTimestamp_lte?: InputMaybe; + lastSwapTimestamp_not?: InputMaybe; + lastSwapTimestamp_not_in?: InputMaybe>>; + liquidity?: InputMaybe; + liquidity_gt?: InputMaybe; + liquidity_gte?: InputMaybe; + liquidity_in?: InputMaybe>>; + liquidity_lt?: InputMaybe; + liquidity_lte?: InputMaybe; + liquidity_not?: InputMaybe; + liquidity_not_in?: InputMaybe>>; + migratedAt?: InputMaybe; + migratedAt_gt?: InputMaybe; + migratedAt_gte?: InputMaybe; + migratedAt_in?: InputMaybe>>; + migratedAt_lt?: InputMaybe; + migratedAt_lte?: InputMaybe; + migratedAt_not?: InputMaybe; + migratedAt_not_in?: InputMaybe>>; + migratedFromPool?: InputMaybe; + migratedFromPool_contains?: InputMaybe; + migratedFromPool_ends_with?: InputMaybe; + migratedFromPool_in?: InputMaybe>>; + migratedFromPool_not?: InputMaybe; + migratedFromPool_not_contains?: InputMaybe; + migratedFromPool_not_ends_with?: InputMaybe; + migratedFromPool_not_in?: InputMaybe>>; + migratedFromPool_not_starts_with?: InputMaybe; + migratedFromPool_starts_with?: InputMaybe; + migratorVersion?: InputMaybe; + migratorVersion_contains?: InputMaybe; + migratorVersion_ends_with?: InputMaybe; + migratorVersion_in?: InputMaybe>>; + migratorVersion_not?: InputMaybe; + migratorVersion_not_contains?: InputMaybe; + migratorVersion_not_ends_with?: InputMaybe; + migratorVersion_not_in?: InputMaybe>>; + migratorVersion_not_starts_with?: InputMaybe; + migratorVersion_starts_with?: InputMaybe; + percentDayChange?: InputMaybe; + percentDayChange_gt?: InputMaybe; + percentDayChange_gte?: InputMaybe; + percentDayChange_in?: InputMaybe>>; + percentDayChange_lt?: InputMaybe; + percentDayChange_lte?: InputMaybe; + percentDayChange_not?: InputMaybe; + percentDayChange_not_in?: InputMaybe>>; + poolId?: InputMaybe; + poolId_contains?: InputMaybe; + poolId_ends_with?: InputMaybe; + poolId_in?: InputMaybe>>; + poolId_not?: InputMaybe; + poolId_not_contains?: InputMaybe; + poolId_not_ends_with?: InputMaybe; + poolId_not_in?: InputMaybe>>; + poolId_not_starts_with?: InputMaybe; + poolId_starts_with?: InputMaybe; + price?: InputMaybe; + price_gt?: InputMaybe; + price_gte?: InputMaybe; + price_in?: InputMaybe>>; + price_lt?: InputMaybe; + price_lte?: InputMaybe; + price_not?: InputMaybe; + price_not_in?: InputMaybe>>; + quoteToken?: InputMaybe; + quoteToken_contains?: InputMaybe; + quoteToken_ends_with?: InputMaybe; + quoteToken_in?: InputMaybe>>; + quoteToken_not?: InputMaybe; + quoteToken_not_contains?: InputMaybe; + quoteToken_not_ends_with?: InputMaybe; + quoteToken_not_in?: InputMaybe>>; + quoteToken_not_starts_with?: InputMaybe; + quoteToken_starts_with?: InputMaybe; + reserves0?: InputMaybe; + reserves0_gt?: InputMaybe; + reserves0_gte?: InputMaybe; + reserves0_in?: InputMaybe>>; + reserves0_lt?: InputMaybe; + reserves0_lte?: InputMaybe; + reserves0_not?: InputMaybe; + reserves0_not_in?: InputMaybe>>; + reserves1?: InputMaybe; + reserves1_gt?: InputMaybe; + reserves1_gte?: InputMaybe; + reserves1_in?: InputMaybe>>; + reserves1_lt?: InputMaybe; + reserves1_lte?: InputMaybe; + reserves1_not?: InputMaybe; + reserves1_not_in?: InputMaybe>>; + sqrtPriceX96?: InputMaybe; + sqrtPriceX96_gt?: InputMaybe; + sqrtPriceX96_gte?: InputMaybe; + sqrtPriceX96_in?: InputMaybe>>; + sqrtPriceX96_lt?: InputMaybe; + sqrtPriceX96_lte?: InputMaybe; + sqrtPriceX96_not?: InputMaybe; + sqrtPriceX96_not_in?: InputMaybe>>; + tick?: InputMaybe; + tickSpacing?: InputMaybe; + tickSpacing_gt?: InputMaybe; + tickSpacing_gte?: InputMaybe; + tickSpacing_in?: InputMaybe>>; + tickSpacing_lt?: InputMaybe; + tickSpacing_lte?: InputMaybe; + tickSpacing_not?: InputMaybe; + tickSpacing_not_in?: InputMaybe>>; + tick_gt?: InputMaybe; + tick_gte?: InputMaybe; + tick_in?: InputMaybe>>; + tick_lt?: InputMaybe; + tick_lte?: InputMaybe; + tick_not?: InputMaybe; + tick_not_in?: InputMaybe>>; + totalFee0?: InputMaybe; + totalFee0_gt?: InputMaybe; + totalFee0_gte?: InputMaybe; + totalFee0_in?: InputMaybe>>; + totalFee0_lt?: InputMaybe; + totalFee0_lte?: InputMaybe; + totalFee0_not?: InputMaybe; + totalFee0_not_in?: InputMaybe>>; + totalFee1?: InputMaybe; + totalFee1_gt?: InputMaybe; + totalFee1_gte?: InputMaybe; + totalFee1_in?: InputMaybe>>; + totalFee1_lt?: InputMaybe; + totalFee1_lte?: InputMaybe; + totalFee1_not?: InputMaybe; + totalFee1_not_in?: InputMaybe>>; + volumeUsd?: InputMaybe; + volumeUsd_gt?: InputMaybe; + volumeUsd_gte?: InputMaybe; + volumeUsd_in?: InputMaybe>>; + volumeUsd_lt?: InputMaybe; + volumeUsd_lte?: InputMaybe; + volumeUsd_not?: InputMaybe; + volumeUsd_not_in?: InputMaybe>>; +}; + +export type V4poolsPage = { + __typename?: 'v4poolsPage'; + items: Array; + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + export type TokenFragmentFragment = { __typename?: 'token', address: string, name: string, symbol: string, decimals: number, isDerc20: boolean } & { ' $fragmentName'?: 'TokenFragmentFragment' }; export type AssetFragmentFragment = { __typename?: 'asset', address: string, numeraire: string, timelock: string, governance: string, liquidityMigrator: string, migrationPool: string, numTokensToSell: any, integrator: string, createdAt: any, migratedAt?: any | null } & { ' $fragmentName'?: 'AssetFragmentFragment' }; @@ -2148,7 +2568,7 @@ export type PoolsQueryVariables = Exact<{ }>; -export type PoolsQuery = { __typename?: 'Query', pools: { __typename?: 'poolPage', items: Array<{ __typename?: 'pool', address: string, chainId: any, tick: number, sqrtPrice: any, liquidity: any, createdAt: any, price: any, fee: number, type: string, dollarLiquidity: any, volumeUsd: any, percentDayChange: number, totalFee0: any, totalFee1: any, graduationThreshold: any, graduationBalance: any, isToken0: boolean, lastRefreshed?: any | null, lastSwapTimestamp?: any | null, reserves0: any, reserves1: any, marketCapUsd: any, asset?: { __typename?: 'asset', marketCapUsd: any } | null, baseToken?: { __typename?: 'token', address: string, name: string, symbol: string } | null, quoteToken?: { __typename?: 'token', address: string, name: string, symbol: string } | null, dailyVolume?: { __typename?: 'dailyVolume', volumeUsd: any } | null }> } }; +export type PoolsQuery = { __typename?: 'Query', pools: { __typename?: 'poolPage', items: Array<{ __typename?: 'pool', address: string, chainId: any, tick: number, sqrtPrice: any, liquidity: any, createdAt: any, price: any, fee: number, type: string, dollarLiquidity: any, volumeUsd: any, percentDayChange: number, totalFee0: any, totalFee1: any, minThreshold?: any | null, maxThreshold: any, graduationBalance: any, isToken0: boolean, lastRefreshed?: any | null, lastSwapTimestamp?: any | null, reserves0: any, reserves1: any, marketCapUsd: any, asset?: { __typename?: 'asset', marketCapUsd: any } | null, baseToken?: { __typename?: 'token', address: string, name: string, symbol: string } | null, quoteToken?: { __typename?: 'token', address: string, name: string, symbol: string } | null, dailyVolume?: { __typename?: 'dailyVolume', volumeUsd: any } | null }> } }; export const TokenFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"token"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"isDerc20"}}]}}]} as unknown as DocumentNode; export const AssetFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AssetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"asset"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"numeraire"}},{"kind":"Field","name":{"kind":"Name","value":"timelock"}},{"kind":"Field","name":{"kind":"Name","value":"governance"}},{"kind":"Field","name":{"kind":"Name","value":"liquidityMigrator"}},{"kind":"Field","name":{"kind":"Name","value":"migrationPool"}},{"kind":"Field","name":{"kind":"Name","value":"numTokensToSell"}},{"kind":"Field","name":{"kind":"Name","value":"integrator"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"migratedAt"}}]}}]} as unknown as DocumentNode; @@ -2156,4 +2576,4 @@ export const AssetsDocument = {"kind":"Document","definitions":[{"kind":"Operati export const TokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Token"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}},{"kind":"Field","name":{"kind":"Name","value":"isDerc20"}},{"kind":"Field","name":{"kind":"Name","value":"totalSupply"}},{"kind":"Field","name":{"kind":"Name","value":"firstSeenAt"}}]}}]}}]} as unknown as DocumentNode; export const PositionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Positions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pool"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"positions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"pool"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pool"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"liquidity"}},{"kind":"Field","name":{"kind":"Name","value":"tickLower"}},{"kind":"Field","name":{"kind":"Name","value":"tickUpper"}}]}}]}}]}}]} as unknown as DocumentNode; export const AssetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Asset"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"asset"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"numeraire"}},{"kind":"Field","name":{"kind":"Name","value":"timelock"}},{"kind":"Field","name":{"kind":"Name","value":"pool"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"liquidity"}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"tick"}},{"kind":"Field","name":{"kind":"Name","value":"baseToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}}]}},{"kind":"Field","name":{"kind":"Name","value":"quoteToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}},{"kind":"Field","name":{"kind":"Name","value":"decimals"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"migratedAt"}}]}}]}}]} as unknown as DocumentNode; -export const PoolsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Pools"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"poolFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pools"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"tick"}},{"kind":"Field","name":{"kind":"Name","value":"sqrtPrice"}},{"kind":"Field","name":{"kind":"Name","value":"liquidity"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"marketCapUsd"}}]}},{"kind":"Field","name":{"kind":"Name","value":"baseToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}},{"kind":"Field","name":{"kind":"Name","value":"quoteToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"dollarLiquidity"}},{"kind":"Field","name":{"kind":"Name","value":"dailyVolume"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"volumeUsd"}}]}},{"kind":"Field","name":{"kind":"Name","value":"volumeUsd"}},{"kind":"Field","name":{"kind":"Name","value":"percentDayChange"}},{"kind":"Field","name":{"kind":"Name","value":"totalFee0"}},{"kind":"Field","name":{"kind":"Name","value":"totalFee1"}},{"kind":"Field","name":{"kind":"Name","value":"graduationThreshold"}},{"kind":"Field","name":{"kind":"Name","value":"graduationBalance"}},{"kind":"Field","name":{"kind":"Name","value":"isToken0"}},{"kind":"Field","name":{"kind":"Name","value":"lastRefreshed"}},{"kind":"Field","name":{"kind":"Name","value":"lastSwapTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"reserves0"}},{"kind":"Field","name":{"kind":"Name","value":"reserves1"}},{"kind":"Field","name":{"kind":"Name","value":"marketCapUsd"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const PoolsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Pools"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"poolFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pools"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"chainId"}},{"kind":"Field","name":{"kind":"Name","value":"tick"}},{"kind":"Field","name":{"kind":"Name","value":"sqrtPrice"}},{"kind":"Field","name":{"kind":"Name","value":"liquidity"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"asset"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"marketCapUsd"}}]}},{"kind":"Field","name":{"kind":"Name","value":"baseToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}},{"kind":"Field","name":{"kind":"Name","value":"quoteToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"address"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"symbol"}}]}},{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"fee"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"dollarLiquidity"}},{"kind":"Field","name":{"kind":"Name","value":"dailyVolume"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"volumeUsd"}}]}},{"kind":"Field","name":{"kind":"Name","value":"volumeUsd"}},{"kind":"Field","name":{"kind":"Name","value":"percentDayChange"}},{"kind":"Field","name":{"kind":"Name","value":"totalFee0"}},{"kind":"Field","name":{"kind":"Name","value":"totalFee1"}},{"kind":"Field","name":{"kind":"Name","value":"minThreshold"}},{"kind":"Field","name":{"kind":"Name","value":"maxThreshold"}},{"kind":"Field","name":{"kind":"Name","value":"graduationBalance"}},{"kind":"Field","name":{"kind":"Name","value":"isToken0"}},{"kind":"Field","name":{"kind":"Name","value":"lastRefreshed"}},{"kind":"Field","name":{"kind":"Name","value":"lastSwapTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"reserves0"}},{"kind":"Field","name":{"kind":"Name","value":"reserves1"}},{"kind":"Field","name":{"kind":"Name","value":"marketCapUsd"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/src/hooks/useMarketDetails.ts b/src/hooks/useMarketDetails.ts index bb1b35c..7b91f26 100644 --- a/src/hooks/useMarketDetails.ts +++ b/src/hooks/useMarketDetails.ts @@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query"; import { Address } from "viem"; import { AssetData, ReadFactory } from "doppler-v3-sdk"; import { getDrift } from "../utils/drift"; +import { baseSepolia } from "viem/chains"; export const fetchAssetData = async ( airlock: Address | undefined, @@ -11,7 +12,7 @@ export const fetchAssetData = async ( throw "Airlock or asset address is undefined"; } - const drift = getDrift(); + const drift = getDrift(baseSepolia); const readFactory = new ReadFactory(airlock, drift); const assetData = await readFactory.getAssetData(assetAddress); diff --git a/src/hooks/usePoolCreationData.ts b/src/hooks/usePoolCreationData.ts index 6f45903..e4032ff 100644 --- a/src/hooks/usePoolCreationData.ts +++ b/src/hooks/usePoolCreationData.ts @@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query"; import { Address, zeroAddress } from "viem"; import { ReadDerc20, ReadFactory } from "doppler-v3-sdk"; import { getDrift } from "../utils/drift"; +import { baseSepolia } from "viem/chains"; export type PoolQueryResult = { data: PoolData[] | undefined; @@ -38,7 +39,7 @@ export interface PoolCreationData { } const getCreationData = async (airlock: Address) => { - const drift = getDrift(); + const drift = getDrift(baseSepolia); const readFactory = new ReadFactory(airlock, drift); const logs = await readFactory.getCreateEvents({ fromBlock: 0n, diff --git a/src/hooks/usePoolData.ts b/src/hooks/usePoolData.ts index 422afaa..36783b2 100644 --- a/src/hooks/usePoolData.ts +++ b/src/hooks/usePoolData.ts @@ -1,5 +1,5 @@ import { useQuery } from "@tanstack/react-query"; -import { Address } from "viem"; +import { Address, parseEther } from "viem"; import { AssetData, ReadUniswapV3Pool, @@ -11,6 +11,7 @@ import { import { getDrift } from "../utils/drift"; import { useAssetData } from "./useMarketDetails"; import { useTokenData } from "./useToken"; +import { baseSepolia } from "viem/chains"; interface PoolData { poolBalance: bigint; @@ -42,7 +43,7 @@ const fetchPositionData = async ( throw "Asset address not found"; } - const drift = getDrift(); + const drift = getDrift(baseSepolia); const pool = new ReadUniswapV3Pool(assetData.pool, drift); const initializer = new ReadUniswapV3Initializer(initializerAddress, drift); const asset = new ReadDerc20(assetAddress, drift); @@ -66,7 +67,11 @@ const fetchPositionData = async ( return { poolBalance, - initializerState, + // TODO: fix og types + initializerState: { + ...initializerState, + maxShareToBond: parseEther("0.35"), + }, slot0, positions, }; diff --git a/src/hooks/useToken.ts b/src/hooks/useToken.ts index c9f91a0..9b43f32 100644 --- a/src/hooks/useToken.ts +++ b/src/hooks/useToken.ts @@ -5,6 +5,7 @@ import { getDrift } from "../utils/drift"; import { TokenData } from "../types"; import { INDEXER_URL } from "../services/indexer"; import { gql, request } from "graphql-request"; +import { baseSepolia } from "viem/chains"; export const fetchDerc20TokenData = async ( address: Address | undefined @@ -14,7 +15,7 @@ export const fetchDerc20TokenData = async ( } try { - const drift = getDrift(); + const drift = getDrift(baseSepolia); const token = new ReadDerc20(address, drift); const [name, symbol, decimals, totalSupply] = await Promise.all([ diff --git a/src/pages/DeployDoppler.tsx b/src/pages/DeployDoppler.tsx index e524e3e..a3b783b 100644 --- a/src/pages/DeployDoppler.tsx +++ b/src/pages/DeployDoppler.tsx @@ -9,6 +9,7 @@ import { Label } from "@/components/ui/label"; import { Card } from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { Checkbox } from "@/components/ui/checkbox"; +import { baseSepolia } from "viem/chains"; const TICK_SPACING = 200; const weth = "0x4200000000000000000000000000000000000006"; @@ -124,7 +125,9 @@ function DeployDoppler() { vestingConfig: "default", }; - const drift = getDrift(walletClient); + const drift = getDrift(baseSepolia, walletClient); + + // TODO: ReadWriteFactory types need to be fixed // @ts-ignore const rwFactory = new ReadWriteFactory(airlock, drift); const createData = await rwFactory.encodeCreateData(createV3PoolParams); diff --git a/src/pages/ViewDoppler.tsx b/src/pages/ViewDoppler.tsx index 11c830d..35b95bf 100644 --- a/src/pages/ViewDoppler.tsx +++ b/src/pages/ViewDoppler.tsx @@ -27,6 +27,7 @@ import { import LiquidityChart from "../components/LiquidityChart"; import TokenName from "../components/TokenName"; import { addresses } from "../addresses"; +import { baseSepolia } from "viem/chains"; function ViewDoppler() { @@ -36,7 +37,7 @@ function ViewDoppler() { const { data: walletClient } = useWalletClient(account); const publicClient = usePublicClient(); const { universalRouter, quoterV2 } = addresses; - const drift = getDrift(walletClient); + const drift = getDrift(baseSepolia, walletClient); const quoter = new ReadQuoter(quoterV2, zeroAddress, drift); // Validation and data fetching diff --git a/src/services/documents.ts b/src/services/documents.ts index 3c684ed..e4b41fc 100644 --- a/src/services/documents.ts +++ b/src/services/documents.ts @@ -172,7 +172,8 @@ export const PoolsDocument = graphql(` percentDayChange totalFee0 totalFee1 - graduationThreshold + minThreshold + maxThreshold graduationBalance isToken0 lastRefreshed diff --git a/src/utils/drift.ts b/src/utils/drift.ts index 0a24775..60bb01c 100644 --- a/src/utils/drift.ts +++ b/src/utils/drift.ts @@ -1,10 +1,14 @@ -import { createDrift, Drift } from "@delvtech/drift"; +import { createDrift } from "@delvtech/drift"; import { viemAdapter } from "@delvtech/drift-viem"; -import { getPublicClient } from "@wagmi/core"; -import { config } from "../wagmi"; -import { WalletClient } from "viem"; +import { Chain, createPublicClient, http, WalletClient } from "viem"; +import { INDEXER_URL } from "../services/indexer"; + +export function getDrift(chain: Chain, walletClient?: WalletClient) { + const publicClient = createPublicClient({ + chain, + transport: http(INDEXER_URL), + }); -export function getDrift(walletClient?: WalletClient): Drift { - const publicClient = getPublicClient(config); return createDrift({ adapter: viemAdapter({ publicClient, walletClient }) }); } + diff --git a/src/wagmi.ts b/src/wagmi.ts index e4042e2..13e495f 100644 --- a/src/wagmi.ts +++ b/src/wagmi.ts @@ -2,8 +2,6 @@ import { http, createConfig } from "wagmi"; import { baseSepolia } from "wagmi/chains"; import { coinbaseWallet, injected } from "wagmi/connectors"; -const alchemyKey = import.meta.env.VITE_ALCHEMY_API_KEY; - export const config = createConfig({ chains: [baseSepolia], connectors: [injected(), coinbaseWallet()],