-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock1.ts
173 lines (167 loc) · 5.41 KB
/
mock1.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import { BigNumber, constants } from "ethers";
import { parseUnits } from "ethers/lib/utils";
import { MarketMapping, ScaledUserMarketData, StEthData } from "../types";
import { AdapterMock } from ".";
import { GLOBAL_DATA, MARKETS_REWARDS_DISTRIBUTION } from "./global";
import {
MARKETS_CONFIGS,
MARKETS_DATA,
MARKETS_SUPPLY_DATA,
Underlying,
} from "./markets";
const USER_MARKETS_DATA: MarketMapping<ScaledUserMarketData> = {
[Underlying.dai]: {
underlyingAddress: Underlying.dai,
scaledBorrowInP2P: parseUnits("1234", 18),
scaledBorrowOnPool: parseUnits("0", 18),
scaledCollateral: parseUnits("345698", 18),
scaledSupplyInP2P: parseUnits("654", 18),
scaledSupplyOnPool: parseUnits("3567", 18),
walletBalance: parseUnits("7356756", 18),
approval: constants.Zero,
permit2Approval: constants.MaxUint256,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
[Underlying.usdc]: {
underlyingAddress: Underlying.usdc,
scaledBorrowInP2P: parseUnits("0", 6),
scaledBorrowOnPool: parseUnits("42343", 6),
scaledCollateral: parseUnits("243032", 6),
scaledSupplyInP2P: parseUnits("0", 6),
scaledSupplyOnPool: parseUnits("0", 6),
walletBalance: parseUnits("42134241", 6),
approval: constants.MaxUint256,
permit2Approval: constants.Zero,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
[Underlying.wbtc]: {
underlyingAddress: Underlying.wbtc,
scaledBorrowInP2P: parseUnits("0", 8),
scaledBorrowOnPool: parseUnits("0", 8),
scaledCollateral: parseUnits("4.32", 8),
scaledSupplyInP2P: parseUnits("1.2", 8),
scaledSupplyOnPool: parseUnits("2", 8),
walletBalance: parseUnits("123", 8),
approval: constants.MaxUint256,
permit2Approval: constants.Zero,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
[Underlying.uni]: {
underlyingAddress: Underlying.uni,
scaledBorrowInP2P: parseUnits("0", 18),
scaledBorrowOnPool: parseUnits("4320", 18),
scaledCollateral: parseUnits("46732", 18),
scaledSupplyInP2P: parseUnits("576", 18),
scaledSupplyOnPool: parseUnits("0", 18),
walletBalance: parseUnits("12686743", 18),
approval: constants.MaxUint256,
permit2Approval: constants.Zero,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
[Underlying.usdt]: {
underlyingAddress: Underlying.usdt,
scaledBorrowInP2P: parseUnits("32424", 6),
scaledBorrowOnPool: parseUnits("0", 6),
scaledCollateral: constants.Zero,
scaledSupplyInP2P: parseUnits("0", 6),
scaledSupplyOnPool: parseUnits("0", 6),
walletBalance: parseUnits("12350435", 6),
approval: constants.MaxUint256,
permit2Approval: constants.Zero,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
[Underlying.weth]: {
underlyingAddress: Underlying.weth,
scaledBorrowInP2P: parseUnits("0", 18),
scaledBorrowOnPool: parseUnits("0", 18),
scaledCollateral: parseUnits("0", 18),
scaledSupplyInP2P: parseUnits("0", 18),
scaledSupplyOnPool: parseUnits("0", 18),
walletBalance: parseUnits("0", 18),
approval: constants.Zero,
permit2Approval: constants.Zero,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
[Underlying.wsteth]: {
underlyingAddress: Underlying.wsteth,
scaledBorrowInP2P: parseUnits("0", 18),
scaledBorrowOnPool: parseUnits("0", 18),
scaledCollateral: parseUnits("0", 18),
scaledSupplyInP2P: parseUnits("0", 18),
scaledSupplyOnPool: parseUnits("0", 18),
walletBalance: parseUnits("0", 18),
approval: constants.Zero,
permit2Approval: constants.Zero,
nonce: BigNumber.from(0),
bulkerNonce: BigNumber.from(0),
bulkerApproval: constants.Zero,
},
};
const ONE_WEEK = 24 * 3600 * 7; // in s
export const USER_REWARDS_DATA = {
data: {
age: {
name: "age0",
startTimestamp: Math.floor(Date.now() / 1000) - ONE_WEEK,
endTimestamp: Math.floor(Date.now() / 1000) + ONE_WEEK,
},
epoch: {
id: "0",
name: "epoch0",
startTimestamp: Math.floor(Date.now() / 1000) - ONE_WEEK,
endTimestamp: Math.floor(Date.now() / 1000) + ONE_WEEK,
snapshotBlock: 16997062,
},
transaction: {
proof: [],
amount: parseUnits("150000"),
},
},
balances: {
claimed: parseUnits("130000"),
claimable: parseUnits("250000"),
claimableSoon: parseUnits("100000"),
currentEpoch: parseUnits("304560"),
},
};
export const ADAPTER_MOCK_1: AdapterMock = {
marketsList: [
Underlying.dai,
Underlying.usdc,
Underlying.wbtc,
Underlying.uni,
Underlying.usdt,
Underlying.weth,
Underlying.wsteth,
],
userData: {
ethBalance: parseUnits("1023.423", 18),
stEthData: {
bulkerApproval: constants.Zero,
stethPerWsteth: constants.WeiPerEther,
permit2Approval: constants.MaxUint256,
balance: parseUnits("50"),
bulkerNonce: BigNumber.from(0),
wstEthApproval: constants.MaxUint256,
},
},
marketsConfigs: MARKETS_CONFIGS,
marketsData: MARKETS_DATA,
marketsSupply: MARKETS_SUPPLY_DATA,
userMarketsData: USER_MARKETS_DATA,
globalData: GLOBAL_DATA,
userRewardsData: USER_REWARDS_DATA,
marketsRewardsDistribution: MARKETS_REWARDS_DISTRIBUTION,
};