diff --git a/packages/sdk-core/src/subgraph/entities/pool/pool.ts b/packages/sdk-core/src/subgraph/entities/pool/pool.ts index 6ad1fc7746..7516d14c07 100644 --- a/packages/sdk-core/src/subgraph/entities/pool/pool.ts +++ b/packages/sdk-core/src/subgraph/entities/pool/pool.ts @@ -29,22 +29,22 @@ export interface Pool { totalAmountInstantlyDistributedUntilUpdatedAt: BigNumber; totalAmountFlowedDistributedUntilUpdatedAt: BigNumber; totalAmountDistributedUntilUpdatedAt: BigNumber; + totalFlowAdjustmentAmountDistributedUntilUpdatedAt: BigNumber; totalUnits: BigNumber; totalConnectedUnits: BigNumber; totalDisconnectedUnits: BigNumber; + perUnitSettledValue: BigNumber; + perUnitFlowRate: BigNumber; /** * A member is any account which has more than 0 units in the pool. - * */ totalMembers: number; /** * A connected member is any account which has more than 0 units in the pool and is connected. - * */ totalConnectedMembers: number; /** * A disconnected member is any account which has more than 0 units in the pool and is not connected. - * */ totalDisconnectedMembers: number; adjustmentFlowRate: BigNumber; @@ -110,6 +110,10 @@ export class PoolQueryHandler extends SubgraphQueryHandler< x.totalAmountFlowedDistributedUntilUpdatedAt, totalAmountDistributedUntilUpdatedAt: x.totalAmountDistributedUntilUpdatedAt, + totalFlowAdjustmentAmountDistributedUntilUpdatedAt: + x.totalFlowAdjustmentAmountDistributedUntilUpdatedAt, + perUnitFlowRate: x.perUnitFlowRate, + perUnitSettledValue: x.perUnitSettledValue, admin: x.admin.id, token: x.token.id, })); diff --git a/packages/sdk-core/src/subgraph/entities/pool/pools.graphql b/packages/sdk-core/src/subgraph/entities/pool/pools.graphql index f40661b6d4..1492b3e102 100644 --- a/packages/sdk-core/src/subgraph/entities/pool/pools.graphql +++ b/packages/sdk-core/src/subgraph/entities/pool/pools.graphql @@ -1,51 +1,54 @@ query getPool($id: ID!) { - pool(id: $id) { - ...PoolPart - } + pool(id: $id) { + ...PoolPart + } } query pools( - $first: Int = 10 - $orderBy: Pool_orderBy = id - $orderDirection: OrderDirection = asc - $skip: Int = 0 - $where: Pool_filter = {} - $block: Block_height + $first: Int = 10 + $orderBy: Pool_orderBy = id + $orderDirection: OrderDirection = asc + $skip: Int = 0 + $where: Pool_filter = {} + $block: Block_height ) { - pools( - first: $first - orderBy: $orderBy - orderDirection: $orderDirection - skip: $skip - where: $where - block: $block - ) { - ...PoolPart - } + pools( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + skip: $skip + where: $where + block: $block + ) { + ...PoolPart + } } fragment PoolPart on Pool { - id - createdAtTimestamp - createdAtBlockNumber - updatedAtTimestamp - updatedAtBlockNumber - flowRate - totalMembers - totalUnits - totalAmountDistributedUntilUpdatedAt - adjustmentFlowRate - totalAmountFlowedDistributedUntilUpdatedAt - totalAmountInstantlyDistributedUntilUpdatedAt - totalBuffer - totalConnectedMembers - totalConnectedUnits - totalDisconnectedMembers - totalDisconnectedUnits - admin { id - } - token { - id - } + createdAtTimestamp + createdAtBlockNumber + updatedAtTimestamp + updatedAtBlockNumber + admin { + id + } + token { + id + } + totalMembers + totalUnits + totalConnectedMembers + totalConnectedUnits + totalDisconnectedMembers + totalDisconnectedUnits + totalAmountInstantlyDistributedUntilUpdatedAt + flowRate + perUnitSettledValue + perUnitFlowRate + totalBuffer + totalAmountFlowedDistributedUntilUpdatedAt + totalAmountDistributedUntilUpdatedAt + adjustmentFlowRate + totalFlowAdjustmentAmountDistributedUntilUpdatedAt } diff --git a/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts b/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts index 3b679e58e7..553235723a 100644 --- a/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts +++ b/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts @@ -32,6 +32,8 @@ export interface PoolMember { totalAmountReceivedUntilUpdatedAt: BigNumber; poolTotalAmountDistributedUntilUpdatedAt: BigNumber; pool: Address; + syncedPerUnitFlowRate: BigNumber; + syncedPerUnitSettledValue: BigNumber; } export type PoolMembersListQuery = SubgraphListQuery< @@ -70,6 +72,8 @@ export class PoolMemberQueryHandler extends SubgraphQueryHandler< updatedAtBlockNumber: Number(x.updatedAtBlockNumber), pool: x.pool.id, token: x.pool.token.id, + syncedPerUnitFlowRate: x.syncedPerUnitFlowRate, + syncedPerUnitSettledValue: x.syncedPerUnitSettledValue, })); requestDocument = PoolMembersDocument; diff --git a/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql b/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql index 035d12f85c..90e9cd5bec 100644 --- a/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql +++ b/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql @@ -1,37 +1,39 @@ query poolMembers( - $first: Int = 10 - $skip: Int = 0 - $orderBy: PoolMember_orderBy = id - $orderDirection: OrderDirection = asc - $where: PoolMember_filter = {} - $block: Block_height + $first: Int = 10 + $skip: Int = 0 + $orderBy: PoolMember_orderBy = id + $orderDirection: OrderDirection = asc + $where: PoolMember_filter = {} + $block: Block_height ) { - poolMembers( - first: $first - orderBy: $orderBy - orderDirection: $orderDirection - skip: $skip - where: $where - block: $block - ) { - id - createdAtTimestamp - createdAtBlockNumber - updatedAtTimestamp - updatedAtBlockNumber - units - pool { - id - token { + poolMembers( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + skip: $skip + where: $where + block: $block + ) { id - } + createdAtTimestamp + createdAtBlockNumber + updatedAtTimestamp + updatedAtBlockNumber + units + pool { + id + token { + id + } + } + account { + id + } + isConnected + totalAmountClaimed + totalAmountReceivedUntilUpdatedAt + poolTotalAmountDistributedUntilUpdatedAt + syncedPerUnitFlowRate + syncedPerUnitSettledValue } - account { - id - } - isConnected - totalAmountClaimed - totalAmountReceivedUntilUpdatedAt - poolTotalAmountDistributedUntilUpdatedAt - } }