Skip to content

Commit c5b4a44

Browse files
committed
Integrate split revenue into the sdk
1 parent 713fe69 commit c5b4a44

File tree

6 files changed

+412
-131
lines changed

6 files changed

+412
-131
lines changed

packages/graphql/schema.graphql

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,8 @@ enum OperationType {
680680
VAULT_FEE_WITHDRAWN
681681
VAULT_WITHDRAW
682682
LIQUIDATION
683+
REVENUE_SPLITTER_OWNER_DEPLOYED
684+
REVENUE_SPLITTER_RECIPIENT_SET
683685
}
684686

685687
enum OrderDirection {
@@ -941,6 +943,24 @@ type Query {
941943
savingsGhoWithdraw(request: SavingsGhoWithdrawRequest!): TransactionRequest!
942944
}
943945

946+
type RecipientPercent {
947+
"""Address of the recipient."""
948+
address: EvmAddress!
949+
950+
"""
951+
Percentage of the fee that will be sent to the recipient, expressed in basis points.
952+
"""
953+
percent: PercentValue!
954+
}
955+
956+
input RecipientPercentInput {
957+
"""Address of the recipient."""
958+
address: EvmAddress!
959+
960+
"""Percentage of the fee that will be sent to the recipient."""
961+
percent: BigDecimal!
962+
}
963+
944964
input RepayAmountInput @oneOf {
945965
"""The native amount"""
946966
native: BigDecimal
@@ -1232,6 +1252,9 @@ type ReserveUserState {
12321252
input SavingsGhoBalanceRequest {
12331253
"""The user to query the savings GHO balance"""
12341254
user: EvmAddress!
1255+
1256+
"""The chain id - savings GHO for now only works on Ethereum"""
1257+
chainId: ChainId
12351258
}
12361259

12371260
input SavingsGhoDepositRequest {
@@ -1245,6 +1268,9 @@ input SavingsGhoDepositRequest {
12451268
The address to which saving GHO shares will be minted to - defaults to `depositor`.
12461269
"""
12471270
recipient: EvmAddress
1271+
1272+
"""The chain id - savings GHO for now only works on Ethereum"""
1273+
chainId: ChainId
12481274
}
12491275

12501276
input SavingsGhoWithdrawAmount @oneOf {
@@ -1266,6 +1292,9 @@ input SavingsGhoWithdrawRequest {
12661292

12671293
"""The address to which GHO will be minted to - defaults to `depositor`."""
12681294
recipient: EvmAddress
1295+
1296+
"""The chain id - savings GHO for now only works on Ethereum"""
1297+
chainId: ChainId
12691298
}
12701299

12711300
input SayingsGhoDepositAmountInput {
@@ -1699,9 +1728,6 @@ type Vault {
16991728
"""The vault address"""
17001729
address: EvmAddress!
17011730

1702-
"""The owner of the vault"""
1703-
owner: EvmAddress!
1704-
17051731
"""The name of the share"""
17061732
shareName: String!
17071733

@@ -1728,11 +1754,15 @@ type Vault {
17281754
"""The user's shares info on the vault"""
17291755
userShares: UserVaultShares
17301756

1757+
"""The owner of the vault"""
1758+
owner: EvmAddress!
1759+
17311760
"""The total fees the owner can claim currently for the vault"""
17321761
feesBalance: TokenAmount!
17331762

17341763
"""The total vault APR after their fee is taken off"""
17351764
vaultApr: PercentValue!
1765+
feeRecipients: [RecipientPercent!]!
17361766
}
17371767

17381768
input VaultDeployRequest {
@@ -1766,6 +1796,12 @@ input VaultDeployRequest {
17661796
The initial amount of underlying assets to deposit. This must be a non-zero, non-trivial amount, depending on the underlying asset's decimals.
17671797
"""
17681798
initialLockDeposit: BigDecimal!
1799+
1800+
"""
1801+
The recipients of the fee revenue, expressed as a percentage of the total fee revenue.
1802+
If not provided, the fee revenue will be sent to the owner of the vault.
1803+
"""
1804+
recipients: [RecipientPercentInput!]
17691805
}
17701806

17711807
input VaultDepositAmountInput {

packages/graphql/src/fragments/common.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ export const PercentValueFragment = graphql(
2222
);
2323
export type PercentValue = FragmentOf<typeof PercentValueFragment>;
2424

25+
export const RecipientPercentFragment = graphql(
26+
`fragment RecipientPercent on RecipientPercent {
27+
__typename
28+
address
29+
percent {
30+
...PercentValue
31+
}
32+
}`,
33+
[PercentValueFragment],
34+
);
35+
export type RecipientPercent = FragmentOf<typeof RecipientPercentFragment>;
36+
2537
export const CurrencyFragment = graphql(
2638
`fragment Currency on Currency {
2739
__typename

packages/graphql/src/fragments/vaults.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { type FragmentDocumentFor, graphql } from '../graphql';
33
import {
44
PaginatedResultInfoFragment,
55
PercentValueFragment,
6+
RecipientPercentFragment,
67
TokenAmountFragment,
78
} from './common';
89
import { ReserveFragment } from './reserve';
@@ -37,6 +38,9 @@ export const VaultFragment = graphql(
3738
totalFeeRevenue {
3839
...TokenAmount
3940
}
41+
feeRecipients {
42+
...RecipientPercent
43+
}
4044
balance {
4145
...TokenAmount
4246
}
@@ -56,6 +60,7 @@ export const VaultFragment = graphql(
5660
PercentValueFragment,
5761
TokenAmountFragment,
5862
UserVaultSharesFragment,
63+
RecipientPercentFragment,
5964
],
6065
);
6166
export type Vault = FragmentOf<typeof VaultFragment>;

0 commit comments

Comments
 (0)