@merkl/api 0.20.52 → 0.20.53
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/backgroundJobs/index.js +5 -3
- package/dist/src/eden/index.d.ts +280 -91
- package/dist/src/engine/dynamicData/factory.js +6 -0
- package/dist/src/engine/dynamicData/implementations/Erc20.d.ts +2 -2
- package/dist/src/engine/dynamicData/implementations/Erc20.js +16 -2
- package/dist/src/engine/dynamicData/implementations/UniswapV4.js +1 -1
- package/dist/src/engine/opportunityMetadata/factory.js +6 -0
- package/dist/src/index.d.ts +72 -15
- package/dist/src/jobs/update-uniswap-v4-pools.js +3 -2
- package/dist/src/modules/v4/accounting/accounting.repository.js +72 -18
- package/dist/src/modules/v4/router.d.ts +72 -15
- package/dist/src/modules/v4/uniswap/uniswap.controller.d.ts +72 -15
- package/dist/src/modules/v4/uniswap/uniswap.controller.js +49 -6
- package/dist/src/modules/v4/uniswap/uniswap.model.d.ts +35 -16
- package/dist/src/modules/v4/uniswap/uniswap.model.js +22 -8
- package/dist/src/modules/v4/uniswap/uniswap.repository.d.ts +2 -2
- package/dist/src/modules/v4/uniswap/uniswap.repository.js +2 -2
- package/dist/src/modules/v4/uniswap/uniswap.service.d.ts +4 -19
- package/dist/src/modules/v4/uniswap/uniswap.service.js +20 -80
- package/dist/src/routes/v3/uniswapv4.js +5 -5
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/dist/src/engine/dynamicData/utils/getUniswapV4Pools.d.ts +0 -10
- package/dist/src/engine/dynamicData/utils/getUniswapV4Pools.js +0 -188
@@ -2,7 +2,9 @@
|
|
2
2
|
import { Redis } from "@/cache";
|
3
3
|
import { redisClient } from "@/cache/redis";
|
4
4
|
import { getEulerV2Vaults, updateEulerVaultsCollatInDatabase } from "@/engine/dynamicData/utils/getEulerV2Vaults";
|
5
|
-
import {
|
5
|
+
import { CacheService } from "@/modules/v4/cache";
|
6
|
+
import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
7
|
+
import { UniswapService } from "@/modules/v4/uniswap/uniswap.service";
|
6
8
|
import { log } from "@/utils/logger";
|
7
9
|
import { engineDbClient } from "@db";
|
8
10
|
import { swagger } from "@elysiajs/swagger";
|
@@ -25,11 +27,11 @@ new Elysia({
|
|
25
27
|
.get("/eulerUpdate", async () => {
|
26
28
|
log.info("🔃 updating Euler vaults...");
|
27
29
|
await updateEulerVaultsCollatInDatabase();
|
28
|
-
await Redis.safeSet("EulerV2Vaults", await getEulerV2Vaults());
|
30
|
+
await Redis.safeSet("EulerV2Vaults", await getEulerV2Vaults()); // TODO: keeping it with Redis for debug purposes, will do the transition soon
|
29
31
|
})
|
30
32
|
.get("/uniswapv4Update", async () => {
|
31
33
|
log.info("🔃 updating UniswapV4 pools...");
|
32
|
-
await
|
34
|
+
await CacheService.set(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools);
|
33
35
|
})
|
34
36
|
.onError(ctx => {
|
35
37
|
console.error(ctx.error.message);
|
package/dist/src/eden/index.d.ts
CHANGED
@@ -4019,34 +4019,67 @@ declare const eden: {
|
|
4019
4019
|
};
|
4020
4020
|
}>>;
|
4021
4021
|
};
|
4022
|
-
v4: {
|
4022
|
+
v4: ((params: {
|
4023
|
+
poolId: string | number;
|
4024
|
+
}) => {
|
4025
|
+
get: (options?: {
|
4026
|
+
headers?: Record<string, unknown> | undefined;
|
4027
|
+
query?: Record<string, unknown> | undefined;
|
4028
|
+
fetch?: RequestInit | undefined;
|
4029
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4030
|
+
200: UniswapV4PoolType[];
|
4031
|
+
}>>;
|
4032
|
+
}) & {
|
4023
4033
|
pools: {
|
4024
|
-
get: (options
|
4034
|
+
get: (options?: {
|
4025
4035
|
headers?: Record<string, unknown> | undefined;
|
4026
|
-
query
|
4027
|
-
chainId: number;
|
4028
|
-
};
|
4036
|
+
query?: Record<string, unknown> | undefined;
|
4029
4037
|
fetch?: RequestInit | undefined;
|
4030
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4038
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4031
4039
|
200: {
|
4032
4040
|
[x: string]: {
|
4033
|
-
poolId: string;
|
4034
|
-
|
4035
|
-
hooks: string;
|
4036
|
-
fee: number;
|
4037
|
-
tickSpacing: number;
|
4038
|
-
currency0: string;
|
4039
|
-
currency1: string;
|
4040
|
-
};
|
4041
|
-
decimalsCurrency0: number;
|
4042
|
-
decimalsCurrency1: number;
|
4043
|
-
symbolCurrency0: string;
|
4044
|
-
symbolCurrency1: string;
|
4045
|
-
};
|
4041
|
+
[poolId: string]: UniswapV4PoolType;
|
4042
|
+
} | undefined;
|
4046
4043
|
};
|
4047
4044
|
}>>;
|
4048
4045
|
};
|
4046
|
+
update: ((params: {
|
4047
|
+
chainId: string | number;
|
4048
|
+
}) => {
|
4049
|
+
post: (body: unknown, options: {
|
4050
|
+
headers: {
|
4051
|
+
authorization: string;
|
4052
|
+
};
|
4053
|
+
query?: Record<string, unknown> | undefined;
|
4054
|
+
fetch?: RequestInit | undefined;
|
4055
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4056
|
+
200: void;
|
4057
|
+
}>>;
|
4058
|
+
}) & {
|
4059
|
+
post: (body: unknown, options: {
|
4060
|
+
headers: {
|
4061
|
+
authorization: string;
|
4062
|
+
};
|
4063
|
+
query?: Record<string, unknown> | undefined;
|
4064
|
+
fetch?: RequestInit | undefined;
|
4065
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4066
|
+
200: void;
|
4067
|
+
}>>;
|
4068
|
+
};
|
4049
4069
|
};
|
4070
|
+
v4pools: ((params: {
|
4071
|
+
chainId: string | number;
|
4072
|
+
}) => {
|
4073
|
+
get: (options?: {
|
4074
|
+
headers?: Record<string, unknown> | undefined;
|
4075
|
+
query?: Record<string, unknown> | undefined;
|
4076
|
+
fetch?: RequestInit | undefined;
|
4077
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4078
|
+
200: {
|
4079
|
+
[x: string]: any;
|
4080
|
+
};
|
4081
|
+
}>>;
|
4082
|
+
}) & {};
|
4050
4083
|
};
|
4051
4084
|
} | {
|
4052
4085
|
derive: {};
|
@@ -7974,34 +8007,67 @@ declare const eden: {
|
|
7974
8007
|
};
|
7975
8008
|
}>>;
|
7976
8009
|
};
|
7977
|
-
v4: {
|
8010
|
+
v4: ((params: {
|
8011
|
+
poolId: string | number;
|
8012
|
+
}) => {
|
8013
|
+
get: (options?: {
|
8014
|
+
headers?: Record<string, unknown> | undefined;
|
8015
|
+
query?: Record<string, unknown> | undefined;
|
8016
|
+
fetch?: RequestInit | undefined;
|
8017
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8018
|
+
200: UniswapV4PoolType[];
|
8019
|
+
}>>;
|
8020
|
+
}) & {
|
7978
8021
|
pools: {
|
7979
|
-
get: (options
|
8022
|
+
get: (options?: {
|
7980
8023
|
headers?: Record<string, unknown> | undefined;
|
7981
|
-
query
|
7982
|
-
chainId: number;
|
7983
|
-
};
|
8024
|
+
query?: Record<string, unknown> | undefined;
|
7984
8025
|
fetch?: RequestInit | undefined;
|
7985
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8026
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7986
8027
|
200: {
|
7987
8028
|
[x: string]: {
|
7988
|
-
poolId: string;
|
7989
|
-
|
7990
|
-
hooks: string;
|
7991
|
-
fee: number;
|
7992
|
-
tickSpacing: number;
|
7993
|
-
currency0: string;
|
7994
|
-
currency1: string;
|
7995
|
-
};
|
7996
|
-
decimalsCurrency0: number;
|
7997
|
-
decimalsCurrency1: number;
|
7998
|
-
symbolCurrency0: string;
|
7999
|
-
symbolCurrency1: string;
|
8000
|
-
};
|
8029
|
+
[poolId: string]: UniswapV4PoolType;
|
8030
|
+
} | undefined;
|
8001
8031
|
};
|
8002
8032
|
}>>;
|
8003
8033
|
};
|
8034
|
+
update: ((params: {
|
8035
|
+
chainId: string | number;
|
8036
|
+
}) => {
|
8037
|
+
post: (body: unknown, options: {
|
8038
|
+
headers: {
|
8039
|
+
authorization: string;
|
8040
|
+
};
|
8041
|
+
query?: Record<string, unknown> | undefined;
|
8042
|
+
fetch?: RequestInit | undefined;
|
8043
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8044
|
+
200: void;
|
8045
|
+
}>>;
|
8046
|
+
}) & {
|
8047
|
+
post: (body: unknown, options: {
|
8048
|
+
headers: {
|
8049
|
+
authorization: string;
|
8050
|
+
};
|
8051
|
+
query?: Record<string, unknown> | undefined;
|
8052
|
+
fetch?: RequestInit | undefined;
|
8053
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8054
|
+
200: void;
|
8055
|
+
}>>;
|
8056
|
+
};
|
8004
8057
|
};
|
8058
|
+
v4pools: ((params: {
|
8059
|
+
chainId: string | number;
|
8060
|
+
}) => {
|
8061
|
+
get: (options?: {
|
8062
|
+
headers?: Record<string, unknown> | undefined;
|
8063
|
+
query?: Record<string, unknown> | undefined;
|
8064
|
+
fetch?: RequestInit | undefined;
|
8065
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8066
|
+
200: {
|
8067
|
+
[x: string]: any;
|
8068
|
+
};
|
8069
|
+
}>>;
|
8070
|
+
}) & {};
|
8005
8071
|
};
|
8006
8072
|
};
|
8007
8073
|
v3: {
|
@@ -13651,26 +13717,83 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13651
13717
|
get: {
|
13652
13718
|
body: unknown;
|
13653
13719
|
params: {};
|
13654
|
-
query:
|
13720
|
+
query: unknown;
|
13721
|
+
headers: unknown;
|
13722
|
+
response: {
|
13723
|
+
200: {
|
13724
|
+
[x: string]: {
|
13725
|
+
[poolId: string]: UniswapV4PoolType;
|
13726
|
+
} | undefined;
|
13727
|
+
};
|
13728
|
+
};
|
13729
|
+
};
|
13730
|
+
};
|
13731
|
+
};
|
13732
|
+
} & {
|
13733
|
+
v4pools: {
|
13734
|
+
":chainId": {
|
13735
|
+
get: {
|
13736
|
+
body: unknown;
|
13737
|
+
params: {
|
13655
13738
|
chainId: number;
|
13656
13739
|
};
|
13740
|
+
query: unknown;
|
13657
13741
|
headers: unknown;
|
13658
13742
|
response: {
|
13659
13743
|
200: {
|
13660
|
-
[x: string]:
|
13661
|
-
|
13662
|
-
|
13663
|
-
|
13664
|
-
|
13665
|
-
|
13666
|
-
|
13667
|
-
|
13668
|
-
|
13669
|
-
|
13670
|
-
|
13671
|
-
|
13672
|
-
|
13673
|
-
|
13744
|
+
[x: string]: any;
|
13745
|
+
};
|
13746
|
+
};
|
13747
|
+
};
|
13748
|
+
};
|
13749
|
+
};
|
13750
|
+
} & {
|
13751
|
+
v4: {
|
13752
|
+
":poolId": {
|
13753
|
+
get: {
|
13754
|
+
body: unknown;
|
13755
|
+
params: {
|
13756
|
+
poolId: string;
|
13757
|
+
};
|
13758
|
+
query: unknown;
|
13759
|
+
headers: unknown;
|
13760
|
+
response: {
|
13761
|
+
200: UniswapV4PoolType[];
|
13762
|
+
};
|
13763
|
+
};
|
13764
|
+
};
|
13765
|
+
};
|
13766
|
+
} & {
|
13767
|
+
v4: {
|
13768
|
+
update: {
|
13769
|
+
post: {
|
13770
|
+
body: unknown;
|
13771
|
+
params: {};
|
13772
|
+
query: unknown;
|
13773
|
+
headers: {
|
13774
|
+
authorization: string;
|
13775
|
+
};
|
13776
|
+
response: {
|
13777
|
+
200: void;
|
13778
|
+
};
|
13779
|
+
};
|
13780
|
+
};
|
13781
|
+
};
|
13782
|
+
} & {
|
13783
|
+
v4: {
|
13784
|
+
update: {
|
13785
|
+
":chainId": {
|
13786
|
+
post: {
|
13787
|
+
body: unknown;
|
13788
|
+
params: {
|
13789
|
+
chainId: number;
|
13790
|
+
};
|
13791
|
+
query: unknown;
|
13792
|
+
headers: {
|
13793
|
+
authorization: string;
|
13794
|
+
};
|
13795
|
+
response: {
|
13796
|
+
200: void;
|
13674
13797
|
};
|
13675
13798
|
};
|
13676
13799
|
};
|
@@ -18508,34 +18631,67 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
18508
18631
|
};
|
18509
18632
|
}>>;
|
18510
18633
|
};
|
18511
|
-
v4: {
|
18634
|
+
v4: ((params: {
|
18635
|
+
poolId: string | number;
|
18636
|
+
}) => {
|
18637
|
+
get: (options?: {
|
18638
|
+
headers?: Record<string, unknown> | undefined;
|
18639
|
+
query?: Record<string, unknown> | undefined;
|
18640
|
+
fetch?: RequestInit | undefined;
|
18641
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18642
|
+
200: UniswapV4PoolType[];
|
18643
|
+
}>>;
|
18644
|
+
}) & {
|
18512
18645
|
pools: {
|
18513
|
-
get: (options
|
18646
|
+
get: (options?: {
|
18514
18647
|
headers?: Record<string, unknown> | undefined;
|
18515
|
-
query
|
18516
|
-
chainId: number;
|
18517
|
-
};
|
18648
|
+
query?: Record<string, unknown> | undefined;
|
18518
18649
|
fetch?: RequestInit | undefined;
|
18519
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18650
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18520
18651
|
200: {
|
18521
18652
|
[x: string]: {
|
18522
|
-
poolId: string;
|
18523
|
-
|
18524
|
-
|
18525
|
-
|
18526
|
-
|
18527
|
-
|
18528
|
-
|
18529
|
-
|
18530
|
-
|
18531
|
-
|
18532
|
-
|
18533
|
-
|
18534
|
-
|
18653
|
+
[poolId: string]: UniswapV4PoolType;
|
18654
|
+
} | undefined;
|
18655
|
+
};
|
18656
|
+
}>>;
|
18657
|
+
};
|
18658
|
+
update: ((params: {
|
18659
|
+
chainId: string | number;
|
18660
|
+
}) => {
|
18661
|
+
post: (body: unknown, options: {
|
18662
|
+
headers: {
|
18663
|
+
authorization: string;
|
18664
|
+
};
|
18665
|
+
query?: Record<string, unknown> | undefined;
|
18666
|
+
fetch?: RequestInit | undefined;
|
18667
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18668
|
+
200: void;
|
18669
|
+
}>>;
|
18670
|
+
}) & {
|
18671
|
+
post: (body: unknown, options: {
|
18672
|
+
headers: {
|
18673
|
+
authorization: string;
|
18535
18674
|
};
|
18675
|
+
query?: Record<string, unknown> | undefined;
|
18676
|
+
fetch?: RequestInit | undefined;
|
18677
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18678
|
+
200: void;
|
18536
18679
|
}>>;
|
18537
18680
|
};
|
18538
18681
|
};
|
18682
|
+
v4pools: ((params: {
|
18683
|
+
chainId: string | number;
|
18684
|
+
}) => {
|
18685
|
+
get: (options?: {
|
18686
|
+
headers?: Record<string, unknown> | undefined;
|
18687
|
+
query?: Record<string, unknown> | undefined;
|
18688
|
+
fetch?: RequestInit | undefined;
|
18689
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
18690
|
+
200: {
|
18691
|
+
[x: string]: any;
|
18692
|
+
};
|
18693
|
+
}>>;
|
18694
|
+
}) & {};
|
18539
18695
|
};
|
18540
18696
|
} | {
|
18541
18697
|
derive: {};
|
@@ -22463,34 +22619,67 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
22463
22619
|
};
|
22464
22620
|
}>>;
|
22465
22621
|
};
|
22466
|
-
v4: {
|
22622
|
+
v4: ((params: {
|
22623
|
+
poolId: string | number;
|
22624
|
+
}) => {
|
22625
|
+
get: (options?: {
|
22626
|
+
headers?: Record<string, unknown> | undefined;
|
22627
|
+
query?: Record<string, unknown> | undefined;
|
22628
|
+
fetch?: RequestInit | undefined;
|
22629
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
22630
|
+
200: UniswapV4PoolType[];
|
22631
|
+
}>>;
|
22632
|
+
}) & {
|
22467
22633
|
pools: {
|
22468
|
-
get: (options
|
22634
|
+
get: (options?: {
|
22469
22635
|
headers?: Record<string, unknown> | undefined;
|
22470
|
-
query
|
22471
|
-
chainId: number;
|
22472
|
-
};
|
22636
|
+
query?: Record<string, unknown> | undefined;
|
22473
22637
|
fetch?: RequestInit | undefined;
|
22474
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
22638
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
22475
22639
|
200: {
|
22476
22640
|
[x: string]: {
|
22477
|
-
poolId: string;
|
22478
|
-
|
22479
|
-
|
22480
|
-
|
22481
|
-
|
22482
|
-
|
22483
|
-
|
22484
|
-
|
22485
|
-
|
22486
|
-
|
22487
|
-
|
22488
|
-
|
22489
|
-
|
22641
|
+
[poolId: string]: UniswapV4PoolType;
|
22642
|
+
} | undefined;
|
22643
|
+
};
|
22644
|
+
}>>;
|
22645
|
+
};
|
22646
|
+
update: ((params: {
|
22647
|
+
chainId: string | number;
|
22648
|
+
}) => {
|
22649
|
+
post: (body: unknown, options: {
|
22650
|
+
headers: {
|
22651
|
+
authorization: string;
|
22652
|
+
};
|
22653
|
+
query?: Record<string, unknown> | undefined;
|
22654
|
+
fetch?: RequestInit | undefined;
|
22655
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
22656
|
+
200: void;
|
22657
|
+
}>>;
|
22658
|
+
}) & {
|
22659
|
+
post: (body: unknown, options: {
|
22660
|
+
headers: {
|
22661
|
+
authorization: string;
|
22490
22662
|
};
|
22663
|
+
query?: Record<string, unknown> | undefined;
|
22664
|
+
fetch?: RequestInit | undefined;
|
22665
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
22666
|
+
200: void;
|
22491
22667
|
}>>;
|
22492
22668
|
};
|
22493
22669
|
};
|
22670
|
+
v4pools: ((params: {
|
22671
|
+
chainId: string | number;
|
22672
|
+
}) => {
|
22673
|
+
get: (options?: {
|
22674
|
+
headers?: Record<string, unknown> | undefined;
|
22675
|
+
query?: Record<string, unknown> | undefined;
|
22676
|
+
fetch?: RequestInit | undefined;
|
22677
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
22678
|
+
200: {
|
22679
|
+
[x: string]: any;
|
22680
|
+
};
|
22681
|
+
}>>;
|
22682
|
+
}) & {};
|
22494
22683
|
};
|
22495
22684
|
};
|
22496
22685
|
v3: {
|
@@ -51,5 +51,11 @@ const map = {
|
|
51
51
|
[Campaign.MORPHOSUPPLY]: new DefaultDynamicData(), // TODO
|
52
52
|
[Campaign.SYNCSWAP_VAULT]: new DefaultDynamicData(), // TODO
|
53
53
|
[Campaign.MAVERICK_BP]: new DefaultDynamicData(), // TODO
|
54
|
+
[Campaign.ERC6909]: new DefaultDynamicData(), // TODO
|
55
|
+
[Campaign.ERC6909FIXAPR]: new DefaultDynamicData(), // TODO
|
56
|
+
[Campaign.COMPOUND_V3]: new DefaultDynamicData(), // TODO,
|
57
|
+
[Campaign.COMPOUND_V3_FIXAPR]: new DefaultDynamicData(), // TODO
|
58
|
+
[Campaign.ERC1155]: new DefaultDynamicData(), // TODO
|
59
|
+
[Campaign.ERC1155FIXAPR]: new DefaultDynamicData(), // TODO
|
54
60
|
};
|
55
61
|
export const dynamicDataBuilderFactory = (campaignType) => map[campaignType];
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { Campaign, type CampaignParameters, type MerklChainId } from "@sdk";
|
2
2
|
import type { DynamicDataBuilder } from "../interface";
|
3
|
-
export type ERC20SupportedCampaignType = Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR | Campaign.EULER;
|
3
|
+
export type ERC20SupportedCampaignType = Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR | Campaign.EULER | Campaign.ERC20_FIX_APR;
|
4
4
|
export declare class Erc20DynamicData implements DynamicDataBuilder<ERC20SupportedCampaignType> {
|
5
5
|
build(chainId: MerklChainId, campaigns: CampaignParameters<ERC20SupportedCampaignType>[]): Promise<any[]>;
|
6
6
|
}
|
@@ -9,7 +9,7 @@ import { TokenRepository } from "@/modules/v4/token/token.repository";
|
|
9
9
|
import { TokenService } from "@/modules/v4/token/token.service";
|
10
10
|
import { log } from "@/utils/logger";
|
11
11
|
import { Pricer } from "@/utils/pricer";
|
12
|
-
import { BN2Number, BalancerPoolInterface, BalancerV3StablePoolInterface, ChainId, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
|
12
|
+
import { BN2Number, BalancerPoolInterface, BalancerV3StablePoolInterface, Campaign, ChainId, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
|
13
13
|
export class Erc20DynamicData {
|
14
14
|
async build(chainId, campaigns) {
|
15
15
|
const pricer = await Pricer.load();
|
@@ -157,7 +157,21 @@ export class Erc20DynamicData {
|
|
157
157
|
{ chainId: campaign.chainId, address: campaign.rewardToken },
|
158
158
|
]);
|
159
159
|
const rewardToken = rewardTokens[0];
|
160
|
-
|
160
|
+
if (rewardToken.isPoint) {
|
161
|
+
apr = apr / 365 / 100;
|
162
|
+
}
|
163
|
+
else if (campaign.campaignType === Campaign.ERC20_FIX_APR &&
|
164
|
+
["tacBTC", "tacETH", "tacUSD"].includes(campaign.campaignParameters.symbolTargetToken)) {
|
165
|
+
if (campaign.campaignParameters.symbolTargetToken === "tacBTC") {
|
166
|
+
apr = 27.92;
|
167
|
+
}
|
168
|
+
else if (campaign.campaignParameters.symbolTargetToken === "tacETH") {
|
169
|
+
apr = 32.58;
|
170
|
+
}
|
171
|
+
else if (campaign.campaignParameters.symbolTargetToken === "tacUSD") {
|
172
|
+
apr = 46.54;
|
173
|
+
}
|
174
|
+
}
|
161
175
|
if (campaign.chainId === ChainId.ETHERLINK) {
|
162
176
|
whitelistedSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.totalSupply;
|
163
177
|
}
|
@@ -121,7 +121,7 @@ export class UniswapV4DynamicData {
|
|
121
121
|
chainId: chainId,
|
122
122
|
symbol: symbolCurrency1,
|
123
123
|
}));
|
124
|
-
const {
|
124
|
+
const { amount0, amount1 } = await computeUniV4PoolTVLFromMostRecentStateSave(chainId, pool.poolId, priceToken0, priceToken1, decimalsCurrency0, decimalsCurrency1);
|
125
125
|
poolBalanceToken0 += amount0;
|
126
126
|
poolBalanceToken1 += amount1;
|
127
127
|
/** Iterate over distributions to compute APRs */
|
@@ -54,5 +54,11 @@ const map = {
|
|
54
54
|
[Campaign.EVENT_BASED]: new EventBasedMetadata(),
|
55
55
|
[Campaign.ERC20REBASEFIXAPR]: new Erc20Metadata(),
|
56
56
|
[Campaign.MAVERICK_BP]: new DefaultMetadata(), // TODO
|
57
|
+
[Campaign.ERC6909]: new DefaultMetadata(), // TODO
|
58
|
+
[Campaign.ERC6909FIXAPR]: new DefaultMetadata(), // TODO
|
59
|
+
[Campaign.COMPOUND_V3]: new DefaultMetadata(), // TODO,
|
60
|
+
[Campaign.COMPOUND_V3_FIXAPR]: new DefaultMetadata(), // TODO
|
61
|
+
[Campaign.ERC1155]: new DefaultMetadata(), // TODO
|
62
|
+
[Campaign.ERC1155FIXAPR]: new DefaultMetadata(), // TODO
|
57
63
|
};
|
58
64
|
export const metadataBuilderFactory = (campaignType) => map[campaignType];
|
package/dist/src/index.d.ts
CHANGED
@@ -5030,26 +5030,83 @@ declare const app: Elysia<"", false, {
|
|
5030
5030
|
get: {
|
5031
5031
|
body: unknown;
|
5032
5032
|
params: {};
|
5033
|
-
query:
|
5033
|
+
query: unknown;
|
5034
|
+
headers: unknown;
|
5035
|
+
response: {
|
5036
|
+
200: {
|
5037
|
+
[x: string]: {
|
5038
|
+
[poolId: string]: UniswapV4PoolType;
|
5039
|
+
} | undefined;
|
5040
|
+
};
|
5041
|
+
};
|
5042
|
+
};
|
5043
|
+
};
|
5044
|
+
};
|
5045
|
+
} & {
|
5046
|
+
v4pools: {
|
5047
|
+
":chainId": {
|
5048
|
+
get: {
|
5049
|
+
body: unknown;
|
5050
|
+
params: {
|
5034
5051
|
chainId: number;
|
5035
5052
|
};
|
5053
|
+
query: unknown;
|
5036
5054
|
headers: unknown;
|
5037
5055
|
response: {
|
5038
5056
|
200: {
|
5039
|
-
[x: string]:
|
5040
|
-
|
5041
|
-
|
5042
|
-
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5047
|
-
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5057
|
+
[x: string]: any;
|
5058
|
+
};
|
5059
|
+
};
|
5060
|
+
};
|
5061
|
+
};
|
5062
|
+
};
|
5063
|
+
} & {
|
5064
|
+
v4: {
|
5065
|
+
":poolId": {
|
5066
|
+
get: {
|
5067
|
+
body: unknown;
|
5068
|
+
params: {
|
5069
|
+
poolId: string;
|
5070
|
+
};
|
5071
|
+
query: unknown;
|
5072
|
+
headers: unknown;
|
5073
|
+
response: {
|
5074
|
+
200: UniswapV4PoolType[];
|
5075
|
+
};
|
5076
|
+
};
|
5077
|
+
};
|
5078
|
+
};
|
5079
|
+
} & {
|
5080
|
+
v4: {
|
5081
|
+
update: {
|
5082
|
+
post: {
|
5083
|
+
body: unknown;
|
5084
|
+
params: {};
|
5085
|
+
query: unknown;
|
5086
|
+
headers: {
|
5087
|
+
authorization: string;
|
5088
|
+
};
|
5089
|
+
response: {
|
5090
|
+
200: void;
|
5091
|
+
};
|
5092
|
+
};
|
5093
|
+
};
|
5094
|
+
};
|
5095
|
+
} & {
|
5096
|
+
v4: {
|
5097
|
+
update: {
|
5098
|
+
":chainId": {
|
5099
|
+
post: {
|
5100
|
+
body: unknown;
|
5101
|
+
params: {
|
5102
|
+
chainId: number;
|
5103
|
+
};
|
5104
|
+
query: unknown;
|
5105
|
+
headers: {
|
5106
|
+
authorization: string;
|
5107
|
+
};
|
5108
|
+
response: {
|
5109
|
+
200: void;
|
5053
5110
|
};
|
5054
5111
|
};
|
5055
5112
|
};
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { CacheService } from "@/modules/v4/cache";
|
2
|
+
import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
2
3
|
import { UniswapService } from "@/modules/v4/uniswap/uniswap.service";
|
3
4
|
async function main() {
|
4
5
|
try {
|
5
|
-
await
|
6
|
+
await CacheService.set(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools);
|
6
7
|
process.exit(0);
|
7
8
|
}
|
8
9
|
catch (err) {
|