@defisaver/positions-sdk 0.0.201-fluid-dev-3 → 0.0.201-fluid-dev-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,8 +24,6 @@ export declare enum FluidMainnetVersion {
24
24
  WSTETH_USDC_4 = "WSTETH_USDC_4",
25
25
  WSTETH_USDT_5 = "WSTETH_USDT_5",
26
26
  WEETH_WSTETH_6 = "WEETH_WSTETH_6",
27
- SUSDE_USDC_7 = "SUSDE_USDC_7",
28
- SUSDE_USDT_8 = "SUSDE_USDT_8",
29
27
  WEETH_USDC_9 = "WEETH_USDC_9",
30
28
  WEETH_USDT_10 = "WEETH_USDT_10",
31
29
  ETH_USDC_11 = "ETH_USDC_11",
@@ -50,7 +48,6 @@ export declare enum FluidMainnetVersion {
50
48
  CBBTC_USDT_30 = "CBBTC_USDT_30",
51
49
  ETH_CBBTC_31 = "ETH_CBBTC_31",
52
50
  WEETH_CBBTC_32 = "WEETH_CBBTC_32",
53
- WSTETH_CBBTC_33 = "WSTETH_CBBTC_33",
54
51
  WSTETH_ETH_WSTETH_ETH_44 = "WSTETH_ETH_WSTETH_ETH_44",
55
52
  ETH_USDC_USDT_45 = "ETH_USDC_USDT_45",
56
53
  WSTETH_USDC_USDT_46 = "WSTETH_USDC_USDT_46",
@@ -66,8 +63,6 @@ export declare enum FluidMainnetVersion {
66
63
  SUSDE_GHO_56 = "SUSDE_GHO_56",
67
64
  WEETH_GHO_57 = "WEETH_GHO_57",
68
65
  SUSDS_GHO_58 = "SUSDS_GHO_58",
69
- WBTC_GHO_59 = "WBTC_GHO_59",
70
- CBBTC_GHO_60 = "CBBTC_GHO_60",
71
66
  GHO_USDC_GHO_USDC_61 = "GHO_USDC_GHO_USDC_61",
72
67
  WEETH_ETH_WSTETH_74 = "WEETH_ETH_WSTETH_74",
73
68
  USDC_ETH_USDC_ETH_77 = "USDC_ETH_USDC_ETH_77",
@@ -120,10 +115,7 @@ export declare enum FluidBaseVersions {
120
115
  CBBTC_ETH_13_BASE = "CBBTC_ETH_13_BASE",
121
116
  ETH_CBBTC_14_BASE = "ETH_CBBTC_14_BASE",
122
117
  WEETH_CBBTC_15_BASE = "WEETH_CBBTC_15_BASE",
123
- WSTETH_CBBTC_16_BASE = "WSTETH_CBBTC_16_BASE",
124
- ETH_SUSDS_17_BASE = "ETH_SUSDS_17_BASE",
125
- WSTETH_SUSDS_18_BASE = "WSTETH_SUSDS_18_BASE",
126
- CBBTC_SUSDS_19_BASE = "CBBTC_SUSDS_19_BASE"
118
+ WSTETH_CBBTC_16_BASE = "WSTETH_CBBTC_16_BASE"
127
119
  }
128
120
  export type FluidVersions = FluidArbitrumVersion | FluidBaseVersions | FluidMainnetVersion;
129
121
  export declare enum FluidMainnetDepositToken {
@@ -131,7 +123,8 @@ export declare enum FluidMainnetDepositToken {
131
123
  wstETH = "wstETH",
132
124
  USDC = "USDC",
133
125
  USDT = "USDT",
134
- GHO = "GHO"
126
+ GHO = "GHO",
127
+ sUSDS = "sUSDS"
135
128
  }
136
129
  export declare enum FluidArbitrumDepositToken {
137
130
  ETH = "ETH",
@@ -144,7 +137,8 @@ export declare enum FluidBaseDepositToken {
144
137
  ETH = "ETH",
145
138
  USDC = "USDC",
146
139
  wstETH = "wstETH",
147
- EURC = "EURC"
140
+ EURC = "EURC",
141
+ sUSDS = "sUSDS"
148
142
  }
149
143
  export type FluidDepositTokenByNetwork = {
150
144
  [NetworkNumber.Eth]: FluidMainnetDepositToken;
@@ -10,8 +10,6 @@ var FluidMainnetVersion;
10
10
  FluidMainnetVersion["WSTETH_USDC_4"] = "WSTETH_USDC_4";
11
11
  FluidMainnetVersion["WSTETH_USDT_5"] = "WSTETH_USDT_5";
12
12
  FluidMainnetVersion["WEETH_WSTETH_6"] = "WEETH_WSTETH_6";
13
- FluidMainnetVersion["SUSDE_USDC_7"] = "SUSDE_USDC_7";
14
- FluidMainnetVersion["SUSDE_USDT_8"] = "SUSDE_USDT_8";
15
13
  FluidMainnetVersion["WEETH_USDC_9"] = "WEETH_USDC_9";
16
14
  FluidMainnetVersion["WEETH_USDT_10"] = "WEETH_USDT_10";
17
15
  FluidMainnetVersion["ETH_USDC_11"] = "ETH_USDC_11";
@@ -36,7 +34,6 @@ var FluidMainnetVersion;
36
34
  FluidMainnetVersion["CBBTC_USDT_30"] = "CBBTC_USDT_30";
37
35
  FluidMainnetVersion["ETH_CBBTC_31"] = "ETH_CBBTC_31";
38
36
  FluidMainnetVersion["WEETH_CBBTC_32"] = "WEETH_CBBTC_32";
39
- FluidMainnetVersion["WSTETH_CBBTC_33"] = "WSTETH_CBBTC_33";
40
37
  FluidMainnetVersion["WSTETH_ETH_WSTETH_ETH_44"] = "WSTETH_ETH_WSTETH_ETH_44";
41
38
  FluidMainnetVersion["ETH_USDC_USDT_45"] = "ETH_USDC_USDT_45";
42
39
  FluidMainnetVersion["WSTETH_USDC_USDT_46"] = "WSTETH_USDC_USDT_46";
@@ -52,8 +49,6 @@ var FluidMainnetVersion;
52
49
  FluidMainnetVersion["SUSDE_GHO_56"] = "SUSDE_GHO_56";
53
50
  FluidMainnetVersion["WEETH_GHO_57"] = "WEETH_GHO_57";
54
51
  FluidMainnetVersion["SUSDS_GHO_58"] = "SUSDS_GHO_58";
55
- FluidMainnetVersion["WBTC_GHO_59"] = "WBTC_GHO_59";
56
- FluidMainnetVersion["CBBTC_GHO_60"] = "CBBTC_GHO_60";
57
52
  FluidMainnetVersion["GHO_USDC_GHO_USDC_61"] = "GHO_USDC_GHO_USDC_61";
58
53
  FluidMainnetVersion["WEETH_ETH_WSTETH_74"] = "WEETH_ETH_WSTETH_74";
59
54
  FluidMainnetVersion["USDC_ETH_USDC_ETH_77"] = "USDC_ETH_USDC_ETH_77";
@@ -109,9 +104,6 @@ var FluidBaseVersions;
109
104
  FluidBaseVersions["ETH_CBBTC_14_BASE"] = "ETH_CBBTC_14_BASE";
110
105
  FluidBaseVersions["WEETH_CBBTC_15_BASE"] = "WEETH_CBBTC_15_BASE";
111
106
  FluidBaseVersions["WSTETH_CBBTC_16_BASE"] = "WSTETH_CBBTC_16_BASE";
112
- FluidBaseVersions["ETH_SUSDS_17_BASE"] = "ETH_SUSDS_17_BASE";
113
- FluidBaseVersions["WSTETH_SUSDS_18_BASE"] = "WSTETH_SUSDS_18_BASE";
114
- FluidBaseVersions["CBBTC_SUSDS_19_BASE"] = "CBBTC_SUSDS_19_BASE";
115
107
  })(FluidBaseVersions || (exports.FluidBaseVersions = FluidBaseVersions = {}));
116
108
  var FluidMainnetDepositToken;
117
109
  (function (FluidMainnetDepositToken) {
@@ -120,6 +112,7 @@ var FluidMainnetDepositToken;
120
112
  FluidMainnetDepositToken["USDC"] = "USDC";
121
113
  FluidMainnetDepositToken["USDT"] = "USDT";
122
114
  FluidMainnetDepositToken["GHO"] = "GHO";
115
+ FluidMainnetDepositToken["sUSDS"] = "sUSDS";
123
116
  })(FluidMainnetDepositToken || (exports.FluidMainnetDepositToken = FluidMainnetDepositToken = {}));
124
117
  var FluidArbitrumDepositToken;
125
118
  (function (FluidArbitrumDepositToken) {
@@ -135,6 +128,7 @@ var FluidBaseDepositToken;
135
128
  FluidBaseDepositToken["USDC"] = "USDC";
136
129
  FluidBaseDepositToken["wstETH"] = "wstETH";
137
130
  FluidBaseDepositToken["EURC"] = "EURC";
131
+ FluidBaseDepositToken["sUSDS"] = "sUSDS";
138
132
  })(FluidBaseDepositToken || (exports.FluidBaseDepositToken = FluidBaseDepositToken = {}));
139
133
  var FluidVaultType;
140
134
  (function (FluidVaultType) {
@@ -6715,6 +6715,12 @@ export namespace ETHPriceFeed {
6715
6715
  "1": {
6716
6716
  address: string;
6717
6717
  };
6718
+ "8453": {
6719
+ address: string;
6720
+ };
6721
+ "42161": {
6722
+ address: string;
6723
+ };
6718
6724
  };
6719
6725
  export { networks_73 as networks };
6720
6726
  }
@@ -6799,6 +6805,12 @@ export namespace WstETHPriceFeed {
6799
6805
  "1": {
6800
6806
  address: string;
6801
6807
  };
6808
+ "8453": {
6809
+ address: string;
6810
+ };
6811
+ "42161": {
6812
+ address: string;
6813
+ };
6802
6814
  };
6803
6815
  export { networks_75 as networks };
6804
6816
  }
@@ -7283,6 +7295,9 @@ export namespace DFSFeedRegistry {
7283
7295
  "8453": {
7284
7296
  address: string;
7285
7297
  };
7298
+ "42161": {
7299
+ address: string;
7300
+ };
7286
7301
  };
7287
7302
  export { networks_78 as networks };
7288
7303
  }
@@ -1014,7 +1014,9 @@ module.exports = {
1014
1014
  "ETHPriceFeed": {
1015
1015
  "abi": [{ "inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }, { "internalType": "address", "name": "_accessController", "type": "address" }], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "int256", "name": "current", "type": "int256" }, { "indexed": true, "internalType": "uint256", "name": "roundId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "updatedAt", "type": "uint256" }], "name": "AnswerUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "roundId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "startedBy", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "startedAt", "type": "uint256" }], "name": "NewRound", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }], "name": "OwnershipTransferRequested", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "accessController", "outputs": [{ "internalType": "contract AccessControllerInterface", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "aggregator", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }], "name": "confirmAggregator", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "description", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_roundId", "type": "uint256" }], "name": "getAnswer", "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "getRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_roundId", "type": "uint256" }], "name": "getTimestamp", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "latestAnswer", "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "latestRound", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "latestRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "latestTimestamp", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "name": "phaseAggregators", "outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "phaseId", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_aggregator", "type": "address" }], "name": "proposeAggregator", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proposedAggregator", "outputs": [{ "internalType": "contract AggregatorV2V3Interface", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint80", "name": "_roundId", "type": "uint80" }], "name": "proposedGetRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proposedLatestRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_accessController", "type": "address" }], "name": "setController", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_to", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "version", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }],
