sol-parser-sdk-nodejs 0.4.4 → 0.5.5
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/README.md +16 -4
- package/README_CN.md +16 -4
- package/dist/accounts/mod.d.ts +1 -1
- package/dist/accounts/mod.js +43 -9
- package/dist/accounts/pumpfun.d.ts +10 -0
- package/dist/accounts/pumpfun.js +384 -3
- package/dist/core/account_dispatcher_rpc.js +5 -26
- package/dist/core/account_fill_meteora.d.ts +1 -2
- package/dist/core/account_fill_meteora.js +0 -2
- package/dist/core/account_fill_pumpfun.js +86 -24
- package/dist/core/account_fill_pumpswap.js +50 -0
- package/dist/core/account_fill_raydium_launchlab.d.ts +4 -0
- package/dist/core/account_fill_raydium_launchlab.js +20 -0
- package/dist/core/dex_event.d.ts +136 -17
- package/dist/core/pumpfun_fee_enrich.d.ts +1 -0
- package/dist/core/pumpfun_fee_enrich.js +51 -0
- package/dist/grpc/log_instr_dedup.js +62 -14
- package/dist/grpc/program_ids.d.ts +4 -3
- package/dist/grpc/program_ids.js +11 -5
- package/dist/grpc/types.d.ts +13 -6
- package/dist/grpc/types.js +250 -239
- package/dist/index.d.ts +6 -5
- package/dist/index.js +21 -7
- package/dist/instr/meteora_damm_ix.js +4 -1
- package/dist/instr/meteora_dlmm_ix.d.ts +2 -0
- package/dist/instr/meteora_dlmm_ix.js +134 -0
- package/dist/instr/meteora_pools_ix.d.ts +2 -0
- package/dist/instr/meteora_pools_ix.js +78 -0
- package/dist/instr/mod.d.ts +3 -1
- package/dist/instr/mod.js +38 -19
- package/dist/instr/program_ids.d.ts +1 -5
- package/dist/instr/program_ids.js +3 -6
- package/dist/instr/pumpfun_ix.js +219 -5
- package/dist/instr/pumpswap_ix.js +36 -2
- package/dist/instr/raydium_launchlab_ix.d.ts +8 -0
- package/dist/instr/raydium_launchlab_ix.js +125 -0
- package/dist/instr/rust_aliases.d.ts +2 -0
- package/dist/instr/rust_aliases.js +5 -1
- package/dist/logs/optimized_matcher.js +14 -9
- package/dist/logs/pump.js +76 -3
- package/dist/logs/pump_amm.js +1 -1
- package/dist/logs/raydium_launchlab.d.ts +10 -0
- package/dist/logs/raydium_launchlab.js +84 -0
- package/dist/shredstream/client.d.ts +4 -1
- package/dist/shredstream/client.js +18 -14
- package/dist/shredstream/index.d.ts +1 -1
- package/dist/shredstream/index.js +1 -1
- package/dist/shredstream/instruction_parse.d.ts +3 -3
- package/dist/shredstream/instruction_parse.js +36 -13
- package/dist/util/market.d.ts +18 -0
- package/dist/util/market.js +54 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ const account_fill_pumpfun_js_1 = require("./account_fill_pumpfun.js");
|
|
|
7
7
|
const account_fill_pumpswap_js_1 = require("./account_fill_pumpswap.js");
|
|
8
8
|
const account_fill_raydium_js_1 = require("./account_fill_raydium.js");
|
|
9
9
|
const account_fill_orca_js_1 = require("./account_fill_orca.js");
|
|
10
|
-
const
|
|
10
|
+
const account_fill_raydium_launchlab_js_1 = require("./account_fill_raydium_launchlab.js");
|
|
11
11
|
const account_fill_meteora_js_1 = require("./account_fill_meteora.js");
|
|
12
12
|
function tryFill(programId, programInvokes, message, meta, resolver, fn) {
|
|
13
13
|
const invoke = (0, rpc_invoke_map_js_1.findMaxAccountsInvoke)(programId, programInvokes, message, meta);
|
|
@@ -18,24 +18,6 @@ function tryFill(programId, programInvokes, message, meta, resolver, fn) {
|
|
|
18
18
|
return;
|
|
19
19
|
fn(get);
|
|
20
20
|
}
|
|
21
|
-
const BONK_PROGRAM_FILL_ORDER = [
|
|
22
|
-
program_ids_js_1.BONK_PROGRAM_ID,
|
|
23
|
-
program_ids_js_1.BONK_LAUNCHPAD_PROGRAM_ID,
|
|
24
|
-
program_ids_js_1.BONK_PROGRAM_ID_LEGACY,
|
|
25
|
-
];
|
|
26
|
-
/** Bonk 多程序 ID:按 Rust 主网 ID → Launchpad → 旧 TS 兼容顺序尝试 CPI 账户填充 */
|
|
27
|
-
function tryFillBonk(programInvokes, message, meta, resolver, fn) {
|
|
28
|
-
for (const programId of BONK_PROGRAM_FILL_ORDER) {
|
|
29
|
-
const invoke = (0, rpc_invoke_map_js_1.findMaxAccountsInvoke)(programId, programInvokes, message, meta);
|
|
30
|
-
if (!invoke)
|
|
31
|
-
continue;
|
|
32
|
-
const get = (0, rpc_invoke_map_js_1.makeInvokeAccountGetter)(resolver, invoke, message, meta);
|
|
33
|
-
if (!get)
|
|
34
|
-
continue;
|
|
35
|
-
fn(get);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
21
|
/** 就地修改事件体内字段 */
|
|
40
22
|
function fillAccountsFromTransactionDataRpc(ev, message, meta, programInvokes, resolver) {
|
|
41
23
|
if ("PumpFunTrade" in ev) {
|
|
@@ -143,9 +125,6 @@ function fillAccountsFromTransactionDataRpc(ev, message, meta, programInvokes, r
|
|
|
143
125
|
else if ("MeteoraDammV2AddLiquidity" in ev) {
|
|
144
126
|
tryFill(program_ids_js_1.METEORA_DAMM_V2_PROGRAM_ID, programInvokes, message, meta, resolver, (g) => (0, account_fill_meteora_js_1.fillMeteoraDammV2AddLiquidityAccounts)(ev.MeteoraDammV2AddLiquidity, g));
|
|
145
127
|
}
|
|
146
|
-
else if ("MeteoraDammV2RemoveAllLiquidity" in ev) {
|
|
147
|
-
tryFill(program_ids_js_1.METEORA_DAMM_V2_PROGRAM_ID, programInvokes, message, meta, resolver, (g) => (0, account_fill_meteora_js_1.fillMeteoraDammV2RemoveAllLiquidityAccounts)(ev.MeteoraDammV2RemoveAllLiquidity, g));
|
|
148
|
-
}
|
|
149
128
|
else if ("MeteoraDammV2RemoveLiquidity" in ev) {
|
|
150
129
|
tryFill(program_ids_js_1.METEORA_DAMM_V2_PROGRAM_ID, programInvokes, message, meta, resolver, (g) => (0, account_fill_meteora_js_1.fillMeteoraDammV2RemoveLiquidityAccounts)(ev.MeteoraDammV2RemoveLiquidity, g));
|
|
151
130
|
}
|
|
@@ -167,10 +146,10 @@ function fillAccountsFromTransactionDataRpc(ev, message, meta, programInvokes, r
|
|
|
167
146
|
else if ("MeteoraDlmmRemoveLiquidity" in ev) {
|
|
168
147
|
tryFill(program_ids_js_1.METEORA_DLMM_PROGRAM_ID, programInvokes, message, meta, resolver, (g) => (0, account_fill_meteora_js_1.fillMeteoraDlmmRemoveLiquidityAccounts)(ev.MeteoraDlmmRemoveLiquidity, g));
|
|
169
148
|
}
|
|
170
|
-
else if ("
|
|
171
|
-
|
|
149
|
+
else if ("RaydiumLaunchlabTrade" in ev) {
|
|
150
|
+
tryFill(program_ids_js_1.RAYDIUM_LAUNCHLAB_PROGRAM_ID, programInvokes, message, meta, resolver, (g) => (0, account_fill_raydium_launchlab_js_1.fillRaydiumLaunchlabTradeAccounts)(ev.RaydiumLaunchlabTrade, g));
|
|
172
151
|
}
|
|
173
|
-
else if ("
|
|
174
|
-
|
|
152
|
+
else if ("RaydiumLaunchlabPoolCreate" in ev) {
|
|
153
|
+
tryFill(program_ids_js_1.RAYDIUM_LAUNCHLAB_PROGRAM_ID, programInvokes, message, meta, resolver, (g) => (0, account_fill_raydium_launchlab_js_1.fillRaydiumLaunchlabPoolCreateAccounts)(ev.RaydiumLaunchlabPoolCreate, g));
|
|
175
154
|
}
|
|
176
155
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Meteora DAMM V2 / Pools / DLMM 账户填充(部分占位) */
|
|
2
|
-
import type { MeteoraDammV2AddLiquidityEvent, MeteoraDammV2ClosePositionEvent, MeteoraDammV2CreatePositionEvent, MeteoraDammV2InitializePoolEvent,
|
|
2
|
+
import type { MeteoraDammV2AddLiquidityEvent, MeteoraDammV2ClosePositionEvent, MeteoraDammV2CreatePositionEvent, MeteoraDammV2InitializePoolEvent, MeteoraDammV2RemoveLiquidityEvent, MeteoraDammV2SwapEvent, MeteoraDlmmAddLiquidityEvent, MeteoraDlmmRemoveLiquidityEvent, MeteoraDlmmSwapEvent, MeteoraPoolsAddLiquidityEvent, MeteoraPoolsRemoveLiquidityEvent, MeteoraPoolsSwapEvent } from "./dex_event.js";
|
|
3
3
|
/** 预留:gRPC+meta 全量路径若需从 account_keys 补 vault,应对齐 cp_amm `swap` 账户顺序(IDL 中 vault/mint/token program 下标) */
|
|
4
4
|
export declare function fillMeteoraDammV2SwapAccounts(_e: MeteoraDammV2SwapEvent, _get: (i: number) => string): void;
|
|
5
5
|
export declare function fillMeteoraDammV2CreatePositionAccounts(_e: MeteoraDammV2CreatePositionEvent, _get: (i: number) => string): void;
|
|
@@ -7,7 +7,6 @@ export declare function fillMeteoraDammV2InitializePoolAccounts(_e: MeteoraDammV
|
|
|
7
7
|
export declare function fillMeteoraDammV2ClosePositionAccounts(_e: MeteoraDammV2ClosePositionEvent, _get: (i: number) => string): void;
|
|
8
8
|
export declare function fillMeteoraDammV2AddLiquidityAccounts(_e: MeteoraDammV2AddLiquidityEvent, _get: (i: number) => string): void;
|
|
9
9
|
export declare function fillMeteoraDammV2RemoveLiquidityAccounts(_e: MeteoraDammV2RemoveLiquidityEvent, _get: (i: number) => string): void;
|
|
10
|
-
export declare function fillMeteoraDammV2RemoveAllLiquidityAccounts(_e: MeteoraDammV2RemoveAllLiquidityEvent, _get: (i: number) => string): void;
|
|
11
10
|
export declare function fillMeteoraPoolsSwapAccounts(_e: MeteoraPoolsSwapEvent, _get: (i: number) => string): void;
|
|
12
11
|
export declare function fillMeteoraPoolsAddLiquidityAccounts(_e: MeteoraPoolsAddLiquidityEvent, _get: (i: number) => string): void;
|
|
13
12
|
export declare function fillMeteoraPoolsRemoveLiquidityAccounts(_e: MeteoraPoolsRemoveLiquidityEvent, _get: (i: number) => string): void;
|
|
@@ -6,7 +6,6 @@ exports.fillMeteoraDammV2InitializePoolAccounts = fillMeteoraDammV2InitializePoo
|
|
|
6
6
|
exports.fillMeteoraDammV2ClosePositionAccounts = fillMeteoraDammV2ClosePositionAccounts;
|
|
7
7
|
exports.fillMeteoraDammV2AddLiquidityAccounts = fillMeteoraDammV2AddLiquidityAccounts;
|
|
8
8
|
exports.fillMeteoraDammV2RemoveLiquidityAccounts = fillMeteoraDammV2RemoveLiquidityAccounts;
|
|
9
|
-
exports.fillMeteoraDammV2RemoveAllLiquidityAccounts = fillMeteoraDammV2RemoveAllLiquidityAccounts;
|
|
10
9
|
exports.fillMeteoraPoolsSwapAccounts = fillMeteoraPoolsSwapAccounts;
|
|
11
10
|
exports.fillMeteoraPoolsAddLiquidityAccounts = fillMeteoraPoolsAddLiquidityAccounts;
|
|
12
11
|
exports.fillMeteoraPoolsRemoveLiquidityAccounts = fillMeteoraPoolsRemoveLiquidityAccounts;
|
|
@@ -20,7 +19,6 @@ function fillMeteoraDammV2InitializePoolAccounts(_e, _get) { }
|
|
|
20
19
|
function fillMeteoraDammV2ClosePositionAccounts(_e, _get) { }
|
|
21
20
|
function fillMeteoraDammV2AddLiquidityAccounts(_e, _get) { }
|
|
22
21
|
function fillMeteoraDammV2RemoveLiquidityAccounts(_e, _get) { }
|
|
23
|
-
function fillMeteoraDammV2RemoveAllLiquidityAccounts(_e, _get) { }
|
|
24
22
|
function fillMeteoraPoolsSwapAccounts(_e, _get) { }
|
|
25
23
|
function fillMeteoraPoolsAddLiquidityAccounts(_e, _get) { }
|
|
26
24
|
function fillMeteoraPoolsRemoveLiquidityAccounts(_e, _get) { }
|
|
@@ -8,39 +8,101 @@ const dex_event_js_1 = require("./dex_event.js");
|
|
|
8
8
|
const Z = () => (0, dex_event_js_1.defaultPubkey)();
|
|
9
9
|
function fillPumpfunTradeAccounts(e, get) {
|
|
10
10
|
const zero = Z();
|
|
11
|
+
const accountAtMatchesMint = (idx) => Boolean(e.mint && e.mint !== zero && get(idx) === e.mint);
|
|
12
|
+
const set = (key, idx) => {
|
|
13
|
+
const current = e[key];
|
|
14
|
+
if (!current || current === zero) {
|
|
15
|
+
e[key] = get(idx);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
11
18
|
const isV2 = e.ix_name === "buy_v2" ||
|
|
12
19
|
e.ix_name === "sell_v2" ||
|
|
13
|
-
e.ix_name === "buy_exact_quote_in_v2"
|
|
20
|
+
e.ix_name === "buy_exact_quote_in_v2" ||
|
|
21
|
+
accountAtMatchesMint(1);
|
|
14
22
|
if (isV2) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
set("global", 0);
|
|
24
|
+
set("quote_mint", 2);
|
|
25
|
+
set("fee_recipient", 6);
|
|
26
|
+
set("bonding_curve", 10);
|
|
27
|
+
set("associated_bonding_curve", 11);
|
|
28
|
+
set("associated_quote_bonding_curve", 12);
|
|
29
|
+
set("user", 13);
|
|
30
|
+
set("associated_user", 14);
|
|
31
|
+
set("associated_quote_user", 15);
|
|
32
|
+
set("token_program", 3);
|
|
33
|
+
set("quote_token_program", 4);
|
|
34
|
+
set("associated_token_program", 5);
|
|
35
|
+
set("creator_vault", 16);
|
|
36
|
+
set("associated_quote_fee_recipient", 7);
|
|
37
|
+
set("buyback_fee_recipient", 8);
|
|
38
|
+
set("associated_quote_buyback_fee_recipient", 9);
|
|
39
|
+
set("associated_creator_vault", 17);
|
|
40
|
+
set("sharing_config", 18);
|
|
41
|
+
if (e.ix_name === "sell_v2" || (!e.is_buy && e.ix_name === "sell")) {
|
|
42
|
+
set("user_volume_accumulator", 19);
|
|
43
|
+
set("associated_user_volume_accumulator", 20);
|
|
44
|
+
set("fee_config", 21);
|
|
45
|
+
set("fee_program", 22);
|
|
46
|
+
set("system_program", 23);
|
|
47
|
+
set("event_authority", 24);
|
|
48
|
+
set("program", 25);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
set("global_volume_accumulator", 19);
|
|
52
|
+
set("user_volume_accumulator", 20);
|
|
53
|
+
set("associated_user_volume_accumulator", 21);
|
|
54
|
+
set("fee_config", 22);
|
|
55
|
+
set("fee_program", 23);
|
|
56
|
+
set("system_program", 24);
|
|
57
|
+
set("event_authority", 25);
|
|
58
|
+
set("program", 26);
|
|
21
59
|
}
|
|
22
|
-
if (!e.creator_vault || e.creator_vault === zero)
|
|
23
|
-
e.creator_vault = get(16);
|
|
24
|
-
if (!e.token_program || e.token_program === zero)
|
|
25
|
-
e.token_program = get(3);
|
|
26
60
|
return;
|
|
27
61
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
62
|
+
set("global", 0);
|
|
63
|
+
set("fee_recipient", 1);
|
|
64
|
+
set("bonding_curve", 3);
|
|
65
|
+
set("associated_bonding_curve", 4);
|
|
66
|
+
set("associated_user", 5);
|
|
67
|
+
set("user", 6);
|
|
68
|
+
set("system_program", 7);
|
|
69
|
+
set("creator_vault", e.is_buy ? 9 : 8);
|
|
70
|
+
set("token_program", e.is_buy ? 8 : 9);
|
|
71
|
+
set("event_authority", 10);
|
|
72
|
+
set("program", 11);
|
|
73
|
+
if (e.is_buy) {
|
|
74
|
+
set("global_volume_accumulator", 12);
|
|
75
|
+
set("user_volume_accumulator", 13);
|
|
76
|
+
set("fee_config", 14);
|
|
77
|
+
set("fee_program", 15);
|
|
78
|
+
set("bonding_curve_v2", 16);
|
|
79
|
+
set("buyback_fee_recipient", 17);
|
|
80
|
+
const a17 = get(17);
|
|
81
|
+
if (a17 && a17 !== zero && e.account == null)
|
|
82
|
+
e.account = a17;
|
|
83
|
+
return;
|
|
34
84
|
}
|
|
35
|
-
|
|
36
|
-
|
|
85
|
+
set("fee_config", 12);
|
|
86
|
+
set("fee_program", 13);
|
|
87
|
+
const a16 = get(16);
|
|
88
|
+
if (a16 && a16 !== zero) {
|
|
89
|
+
set("user_volume_accumulator", 14);
|
|
90
|
+
set("bonding_curve_v2", 15);
|
|
91
|
+
set("buyback_fee_recipient", 16);
|
|
92
|
+
if (e.account == null)
|
|
93
|
+
e.account = a16;
|
|
94
|
+
return;
|
|
37
95
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
96
|
+
if (e.is_cashback_coin) {
|
|
97
|
+
set("user_volume_accumulator", 14);
|
|
98
|
+
set("bonding_curve_v2", 15);
|
|
99
|
+
return;
|
|
40
100
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
101
|
+
set("bonding_curve_v2", 14);
|
|
102
|
+
set("buyback_fee_recipient", 15);
|
|
103
|
+
const a15 = get(15);
|
|
104
|
+
if (a15 && a15 !== zero && e.account == null)
|
|
105
|
+
e.account = a15;
|
|
44
106
|
}
|
|
45
107
|
function fillPumpfunCreateAccounts(e, get) {
|
|
46
108
|
const zero = Z();
|
|
@@ -48,9 +48,59 @@ function fillPumpswapTradeCommon(e, get) {
|
|
|
48
48
|
}
|
|
49
49
|
function fillPumpswapBuyAccounts(e, get) {
|
|
50
50
|
fillPumpswapTradeCommon(e, get);
|
|
51
|
+
const zero = Z();
|
|
52
|
+
const a26 = get(26);
|
|
53
|
+
if (a26 && a26 !== zero) {
|
|
54
|
+
if (!e.pool_v2 || e.pool_v2 === zero)
|
|
55
|
+
e.pool_v2 = get(24);
|
|
56
|
+
if (!e.fee_recipient || e.fee_recipient === zero)
|
|
57
|
+
e.fee_recipient = get(25);
|
|
58
|
+
if (!e.fee_recipient_quote_token_account || e.fee_recipient_quote_token_account === zero) {
|
|
59
|
+
e.fee_recipient_quote_token_account = a26;
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const a25 = get(25);
|
|
64
|
+
if (a25 && a25 !== zero) {
|
|
65
|
+
if (!e.pool_v2 || e.pool_v2 === zero)
|
|
66
|
+
e.pool_v2 = get(23);
|
|
67
|
+
if (!e.fee_recipient || e.fee_recipient === zero)
|
|
68
|
+
e.fee_recipient = get(24);
|
|
69
|
+
if (!e.fee_recipient_quote_token_account || e.fee_recipient_quote_token_account === zero) {
|
|
70
|
+
e.fee_recipient_quote_token_account = a25;
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!e.pool_v2 || e.pool_v2 === zero)
|
|
75
|
+
e.pool_v2 = get(23);
|
|
51
76
|
}
|
|
52
77
|
function fillPumpswapSellAccounts(e, get) {
|
|
53
78
|
fillPumpswapTradeCommon(e, get);
|
|
79
|
+
const zero = Z();
|
|
80
|
+
const a25 = get(25);
|
|
81
|
+
if (a25 && a25 !== zero) {
|
|
82
|
+
if (!e.pool_v2 || e.pool_v2 === zero)
|
|
83
|
+
e.pool_v2 = get(23);
|
|
84
|
+
if (!e.fee_recipient || e.fee_recipient === zero)
|
|
85
|
+
e.fee_recipient = get(24);
|
|
86
|
+
if (!e.fee_recipient_quote_token_account || e.fee_recipient_quote_token_account === zero) {
|
|
87
|
+
e.fee_recipient_quote_token_account = a25;
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const a23 = get(23);
|
|
92
|
+
if (a23 && a23 !== zero) {
|
|
93
|
+
if (!e.pool_v2 || e.pool_v2 === zero)
|
|
94
|
+
e.pool_v2 = get(21);
|
|
95
|
+
if (!e.fee_recipient || e.fee_recipient === zero)
|
|
96
|
+
e.fee_recipient = get(22);
|
|
97
|
+
if (!e.fee_recipient_quote_token_account || e.fee_recipient_quote_token_account === zero) {
|
|
98
|
+
e.fee_recipient_quote_token_account = a23;
|
|
99
|
+
}
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (!e.pool_v2 || e.pool_v2 === zero)
|
|
103
|
+
e.pool_v2 = get(21);
|
|
54
104
|
}
|
|
55
105
|
function fillPumpswapCreatePoolAccounts(e, get) {
|
|
56
106
|
const zero = Z();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** RaydiumLaunchlab(LaunchLab)账户填充 */
|
|
2
|
+
import type { RaydiumLaunchlabPoolCreateEvent, RaydiumLaunchlabTradeEvent } from "./dex_event.js";
|
|
3
|
+
export declare function fillRaydiumLaunchlabTradeAccounts(e: RaydiumLaunchlabTradeEvent, get: (i: number) => string): void;
|
|
4
|
+
export declare function fillRaydiumLaunchlabPoolCreateAccounts(e: RaydiumLaunchlabPoolCreateEvent, get: (i: number) => string): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fillRaydiumLaunchlabTradeAccounts = fillRaydiumLaunchlabTradeAccounts;
|
|
4
|
+
exports.fillRaydiumLaunchlabPoolCreateAccounts = fillRaydiumLaunchlabPoolCreateAccounts;
|
|
5
|
+
const dex_event_js_1 = require("./dex_event.js");
|
|
6
|
+
const Z = () => (0, dex_event_js_1.defaultPubkey)();
|
|
7
|
+
function fillRaydiumLaunchlabTradeAccounts(e, get) {
|
|
8
|
+
const zero = Z();
|
|
9
|
+
if (!e.user || e.user === zero)
|
|
10
|
+
e.user = get(0);
|
|
11
|
+
if (!e.pool_state || e.pool_state === zero)
|
|
12
|
+
e.pool_state = get(4);
|
|
13
|
+
}
|
|
14
|
+
function fillRaydiumLaunchlabPoolCreateAccounts(e, get) {
|
|
15
|
+
const zero = Z();
|
|
16
|
+
if (!e.pool_state || e.pool_state === zero)
|
|
17
|
+
e.pool_state = get(5);
|
|
18
|
+
if (!e.creator || e.creator === zero)
|
|
19
|
+
e.creator = get(1);
|
|
20
|
+
}
|
package/dist/core/dex_event.d.ts
CHANGED
|
@@ -106,8 +106,6 @@ export type DexEvent = {
|
|
|
106
106
|
MeteoraDammV2AddLiquidity: MeteoraDammV2AddLiquidityEvent;
|
|
107
107
|
} | {
|
|
108
108
|
MeteoraDammV2RemoveLiquidity: MeteoraDammV2RemoveLiquidityEvent;
|
|
109
|
-
} | {
|
|
110
|
-
MeteoraDammV2RemoveAllLiquidity: MeteoraDammV2RemoveAllLiquidityEvent;
|
|
111
109
|
} | {
|
|
112
110
|
MeteoraDammV2CreatePosition: MeteoraDammV2CreatePositionEvent;
|
|
113
111
|
} | {
|
|
@@ -131,11 +129,11 @@ export type DexEvent = {
|
|
|
131
129
|
} | {
|
|
132
130
|
MeteoraDlmmClaimFee: MeteoraDlmmClaimFeeEvent;
|
|
133
131
|
} | {
|
|
134
|
-
|
|
132
|
+
RaydiumLaunchlabTrade: RaydiumLaunchlabTradeEvent;
|
|
135
133
|
} | {
|
|
136
|
-
|
|
134
|
+
RaydiumLaunchlabPoolCreate: RaydiumLaunchlabPoolCreateEvent;
|
|
137
135
|
} | {
|
|
138
|
-
|
|
136
|
+
RaydiumLaunchlabMigrateAmm: RaydiumLaunchlabMigrateAmmEvent;
|
|
139
137
|
} | {
|
|
140
138
|
TokenInfo: TokenInfoEvent;
|
|
141
139
|
} | {
|
|
@@ -144,6 +142,16 @@ export type DexEvent = {
|
|
|
144
142
|
NonceAccount: NonceAccountEvent;
|
|
145
143
|
} | {
|
|
146
144
|
PumpFunGlobalAccount: PumpFunGlobalAccountEvent;
|
|
145
|
+
} | {
|
|
146
|
+
PumpFunBondingCurveAccount: PumpFunBondingCurveAccountEvent;
|
|
147
|
+
} | {
|
|
148
|
+
PumpFunFeeConfigAccount: PumpFunFeeConfigAccountEvent;
|
|
149
|
+
} | {
|
|
150
|
+
PumpFunSharingConfigAccount: PumpFunSharingConfigAccountEvent;
|
|
151
|
+
} | {
|
|
152
|
+
PumpFunGlobalVolumeAccumulatorAccount: PumpFunGlobalVolumeAccumulatorAccountEvent;
|
|
153
|
+
} | {
|
|
154
|
+
PumpFunUserVolumeAccumulatorAccount: PumpFunUserVolumeAccumulatorAccountEvent;
|
|
147
155
|
} | {
|
|
148
156
|
PumpSwapGlobalConfigAccount: PumpSwapGlobalConfigAccountEvent;
|
|
149
157
|
} | {
|
|
@@ -170,6 +178,8 @@ export interface PumpFunCreateTokenEvent {
|
|
|
170
178
|
token_program: string;
|
|
171
179
|
is_mayhem_mode: boolean;
|
|
172
180
|
is_cashback_enabled: boolean;
|
|
181
|
+
quote_mint: string;
|
|
182
|
+
virtual_quote_reserves: bigint;
|
|
173
183
|
}
|
|
174
184
|
export interface PumpFunCreateV2TokenEvent extends PumpFunCreateTokenEvent {
|
|
175
185
|
mint_authority: string;
|
|
@@ -214,11 +224,44 @@ export interface PumpFunTradeEvent {
|
|
|
214
224
|
mayhem_mode: boolean;
|
|
215
225
|
cashback_fee_basis_points: bigint;
|
|
216
226
|
cashback: bigint;
|
|
227
|
+
buyback_fee_basis_points?: bigint;
|
|
228
|
+
buyback_fee?: bigint;
|
|
229
|
+
shareholders?: PumpFeesShareholder[];
|
|
230
|
+
quote_mint?: string;
|
|
231
|
+
quote_amount?: bigint;
|
|
232
|
+
virtual_quote_reserves?: bigint;
|
|
233
|
+
real_quote_reserves?: bigint;
|
|
217
234
|
is_cashback_coin: boolean;
|
|
235
|
+
amount?: bigint;
|
|
236
|
+
max_sol_cost?: bigint;
|
|
237
|
+
min_sol_output?: bigint;
|
|
238
|
+
spendable_sol_in?: bigint;
|
|
239
|
+
spendable_quote_in?: bigint;
|
|
240
|
+
min_tokens_out?: bigint;
|
|
241
|
+
global?: string;
|
|
218
242
|
bonding_curve: string;
|
|
243
|
+
bonding_curve_v2?: string;
|
|
219
244
|
associated_bonding_curve: string;
|
|
245
|
+
associated_user?: string;
|
|
246
|
+
system_program?: string;
|
|
220
247
|
token_program: string;
|
|
248
|
+
quote_token_program?: string;
|
|
249
|
+
associated_token_program?: string;
|
|
221
250
|
creator_vault: string;
|
|
251
|
+
associated_quote_fee_recipient?: string;
|
|
252
|
+
buyback_fee_recipient?: string;
|
|
253
|
+
associated_quote_buyback_fee_recipient?: string;
|
|
254
|
+
associated_quote_bonding_curve?: string;
|
|
255
|
+
associated_quote_user?: string;
|
|
256
|
+
associated_creator_vault?: string;
|
|
257
|
+
sharing_config?: string;
|
|
258
|
+
event_authority?: string;
|
|
259
|
+
program?: string;
|
|
260
|
+
global_volume_accumulator?: string;
|
|
261
|
+
user_volume_accumulator?: string;
|
|
262
|
+
associated_user_volume_accumulator?: string;
|
|
263
|
+
fee_config?: string;
|
|
264
|
+
fee_program?: string;
|
|
222
265
|
account?: string;
|
|
223
266
|
}
|
|
224
267
|
export interface PumpFunMigrateEvent {
|
|
@@ -401,6 +444,9 @@ export interface PumpSwapBuyEvent {
|
|
|
401
444
|
coin_creator_vault_authority: string;
|
|
402
445
|
base_token_program: string;
|
|
403
446
|
quote_token_program: string;
|
|
447
|
+
pool_v2?: string;
|
|
448
|
+
fee_recipient?: string;
|
|
449
|
+
fee_recipient_quote_token_account?: string;
|
|
404
450
|
}
|
|
405
451
|
export interface PumpSwapSellEvent {
|
|
406
452
|
metadata: EventMetadata;
|
|
@@ -438,6 +484,9 @@ export interface PumpSwapSellEvent {
|
|
|
438
484
|
coin_creator_vault_authority: string;
|
|
439
485
|
base_token_program: string;
|
|
440
486
|
quote_token_program: string;
|
|
487
|
+
pool_v2?: string;
|
|
488
|
+
fee_recipient?: string;
|
|
489
|
+
fee_recipient_quote_token_account?: string;
|
|
441
490
|
}
|
|
442
491
|
export interface PumpSwapCreatePoolEvent {
|
|
443
492
|
metadata: EventMetadata;
|
|
@@ -883,15 +932,6 @@ export interface MeteoraDammV2RemoveLiquidityEvent {
|
|
|
883
932
|
token_a_amount_threshold: bigint;
|
|
884
933
|
token_b_amount_threshold: bigint;
|
|
885
934
|
}
|
|
886
|
-
/** 外层 `remove_all_liquidity`;指令仅含两 u64 阈值,无 `liquidity_delta`。 */
|
|
887
|
-
export interface MeteoraDammV2RemoveAllLiquidityEvent {
|
|
888
|
-
metadata: EventMetadata;
|
|
889
|
-
pool: string;
|
|
890
|
-
position: string;
|
|
891
|
-
owner: string;
|
|
892
|
-
token_a_amount_threshold: bigint;
|
|
893
|
-
token_b_amount_threshold: bigint;
|
|
894
|
-
}
|
|
895
935
|
/** 与 `MeteoraDammV2CreatePositionEvent` 对齐 */
|
|
896
936
|
export interface MeteoraDammV2CreatePositionEvent {
|
|
897
937
|
metadata: EventMetadata;
|
|
@@ -999,7 +1039,7 @@ export interface MeteoraDlmmClaimFeeEvent {
|
|
|
999
1039
|
fee_y: bigint;
|
|
1000
1040
|
}
|
|
1001
1041
|
export type TradeDirection = "Buy" | "Sell";
|
|
1002
|
-
export interface
|
|
1042
|
+
export interface RaydiumLaunchlabTradeEvent {
|
|
1003
1043
|
metadata: EventMetadata;
|
|
1004
1044
|
pool_state: string;
|
|
1005
1045
|
user: string;
|
|
@@ -1015,13 +1055,13 @@ export interface BaseMintParam {
|
|
|
1015
1055
|
uri: string;
|
|
1016
1056
|
decimals: number;
|
|
1017
1057
|
}
|
|
1018
|
-
export interface
|
|
1058
|
+
export interface RaydiumLaunchlabPoolCreateEvent {
|
|
1019
1059
|
metadata: EventMetadata;
|
|
1020
1060
|
base_mint_param: BaseMintParam;
|
|
1021
1061
|
pool_state: string;
|
|
1022
1062
|
creator: string;
|
|
1023
1063
|
}
|
|
1024
|
-
export interface
|
|
1064
|
+
export interface RaydiumLaunchlabMigrateAmmEvent {
|
|
1025
1065
|
metadata: EventMetadata;
|
|
1026
1066
|
old_pool: string;
|
|
1027
1067
|
new_pool: string;
|
|
@@ -1079,12 +1119,91 @@ export interface PumpFunGlobal {
|
|
|
1079
1119
|
reserved_fee_recipient: string;
|
|
1080
1120
|
mayhem_mode_enabled: boolean;
|
|
1081
1121
|
reserved_fee_recipients: string[];
|
|
1122
|
+
is_cashback_enabled: boolean;
|
|
1123
|
+
buyback_fee_recipients: string[];
|
|
1124
|
+
buyback_basis_points: bigint;
|
|
1125
|
+
initial_virtual_quote_reserves: bigint;
|
|
1126
|
+
whitelisted_quote_mints: string[];
|
|
1082
1127
|
}
|
|
1083
1128
|
export interface PumpFunGlobalAccountEvent {
|
|
1084
1129
|
metadata: EventMetadata;
|
|
1085
1130
|
pubkey: string;
|
|
1086
1131
|
global: PumpFunGlobal;
|
|
1087
1132
|
}
|
|
1133
|
+
export interface PumpFunBondingCurve {
|
|
1134
|
+
virtual_token_reserves: bigint;
|
|
1135
|
+
virtual_quote_reserves: bigint;
|
|
1136
|
+
real_token_reserves: bigint;
|
|
1137
|
+
real_quote_reserves: bigint;
|
|
1138
|
+
token_total_supply: bigint;
|
|
1139
|
+
complete: boolean;
|
|
1140
|
+
creator: string;
|
|
1141
|
+
is_mayhem_mode: boolean;
|
|
1142
|
+
is_cashback_coin: boolean;
|
|
1143
|
+
quote_mint: string;
|
|
1144
|
+
}
|
|
1145
|
+
export interface PumpFunBondingCurveAccountEvent {
|
|
1146
|
+
metadata: EventMetadata;
|
|
1147
|
+
pubkey: string;
|
|
1148
|
+
bonding_curve: PumpFunBondingCurve;
|
|
1149
|
+
}
|
|
1150
|
+
export interface PumpFunFeeConfig {
|
|
1151
|
+
bump: number;
|
|
1152
|
+
admin: string;
|
|
1153
|
+
flat_fees: PumpFeesFees;
|
|
1154
|
+
fee_tiers: PumpFeesFeeTier[];
|
|
1155
|
+
stable_fee_tiers: PumpFeesFeeTier[];
|
|
1156
|
+
}
|
|
1157
|
+
export interface PumpFunFeeConfigAccountEvent {
|
|
1158
|
+
metadata: EventMetadata;
|
|
1159
|
+
pubkey: string;
|
|
1160
|
+
fee_config: PumpFunFeeConfig;
|
|
1161
|
+
}
|
|
1162
|
+
export interface PumpFunSharingConfig {
|
|
1163
|
+
bump: number;
|
|
1164
|
+
version: number;
|
|
1165
|
+
status: PumpFeesConfigStatus;
|
|
1166
|
+
mint: string;
|
|
1167
|
+
admin: string;
|
|
1168
|
+
admin_revoked: boolean;
|
|
1169
|
+
shareholders: PumpFeesShareholder[];
|
|
1170
|
+
}
|
|
1171
|
+
export interface PumpFunSharingConfigAccountEvent {
|
|
1172
|
+
metadata: EventMetadata;
|
|
1173
|
+
pubkey: string;
|
|
1174
|
+
sharing_config: PumpFunSharingConfig;
|
|
1175
|
+
}
|
|
1176
|
+
export interface PumpFunGlobalVolumeAccumulator {
|
|
1177
|
+
start_time: bigint;
|
|
1178
|
+
end_time: bigint;
|
|
1179
|
+
seconds_in_a_day: bigint;
|
|
1180
|
+
mint: string;
|
|
1181
|
+
total_token_supply: bigint[];
|
|
1182
|
+
sol_volumes: bigint[];
|
|
1183
|
+
}
|
|
1184
|
+
export interface PumpFunGlobalVolumeAccumulatorAccountEvent {
|
|
1185
|
+
metadata: EventMetadata;
|
|
1186
|
+
pubkey: string;
|
|
1187
|
+
global_volume_accumulator: PumpFunGlobalVolumeAccumulator;
|
|
1188
|
+
}
|
|
1189
|
+
export interface PumpFunUserVolumeAccumulator {
|
|
1190
|
+
user: string;
|
|
1191
|
+
needs_claim: boolean;
|
|
1192
|
+
total_unclaimed_tokens: bigint;
|
|
1193
|
+
total_claimed_tokens: bigint;
|
|
1194
|
+
current_sol_volume: bigint;
|
|
1195
|
+
last_update_timestamp: bigint;
|
|
1196
|
+
has_total_claimed_tokens: boolean;
|
|
1197
|
+
cashback_earned: bigint;
|
|
1198
|
+
total_cashback_claimed: bigint;
|
|
1199
|
+
stable_cashback_earned: bigint;
|
|
1200
|
+
total_stable_cashback_claimed: bigint;
|
|
1201
|
+
}
|
|
1202
|
+
export interface PumpFunUserVolumeAccumulatorAccountEvent {
|
|
1203
|
+
metadata: EventMetadata;
|
|
1204
|
+
pubkey: string;
|
|
1205
|
+
user_volume_accumulator: PumpFunUserVolumeAccumulator;
|
|
1206
|
+
}
|
|
1088
1207
|
export interface PumpSwapGlobalConfig {
|
|
1089
1208
|
admin: string;
|
|
1090
1209
|
lp_fee_basis_points: bigint;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DexEvent } from "./dex_event.js";
|
|
2
|
+
export declare function enrichCreateV2FromCreateEvents(events: DexEvent[]): void;
|
|
2
3
|
export declare function enrichCreateV2ObservedFeeRecipient(events: DexEvent[]): void;
|
|
3
4
|
export declare function enrichPumpfunTradesFromCreateInstructions(events: DexEvent[]): void;
|
|
4
5
|
export declare function enrichPumpfunSameTxPostMerge(events: DexEvent[]): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enrichCreateV2FromCreateEvents = enrichCreateV2FromCreateEvents;
|
|
3
4
|
exports.enrichCreateV2ObservedFeeRecipient = enrichCreateV2ObservedFeeRecipient;
|
|
4
5
|
exports.enrichPumpfunTradesFromCreateInstructions = enrichPumpfunTradesFromCreateInstructions;
|
|
5
6
|
exports.enrichPumpfunSameTxPostMerge = enrichPumpfunSameTxPostMerge;
|
|
@@ -25,6 +26,55 @@ function pumpfunCreateFlags(ev) {
|
|
|
25
26
|
return null;
|
|
26
27
|
return [c.mint, c.is_cashback_enabled, c.is_mayhem_mode];
|
|
27
28
|
}
|
|
29
|
+
function fillString(dst, key, value) {
|
|
30
|
+
const zero = (0, dex_event_js_1.defaultPubkey)();
|
|
31
|
+
if ((!dst[key] || dst[key] === zero) && value && value !== zero) {
|
|
32
|
+
dst[key] = value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function fillBigint(dst, key, value) {
|
|
36
|
+
if (dst[key] === 0n && value !== 0n) {
|
|
37
|
+
dst[key] = value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function enrichCreateV2FromCreateEvents(events) {
|
|
41
|
+
const zero = (0, dex_event_js_1.defaultPubkey)();
|
|
42
|
+
const creates = new Map();
|
|
43
|
+
for (const ev of events) {
|
|
44
|
+
if (!("PumpFunCreate" in ev))
|
|
45
|
+
continue;
|
|
46
|
+
const c = ev.PumpFunCreate;
|
|
47
|
+
if (c.mint && c.mint !== zero && !creates.has(c.mint)) {
|
|
48
|
+
creates.set(c.mint, c);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (creates.size === 0)
|
|
52
|
+
return;
|
|
53
|
+
for (const ev of events) {
|
|
54
|
+
if (!("PumpFunCreateV2" in ev))
|
|
55
|
+
continue;
|
|
56
|
+
const c2 = ev.PumpFunCreateV2;
|
|
57
|
+
const c = creates.get(c2.mint);
|
|
58
|
+
if (!c)
|
|
59
|
+
continue;
|
|
60
|
+
fillString(c2, "name", c.name);
|
|
61
|
+
fillString(c2, "symbol", c.symbol);
|
|
62
|
+
fillString(c2, "uri", c.uri);
|
|
63
|
+
fillString(c2, "bonding_curve", c.bonding_curve);
|
|
64
|
+
fillString(c2, "user", c.user);
|
|
65
|
+
fillString(c2, "creator", c.creator);
|
|
66
|
+
fillString(c2, "token_program", c.token_program);
|
|
67
|
+
fillString(c2, "quote_mint", c.quote_mint);
|
|
68
|
+
fillBigint(c2, "timestamp", c.timestamp);
|
|
69
|
+
fillBigint(c2, "virtual_token_reserves", c.virtual_token_reserves);
|
|
70
|
+
fillBigint(c2, "virtual_sol_reserves", c.virtual_sol_reserves);
|
|
71
|
+
fillBigint(c2, "real_token_reserves", c.real_token_reserves);
|
|
72
|
+
fillBigint(c2, "token_total_supply", c.token_total_supply);
|
|
73
|
+
fillBigint(c2, "virtual_quote_reserves", c.virtual_quote_reserves);
|
|
74
|
+
c2.is_mayhem_mode ||= c.is_mayhem_mode;
|
|
75
|
+
c2.is_cashback_enabled ||= c.is_cashback_enabled;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
28
78
|
function enrichCreateV2ObservedFeeRecipient(events) {
|
|
29
79
|
const zero = (0, dex_event_js_1.defaultPubkey)();
|
|
30
80
|
const mintToFee = new Map();
|
|
@@ -75,6 +125,7 @@ function enrichPumpfunTradesFromCreateInstructions(events) {
|
|
|
75
125
|
}
|
|
76
126
|
}
|
|
77
127
|
function enrichPumpfunSameTxPostMerge(events) {
|
|
128
|
+
enrichCreateV2FromCreateEvents(events);
|
|
78
129
|
enrichCreateV2ObservedFeeRecipient(events);
|
|
79
130
|
enrichPumpfunTradesFromCreateInstructions(events);
|
|
80
131
|
}
|