Skip to content

Commit c8cf09d

Browse files
authored
Merge pull request #133 from aave/feat/expose-user-earned-debt-apys
feat: expose user earned/debt APY in MarketUserState
2 parents 642adc6 + 89c3ea6 commit c8cf09d

File tree

6 files changed

+30
-8
lines changed

6 files changed

+30
-8
lines changed

.changeset/short-steaks-allow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@aave/graphql": minor
3+
"@aave/client": minor
4+
---
5+
6+
feat: expose user earned/debt APY in MarketUserState

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ examples/*/pnpm-lock.yaml
2727

2828
# local env files
2929
.env
30+
.env.local
3031

3132
# typescript
3233
*.tsbuildinfo

biome.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@
7474
}
7575
},
7676
{
77-
"includes": ["packages/**/*.spec.ts", "packages/**/*.test.ts", "packages/**/*.helpers.ts"],
77+
"includes": [
78+
"packages/**/*.spec.ts",
79+
"packages/**/*.test.ts",
80+
"packages/**/*.helpers.ts"
81+
],
7882
"linter": {
7983
"rules": {
8084
"style": {
@@ -109,9 +113,9 @@
109113
"style": {
110114
"noNonNullAssertion": "off"
111115
},
112-
"a11y": {
113-
"noLabelWithoutControl": "off"
114-
}
116+
"a11y": {
117+
"noLabelWithoutControl": "off"
118+
}
115119
}
116120
}
117121
}

