@merkl/api 0.20.144 → 0.20.146
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/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.js +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/tvl.js +6 -4
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.js +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/superlend/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/superlend/metadata.js +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +0 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -6,7 +6,7 @@ type campaignType = CampaignType.EULER;
|
|
6
6
|
export declare class EulerMetadata implements MetadataBuilder<campaignType> {
|
7
7
|
build(campaign: Omit<CampaignWithParams<campaignType>, "manualOverrides">): Promise<{
|
8
8
|
action: "LEND" | "BORROW";
|
9
|
-
|
9
|
+
mainProtocol: ProtocolId;
|
10
10
|
name: string;
|
11
11
|
tokens: {
|
12
12
|
chainId: number;
|
@@ -22,7 +22,7 @@ export class EulerMetadata {
|
|
22
22
|
const name = `${action === OpportunityAction.LEND ? `Supply ${underlyingTokenInfo.symbol} on` : "Borrow from"}${vaultName ? ` ${vaultName}` : ""} vault ${subType === EulerSubCampaignType.BORROW_FROM_COLLATERAL ? `using ${symbolCollateral}` : ""}`;
|
23
23
|
return {
|
24
24
|
action,
|
25
|
-
|
25
|
+
mainProtocol: "euler",
|
26
26
|
name,
|
27
27
|
tokens: [
|
28
28
|
{ chainId: computeChainId, address: targetToken },
|
@@ -6,12 +6,13 @@ export class EulerTVLBuilder {
|
|
6
6
|
const tvls = [];
|
7
7
|
const calls = [];
|
8
8
|
for (const campaign of campaigns) {
|
9
|
-
const {
|
9
|
+
const { campaignParameters, campaignId } = campaign;
|
10
|
+
const { evkAddress, subCampaignType } = campaignParameters;
|
10
11
|
if (subCampaignType === EulerSubCampaignType.LEND) {
|
11
12
|
calls.push({
|
12
13
|
callData: EulerEVKInterface.encodeFunctionData("totalAssets"),
|
13
14
|
target: evkAddress,
|
14
|
-
key:
|
15
|
+
key: `totalUnderlying_${campaignId}`,
|
15
16
|
decoder: (data) => BigInt(EulerEVKInterface.decodeFunctionResult("totalAssets", data)[0].toString()),
|
16
17
|
});
|
17
18
|
}
|
@@ -19,14 +20,15 @@ export class EulerTVLBuilder {
|
|
19
20
|
calls.push({
|
20
21
|
callData: EulerEVKInterface.encodeFunctionData("totalBorrows"),
|
21
22
|
target: evkAddress,
|
22
|
-
key:
|
23
|
+
key: `totalUnderlying_${campaignId}`,
|
23
24
|
decoder: (data) => BigInt(EulerEVKInterface.decodeFunctionResult("totalBorrows", data)[0].toString()),
|
24
25
|
});
|
25
26
|
}
|
26
27
|
}
|
27
28
|
const result = await ChainInteractionService(computeChainId).fetchAndDecodeObject(calls);
|
28
29
|
for (const [_, campaign] of campaigns.entries()) {
|
29
|
-
const
|
30
|
+
const { campaignId } = campaign;
|
31
|
+
const totalAssets = result[`totalUnderlying_${campaignId}`];
|
30
32
|
const underlylingTokenAddress = campaign.campaignParameters.addressAsset;
|
31
33
|
const underlyingToken = await TokenService.findUniqueFillOrThrow({
|
32
34
|
chainId: computeChainId,
|
package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.d.ts
CHANGED
@@ -5,7 +5,7 @@ import type { Erc20LikeCampaignEnum } from "../..";
|
|
5
5
|
export declare class GearboxMetadata implements MetadataBuilder<Erc20LikeCampaignEnum> {
|
6
6
|
build(campaign: Omit<CampaignWithParams<Erc20LikeCampaignEnum>, "manualOverrides">): Promise<{
|
7
7
|
action: "LEND";
|
8
|
-
|
8
|
+
mainProtocol: ProtocolId;
|
9
9
|
name: string;
|
10
10
|
tokens: {
|
11
11
|
chainId: number;
|
@@ -8,7 +8,7 @@ export class GearboxMetadata {
|
|
8
8
|
const underlyingTokenSymbol = await TokenInteractionService(computeChainId).symbol(underlyingToken);
|
9
9
|
return {
|
10
10
|
action: OpportunityAction.LEND,
|
11
|
-
|
11
|
+
mainProtocol: "gearbox",
|
12
12
|
name: `Gearbox ${underlyingTokenSymbol} Deposit`,
|
13
13
|
tokens: [
|
14
14
|
{ chainId: computeChainId, address: targetToken },
|
package/dist/src/engine/implementations/Erc20/subTypes/implementations/superlend/metadata.d.ts
CHANGED
@@ -5,7 +5,7 @@ import type { Erc20LikeCampaignEnum } from "../..";
|
|
5
5
|
export declare class SuperlendMetadata implements MetadataBuilder<Erc20LikeCampaignEnum> {
|
6
6
|
build(campaign: Omit<CampaignWithParams<Erc20LikeCampaignEnum>, "manualOverrides">): Promise<{
|
7
7
|
action: "LEND" | "BORROW";
|
8
|
-
|
8
|
+
mainProtocol: ProtocolId;
|
9
9
|
name: string;
|
10
10
|
tokens: {
|
11
11
|
chainId: number;
|
package/dist/src/engine/implementations/Erc20/subTypes/implementations/superlend/metadata.js
CHANGED
@@ -16,7 +16,7 @@ export class SuperlendMetadata {
|
|
16
16
|
: OpportunityAction.LEND;
|
17
17
|
return {
|
18
18
|
action,
|
19
|
-
|
19
|
+
mainProtocol: "superlend",
|
20
20
|
name: `${action === OpportunityAction.BORROW ? "Borrow" : "Supply"} ${underlyingTokenSymbol} on Superlend`,
|
21
21
|
tokens: [
|
22
22
|
{ chainId: computeChainId, address: targetToken },
|
@@ -128,7 +128,6 @@ export class DynamicDataService {
|
|
128
128
|
});
|
129
129
|
}
|
130
130
|
// 2.b.3 APR is obtained from daily rewards and tvl following the distribution type
|
131
|
-
// TODO: switch on distribution type - dailyRewards can be in token amount
|
132
131
|
let aprCampaignValue;
|
133
132
|
if (rewardToken.isPoint) {
|
134
133
|
aprCampaignValue = campaignDailyValue / record.tvl;
|