Skip to content

Commit 03a4e7b

Browse files
authored
Add mayhem mode support and Token2022 integration (#149)
* feat: mayhem update in idl * feat(examples): update bonding curve scripts * feat(example): update listen_blocksubscribe * feat(examples): update geyser listener * feat(examples): update all new token listeners * feat(examples): add comments, fix printing, formatting * feat(examples): pumpswap buy and sell update with mayhem mode * fix(examples): sell pump amm fee recipient * feat(examples): update decode scripts * feat(examples): update fetch price * feat(examples): buy and sell bonding curve scripts * feat(examples): add mint with mayhem mode enabled * feat(examples): improve listening to wallet txs * feat(examples): migration listener improvements * feat(examples): global vol accumulator is not writable * feat(examples): support token/token2022 programs in buy instructions * feat(examples): token/token2022 for pumpswap buy * feat(examples): token/token2022 supprot for sell instructions * feat(bot): support create_v2 with token2022, mayhem mode, other fixes * fix(bot): support only token2022 in logs and pumportal listeners * feat(bot): token2022 support in cleanup flow * fix(bot): update token program handling and improve price validation in trading logic * feat(bot): enhance token program handling for LetsBonk integration
1 parent 7ae8b56 commit 03a4e7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5358
-1650
lines changed

idl/pump_fun_idl.json

Lines changed: 1600 additions & 925 deletions
Large diffs are not rendered by default.

idl/pump_swap_idl.json

Lines changed: 241 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@
543543
},
544544
{
545545
"name": "global_volume_accumulator",
546-
"writable": true,
547546
"pda": {
548547
"seeds": [
549548
{
@@ -972,7 +971,6 @@
972971
},
973972
{
974973
"name": "global_volume_accumulator",
975-
"writable": true,
976974
"pda": {
977975
"seeds": [
978976
{
@@ -2085,6 +2083,10 @@
20852083
{
20862084
"name": "coin_creator",
20872085
"type": "pubkey"
2086+
},
2087+
{
2088+
"name": "is_mayhem_mode",
2089+
"type": "bool"
20882090
}
20892091
]
20902092
},
@@ -3006,6 +3008,92 @@
30063008
],
30073009
"args": []
30083010
},
3011+
{
3012+
"name": "set_reserved_fee_recipients",
3013+
"discriminator": [
3014+
111,
3015+
172,
3016+
162,
3017+
232,
3018+
114,
3019+
89,
3020+
213,
3021+
142
3022+
],
3023+
"accounts": [
3024+
{
3025+
"name": "global_config",
3026+
"writable": true,
3027+
"pda": {
3028+
"seeds": [
3029+
{
3030+
"kind": "const",
3031+
"value": [
3032+
103,
3033+
108,
3034+
111,
3035+
98,
3036+
97,
3037+
108,
3038+
95,
3039+
99,
3040+
111,
3041+
110,
3042+
102,
3043+
105,
3044+
103
3045+
]
3046+
}
3047+
]
3048+
}
3049+
},
3050+
{
3051+
"name": "admin",
3052+
"signer": true,
3053+
"relations": [
3054+
"global_config"
3055+
]
3056+
},
3057+
{
3058+
"name": "event_authority",
3059+
"pda": {
3060+
"seeds": [
3061+
{
3062+
"kind": "const",
3063+
"value": [
3064+
95,
3065+
95,
3066+
101,
3067+
118,
3068+
101,
3069+
110,
3070+
116,
3071+
95,
3072+
97,
3073+
117,
3074+
116,
3075+
104,
3076+
111,
3077+
114,
3078+
105,
3079+
116,
3080+
121
3081+
]
3082+
}
3083+
]
3084+
}
3085+
},
3086+
{
3087+
"name": "program"
3088+
}
3089+
],
3090+
"args": [
3091+
{
3092+
"name": "whitelist_pda",
3093+
"type": "pubkey"
3094+
}
3095+
]
3096+
},
30093097
{
30103098
"name": "sync_user_volume_accumulator",
30113099
"discriminator": [
@@ -3134,6 +3222,70 @@
31343222
],
31353223
"args": []
31363224
},
3225+
{
3226+
"name": "toggle_mayhem_mode",
3227+
"discriminator": [
3228+
1,
3229+
9,
3230+
111,
3231+
208,
3232+
100,
3233+
31,
3234+
255,
3235+
163
3236+
],
3237+
"accounts": [
3238+
{
3239+
"name": "admin",
3240+
"signer": true,
3241+
"relations": [
3242+
"global_config"
3243+
]
3244+
},
3245+
{
3246+
"name": "global_config",
3247+
"writable": true
3248+
},
3249+
{
3250+
"name": "event_authority",
3251+
"pda": {
3252+
"seeds": [
3253+
{
3254+
"kind": "const",
3255+
"value": [
3256+
95,
3257+
95,
3258+
101,
3259+
118,
3260+
101,
3261+
110,
3262+
116,
3263+
95,
3264+
97,
3265+
117,
3266+
116,
3267+
104,
3268+
111,
3269+
114,
3270+
105,
3271+
116,
3272+
121
3273+
]
3274+
}
3275+
]
3276+
}
3277+
},
3278+
{
3279+
"name": "program"
3280+
}
3281+
],
3282+
"args": [
3283+
{
3284+
"name": "enabled",
3285+
"type": "bool"
3286+
}
3287+
]
3288+
},
31373289
{
31383290
"name": "update_admin",
31393291
"discriminator": [
@@ -3644,6 +3796,19 @@
36443796
216
36453797
]
36463798
},
3799+
{
3800+
"name": "ReservedFeeRecipientsEvent",
3801+
"discriminator": [
3802+
43,
3803+
188,
3804+
250,
3805+
18,
3806+
221,
3807+
75,
3808+
187,
3809+
95
3810+
]
3811+
},
36473812
{
36483813
"name": "SellEvent",
36493814
"discriminator": [
@@ -3902,6 +4067,22 @@
39024067
"code": 6040,
39034068
"name": "BuySlippageBelowMinBaseAmountOut",
39044069
"msg": "buy: slippage - would buy less tokens than expected min_base_amount_out"
4070+
},
4071+
{
4072+
"code": 6041,
4073+
"name": "MayhemModeDisabled"
4074+
},
4075+
{
4076+
"code": 6042,
4077+
"name": "OnlyPumpPoolsMayhemMode"
4078+
},
4079+
{
4080+
"code": 6043,
4081+
"name": "MayhemModeInDesiredState"
4082+
},
4083+
{
4084+
"code": 6044,
4085+
"name": "NotEnoughRemainingAccounts"
39054086
}
39064087
],
39074088
"types": [
@@ -4005,6 +4186,10 @@
40054186
{
40064187
"name": "creator",
40074188
"type": "pubkey"
4189+
},
4190+
{
4191+
"name": "is_mayhem_mode",
4192+
"type": "bool"
40084193
}
40094194
]
40104195
}
@@ -4357,6 +4542,10 @@
43574542
{
43584543
"name": "coin_creator",
43594544
"type": "pubkey"
4545+
},
4546+
{
4547+
"name": "is_mayhem_mode",
4548+
"type": "bool"
43604549
}
43614550
]
43624551
}
@@ -4625,6 +4814,27 @@
46254814
"The admin authority for setting coin creators"
46264815
],
46274816
"type": "pubkey"
4817+
},
4818+
{
4819+
"name": "whitelist_pda",
4820+
"type": "pubkey"
4821+
},
4822+
{
4823+
"name": "reserved_fee_recipient",
4824+
"type": "pubkey"
4825+
},
4826+
{
4827+
"name": "mayhem_mode_enabled",
4828+
"type": "bool"
4829+
},
4830+
{
4831+
"name": "reserved_fee_recipients",
4832+
"type": {
4833+
"array": [
4834+
"pubkey",
4835+
7
4836+
]
4837+
}
46284838
}
46294839
]
46304840
}
@@ -4747,6 +4957,35 @@
47474957
{
47484958
"name": "coin_creator",
47494959
"type": "pubkey"
4960+
},
4961+
{
4962+
"name": "is_mayhem_mode",
4963+
"type": "bool"
4964+
}
4965+
]
4966+
}
4967+
},
4968+
{
4969+
"name": "ReservedFeeRecipientsEvent",
4970+
"type": {
4971+
"kind": "struct",
4972+
"fields": [
4973+
{
4974+
"name": "timestamp",
4975+
"type": "i64"
4976+
},
4977+
{
4978+
"name": "reserved_fee_recipient",
4979+
"type": "pubkey"
4980+
},
4981+
{
4982+
"name": "reserved_fee_recipients",
4983+
"type": {
4984+
"array": [
4985+
"pubkey",
4986+
7
4987+
]
4988+
}
47504989
}
47514990
]
47524991
}

0 commit comments

Comments
 (0)