@reserve-protocol/dtf-sdk 0.1.1 → 0.1.2
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.
- package/dist/abi/distributor.d.ts +21 -0
- package/dist/abi/distributor.d.ts.map +1 -0
- package/dist/abi/facade-read.d.ts +140 -0
- package/dist/abi/facade-read.d.ts.map +1 -0
- package/dist/abi/main.d.ts +102 -0
- package/dist/abi/main.d.ts.map +1 -0
- package/dist/abi/st-rsr.d.ts +104 -0
- package/dist/abi/st-rsr.d.ts.map +1 -0
- package/dist/ccip-tn8s4j8m.js +14 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index-azrx1hqn.js +6105 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +498 -7
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/query-subgraph.d.ts +2 -1
- package/dist/utils/query-subgraph.d.ts.map +1 -1
- package/dist/yield-dtf/detect-dtf-type.d.ts +13 -0
- package/dist/yield-dtf/detect-dtf-type.d.ts.map +1 -0
- package/dist/yield-dtf/issue.d.ts +22 -0
- package/dist/yield-dtf/issue.d.ts.map +1 -0
- package/dist/yield-dtf/read-backing.d.ts +15 -0
- package/dist/yield-dtf/read-backing.d.ts.map +1 -0
- package/dist/yield-dtf/read-basket.d.ts +10 -0
- package/dist/yield-dtf/read-basket.d.ts.map +1 -0
- package/dist/yield-dtf/read-components.d.ts +8 -0
- package/dist/yield-dtf/read-components.d.ts.map +1 -0
- package/dist/yield-dtf/read-config.d.ts +8 -0
- package/dist/yield-dtf/read-config.d.ts.map +1 -0
- package/dist/yield-dtf/read-distribution.d.ts +8 -0
- package/dist/yield-dtf/read-distribution.d.ts.map +1 -0
- package/dist/yield-dtf/read-st-rsr.d.ts +7 -0
- package/dist/yield-dtf/read-st-rsr.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { SupportedChainId, PriceControl, RebalanceControl, BasketToken, GovernanceConfig, DtfOnchainConfig, DtfRoles, BasketInfo, DtfBasketAsset, DtfBasketResponse, DtfDiscoverItem, ProposalState, ComputedProposalState, ProposalInfo, ProposalActions, RebalanceInfo, AuctionInfo, Volatility, PriceRecord, TransactionRequest, VoteSupport, FeeRecipient, MintQuote, RedeemQuote, PendingFees, ProposalVotes, GovernanceSettings, VoteLockInfo, RebalanceHistoryItem, RebalanceDetail, HistoricalDtfPoint, HistoricalPricePoint, DeployBasicDetails, DeployAdditionalDetails, DeployFlags, DeployGovParams, DeployGovRoles, ZapQuoteParams, ZapQuote, ZapDeployBasicDetails, ZapDeployAdditionalDetails, ZapDeployFlags, ZapDeployGovParams, ZapDeployParams, ZapDeployResult, DecodedProposalAction, ProposalPreview, DtfAddressMap, VoteLockPosition, DtfRevenueRaw, DtfRevenueUsd, EcosystemRevenue, FeeMetrics, RevenueSnapshot, RsrBurnEvent, RsrBurnData, RsrBurnProjection, BurnAccuracy, } from './types';
|
|
1
|
+
export type { SupportedChainId, DtfType, PriceControl, RebalanceControl, BasketToken, GovernanceConfig, DtfOnchainConfig, DtfRoles, BasketInfo, DtfBasketAsset, DtfBasketResponse, DtfDiscoverItem, ProposalState, ComputedProposalState, ProposalInfo, ProposalActions, RebalanceInfo, AuctionInfo, Volatility, PriceRecord, TransactionRequest, VoteSupport, FeeRecipient, MintQuote, RedeemQuote, PendingFees, ProposalVotes, GovernanceSettings, VoteLockInfo, RebalanceHistoryItem, RebalanceDetail, HistoricalDtfPoint, HistoricalPricePoint, DeployBasicDetails, DeployAdditionalDetails, DeployFlags, DeployGovParams, DeployGovRoles, ZapQuoteParams, ZapQuote, ZapDeployBasicDetails, ZapDeployAdditionalDetails, ZapDeployFlags, ZapDeployGovParams, ZapDeployParams, ZapDeployResult, DecodedProposalAction, ProposalPreview, DtfAddressMap, VoteLockPosition, DtfRevenueRaw, DtfRevenueUsd, EcosystemRevenue, FeeMetrics, RevenueSnapshot, RsrBurnEvent, RsrBurnData, RsrBurnProjection, BurnAccuracy, YieldDtfComponents, YieldDtfBasketToken, BackingOverview, StRSRInfo, YieldDtfRevenueInfo, YieldDtfConfig, } from './types';
|
|
2
2
|
export { createDtfClients, type CreateClientsOptions, type DtfClients, } from './clients/create-clients';
|
|
3
3
|
export { createPriceClient } from './clients/create-price-client';
|
|
4
4
|
export { fetchDtfConfig } from './dtf/read-config';
|
|
@@ -10,6 +10,14 @@ export { readDtfRoles } from './dtf/read-roles';
|
|
|
10
10
|
export { readDtfVersion } from './dtf/read-version';
|
|
11
11
|
export { readTotalSupply, readBalanceOf, readName, readSymbol, } from './dtf/read-dtf';
|
|
12
12
|
export { fetchDtfPrice, fetchZapQuote, fetchVoteLockPositions } from './dtf/fetch-dtf';
|
|
13
|
+
export { detectDtfType } from './yield-dtf/detect-dtf-type';
|
|
14
|
+
export { readYieldDtfComponents } from './yield-dtf/read-components';
|
|
15
|
+
export { readYieldDtfBasket } from './yield-dtf/read-basket';
|
|
16
|
+
export { readBackingOverview, readYieldDtfPrice } from './yield-dtf/read-backing';
|
|
17
|
+
export { readStRSRInfo } from './yield-dtf/read-st-rsr';
|
|
18
|
+
export { readDistribution } from './yield-dtf/read-distribution';
|
|
19
|
+
export { fetchYieldDtfConfig } from './yield-dtf/read-config';
|
|
20
|
+
export { readIssueQuote as readYieldIssueQuote, readRedeemQuote as readYieldRedeemQuote, type YieldIssueQuote, type YieldRedeemQuote, } from './yield-dtf/issue';
|
|
13
21
|
export { readMintQuote, readMintFee, buildMintCalldata, buildApproveCalldata, readAllowances, applySlippage, } from './dtf/mint';
|
|
14
22
|
export { readRedeemQuote, buildRedeemCalldata } from './dtf/redeem';
|
|
15
23
|
export { readPendingFees, readFeeRecipients, parseFeeRecipients, buildDistributeFeesCalldata, buildSetMintFeeCalldata, buildSetTvlFeeCalldata, buildSetFeeRecipientsCalldata, } from './dtf/fees';
|
|
@@ -44,7 +52,7 @@ export { fetchWithRetry, type FetchWithRetryOptions } from './utils/fetch-with-r
|
|
|
44
52
|
export { fetchTokenMetadata } from './utils/fetch-token-metadata';
|
|
45
53
|
export { validatePriceControl } from './utils/validate-price-control';
|
|
46
54
|
export { querySubgraph } from './utils/query-subgraph';
|
|
47
|
-
export { SUBGRAPH_URLS, SUPPORTED_CHAINS, CHAINLINK_BTC_USD, CHAINLINK_RSR_USD, CHAINLINK_DECIMALS, STALE_PRICE_THRESHOLD_S, RESERVE_API_BASE_URL, AUCTION_LAUNCHER_WINDOW, REBALANCE_TTL, PRICE_CONTROL, FOLIO_ROLES, VOLATILITY_TO_PRICE_ERROR, PROPOSAL_VOLATILITY_TO_PRICE_ERROR, PROPOSAL_STATE_MAP, D18, SMALL_AUCTION_THRESHOLD_L1, SMALL_AUCTION_THRESHOLD_L2, DEPLOYER_ADDRESS, GOVERNANCE_DEPLOYER_ADDRESS, V5_SPELL_ADDRESS, V4_SPELL_ADDRESS, GOVERNANCE_SPELL_ADDRESS, ROLE_NAMES, } from './constants';
|
|
55
|
+
export { SUBGRAPH_URLS, YIELD_SUBGRAPH_URLS, FACADE_READ_ADDRESS, SUPPORTED_CHAINS, CHAINLINK_BTC_USD, CHAINLINK_RSR_USD, CHAINLINK_DECIMALS, STALE_PRICE_THRESHOLD_S, RESERVE_API_BASE_URL, AUCTION_LAUNCHER_WINDOW, REBALANCE_TTL, PRICE_CONTROL, FOLIO_ROLES, VOLATILITY_TO_PRICE_ERROR, PROPOSAL_VOLATILITY_TO_PRICE_ERROR, PROPOSAL_STATE_MAP, D18, SMALL_AUCTION_THRESHOLD_L1, SMALL_AUCTION_THRESHOLD_L2, DEPLOYER_ADDRESS, GOVERNANCE_DEPLOYER_ADDRESS, V5_SPELL_ADDRESS, V4_SPELL_ADDRESS, GOVERNANCE_SPELL_ADDRESS, ROLE_NAMES, } from './constants';
|
|
48
56
|
export { default as folioAbi } from './abi/folio';
|
|
49
57
|
export { default as governorAbi } from './abi/governor';
|
|
50
58
|
export { default as timelockAbi } from './abi/timelock';
|
|
@@ -54,4 +62,8 @@ export { default as deployerAbi } from './abi/deployer';
|
|
|
54
62
|
export { default as governanceDeployerAbi } from './abi/governance-deployer';
|
|
55
63
|
export { default as proxyAdminAbi } from './abi/proxy-admin';
|
|
56
64
|
export { v5SpellAbi, v4SpellAbi, governanceSpellAbi } from './abi/spells';
|
|
65
|
+
export { facadeReadAbi } from './abi/facade-read';
|
|
66
|
+
export { mainAbi } from './abi/main';
|
|
67
|
+
export { stRSRAbi } from './abi/st-rsr';
|
|
68
|
+
export { distributorAbi } from './abi/distributor';
|
|
57
69
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,QAAQ,EACR,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,QAAQ,EACR,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,cAAc,GACf,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,UAAU,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM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,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -114,6 +114,7 @@ import {
|
|
|
114
114
|
hexToBool,
|
|
115
115
|
hexToBytes,
|
|
116
116
|
hexToNumber,
|
|
117
|
+
hexToString,
|
|
117
118
|
integerRegex,
|
|
118
119
|
isAddress,
|
|
119
120
|
isAddressEqual,
|
|
@@ -161,7 +162,7 @@ import {
|
|
|
161
162
|
validate,
|
|
162
163
|
validate1 as validate2,
|
|
163
164
|
withResolvers
|
|
164
|
-
} from "./index-
|
|
165
|
+
} from "./index-azrx1hqn.js";
|
|
165
166
|
import"./index-wjqsw4fc.js";
|
|
166
167
|
import {
|
|
167
168
|
__commonJS,
|
|
@@ -10967,6 +10968,14 @@ var SUBGRAPH_URLS = {
|
|
|
10967
10968
|
56: "https://api.goldsky.com/api/public/project_cmgzim3e100095np2gjnbh6ry/subgraphs/dtf-index-bsc/prod/gn",
|
|
10968
10969
|
8453: "https://api.goldsky.com/api/public/project_cmgzim3e100095np2gjnbh6ry/subgraphs/dtf-index-base/prod/gn"
|
|
10969
10970
|
};
|
|
10971
|
+
var YIELD_SUBGRAPH_URLS = {
|
|
10972
|
+
1: "https://api.goldsky.com/api/public/project_cmgzim3e100095np2gjnbh6ry/subgraphs/dtf-yield-mainnet/4.2.0-v2/gn",
|
|
10973
|
+
8453: "https://api.goldsky.com/api/public/project_cmgzim3e100095np2gjnbh6ry/subgraphs/dtf-yield-base/4.2.0-v2/gn"
|
|
10974
|
+
};
|
|
10975
|
+
var FACADE_READ_ADDRESS = {
|
|
10976
|
+
1: "0x2C7ca56342177343A2954C250702Fd464f4d0613",
|
|
10977
|
+
8453: "0xeb2071e9b542555e90e6e4e1f83fa17423583991"
|
|
10978
|
+
};
|
|
10970
10979
|
var SUPPORTED_CHAINS = [1, 56, 8453];
|
|
10971
10980
|
var CHAINLINK_BTC_USD = "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c";
|
|
10972
10981
|
var CHAINLINK_RSR_USD = "0x759bBC1be8F90eE6457C44abc7d443842a976d02";
|
|
@@ -11080,11 +11089,11 @@ async function fetchWithRetry(url, init, opts) {
|
|
|
11080
11089
|
}
|
|
11081
11090
|
|
|
11082
11091
|
// src/utils/query-subgraph.ts
|
|
11083
|
-
async function querySubgraph(chainId, query, variables = {}) {
|
|
11084
|
-
const
|
|
11085
|
-
if (!
|
|
11092
|
+
async function querySubgraph(chainId, query, variables = {}, url) {
|
|
11093
|
+
const endpoint = url ?? SUBGRAPH_URLS[chainId];
|
|
11094
|
+
if (!endpoint)
|
|
11086
11095
|
throw new Error(`No subgraph URL for chainId ${chainId}`);
|
|
11087
|
-
const response = await fetchWithRetry(
|
|
11096
|
+
const response = await fetchWithRetry(endpoint, {
|
|
11088
11097
|
method: "POST",
|
|
11089
11098
|
headers: { "Content-Type": "application/json" },
|
|
11090
11099
|
body: JSON.stringify({ query, variables })
|
|
@@ -12762,6 +12771,472 @@ async function fetchVoteLockPositions(baseUrl = RESERVE_API_BASE_URL) {
|
|
|
12762
12771
|
}
|
|
12763
12772
|
return await response.json();
|
|
12764
12773
|
}
|
|
12774
|
+
// src/abi/st-rsr.ts
|
|
12775
|
+
var stRSRAbi = [
|
|
12776
|
+
{
|
|
12777
|
+
inputs: [],
|
|
12778
|
+
name: "exchangeRate",
|
|
12779
|
+
outputs: [{ internalType: "uint192", name: "", type: "uint192" }],
|
|
12780
|
+
stateMutability: "view",
|
|
12781
|
+
type: "function"
|
|
12782
|
+
},
|
|
12783
|
+
{
|
|
12784
|
+
inputs: [],
|
|
12785
|
+
name: "totalSupply",
|
|
12786
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
12787
|
+
stateMutability: "view",
|
|
12788
|
+
type: "function"
|
|
12789
|
+
},
|
|
12790
|
+
{
|
|
12791
|
+
inputs: [],
|
|
12792
|
+
name: "unstakingDelay",
|
|
12793
|
+
outputs: [{ internalType: "uint48", name: "", type: "uint48" }],
|
|
12794
|
+
stateMutability: "view",
|
|
12795
|
+
type: "function"
|
|
12796
|
+
},
|
|
12797
|
+
{
|
|
12798
|
+
inputs: [
|
|
12799
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
12800
|
+
],
|
|
12801
|
+
name: "balanceOf",
|
|
12802
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
12803
|
+
stateMutability: "view",
|
|
12804
|
+
type: "function"
|
|
12805
|
+
},
|
|
12806
|
+
{
|
|
12807
|
+
inputs: [],
|
|
12808
|
+
name: "main",
|
|
12809
|
+
outputs: [{ internalType: "contract IMain", name: "", type: "address" }],
|
|
12810
|
+
stateMutability: "view",
|
|
12811
|
+
type: "function"
|
|
12812
|
+
},
|
|
12813
|
+
{
|
|
12814
|
+
inputs: [],
|
|
12815
|
+
name: "name",
|
|
12816
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
12817
|
+
stateMutability: "view",
|
|
12818
|
+
type: "function"
|
|
12819
|
+
},
|
|
12820
|
+
{
|
|
12821
|
+
inputs: [],
|
|
12822
|
+
name: "symbol",
|
|
12823
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
12824
|
+
stateMutability: "view",
|
|
12825
|
+
type: "function"
|
|
12826
|
+
},
|
|
12827
|
+
{
|
|
12828
|
+
inputs: [
|
|
12829
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
12830
|
+
],
|
|
12831
|
+
name: "delegates",
|
|
12832
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
12833
|
+
stateMutability: "view",
|
|
12834
|
+
type: "function"
|
|
12835
|
+
},
|
|
12836
|
+
{
|
|
12837
|
+
inputs: [
|
|
12838
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
12839
|
+
],
|
|
12840
|
+
name: "getVotes",
|
|
12841
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
12842
|
+
stateMutability: "view",
|
|
12843
|
+
type: "function"
|
|
12844
|
+
}
|
|
12845
|
+
];
|
|
12846
|
+
|
|
12847
|
+
// src/abi/main.ts
|
|
12848
|
+
var mainAbi = [
|
|
12849
|
+
{
|
|
12850
|
+
inputs: [],
|
|
12851
|
+
name: "rToken",
|
|
12852
|
+
outputs: [{ internalType: "contract IRToken", name: "", type: "address" }],
|
|
12853
|
+
stateMutability: "view",
|
|
12854
|
+
type: "function"
|
|
12855
|
+
},
|
|
12856
|
+
{
|
|
12857
|
+
inputs: [],
|
|
12858
|
+
name: "stRSR",
|
|
12859
|
+
outputs: [{ internalType: "contract IStRSR", name: "", type: "address" }],
|
|
12860
|
+
stateMutability: "view",
|
|
12861
|
+
type: "function"
|
|
12862
|
+
},
|
|
12863
|
+
{
|
|
12864
|
+
inputs: [],
|
|
12865
|
+
name: "assetRegistry",
|
|
12866
|
+
outputs: [{ internalType: "contract IAssetRegistry", name: "", type: "address" }],
|
|
12867
|
+
stateMutability: "view",
|
|
12868
|
+
type: "function"
|
|
12869
|
+
},
|
|
12870
|
+
{
|
|
12871
|
+
inputs: [],
|
|
12872
|
+
name: "basketHandler",
|
|
12873
|
+
outputs: [{ internalType: "contract IBasketHandler", name: "", type: "address" }],
|
|
12874
|
+
stateMutability: "view",
|
|
12875
|
+
type: "function"
|
|
12876
|
+
},
|
|
12877
|
+
{
|
|
12878
|
+
inputs: [],
|
|
12879
|
+
name: "backingManager",
|
|
12880
|
+
outputs: [{ internalType: "contract IBackingManager", name: "", type: "address" }],
|
|
12881
|
+
stateMutability: "view",
|
|
12882
|
+
type: "function"
|
|
12883
|
+
},
|
|
12884
|
+
{
|
|
12885
|
+
inputs: [],
|
|
12886
|
+
name: "distributor",
|
|
12887
|
+
outputs: [{ internalType: "contract IDistributor", name: "", type: "address" }],
|
|
12888
|
+
stateMutability: "view",
|
|
12889
|
+
type: "function"
|
|
12890
|
+
},
|
|
12891
|
+
{
|
|
12892
|
+
inputs: [],
|
|
12893
|
+
name: "furnace",
|
|
12894
|
+
outputs: [{ internalType: "contract IFurnace", name: "", type: "address" }],
|
|
12895
|
+
stateMutability: "view",
|
|
12896
|
+
type: "function"
|
|
12897
|
+
},
|
|
12898
|
+
{
|
|
12899
|
+
inputs: [],
|
|
12900
|
+
name: "broker",
|
|
12901
|
+
outputs: [{ internalType: "contract IBroker", name: "", type: "address" }],
|
|
12902
|
+
stateMutability: "view",
|
|
12903
|
+
type: "function"
|
|
12904
|
+
},
|
|
12905
|
+
{
|
|
12906
|
+
inputs: [],
|
|
12907
|
+
name: "rsrTrader",
|
|
12908
|
+
outputs: [{ internalType: "contract IRevenueTrader", name: "", type: "address" }],
|
|
12909
|
+
stateMutability: "view",
|
|
12910
|
+
type: "function"
|
|
12911
|
+
},
|
|
12912
|
+
{
|
|
12913
|
+
inputs: [],
|
|
12914
|
+
name: "rTokenTrader",
|
|
12915
|
+
outputs: [{ internalType: "contract IRevenueTrader", name: "", type: "address" }],
|
|
12916
|
+
stateMutability: "view",
|
|
12917
|
+
type: "function"
|
|
12918
|
+
}
|
|
12919
|
+
];
|
|
12920
|
+
|
|
12921
|
+
// src/yield-dtf/detect-dtf-type.ts
|
|
12922
|
+
async function detectDtfType(publicClient, address) {
|
|
12923
|
+
try {
|
|
12924
|
+
const mainAddress = await publicClient.readContract({
|
|
12925
|
+
address,
|
|
12926
|
+
abi: stRSRAbi,
|
|
12927
|
+
functionName: "main"
|
|
12928
|
+
});
|
|
12929
|
+
const rTokenAddress = await publicClient.readContract({
|
|
12930
|
+
address: mainAddress,
|
|
12931
|
+
abi: mainAbi,
|
|
12932
|
+
functionName: "rToken"
|
|
12933
|
+
});
|
|
12934
|
+
if (rTokenAddress.toLowerCase() === address.toLowerCase()) {
|
|
12935
|
+
return "yield";
|
|
12936
|
+
}
|
|
12937
|
+
return "index";
|
|
12938
|
+
} catch {
|
|
12939
|
+
return "index";
|
|
12940
|
+
}
|
|
12941
|
+
}
|
|
12942
|
+
// src/yield-dtf/read-components.ts
|
|
12943
|
+
async function readYieldDtfComponents(publicClient, rTokenAddress) {
|
|
12944
|
+
const mainAddress = await publicClient.readContract({
|
|
12945
|
+
address: rTokenAddress,
|
|
12946
|
+
abi: stRSRAbi,
|
|
12947
|
+
functionName: "main"
|
|
12948
|
+
});
|
|
12949
|
+
const results = await publicClient.multicall({
|
|
12950
|
+
contracts: [
|
|
12951
|
+
{ address: mainAddress, abi: mainAbi, functionName: "rToken" },
|
|
12952
|
+
{ address: mainAddress, abi: mainAbi, functionName: "stRSR" },
|
|
12953
|
+
{ address: mainAddress, abi: mainAbi, functionName: "assetRegistry" },
|
|
12954
|
+
{ address: mainAddress, abi: mainAbi, functionName: "basketHandler" },
|
|
12955
|
+
{ address: mainAddress, abi: mainAbi, functionName: "backingManager" },
|
|
12956
|
+
{ address: mainAddress, abi: mainAbi, functionName: "distributor" },
|
|
12957
|
+
{ address: mainAddress, abi: mainAbi, functionName: "furnace" },
|
|
12958
|
+
{ address: mainAddress, abi: mainAbi, functionName: "broker" },
|
|
12959
|
+
{ address: mainAddress, abi: mainAbi, functionName: "rsrTrader" },
|
|
12960
|
+
{ address: mainAddress, abi: mainAbi, functionName: "rTokenTrader" }
|
|
12961
|
+
],
|
|
12962
|
+
allowFailure: false
|
|
12963
|
+
});
|
|
12964
|
+
return {
|
|
12965
|
+
main: mainAddress,
|
|
12966
|
+
rToken: results[0],
|
|
12967
|
+
stRSR: results[1],
|
|
12968
|
+
assetRegistry: results[2],
|
|
12969
|
+
basketHandler: results[3],
|
|
12970
|
+
backingManager: results[4],
|
|
12971
|
+
distributor: results[5],
|
|
12972
|
+
furnace: results[6],
|
|
12973
|
+
broker: results[7],
|
|
12974
|
+
rsrTrader: results[8],
|
|
12975
|
+
rTokenTrader: results[9]
|
|
12976
|
+
};
|
|
12977
|
+
}
|
|
12978
|
+
// src/abi/facade-read.ts
|
|
12979
|
+
var facadeReadAbi = [
|
|
12980
|
+
{
|
|
12981
|
+
inputs: [
|
|
12982
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" }
|
|
12983
|
+
],
|
|
12984
|
+
name: "backingOverview",
|
|
12985
|
+
outputs: [
|
|
12986
|
+
{ internalType: "uint192", name: "backing", type: "uint192" },
|
|
12987
|
+
{ internalType: "uint192", name: "overCollateralization", type: "uint192" }
|
|
12988
|
+
],
|
|
12989
|
+
stateMutability: "view",
|
|
12990
|
+
type: "function"
|
|
12991
|
+
},
|
|
12992
|
+
{
|
|
12993
|
+
inputs: [
|
|
12994
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" }
|
|
12995
|
+
],
|
|
12996
|
+
name: "basketBreakdown",
|
|
12997
|
+
outputs: [
|
|
12998
|
+
{ internalType: "address[]", name: "erc20s", type: "address[]" },
|
|
12999
|
+
{ internalType: "uint192[]", name: "uoaShares", type: "uint192[]" },
|
|
13000
|
+
{ internalType: "bytes32[]", name: "targets", type: "bytes32[]" }
|
|
13001
|
+
],
|
|
13002
|
+
stateMutability: "nonpayable",
|
|
13003
|
+
type: "function"
|
|
13004
|
+
},
|
|
13005
|
+
{
|
|
13006
|
+
inputs: [
|
|
13007
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" }
|
|
13008
|
+
],
|
|
13009
|
+
name: "basketTokens",
|
|
13010
|
+
outputs: [
|
|
13011
|
+
{ internalType: "address[]", name: "tokens", type: "address[]" }
|
|
13012
|
+
],
|
|
13013
|
+
stateMutability: "view",
|
|
13014
|
+
type: "function"
|
|
13015
|
+
},
|
|
13016
|
+
{
|
|
13017
|
+
inputs: [
|
|
13018
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" },
|
|
13019
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
|
13020
|
+
],
|
|
13021
|
+
name: "issue",
|
|
13022
|
+
outputs: [
|
|
13023
|
+
{ internalType: "address[]", name: "tokens", type: "address[]" },
|
|
13024
|
+
{ internalType: "uint256[]", name: "deposits", type: "uint256[]" },
|
|
13025
|
+
{ internalType: "uint192[]", name: "depositsUoA", type: "uint192[]" }
|
|
13026
|
+
],
|
|
13027
|
+
stateMutability: "nonpayable",
|
|
13028
|
+
type: "function"
|
|
13029
|
+
},
|
|
13030
|
+
{
|
|
13031
|
+
inputs: [
|
|
13032
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" }
|
|
13033
|
+
],
|
|
13034
|
+
name: "price",
|
|
13035
|
+
outputs: [
|
|
13036
|
+
{ internalType: "uint192", name: "low", type: "uint192" },
|
|
13037
|
+
{ internalType: "uint192", name: "high", type: "uint192" }
|
|
13038
|
+
],
|
|
13039
|
+
stateMutability: "view",
|
|
13040
|
+
type: "function"
|
|
13041
|
+
},
|
|
13042
|
+
{
|
|
13043
|
+
inputs: [
|
|
13044
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" },
|
|
13045
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
|
13046
|
+
],
|
|
13047
|
+
name: "redeem",
|
|
13048
|
+
outputs: [
|
|
13049
|
+
{ internalType: "address[]", name: "tokens", type: "address[]" },
|
|
13050
|
+
{ internalType: "uint256[]", name: "withdrawals", type: "uint256[]" },
|
|
13051
|
+
{ internalType: "uint256[]", name: "available", type: "uint256[]" }
|
|
13052
|
+
],
|
|
13053
|
+
stateMutability: "nonpayable",
|
|
13054
|
+
type: "function"
|
|
13055
|
+
},
|
|
13056
|
+
{
|
|
13057
|
+
inputs: [
|
|
13058
|
+
{ internalType: "contract IRToken", name: "rToken", type: "address" }
|
|
13059
|
+
],
|
|
13060
|
+
name: "stToken",
|
|
13061
|
+
outputs: [
|
|
13062
|
+
{ internalType: "contract IStRSR", name: "stTokenAddress", type: "address" }
|
|
13063
|
+
],
|
|
13064
|
+
stateMutability: "view",
|
|
13065
|
+
type: "function"
|
|
13066
|
+
}
|
|
13067
|
+
];
|
|
13068
|
+
|
|
13069
|
+
// src/yield-dtf/read-basket.ts
|
|
13070
|
+
async function readYieldDtfBasket(publicClient, facadeAddress, rTokenAddress) {
|
|
13071
|
+
const result = await publicClient.readContract({
|
|
13072
|
+
address: facadeAddress,
|
|
13073
|
+
abi: facadeReadAbi,
|
|
13074
|
+
functionName: "basketBreakdown",
|
|
13075
|
+
args: [rTokenAddress]
|
|
13076
|
+
});
|
|
13077
|
+
const [erc20s, uoaShares, targets] = result;
|
|
13078
|
+
const tokenMeta = await fetchTokenMetadata(publicClient, erc20s);
|
|
13079
|
+
return tokenMeta.map((token, i) => ({
|
|
13080
|
+
address: token.address,
|
|
13081
|
+
symbol: token.symbol,
|
|
13082
|
+
decimals: token.decimals,
|
|
13083
|
+
targetUnit: decodeBytes32(targets[i]),
|
|
13084
|
+
uoaShare: uoaShares[i]
|
|
13085
|
+
}));
|
|
13086
|
+
}
|
|
13087
|
+
function decodeBytes32(hex) {
|
|
13088
|
+
if (hex === "0x0000000000000000000000000000000000000000000000000000000000000000")
|
|
13089
|
+
return "";
|
|
13090
|
+
try {
|
|
13091
|
+
return hexToString(hex, { size: 32 });
|
|
13092
|
+
} catch {
|
|
13093
|
+
return hex;
|
|
13094
|
+
}
|
|
13095
|
+
}
|
|
13096
|
+
// src/yield-dtf/read-backing.ts
|
|
13097
|
+
async function readBackingOverview(publicClient, facadeAddress, rTokenAddress) {
|
|
13098
|
+
const [backing, overCollateralization] = await publicClient.readContract({
|
|
13099
|
+
address: facadeAddress,
|
|
13100
|
+
abi: facadeReadAbi,
|
|
13101
|
+
functionName: "backingOverview",
|
|
13102
|
+
args: [rTokenAddress]
|
|
13103
|
+
});
|
|
13104
|
+
return {
|
|
13105
|
+
backing,
|
|
13106
|
+
overCollateralization
|
|
13107
|
+
};
|
|
13108
|
+
}
|
|
13109
|
+
async function readYieldDtfPrice(publicClient, facadeAddress, rTokenAddress) {
|
|
13110
|
+
const [low, high] = await publicClient.readContract({
|
|
13111
|
+
address: facadeAddress,
|
|
13112
|
+
abi: facadeReadAbi,
|
|
13113
|
+
functionName: "price",
|
|
13114
|
+
args: [rTokenAddress]
|
|
13115
|
+
});
|
|
13116
|
+
return { low, high };
|
|
13117
|
+
}
|
|
13118
|
+
// src/yield-dtf/read-st-rsr.ts
|
|
13119
|
+
async function readStRSRInfo(publicClient, stRSRAddress, account) {
|
|
13120
|
+
const baseContracts = [
|
|
13121
|
+
{ address: stRSRAddress, abi: stRSRAbi, functionName: "exchangeRate" },
|
|
13122
|
+
{ address: stRSRAddress, abi: stRSRAbi, functionName: "totalSupply" },
|
|
13123
|
+
{ address: stRSRAddress, abi: stRSRAbi, functionName: "unstakingDelay" }
|
|
13124
|
+
];
|
|
13125
|
+
const accountContracts = account ? [
|
|
13126
|
+
{ address: stRSRAddress, abi: stRSRAbi, functionName: "balanceOf", args: [account] },
|
|
13127
|
+
{ address: stRSRAddress, abi: stRSRAbi, functionName: "getVotes", args: [account] },
|
|
13128
|
+
{ address: stRSRAddress, abi: stRSRAbi, functionName: "delegates", args: [account] }
|
|
13129
|
+
] : [];
|
|
13130
|
+
const results = await publicClient.multicall({
|
|
13131
|
+
contracts: [...baseContracts, ...accountContracts],
|
|
13132
|
+
allowFailure: false
|
|
13133
|
+
});
|
|
13134
|
+
const info = {
|
|
13135
|
+
exchangeRate: results[0],
|
|
13136
|
+
totalSupply: results[1],
|
|
13137
|
+
unstakingDelay: results[2]
|
|
13138
|
+
};
|
|
13139
|
+
if (account) {
|
|
13140
|
+
info.balance = results[3];
|
|
13141
|
+
info.votingPower = results[4];
|
|
13142
|
+
info.delegatee = results[5];
|
|
13143
|
+
}
|
|
13144
|
+
return info;
|
|
13145
|
+
}
|
|
13146
|
+
// src/abi/distributor.ts
|
|
13147
|
+
var distributorAbi = [
|
|
13148
|
+
{
|
|
13149
|
+
inputs: [],
|
|
13150
|
+
name: "totals",
|
|
13151
|
+
outputs: [
|
|
13152
|
+
{
|
|
13153
|
+
components: [
|
|
13154
|
+
{ internalType: "uint24", name: "rTokenTotal", type: "uint24" },
|
|
13155
|
+
{ internalType: "uint24", name: "rsrTotal", type: "uint24" }
|
|
13156
|
+
],
|
|
13157
|
+
internalType: "struct RevenueTotals",
|
|
13158
|
+
name: "revTotals",
|
|
13159
|
+
type: "tuple"
|
|
13160
|
+
}
|
|
13161
|
+
],
|
|
13162
|
+
stateMutability: "view",
|
|
13163
|
+
type: "function"
|
|
13164
|
+
}
|
|
13165
|
+
];
|
|
13166
|
+
|
|
13167
|
+
// src/yield-dtf/read-distribution.ts
|
|
13168
|
+
async function readDistribution(publicClient, distributorAddress) {
|
|
13169
|
+
const result = await publicClient.readContract({
|
|
13170
|
+
address: distributorAddress,
|
|
13171
|
+
abi: distributorAbi,
|
|
13172
|
+
functionName: "totals"
|
|
13173
|
+
});
|
|
13174
|
+
const totals = result;
|
|
13175
|
+
return {
|
|
13176
|
+
rTokenTotal: BigInt(totals.rTokenTotal),
|
|
13177
|
+
rsrTotal: BigInt(totals.rsrTotal)
|
|
13178
|
+
};
|
|
13179
|
+
}
|
|
13180
|
+
// src/yield-dtf/read-config.ts
|
|
13181
|
+
async function fetchYieldDtfConfig(publicClient, chainId, rTokenAddress) {
|
|
13182
|
+
const facadeAddress = FACADE_READ_ADDRESS[chainId];
|
|
13183
|
+
if (!facadeAddress) {
|
|
13184
|
+
throw new Error(`No FacadeRead address for chainId ${chainId}`);
|
|
13185
|
+
}
|
|
13186
|
+
const components = await readYieldDtfComponents(publicClient, rTokenAddress);
|
|
13187
|
+
const [basket, backing, price, nameResult, symbolResult, stRSRInfo, distribution] = await Promise.all([
|
|
13188
|
+
readYieldDtfBasket(publicClient, facadeAddress, rTokenAddress),
|
|
13189
|
+
readBackingOverview(publicClient, facadeAddress, rTokenAddress),
|
|
13190
|
+
readYieldDtfPrice(publicClient, facadeAddress, rTokenAddress),
|
|
13191
|
+
publicClient.readContract({
|
|
13192
|
+
address: rTokenAddress,
|
|
13193
|
+
abi: ERC20_META_ABI,
|
|
13194
|
+
functionName: "name"
|
|
13195
|
+
}),
|
|
13196
|
+
publicClient.readContract({
|
|
13197
|
+
address: rTokenAddress,
|
|
13198
|
+
abi: ERC20_META_ABI,
|
|
13199
|
+
functionName: "symbol"
|
|
13200
|
+
}),
|
|
13201
|
+
readStRSRInfo(publicClient, components.stRSR),
|
|
13202
|
+
readDistribution(publicClient, components.distributor)
|
|
13203
|
+
]);
|
|
13204
|
+
return {
|
|
13205
|
+
type: "yield",
|
|
13206
|
+
components,
|
|
13207
|
+
name: nameResult,
|
|
13208
|
+
symbol: symbolResult,
|
|
13209
|
+
basket,
|
|
13210
|
+
backing,
|
|
13211
|
+
priceLow: price.low,
|
|
13212
|
+
priceHigh: price.high,
|
|
13213
|
+
exchangeRate: stRSRInfo.exchangeRate,
|
|
13214
|
+
unstakingDelay: stRSRInfo.unstakingDelay,
|
|
13215
|
+
rTokenTotal: distribution.rTokenTotal,
|
|
13216
|
+
rsrTotal: distribution.rsrTotal
|
|
13217
|
+
};
|
|
13218
|
+
}
|
|
13219
|
+
// src/yield-dtf/issue.ts
|
|
13220
|
+
async function readIssueQuote(publicClient, facadeAddress, rTokenAddress, amount) {
|
|
13221
|
+
const result = await publicClient.readContract({
|
|
13222
|
+
address: facadeAddress,
|
|
13223
|
+
abi: facadeReadAbi,
|
|
13224
|
+
functionName: "issue",
|
|
13225
|
+
args: [rTokenAddress, amount]
|
|
13226
|
+
});
|
|
13227
|
+
const [tokens, deposits, depositsUoA] = result;
|
|
13228
|
+
return { tokens, deposits, depositsUoA };
|
|
13229
|
+
}
|
|
13230
|
+
async function readRedeemQuote(publicClient, facadeAddress, rTokenAddress, amount) {
|
|
13231
|
+
const result = await publicClient.readContract({
|
|
13232
|
+
address: facadeAddress,
|
|
13233
|
+
abi: facadeReadAbi,
|
|
13234
|
+
functionName: "redeem",
|
|
13235
|
+
args: [rTokenAddress, amount]
|
|
13236
|
+
});
|
|
13237
|
+
const [tokens, withdrawals, available] = result;
|
|
13238
|
+
return { tokens, withdrawals, available };
|
|
13239
|
+
}
|
|
12765
13240
|
// src/utils/assert.ts
|
|
12766
13241
|
function assert6(condition, message) {
|
|
12767
13242
|
if (!condition)
|
|
@@ -12842,7 +13317,7 @@ function applySlippage(amount, slippageBps) {
|
|
|
12842
13317
|
return amount - amount * slippageBps / 10000n;
|
|
12843
13318
|
}
|
|
12844
13319
|
// src/dtf/redeem.ts
|
|
12845
|
-
async function
|
|
13320
|
+
async function readRedeemQuote2(publicClient, folioAddress, shares) {
|
|
12846
13321
|
const result = await publicClient.readContract({
|
|
12847
13322
|
address: folioAddress,
|
|
12848
13323
|
abi: folio_default,
|
|
@@ -17561,14 +18036,21 @@ export {
|
|
|
17561
18036
|
transformV5Rebalance,
|
|
17562
18037
|
timelock_default as timelockAbi,
|
|
17563
18038
|
submitZapDeploy,
|
|
18039
|
+
stRSRAbi,
|
|
17564
18040
|
resolveToken,
|
|
18041
|
+
readRedeemQuote as readYieldRedeemQuote,
|
|
18042
|
+
readIssueQuote as readYieldIssueQuote,
|
|
18043
|
+
readYieldDtfPrice,
|
|
18044
|
+
readYieldDtfComponents,
|
|
18045
|
+
readYieldDtfBasket,
|
|
17565
18046
|
readVotingPower,
|
|
17566
18047
|
readVoteLockInfo,
|
|
17567
18048
|
readVoteLockAsset,
|
|
17568
18049
|
readTotalSupply,
|
|
17569
18050
|
readSymbol,
|
|
18051
|
+
readStRSRInfo,
|
|
17570
18052
|
readRewardTokens,
|
|
17571
|
-
readRedeemQuote,
|
|
18053
|
+
readRedeemQuote2 as readRedeemQuote,
|
|
17572
18054
|
readRebalanceState,
|
|
17573
18055
|
readRebalanceControl,
|
|
17574
18056
|
readQuorum,
|
|
@@ -17586,9 +18068,11 @@ export {
|
|
|
17586
18068
|
readFeeRecipients,
|
|
17587
18069
|
readDtfVersion,
|
|
17588
18070
|
readDtfRoles,
|
|
18071
|
+
readDistribution,
|
|
17589
18072
|
readChainlinkPrice,
|
|
17590
18073
|
readBasket,
|
|
17591
18074
|
readBalanceOf,
|
|
18075
|
+
readBackingOverview,
|
|
17592
18076
|
readAllowances,
|
|
17593
18077
|
readActiveAuction,
|
|
17594
18078
|
querySubgraph,
|
|
@@ -17597,6 +18081,7 @@ export {
|
|
|
17597
18081
|
parseFeeRecipients,
|
|
17598
18082
|
nearestPrice,
|
|
17599
18083
|
mapAssets,
|
|
18084
|
+
mainAbi,
|
|
17600
18085
|
labelAddress,
|
|
17601
18086
|
hashDescription,
|
|
17602
18087
|
governor_default as governorAbi,
|
|
@@ -17607,6 +18092,7 @@ export {
|
|
|
17607
18092
|
formatRoleName,
|
|
17608
18093
|
folio_default as folioAbi,
|
|
17609
18094
|
fetchZapQuote,
|
|
18095
|
+
fetchYieldDtfConfig,
|
|
17610
18096
|
fetchWithRetry,
|
|
17611
18097
|
fetchVoteLockPositions,
|
|
17612
18098
|
fetchTokenVolatility,
|
|
@@ -17628,6 +18114,7 @@ export {
|
|
|
17628
18114
|
fetchDtfBaskets,
|
|
17629
18115
|
fetchDtfBasket,
|
|
17630
18116
|
fetchAllProposals,
|
|
18117
|
+
facadeReadAbi,
|
|
17631
18118
|
extractDeployedAddress,
|
|
17632
18119
|
encodeVotingPeriod,
|
|
17633
18120
|
encodeVotingDelay,
|
|
@@ -17648,6 +18135,8 @@ export {
|
|
|
17648
18135
|
encodeFeeRecipients,
|
|
17649
18136
|
encodeAuctionLength,
|
|
17650
18137
|
encodeAddToBasket,
|
|
18138
|
+
distributorAbi,
|
|
18139
|
+
detectDtfType,
|
|
17651
18140
|
deployer_default as deployerAbi,
|
|
17652
18141
|
decodeProposalActions,
|
|
17653
18142
|
createPriceClient,
|
|
@@ -17698,6 +18187,7 @@ export {
|
|
|
17698
18187
|
assert6 as assert,
|
|
17699
18188
|
applySlippage,
|
|
17700
18189
|
aggregateEcosystemRevenue,
|
|
18190
|
+
YIELD_SUBGRAPH_URLS,
|
|
17701
18191
|
VOTE_LOCK_ADDRESS,
|
|
17702
18192
|
VOLATILITY_TO_PRICE_ERROR,
|
|
17703
18193
|
V5_SPELL_ADDRESS,
|
|
@@ -17717,6 +18207,7 @@ export {
|
|
|
17717
18207
|
GOVERNANCE_SPELL_ADDRESS,
|
|
17718
18208
|
GOVERNANCE_DEPLOYER_ADDRESS,
|
|
17719
18209
|
FOLIO_ROLES,
|
|
18210
|
+
FACADE_READ_ADDRESS,
|
|
17720
18211
|
ERC20_META_ABI,
|
|
17721
18212
|
DEPLOYER_ADDRESS,
|
|
17722
18213
|
DEFAULT_TVL_FEE,
|