/ src / modules / history / v3-user-history-query.ts
v3-user-history-query.ts
 1  export const USER_TRANSACTIONS_V3 = `
 2  query UserTransactions($userAddress: String!, $first: Int!, $skip: Int!) {
 3    userTransactions(where: { user: $userAddress }, orderBy: timestamp, orderDirection: desc, first: $first, skip: $skip) {
 4      id
 5      timestamp
 6      txHash
 7      action
 8      ... on Supply {
 9        amount
10        reserve {
11          symbol
12          decimals
13          name
14          underlyingAsset
15        }
16        assetPriceUSD
17      }
18      ... on RedeemUnderlying {
19        amount
20        reserve {
21          symbol
22          decimals
23          name
24          underlyingAsset
25        }
26        assetPriceUSD
27      }
28      ... on Borrow {
29        amount
30        borrowRateMode
31        reserve {
32          symbol
33          decimals
34          name
35          underlyingAsset
36        }
37        assetPriceUSD
38      }
39      ... on UsageAsCollateral {
40        fromState
41        toState
42        reserve {
43          symbol
44          name
45          underlyingAsset
46        }
47      }
48      ... on Repay {
49        amount
50        reserve {
51          symbol
52          decimals
53          name
54          underlyingAsset
55        }
56        assetPriceUSD
57      }
58      ... on SwapBorrowRate {
59        borrowRateModeFrom
60        borrowRateModeTo
61        variableBorrowRate
62        stableBorrowRate
63        reserve {
64          symbol
65          decimals
66          name
67          underlyingAsset
68        }
69      }
70      ... on LiquidationCall {
71        collateralAmount
72        collateralReserve {
73          symbol
74          decimals
75          name
76          underlyingAsset
77        }
78        principalAmount
79        principalReserve {
80          symbol
81          decimals
82          name
83          underlyingAsset
84        }
85        collateralAssetPriceUSD
86        borrowAssetPriceUSD
87      }
88    }
89  }
90  `;