@1delta/margin-fetcher 0.0.24 → 0.0.26
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/lending/user-data/compound-v3/index.d.ts +0 -1
- package/dist/lending/user-data/compound-v3/index.d.ts.map +1 -1
- package/dist/lending/user-data/compound-v3/index.js +0 -1
- package/dist/lending/user-data/compound-v3/userCallBuild.d.ts +2 -2
- package/dist/lending/user-data/compound-v3/userCallBuild.d.ts.map +1 -1
- package/dist/lending/user-data/compound-v3/userCallBuild.js +6 -10
- package/dist/lending/user-data/compound-v3/userCallParse.js +2 -2
- package/dist/lending/user-data/fetchUserData.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/userCallParse.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/userCallParse.js +8 -1
- package/dist/prices/main-prices/addresses/morpho.d.ts.map +1 -1
- package/dist/prices/main-prices/addresses/morpho.js +1311 -0
- package/dist/yields/index.d.ts.map +1 -1
- package/dist/yields/index.js +210 -5
- package/package.json +1 -1
- package/src/lending/user-data/compound-v3/index.ts +1 -2
- package/src/lending/user-data/compound-v3/userCallBuild.ts +18 -16
- package/src/lending/user-data/compound-v3/userCallParse.ts +2 -2
- package/src/lending/user-data/fetchUserData.ts +0 -1
- package/src/lending/user-data/morpho/userCallParse.ts +11 -3
- package/src/prices/main-prices/addresses/morpho.ts +1311 -0
- package/src/yields/index.ts +248 -5
- package/test/mainPrices.test.ts +2 -2
- package/test/morphoPrice.test.ts +1 -1
- package/test/userDataMorpho.test.ts +203 -13
- package/test/yields.test.ts +1 -1
- package/dist/lending/user-data/compound-v3/addresses.d.ts +0 -10
- package/dist/lending/user-data/compound-v3/addresses.d.ts.map +0 -1
- package/dist/lending/user-data/compound-v3/addresses.js +0 -33
- package/src/lending/user-data/compound-v3/addresses.ts +0 -59
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Chain, COMETS_PER_CHAIN_MAP, COMPOUND_BASE_TOKENS, Lender, SWAYLEND_BASE_TOKENS, } from "@1delta/asset-registry";
|
|
2
|
-
export function getCompoundV3CometAddress(chainId, lender = Lender.COMPOUND_V3_USDCE) {
|
|
3
|
-
return COMETS_PER_CHAIN_MAP[chainId]?.[lender];
|
|
4
|
-
}
|
|
5
|
-
export function getCompoundV3CometRewardsAddress(chainId) {
|
|
6
|
-
return addressesCompoundV3.cometRewards[chainId];
|
|
7
|
-
}
|
|
8
|
-
export function getCompoundV3CometIRGetterAddress(chainId) {
|
|
9
|
-
return addressesCompoundV3.lens[chainId];
|
|
10
|
-
}
|
|
11
|
-
export function getCompoundV3CometLens(chainId) {
|
|
12
|
-
return addressesCompoundV3.lens[chainId];
|
|
13
|
-
}
|
|
14
|
-
const addressesCompoundV3 = {
|
|
15
|
-
lens: {
|
|
16
|
-
[Chain.POLYGON_MAINNET]: "0x4eDA401658c5286d16c4d342884F32280B4E8b1b",
|
|
17
|
-
[Chain.MANTLE]: "0x32B31A066c8dd3F7b77283Ba1d89Ddaf6DA0a8aE",
|
|
18
|
-
[Chain.ARBITRUM_ONE]: "0x13D9c35f4901491Ac4FFebd3100238BBfFBD7181",
|
|
19
|
-
[Chain.BASE]: "0x7e2D250E4FD0EeD6BD2cB3DC525A2b9f12508152",
|
|
20
|
-
[Chain.OP_MAINNET]: "0xA453ba397c61B0c292EA3959A858821145B2707F",
|
|
21
|
-
},
|
|
22
|
-
cometRewards: {
|
|
23
|
-
[Chain.POLYGON_MAINNET]: "0x45939657d1CA34A8FA39A924B71D28Fe8431e581",
|
|
24
|
-
[Chain.MANTLE]: "0xCd83CbBFCE149d141A5171C3D6a0F0fCCeE225Ab",
|
|
25
|
-
[Chain.ARBITRUM_ONE]: "0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae",
|
|
26
|
-
[Chain.BASE]: "0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1",
|
|
27
|
-
[Chain.OP_MAINNET]: "0x443EA0340cb75a160F31A440722dec7b5bc3C2E9",
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
export function getCompoundV3BaseAsset(lender, chainId) {
|
|
31
|
-
return (COMPOUND_BASE_TOKENS[lender]?.[chainId] ??
|
|
32
|
-
SWAYLEND_BASE_TOKENS[lender]?.[chainId]);
|
|
33
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Chain,
|
|
3
|
-
COMETS_PER_CHAIN_MAP,
|
|
4
|
-
COMPOUND_BASE_TOKENS,
|
|
5
|
-
Lender,
|
|
6
|
-
SWAYLEND_BASE_TOKENS,
|
|
7
|
-
} from "@1delta/asset-registry";
|
|
8
|
-
|
|
9
|
-
export function getCompoundV3CometAddress(
|
|
10
|
-
chainId: string,
|
|
11
|
-
lender = Lender.COMPOUND_V3_USDCE
|
|
12
|
-
): string | undefined {
|
|
13
|
-
return COMETS_PER_CHAIN_MAP[chainId]?.[lender];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function getCompoundV3CometRewardsAddress(chainId: string) {
|
|
17
|
-
return addressesCompoundV3.cometRewards[
|
|
18
|
-
chainId as keyof typeof addressesCompoundV3.cometRewards
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function getCompoundV3CometIRGetterAddress(chainId: string) {
|
|
23
|
-
return addressesCompoundV3.lens[
|
|
24
|
-
chainId as keyof typeof addressesCompoundV3.lens
|
|
25
|
-
];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function getCompoundV3CometLens(chainId: string) {
|
|
29
|
-
return addressesCompoundV3.lens[
|
|
30
|
-
chainId as keyof typeof addressesCompoundV3.lens
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const addressesCompoundV3 = {
|
|
35
|
-
lens: {
|
|
36
|
-
[Chain.POLYGON_MAINNET]: "0x4eDA401658c5286d16c4d342884F32280B4E8b1b",
|
|
37
|
-
[Chain.MANTLE]: "0x32B31A066c8dd3F7b77283Ba1d89Ddaf6DA0a8aE",
|
|
38
|
-
[Chain.ARBITRUM_ONE]: "0x13D9c35f4901491Ac4FFebd3100238BBfFBD7181",
|
|
39
|
-
[Chain.BASE]: "0x7e2D250E4FD0EeD6BD2cB3DC525A2b9f12508152",
|
|
40
|
-
[Chain.OP_MAINNET]: "0xA453ba397c61B0c292EA3959A858821145B2707F",
|
|
41
|
-
},
|
|
42
|
-
cometRewards: {
|
|
43
|
-
[Chain.POLYGON_MAINNET]: "0x45939657d1CA34A8FA39A924B71D28Fe8431e581",
|
|
44
|
-
[Chain.MANTLE]: "0xCd83CbBFCE149d141A5171C3D6a0F0fCCeE225Ab",
|
|
45
|
-
[Chain.ARBITRUM_ONE]: "0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae",
|
|
46
|
-
[Chain.BASE]: "0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1",
|
|
47
|
-
[Chain.OP_MAINNET]: "0x443EA0340cb75a160F31A440722dec7b5bc3C2E9",
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export function getCompoundV3BaseAsset(
|
|
52
|
-
lender: Lender | string,
|
|
53
|
-
chainId: string
|
|
54
|
-
) {
|
|
55
|
-
return (
|
|
56
|
-
COMPOUND_BASE_TOKENS[lender]?.[chainId] ??
|
|
57
|
-
SWAYLEND_BASE_TOKENS[lender]?.[chainId]
|
|
58
|
-
);
|
|
59
|
-
}
|