packages/graphql/schema.graphql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,12 @@ type MarketUserState {
566566
"""The user's net annual percentage yield across all positions"""
567567
netAPY: PercentValue!
568568

569+
"""The user's earned annual percentage yield across all supply positions"""
570+
userEarnedAPY: PercentValue!
571+
572+
"""The user's debt annual percentage yield across all borrow positions"""
573+
userDebtAPY: PercentValue!
574+
569575
"""
570576
The user's health factor (risk metric for liquidation) - if null, the user does not have a borrow
571577
"""
@@ -679,7 +685,7 @@ enum OperationType {
679685
VAULT_FEE_UPDATED
680686
VAULT_FEE_WITHDRAWN
681687
VAULT_WITHDRAW
682-
VAULT_TRANSFER
688+
VAULT_OWNERSHIP_TRANSFERRED
683689
REVENUE_SPLITTER_OWNER_DEPLOYED
684690
REVENUE_SPLITTER_OWNER_TRANSFER
685691
LIQUIDATION

packages/graphql/src/fragments/market.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export const MarketUserStateFragment = graphql(
1111
netAPY {
1212
...PercentValue
1313
}
14+
userEarnedAPY {
15+
...PercentValue
16+
}
17+
userDebtAPY {
18+
...PercentValue
19+
}
1420
healthFactor
1521
eModeEnabled
1622
totalCollateralBase
@@ -84,7 +90,6 @@ export const MarketFragment = graphql(
8490
userState {
8591
...MarketUserState
8692
}
87-
8893
borrowReserves: reserves(request: { reserveType: BORROW, orderBy: $borrowsOrderBy }) {
8994
...Reserve
9095
}

packages/graphql/src/graphql-env.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ export type introspection_types = {
5656
'MarketReservesRequestType': { name: 'MarketReservesRequestType'; enumValues: 'SUPPLY' | 'BORROW' | 'BOTH'; };
5757
'MarketUserReserveBorrowPosition': { kind: 'OBJECT'; name: 'MarketUserReserveBorrowPosition'; fields: { 'apy': { name: 'apy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'currency': { name: 'currency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Currency'; ofType: null; }; } }; 'debt': { name: 'debt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TokenAmount'; ofType: null; }; } }; 'market': { name: 'market'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'MarketInfo'; ofType: null; }; } }; }; };
5858
'MarketUserReserveSupplyPosition': { kind: 'OBJECT'; name: 'MarketUserReserveSupplyPosition'; fields: { 'apy': { name: 'apy'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'balance': { name: 'balance'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TokenAmount'; ofType: null; }; } }; 'canBeCollateral': { name: 'canBeCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'currency': { name: 'currency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Currency'; ofType: null; }; } }; 'isCollateral': { name: 'isCollateral'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'market': { name: 'market'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'MarketInfo'; ofType: null; }; } }; }; };
59-
'MarketUserState': { kind: 'OBJECT'; name: 'MarketUserState'; fields: { 'availableBorrowsBase': { name: 'availableBorrowsBase'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'currentLiquidationThreshold': { name: 'currentLiquidationThreshold'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'eModeEnabled': { name: 'eModeEnabled'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; } }; 'isInIsolationMode': { name: 'isInIsolationMode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'ltv': { name: 'ltv'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'netAPY': { name: 'netAPY'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'netWorth': { name: 'netWorth'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'totalCollateralBase': { name: 'totalCollateralBase'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'totalDebtBase': { name: 'totalDebtBase'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; }; };
59+
'MarketUserState': { kind: 'OBJECT'; name: 'MarketUserState'; fields: { 'availableBorrowsBase': { name: 'availableBorrowsBase'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'currentLiquidationThreshold': { name: 'currentLiquidationThreshold'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'eModeEnabled': { name: 'eModeEnabled'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'healthFactor': { name: 'healthFactor'; type: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; } }; 'isInIsolationMode': { name: 'isInIsolationMode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'ltv': { name: 'ltv'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'netAPY': { name: 'netAPY'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'netWorth': { name: 'netWorth'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'totalCollateralBase': { name: 'totalCollateralBase'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'totalDebtBase': { name: 'totalDebtBase'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigDecimal'; ofType: null; }; } }; 'userDebtAPY': { name: 'userDebtAPY'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'userEarnedAPY': { name: 'userEarnedAPY'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; }; };
6060
'MarketsRequest': { kind: 'INPUT_OBJECT'; name: 'MarketsRequest'; isOneOf: false; inputFields: [{ name: 'chainIds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; }; }; }; defaultValue: null }, { name: 'user'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; defaultValue: null }]; };
6161
'MeritBorrowAndSupplyIncentiveCondition': { kind: 'OBJECT'; name: 'MeritBorrowAndSupplyIncentiveCondition'; fields: { 'borrowToken': { name: 'borrowToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Currency'; ofType: null; }; } }; 'claimLink': { name: 'claimLink'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'URL'; ofType: null; }; } }; 'extraApr': { name: 'extraApr'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'supplyToken': { name: 'supplyToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Currency'; ofType: null; }; } }; }; };
6262
'MeritBorrowIncentive': { kind: 'OBJECT'; name: 'MeritBorrowIncentive'; fields: { 'borrowAprDiscount': { name: 'borrowAprDiscount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; 'claimLink': { name: 'claimLink'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'URL'; ofType: null; }; } }; }; };
6363
'MeritSupplyIncentive': { kind: 'OBJECT'; name: 'MeritSupplyIncentive'; fields: { 'claimLink': { name: 'claimLink'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'URL'; ofType: null; }; } }; 'extraSupplyApr': { name: 'extraSupplyApr'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PercentValue'; ofType: null; }; } }; }; };
6464
'MessageData': { kind: 'OBJECT'; name: 'MessageData'; fields: { 'deadline': { name: 'deadline'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'nonce': { name: 'nonce'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; 'owner': { name: 'owner'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'spender': { name: 'spender'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'value': { name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; }; };
6565
'NativeCurrency': { kind: 'OBJECT'; name: 'NativeCurrency'; fields: { 'chainId': { name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ChainId'; ofType: null; }; } }; 'decimals': { name: 'decimals'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'imageUrl': { name: 'imageUrl'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'symbol': { name: 'symbol'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'wrappedToken': { name: 'wrappedToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
66-
'OperationType': { name: 'OperationType'; enumValues: 'BORROW' | 'REPAY' | 'RESERVE_USED_AS_COLLATERAL_ENABLED' | 'RESERVE_USED_AS_COLLATERAL_DISABLED' | 'SUPPLY' | 'USER_EMODE_SET' | 'WITHDRAW' | 'VAULT_DEPLOYED' | 'VAULT_DEPOSIT' | 'VAULT_FEE_UPDATED' | 'VAULT_FEE_WITHDRAWN' | 'VAULT_WITHDRAW' | 'VAULT_TRANSFER' | 'REVENUE_SPLITTER_OWNER_DEPLOYED' | 'REVENUE_SPLITTER_OWNER_TRANSFER' | 'LIQUIDATION'; };
66+
'OperationType': { name: 'OperationType'; enumValues: 'BORROW' | 'REPAY' | 'RESERVE_USED_AS_COLLATERAL_ENABLED' | 'RESERVE_USED_AS_COLLATERAL_DISABLED' | 'SUPPLY' | 'USER_EMODE_SET' | 'WITHDRAW' | 'VAULT_DEPLOYED' | 'VAULT_DEPOSIT' | 'VAULT_FEE_UPDATED' | 'VAULT_FEE_WITHDRAWN' | 'VAULT_WITHDRAW' | 'VAULT_OWNERSHIP_TRANSFERRED' | 'REVENUE_SPLITTER_OWNER_DEPLOYED' | 'REVENUE_SPLITTER_OWNER_TRANSFER' | 'LIQUIDATION'; };
6767
'OrderDirection': { name: 'OrderDirection'; enumValues: 'ASC' | 'DESC'; };
6868
'PageSize': { name: 'PageSize'; enumValues: 'TEN' | 'FIFTY'; };
6969
'PaginatedResultInfo': { kind: 'OBJECT'; name: 'PaginatedResultInfo'; fields: { 'next': { name: 'next'; type: { kind: 'SCALAR'; name: 'Cursor'; ofType: null; } }; 'prev': { name: 'prev'; type: { kind: 'SCALAR'; name: 'Cursor'; ofType: null; } }; }; };

0 commit comments

Comments
 (0)