1016
1016
  "networks": {
1017
- "1": { "address": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" }
1017
+ "1": { "address": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419" },
1018
+ "8453": { "address": "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70" },
1019
+ "42161": { "address": "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612" }
1018
1020
  },
1019
1021
  },
1020
1022
  "USDCPriceFeed": {
@@ -1026,7 +1028,9 @@ module.exports = {
1026
1028
  "WstETHPriceFeed": {
1027
1029
  "abi": [{ "inputs": [{ "internalType": "address", "name": "stETHtoETHPriceFeed_", "type": "address" }, { "internalType": "address", "name": "wstETH_", "type": "address" }, { "internalType": "uint8", "name": "decimals_", "type": "uint8" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "BadDecimals", "type": "error" }, { "inputs": [], "name": "InvalidInt256", "type": "error" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "description", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "latestRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "stETHToETHPriceFeedDecimals", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "stETHtoETHPriceFeed", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "version", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "wstETH", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "wstETHScale", "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], "stateMutability": "view", "type": "function" }],
1028
1030
  "networks": {
1029
- "1": { "address": "0x4F67e4d9BD67eFa28236013288737D39AeF48e79" }
1031
+ "1": { "address": "0x4F67e4d9BD67eFa28236013288737D39AeF48e79" },
1032
+ "8453": { "address": "0x43a5C292A453A3bF3606fa856197f09D7B74251a" },
1033
+ "42161": { "address": "0xb523AE262D20A936BC152e6023996e46FDC2A95D" }
1030
1034
  }
1031
1035
  },
1032
1036
  "MorphoBlueView": {
@@ -1072,6 +1076,7 @@ module.exports = {
1072
1076
  "abi": [{ "inputs": [], "name": "NonContractCall", "type": "error" }, { "inputs": [], "name": "SenderNotAdmin", "type": "error" }, { "inputs": [], "name": "SenderNotOwner", "type": "error" }, { "inputs": [], "name": "adminVault", "outputs": [{ "internalType": "contract AdminVault", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "aggregators", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "getFeed", "outputs": [{ "internalType": "address", "name": "aggregator", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "kill", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }], "name": "latestRoundData", "outputs": [{ "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "base", "type": "address" }, { "internalType": "address", "name": "quote", "type": "address" }, { "internalType": "address", "name": "aggregator", "type": "address" }], "name": "setFeed", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "bases", "type": "address[]" }, { "internalType": "address[]", "name": "quotes", "type": "address[]" }, { "internalType": "address[]", "name": "aggregator", "type": "address[]" }], "name": "setFeeds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "withdrawStuckFunds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }],
1073
1077
  "networks": {
1074
1078
  "8453": { "address": "0x7dFF34190d0307fC234fc7E8C152C9715083eB02" },
1079
+ "42161": { "address": "0x158E27De8B5E5bC3FA1C6D5b365a291c54f6b0Fd" }
1075
1080
  }
1076
1081
  },
1077
1082
  "LlamaLendView": {
@@ -37,3 +37,11 @@ export declare const getFluidPositionWithMarket: (web3: Web3, network: NetworkNu
37
37
  marketData: FluidMarketData;
38
38
  }>;
39
39
  export declare const getAllFluidMarketDataChunked: (network: NetworkNumber, web3: Web3) => Promise<FluidMarketData[]>;
40
+ export declare const getFluidTokenData: (web3: Web3, network: NetworkNumber, token: string) => Promise<{
41
+ fTokenAddress: any;
42
+ fTokenSymbol: string;
43
+ decimals: string;
44
+ totalDeposited: string;
45
+ withdrawable: string;
46
+ apy: string;
47
+ }>;
@@ -8,16 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import Dec from 'decimal.js';
11
- import { getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
11
+ import { assetAmountInEth, getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
12
12
  import { NetworkNumber } from '../types/common';
13
13
  import { FluidVaultType, } from '../types';
14
14
  import { DFSFeedRegistryContract, FeedRegistryContract, FluidViewContract } from '../contracts';
15
15
  import { getEthAmountForDecimals, isMainnetNetwork } from '../services/utils';
16
16
  import { getFluidAggregatedData } from '../helpers/fluidHelpers';
17
17
  import { chunkAndMulticall } from '../multicall';
18
- import { getFluidMarketInfoById, getFluidVersionsDataForNetwork } from '../markets';
18
+ import { getFluidMarketInfoById, getFluidVersionsDataForNetwork, getFTokenAddress } from '../markets';
19
19
  import { USD_QUOTE } from '../constants';
20
- import { getChainlinkAssetAddress, getWstETHPrice } from '../services/priceService';
20
+ import { getChainlinkAssetAddress, getWstETHPriceFluid } from '../services/priceService';
21
21
  export const EMPTY_USED_ASSET = {
22
22
  isSupplied: false,
23
23
  isBorrowed: false,
@@ -38,8 +38,8 @@ const parseVaultType = (vaultType) => {
38
38
  }
39
39
  };
40
40
  const parseMarketData = (web3, data, network) => __awaiter(void 0, void 0, void 0, function* () {
41
- const collAsset = getAssetInfoByAddress(data.supplyToken0);
42
- const debtAsset = getAssetInfoByAddress(data.borrowToken0);
41
+ const collAsset = getAssetInfoByAddress(data.supplyToken0, network);
42
+ const debtAsset = getAssetInfoByAddress(data.borrowToken0, network);
43
43
  const supplyRate = new Dec(data.supplyRateVault).div(100).toString();
44
44
  const borrowRate = new Dec(data.borrowRateVault).div(100).toString();
45
45
  const oracleScaleFactor = new Dec(27).add(debtAsset.decimals).sub(collAsset.decimals).toString();
@@ -51,7 +51,7 @@ const parseMarketData = (web3, data, network) => __awaiter(void 0, void 0, void
51
51
  let loanTokenPrice;
52
52
  if (debtAsset.symbol === 'wstETH') {
53
53
  // need to handle wstETH for l2s inside getWstETHPrice
54
- loanTokenPrice = yield getWstETHPrice(web3);
54
+ loanTokenPrice = yield getWstETHPriceFluid(web3, network);
55
55
  }
56
56
  else if (isMainnet) {
57
57
  const feedRegistryContract = FeedRegistryContract(web3, NetworkNumber.Eth);
@@ -203,5 +203,22 @@ export const getAllFluidMarketDataChunked = (network, web3) => __awaiter(void 0,
203
203
  params: [version.marketAddress],
204
204
  }));
205
205
  const data = yield chunkAndMulticall(calls, 10, 'latest', web3, network);
206
+ // @ts-ignore
206
207
  return Promise.all(data.map((item, i) => __awaiter(void 0, void 0, void 0, function* () { return parseMarketData(web3, item.vaultData, network); })));
207
208
  });
209
+ export const getFluidTokenData = (web3, network, token) => __awaiter(void 0, void 0, void 0, function* () {
210
+ const view = FluidViewContract(web3, network);
211
+ const fTokenAddress = getFTokenAddress(token, network);
212
+ const data = yield view.methods.getFTokenData(fTokenAddress).call();
213
+ const supplyRate = new Dec(data.supplyRate).div(100).toString();
214
+ const decimals = data.decimals;
215
+ const rewardsRate = new Dec(assetAmountInEth(data.rewardsRate)).div(100).toString();
216
+ return {
217
+ fTokenAddress,
218
+ fTokenSymbol: data.symbol,
219
+ decimals,
220
+ totalDeposited: getEthAmountForDecimals(data.totalAssets, decimals),
221
+ withdrawable: getEthAmountForDecimals(data.withdrawable, decimals),
222
+ apy: new Dec(supplyRate).add(rewardsRate).toString(),
223
+ };
224
+ });
@@ -94,9 +94,6 @@ export declare const CBBTC_ETH_13_BASE: (networkId?: NetworkNumber) => FluidMark
94
94
  export declare const ETH_CBBTC_14_BASE: (networkId?: NetworkNumber) => FluidMarketInfo;
95
95
  export declare const WEETH_CBBTC_15_BASE: (networkId?: NetworkNumber) => FluidMarketInfo;
96
96
  export declare const WSTETH_CBBTC_16_BASE: (networkId?: NetworkNumber) => FluidMarketInfo;
97
- export declare const ETH_SUSDS_17_BASE: (networkId?: NetworkNumber) => FluidMarketInfo;
98
- export declare const WSTETH_SUSDS_18_BASE: (networkId?: NetworkNumber) => FluidMarketInfo;
99
- export declare const CBBTC_SUSDS_19_BASE: (networkId?: NetworkNumber) => FluidMarketInfo;
100
97
  export declare const FluidMarkets: (networkId: NetworkNumber) => {
101
98
  ETH_USDC_1: FluidMarketInfo;
102
99
  ETH_USDT_2: FluidMarketInfo;
@@ -192,9 +189,27 @@ export declare const FluidMarkets: (networkId: NetworkNumber) => {
192
189
  ETH_CBBTC_14_BASE: FluidMarketInfo;
193
190
  WEETH_CBBTC_15_BASE: FluidMarketInfo;
194
191
  WSTETH_CBBTC_16_BASE: FluidMarketInfo;
195
- ETH_SUSDS_17_BASE: FluidMarketInfo;
196
- WSTETH_SUSDS_18_BASE: FluidMarketInfo;
197
- CBBTC_SUSDS_19_BASE: FluidMarketInfo;
198
192
  };
199
193
  export declare const getFluidVersionsDataForNetwork: (network: NetworkNumber) => FluidMarketInfo[];
200
194
  export declare const getFluidMarketInfoById: (vaultId: number, network?: NetworkNumber) => FluidMarketInfo | undefined;
195
+ export declare const FluidFTokens: (networkId: NetworkNumber) => {
196
+ ETH: string;
197
+ USDC: string;
198
+ USDT: string;
199
+ wstETH: string;
200
+ GHO: string;
201
+ sUSDS: string;
202
+ } | {
203
+ ETH: string;
204
+ USDC: string;
205
+ USDT: string;
206
+ wstETH: string;
207
+ ARB: string;
208
+ } | {
209
+ ETH: string;
210
+ USDC: string;
211
+ EURC: string;
212
+ wstETH: string;
213
+ sUSDS: string;
214
+ };
215
+ export declare const getFTokenAddress: (token: string, networkId: NetworkNumber) => any;