@merkl/api 0.19.9 → 0.19.10
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/dynamicData/implementations/Hyperdrive.d.ts +1 -1
- package/dist/src/engine/dynamicData/implementations/Hyperdrive.js +12 -2
- package/dist/src/modules/v4/enso/enso.model.d.ts +1 -1
- package/dist/src/modules/v4/enso/enso.model.js +1 -1
- package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +2 -2
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +2 -2
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +1 -3
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { Campaign, type CampaignParameters, type MerklChainId } from "@sdk";
|
2
2
|
import type { DynamicDataBuilder } from "../interface";
|
3
3
|
type campaignType = Campaign.HYPERDRIVELOGPROCESSOR | Campaign.HYPERDRIVELOGFIXPROCESSOR;
|
4
4
|
export declare class HyperdriveDynamicData implements DynamicDataBuilder<campaignType> {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { TokenService } from "@/modules/v4/token/token.service";
|
2
2
|
import { Pricer } from "@/utils/pricer";
|
3
|
-
import { BN2Number, ChainInteractionService, ETH_ADDRESS, HyperDriveSubCampaignType, HyperdriveTargetInterface, YEAR, } from "@sdk";
|
3
|
+
import { BN2Number, Campaign, ChainInteractionService, ETH_ADDRESS, HyperDriveSubCampaignType, HyperdriveTargetInterface, YEAR, } from "@sdk";
|
4
4
|
export class HyperdriveDynamicData {
|
5
5
|
async build(chainId, campaigns) {
|
6
6
|
const pricer = await Pricer.load();
|
@@ -44,11 +44,21 @@ export class HyperdriveDynamicData {
|
|
44
44
|
chainId,
|
45
45
|
symbol: campaign.campaignParameters.baseTokenSymbol,
|
46
46
|
})) ?? 0;
|
47
|
+
let multiplier = 1;
|
48
|
+
if (campaign.campaignType === Campaign.HYPERDRIVELOGPROCESSOR) {
|
49
|
+
const spot_price = ((BN2Number(poolConfig.initialVaultSharePrice, 18) *
|
50
|
+
(BN2Number(poolInfo.shareReserves, 18) - BN2Number(poolInfo.shareAdjustment, 18))) /
|
51
|
+
BN2Number(poolInfo.bondReserves)) **
|
52
|
+
BN2Number(poolConfig.timeStretch);
|
53
|
+
if (spot_price < 1) {
|
54
|
+
multiplier = 1 / (1 - spot_price);
|
55
|
+
}
|
56
|
+
}
|
47
57
|
const tvl = campaign.campaignSubType === HyperDriveSubCampaignType.LP
|
48
58
|
? priceBaseToken * marketSupply
|
49
59
|
: campaign.campaignSubType === HyperDriveSubCampaignType.LONG
|
50
60
|
? priceBaseToken * longSupply
|
51
|
-
: priceBaseToken * shortSupply;
|
61
|
+
: (priceBaseToken * shortSupply) / multiplier;
|
52
62
|
dynamicData.push({
|
53
63
|
...campaign,
|
54
64
|
totalSupplyTargetToken: marketSupply,
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ChainId } from "@sdk";
|
2
2
|
import { t } from "elysia";
|
3
3
|
export const dexIdToProtocolId = {
|
4
|
-
DEX_UNISWAPV3: "uniswap
|
5
|
-
DEX_UNISWAPV2: "uniswap
|
4
|
+
DEX_UNISWAPV3: "uniswap",
|
5
|
+
DEX_UNISWAPV2: "uniswap",
|
6
6
|
DEX_PANCAKESWAPV3: "pancakeswap-v3",
|
7
7
|
DEX_SUSHISWAPV3: "sushiswap-v3",
|
8
8
|
DEX_CURVE: "curve",
|
@@ -9,7 +9,7 @@ export type Protocol = Resource<"Protocol", undefined, {
|
|
9
9
|
numberOfLiveCampaigns?: number;
|
10
10
|
opportunityLiveTags?: string[];
|
11
11
|
}>;
|
12
|
-
declare const protocolTypes: readonly ["ambient", "arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "
|
12
|
+
declare const protocolTypes: readonly ["uniswap", "ambient", "arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "voltage", "zero", "koi", "supswap-v3", "zkswap", "thirdtrade", "velodrome", "aerodrome", "balancer", "curve", "cross_curve", "curveNPool", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "syncswap-v3", "neptune", "zkSwapThreePool", "syncswap", "rfx", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "venus", "woofi", "reactor_fusion", "eigenlayer", "vest", "zerolend", "hyperdrive", "gamma", "oku", "hourglass", "veda", "kyo", "sonex", "quickswap-algebra", "velodrome"];
|
13
13
|
export type ProtocolId = (typeof protocolTypes)[number];
|
14
14
|
export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
|
15
15
|
id: import("@sinclair/typebox").TString;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { t } from "elysia";
|
2
2
|
const protocolTypes = [
|
3
3
|
// ─── AMM ─────────────────────────────────────────────────────────────
|
4
|
+
"uniswap",
|
4
5
|
"ambient",
|
5
6
|
"arthswap",
|
6
7
|
"baseswap",
|
@@ -21,16 +22,13 @@ const protocolTypes = [
|
|
21
22
|
"sushiswap-v3",
|
22
23
|
"swapr",
|
23
24
|
"thruster",
|
24
|
-
"uniswap-v3",
|
25
25
|
"voltage",
|
26
26
|
"zero",
|
27
27
|
"koi",
|
28
28
|
"supswap-v3",
|
29
29
|
"zkswap",
|
30
30
|
"thirdtrade",
|
31
|
-
"uniswapv4",
|
32
31
|
// ─── LP DEX ──────────────────────────────────────────────────────────
|
33
|
-
"uniswap-v2",
|
34
32
|
"velodrome",
|
35
33
|
"aerodrome",
|
36
34
|
"balancer",
|