Skip to content

Commit

Permalink
fix(liquidity-sdk): fetch from rpc or api
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Dec 9, 2024
1 parent 0cc5919 commit 3153240
Show file tree
Hide file tree
Showing 8 changed files with 1,066 additions and 746 deletions.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"cache",
"coverage",
"artifacts",
"packages/bundler-sdk-ethers/src/types",
"packages/liquidation-sdk-viem/src/api/sdk.ts",
"packages/liquidity-sdk-viem/src/api/sdk.ts"
]
Expand Down
12 changes: 11 additions & 1 deletion packages/liquidity-sdk-viem/graphql/GetMarkets.query.gql
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
query getMarkets($chainId: Int!, $marketIds: [String!]) {
markets(where: {chainId_in: [$chainId], uniqueKey_in: $marketIds}) {
markets(where: { chainId_in: [$chainId], uniqueKey_in: $marketIds }) {
items {
uniqueKey
publicAllocatorSharedLiquidity {
vault {
address
}
allocationMarket {
uniqueKey
}
assets
}
supplyingVaults {
address
state {
Expand Down
10 changes: 10 additions & 0 deletions packages/liquidity-sdk-viem/src/api/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ export const GetMarketsDocument = gql`
query getMarkets($chainId: Int!, $marketIds: [String!]) {
markets(where: {chainId_in: [$chainId], uniqueKey_in: $marketIds}) {
items {
uniqueKey
publicAllocatorSharedLiquidity {
vault {
address
}
allocationMarket {
uniqueKey
}
assets
}
supplyingVaults {
address
state {
Expand Down
13 changes: 13 additions & 0 deletions packages/liquidity-sdk-viem/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ export type GetMarketsQuery = {
__typename?: "PaginatedMarkets";
items: Array<{
__typename?: "Market";
uniqueKey: Types.Scalars["MarketId"]["output"];
publicAllocatorSharedLiquidity: Array<{
__typename?: "PublicAllocatorSharedLiquidity";
assets: Types.Scalars["BigInt"]["output"];
vault: {
__typename?: "Vault";
address: Types.Scalars["Address"]["output"];
};
allocationMarket: {
__typename?: "Market";
uniqueKey: Types.Scalars["MarketId"]["output"];
};
}> | null;
supplyingVaults: Array<{
__typename?: "Vault";
address: Types.Scalars["Address"]["output"];
Expand Down
Loading

0 comments on commit 3153240

Please sign in to comment.