@paul.lumberwork/bonding-curve-sdk 1.0.0

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.
@@ -0,0 +1,3411 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { Program } from '@coral-xyz/anchor';
3
+ import { PublicKey, Connection, Keypair } from '@solana/web3.js';
4
+
5
+ /**
6
+ * Program IDL in camelCase format in order to be used in JS/TS.
7
+ *
8
+ * Note that this is only a type helper and is not the actual IDL. The original
9
+ * IDL can be found at `target/idl/pump_fun_program.json`.
10
+ */
11
+ type PumpFunProgram = {
12
+ "address": "6o7oTqg2CfvcMCJTLNEJsef7c875zGpTvcnFctNAjudL";
13
+ "metadata": {
14
+ "name": "pumpFunProgram";
15
+ "version": "0.1.0";
16
+ "spec": "0.1.0";
17
+ "description": "Pump.fun Clone - IDO Launchpad with Bonding Curve";
18
+ };
19
+ "instructions": [
20
+ {
21
+ "name": "adminWithdraw";
22
+ "docs": [
23
+ "Admin withdraw after curve is complete (70% filled)",
24
+ "Transfers:",
25
+ "- Accumulated fees (0.5% from trades) → treasury wallet",
26
+ "- 10% treasury tokens → treasury wallet",
27
+ "- LP SOL → admin wallet (for DEX)",
28
+ "- 20% LP tokens → admin wallet (for DEX)",
29
+ "Only callable by hardcoded admin wallet"
30
+ ];
31
+ "discriminator": [
32
+ 160,
33
+ 166,
34
+ 147,
35
+ 222,
36
+ 46,
37
+ 220,
38
+ 75,
39
+ 224
40
+ ];
41
+ "accounts": [
42
+ {
43
+ "name": "admin";
44
+ "docs": [
45
+ "Admin signer - must match ADMIN_WALLET"
46
+ ];
47
+ "writable": true;
48
+ "signer": true;
49
+ },
50
+ {
51
+ "name": "launchpad";
52
+ "docs": [
53
+ "Launchpad account (needed for treasury address)"
54
+ ];
55
+ "pda": {
56
+ "seeds": [
57
+ {
58
+ "kind": "const";
59
+ "value": [
60
+ 108,
61
+ 97,
62
+ 117,
63
+ 110,
64
+ 99,
65
+ 104,
66
+ 112,
67
+ 97,
68
+ 100
69
+ ];
70
+ }
71
+ ];
72
+ };
73
+ },
74
+ {
75
+ "name": "tokenLaunch";
76
+ "writable": true;
77
+ "pda": {
78
+ "seeds": [
79
+ {
80
+ "kind": "const";
81
+ "value": [
82
+ 116,
83
+ 111,
84
+ 107,
85
+ 101,
86
+ 110,
87
+ 95,
88
+ 108,
89
+ 97,
90
+ 117,
91
+ 110,
92
+ 99,
93
+ 104
94
+ ];
95
+ },
96
+ {
97
+ "kind": "account";
98
+ "path": "mint";
99
+ }
100
+ ];
101
+ };
102
+ },
103
+ {
104
+ "name": "bondingCurve";
105
+ "writable": true;
106
+ "pda": {
107
+ "seeds": [
108
+ {
109
+ "kind": "const";
110
+ "value": [
111
+ 98,
112
+ 111,
113
+ 110,
114
+ 100,
115
+ 105,
116
+ 110,
117
+ 103,
118
+ 95,
119
+ 99,
120
+ 117,
121
+ 114,
122
+ 118,
123
+ 101
124
+ ];
125
+ },
126
+ {
127
+ "kind": "account";
128
+ "path": "tokenLaunch";
129
+ }
130
+ ];
131
+ };
132
+ },
133
+ {
134
+ "name": "mint";
135
+ "docs": [
136
+ "Token mint"
137
+ ];
138
+ },
139
+ {
140
+ "name": "vault";
141
+ "docs": [
142
+ "Vault holding SOL from bonding curve sales"
143
+ ];
144
+ "writable": true;
145
+ "pda": {
146
+ "seeds": [
147
+ {
148
+ "kind": "const";
149
+ "value": [
150
+ 118,
151
+ 97,
152
+ 117,
153
+ 108,
154
+ 116
155
+ ];
156
+ },
157
+ {
158
+ "kind": "account";
159
+ "path": "tokenLaunch";
160
+ }
161
+ ];
162
+ };
163
+ },
164
+ {
165
+ "name": "curveTokenAccount";
166
+ "docs": [
167
+ "Curve token account holding tokens (70% curve + 20% LP + 10% treasury)"
168
+ ];
169
+ "writable": true;
170
+ "pda": {
171
+ "seeds": [
172
+ {
173
+ "kind": "account";
174
+ "path": "bondingCurve";
175
+ },
176
+ {
177
+ "kind": "const";
178
+ "value": [
179
+ 6,
180
+ 221,
181
+ 246,
182
+ 225,
183
+ 215,
184
+ 101,
185
+ 161,
186
+ 147,
187
+ 217,
188
+ 203,
189
+ 225,
190
+ 70,
191
+ 206,
192
+ 235,
193
+ 121,
194
+ 172,
195
+ 28,
196
+ 180,
197
+ 133,
198
+ 237,
199
+ 95,
200
+ 91,
201
+ 55,
202
+ 145,
203
+ 58,
204
+ 140,
205
+ 245,
206
+ 133,
207
+ 126,
208
+ 255,
209
+ 0,
210
+ 169
211
+ ];
212
+ },
213
+ {
214
+ "kind": "account";
215
+ "path": "mint";
216
+ }
217
+ ];
218
+ "program": {
219
+ "kind": "const";
220
+ "value": [
221
+ 140,
222
+ 151,
223
+ 37,
224
+ 143,
225
+ 78,
226
+ 36,
227
+ 137,
228
+ 241,
229
+ 187,
230
+ 61,
231
+ 16,
232
+ 41,
233
+ 20,
234
+ 142,
235
+ 13,
236
+ 131,
237
+ 11,
238
+ 90,
239
+ 19,
240
+ 153,
241
+ 218,
242
+ 255,
243
+ 16,
244
+ 132,
245
+ 4,
246
+ 142,
247
+ 123,
248
+ 216,
249
+ 219,
250
+ 233,
251
+ 248,
252
+ 89
253
+ ];
254
+ };
255
+ };
256
+ },
257
+ {
258
+ "name": "adminTokenAccount";
259
+ "docs": [
260
+ "Admin's token account to receive LP tokens (20%)"
261
+ ];
262
+ "writable": true;
263
+ "pda": {
264
+ "seeds": [
265
+ {
266
+ "kind": "account";
267
+ "path": "admin";
268
+ },
269
+ {
270
+ "kind": "const";
271
+ "value": [
272
+ 6,
273
+ 221,
274
+ 246,
275
+ 225,
276
+ 215,
277
+ 101,
278
+ 161,
279
+ 147,
280
+ 217,
281
+ 203,
282
+ 225,
283
+ 70,
284
+ 206,
285
+ 235,
286
+ 121,
287
+ 172,
288
+ 28,
289
+ 180,
290
+ 133,
291
+ 237,
292
+ 95,
293
+ 91,
294
+ 55,
295
+ 145,
296
+ 58,
297
+ 140,
298
+ 245,
299
+ 133,
300
+ 126,
301
+ 255,
302
+ 0,
303
+ 169
304
+ ];
305
+ },
306
+ {
307
+ "kind": "account";
308
+ "path": "mint";
309
+ }
310
+ ];
311
+ "program": {
312
+ "kind": "const";
313
+ "value": [
314
+ 140,
315
+ 151,
316
+ 37,
317
+ 143,
318
+ 78,
319
+ 36,
320
+ 137,
321
+ 241,
322
+ 187,
323
+ 61,
324
+ 16,
325
+ 41,
326
+ 20,
327
+ 142,
328
+ 13,
329
+ 131,
330
+ 11,
331
+ 90,
332
+ 19,
333
+ 153,
334
+ 218,
335
+ 255,
336
+ 16,
337
+ 132,
338
+ 4,
339
+ 142,
340
+ 123,
341
+ 216,
342
+ 219,
343
+ 233,
344
+ 248,
345
+ 89
346
+ ];
347
+ };
348
+ };
349
+ },
350
+ {
351
+ "name": "treasuryWallet";
352
+ "docs": [
353
+ "Treasury wallet to receive accumulated fees"
354
+ ];
355
+ "writable": true;
356
+ },
357
+ {
358
+ "name": "treasuryTokenAccount";
359
+ "docs": [
360
+ "Treasury's token account to receive treasury tokens (10%)"
361
+ ];
362
+ "writable": true;
363
+ "pda": {
364
+ "seeds": [
365
+ {
366
+ "kind": "account";
367
+ "path": "treasuryWallet";
368
+ },
369
+ {
370
+ "kind": "const";
371
+ "value": [
372
+ 6,
373
+ 221,
374
+ 246,
375
+ 225,
376
+ 215,
377
+ 101,
378
+ 161,
379
+ 147,
380
+ 217,
381
+ 203,
382
+ 225,
383
+ 70,
384
+ 206,
385
+ 235,
386
+ 121,
387
+ 172,
388
+ 28,
389
+ 180,
390
+ 133,
391
+ 237,
392
+ 95,
393
+ 91,
394
+ 55,
395
+ 145,
396
+ 58,
397
+ 140,
398
+ 245,
399
+ 133,
400
+ 126,
401
+ 255,
402
+ 0,
403
+ 169
404
+ ];
405
+ },
406
+ {
407
+ "kind": "account";
408
+ "path": "mint";
409
+ }
410
+ ];
411
+ "program": {
412
+ "kind": "const";
413
+ "value": [
414
+ 140,
415
+ 151,
416
+ 37,
417
+ 143,
418
+ 78,
419
+ 36,
420
+ 137,
421
+ 241,
422
+ 187,
423
+ 61,
424
+ 16,
425
+ 41,
426
+ 20,
427
+ 142,
428
+ 13,
429
+ 131,
430
+ 11,
431
+ 90,
432
+ 19,
433
+ 153,
434
+ 218,
435
+ 255,
436
+ 16,
437
+ 132,
438
+ 4,
439
+ 142,
440
+ 123,
441
+ 216,
442
+ 219,
443
+ 233,
444
+ 248,
445
+ 89
446
+ ];
447
+ };
448
+ };
449
+ },
450
+ {
451
+ "name": "systemProgram";
452
+ "address": "11111111111111111111111111111111";
453
+ },
454
+ {
455
+ "name": "tokenProgram";
456
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
457
+ },
458
+ {
459
+ "name": "associatedTokenProgram";
460
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
461
+ }
462
+ ];
463
+ "args": [];
464
+ },
465
+ {
466
+ "name": "buyTokens";
467
+ "docs": [
468
+ "Buy tokens on the bonding curve",
469
+ "Trading fee: 1% (0.5% admin immediate + 0.5% accumulated)"
470
+ ];
471
+ "discriminator": [
472
+ 189,
473
+ 21,
474
+ 230,
475
+ 133,
476
+ 247,
477
+ 2,
478
+ 110,
479
+ 42
480
+ ];
481
+ "accounts": [
482
+ {
483
+ "name": "contributor";
484
+ "writable": true;
485
+ "signer": true;
486
+ },
487
+ {
488
+ "name": "launchpad";
489
+ "writable": true;
490
+ "pda": {
491
+ "seeds": [
492
+ {
493
+ "kind": "const";
494
+ "value": [
495
+ 108,
496
+ 97,
497
+ 117,
498
+ 110,
499
+ 99,
500
+ 104,
501
+ 112,
502
+ 97,
503
+ 100
504
+ ];
505
+ }
506
+ ];
507
+ };
508
+ },
509
+ {
510
+ "name": "adminWallet";
511
+ "docs": [
512
+ "Admin wallet to receive admin fees (0.5%)"
513
+ ];
514
+ "writable": true;
515
+ },
516
+ {
517
+ "name": "tokenLaunch";
518
+ "writable": true;
519
+ "pda": {
520
+ "seeds": [
521
+ {
522
+ "kind": "const";
523
+ "value": [
524
+ 116,
525
+ 111,
526
+ 107,
527
+ 101,
528
+ 110,
529
+ 95,
530
+ 108,
531
+ 97,
532
+ 117,
533
+ 110,
534
+ 99,
535
+ 104
536
+ ];
537
+ },
538
+ {
539
+ "kind": "account";
540
+ "path": "mint";
541
+ }
542
+ ];
543
+ };
544
+ },
545
+ {
546
+ "name": "bondingCurve";
547
+ "writable": true;
548
+ "pda": {
549
+ "seeds": [
550
+ {
551
+ "kind": "const";
552
+ "value": [
553
+ 98,
554
+ 111,
555
+ 110,
556
+ 100,
557
+ 105,
558
+ 110,
559
+ 103,
560
+ 95,
561
+ 99,
562
+ 117,
563
+ 114,
564
+ 118,
565
+ 101
566
+ ];
567
+ },
568
+ {
569
+ "kind": "account";
570
+ "path": "tokenLaunch";
571
+ }
572
+ ];
573
+ };
574
+ },
575
+ {
576
+ "name": "mint";
577
+ "docs": [
578
+ "Token mint"
579
+ ];
580
+ "writable": true;
581
+ },
582
+ {
583
+ "name": "vault";
584
+ "docs": [
585
+ "Vault to receive SOL (after fees)"
586
+ ];
587
+ "writable": true;
588
+ "pda": {
589
+ "seeds": [
590
+ {
591
+ "kind": "const";
592
+ "value": [
593
+ 118,
594
+ 97,
595
+ 117,
596
+ 108,
597
+ 116
598
+ ];
599
+ },
600
+ {
601
+ "kind": "account";
602
+ "path": "tokenLaunch";
603
+ }
604
+ ];
605
+ };
606
+ },
607
+ {
608
+ "name": "curveTokenAccount";
609
+ "docs": [
610
+ "Curve token account holding tokens for sale"
611
+ ];
612
+ "writable": true;
613
+ "pda": {
614
+ "seeds": [
615
+ {
616
+ "kind": "account";
617
+ "path": "bondingCurve";
618
+ },
619
+ {
620
+ "kind": "const";
621
+ "value": [
622
+ 6,
623
+ 221,
624
+ 246,
625
+ 225,
626
+ 215,
627
+ 101,
628
+ 161,
629
+ 147,
630
+ 217,
631
+ 203,
632
+ 225,
633
+ 70,
634
+ 206,
635
+ 235,
636
+ 121,
637
+ 172,
638
+ 28,
639
+ 180,
640
+ 133,
641
+ 237,
642
+ 95,
643
+ 91,
644
+ 55,
645
+ 145,
646
+ 58,
647
+ 140,
648
+ 245,
649
+ 133,
650
+ 126,
651
+ 255,
652
+ 0,
653
+ 169
654
+ ];
655
+ },
656
+ {
657
+ "kind": "account";
658
+ "path": "mint";
659
+ }
660
+ ];
661
+ "program": {
662
+ "kind": "const";
663
+ "value": [
664
+ 140,
665
+ 151,
666
+ 37,
667
+ 143,
668
+ 78,
669
+ 36,
670
+ 137,
671
+ 241,
672
+ 187,
673
+ 61,
674
+ 16,
675
+ 41,
676
+ 20,
677
+ 142,
678
+ 13,
679
+ 131,
680
+ 11,
681
+ 90,
682
+ 19,
683
+ 153,
684
+ 218,
685
+ 255,
686
+ 16,
687
+ 132,
688
+ 4,
689
+ 142,
690
+ 123,
691
+ 216,
692
+ 219,
693
+ 233,
694
+ 248,
695
+ 89
696
+ ];
697
+ };
698
+ };
699
+ },
700
+ {
701
+ "name": "userTokenAccount";
702
+ "docs": [
703
+ "User's token account to receive purchased tokens"
704
+ ];
705
+ "writable": true;
706
+ "pda": {
707
+ "seeds": [
708
+ {
709
+ "kind": "account";
710
+ "path": "contributor";
711
+ },
712
+ {
713
+ "kind": "const";
714
+ "value": [
715
+ 6,
716
+ 221,
717
+ 246,
718
+ 225,
719
+ 215,
720
+ 101,
721
+ 161,
722
+ 147,
723
+ 217,
724
+ 203,
725
+ 225,
726
+ 70,
727
+ 206,
728
+ 235,
729
+ 121,
730
+ 172,
731
+ 28,
732
+ 180,
733
+ 133,
734
+ 237,
735
+ 95,
736
+ 91,
737
+ 55,
738
+ 145,
739
+ 58,
740
+ 140,
741
+ 245,
742
+ 133,
743
+ 126,
744
+ 255,
745
+ 0,
746
+ 169
747
+ ];
748
+ },
749
+ {
750
+ "kind": "account";
751
+ "path": "mint";
752
+ }
753
+ ];
754
+ "program": {
755
+ "kind": "const";
756
+ "value": [
757
+ 140,
758
+ 151,
759
+ 37,
760
+ 143,
761
+ 78,
762
+ 36,
763
+ 137,
764
+ 241,
765
+ 187,
766
+ 61,
767
+ 16,
768
+ 41,
769
+ 20,
770
+ 142,
771
+ 13,
772
+ 131,
773
+ 11,
774
+ 90,
775
+ 19,
776
+ 153,
777
+ 218,
778
+ 255,
779
+ 16,
780
+ 132,
781
+ 4,
782
+ 142,
783
+ 123,
784
+ 216,
785
+ 219,
786
+ 233,
787
+ 248,
788
+ 89
789
+ ];
790
+ };
791
+ };
792
+ },
793
+ {
794
+ "name": "userPosition";
795
+ "docs": [
796
+ "User position account to track contributions"
797
+ ];
798
+ "writable": true;
799
+ "pda": {
800
+ "seeds": [
801
+ {
802
+ "kind": "const";
803
+ "value": [
804
+ 117,
805
+ 115,
806
+ 101,
807
+ 114,
808
+ 95,
809
+ 112,
810
+ 111,
811
+ 115,
812
+ 105,
813
+ 116,
814
+ 105,
815
+ 111,
816
+ 110
817
+ ];
818
+ },
819
+ {
820
+ "kind": "account";
821
+ "path": "tokenLaunch";
822
+ },
823
+ {
824
+ "kind": "account";
825
+ "path": "contributor";
826
+ }
827
+ ];
828
+ };
829
+ },
830
+ {
831
+ "name": "systemProgram";
832
+ "address": "11111111111111111111111111111111";
833
+ },
834
+ {
835
+ "name": "tokenProgram";
836
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
837
+ },
838
+ {
839
+ "name": "associatedTokenProgram";
840
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
841
+ }
842
+ ];
843
+ "args": [
844
+ {
845
+ "name": "solAmount";
846
+ "type": "u64";
847
+ }
848
+ ];
849
+ },
850
+ {
851
+ "name": "claimTokens";
852
+ "docs": [
853
+ "Claim tokens after launch migration",
854
+ "Users receive their purchased tokens"
855
+ ];
856
+ "discriminator": [
857
+ 108,
858
+ 216,
859
+ 210,
860
+ 231,
861
+ 0,
862
+ 212,
863
+ 42,
864
+ 64
865
+ ];
866
+ "accounts": [
867
+ {
868
+ "name": "user";
869
+ "writable": true;
870
+ "signer": true;
871
+ },
872
+ {
873
+ "name": "tokenLaunch";
874
+ "pda": {
875
+ "seeds": [
876
+ {
877
+ "kind": "const";
878
+ "value": [
879
+ 116,
880
+ 111,
881
+ 107,
882
+ 101,
883
+ 110,
884
+ 95,
885
+ 108,
886
+ 97,
887
+ 117,
888
+ 110,
889
+ 99,
890
+ 104
891
+ ];
892
+ },
893
+ {
894
+ "kind": "account";
895
+ "path": "mint";
896
+ }
897
+ ];
898
+ };
899
+ },
900
+ {
901
+ "name": "bondingCurve";
902
+ "pda": {
903
+ "seeds": [
904
+ {
905
+ "kind": "const";
906
+ "value": [
907
+ 98,
908
+ 111,
909
+ 110,
910
+ 100,
911
+ 105,
912
+ 110,
913
+ 103,
914
+ 95,
915
+ 99,
916
+ 117,
917
+ 114,
918
+ 118,
919
+ 101
920
+ ];
921
+ },
922
+ {
923
+ "kind": "account";
924
+ "path": "tokenLaunch";
925
+ }
926
+ ];
927
+ };
928
+ },
929
+ {
930
+ "name": "mint";
931
+ "docs": [
932
+ "Token mint"
933
+ ];
934
+ },
935
+ {
936
+ "name": "curveTokenAccount";
937
+ "docs": [
938
+ "Token account holding tokens for distribution"
939
+ ];
940
+ "writable": true;
941
+ "pda": {
942
+ "seeds": [
943
+ {
944
+ "kind": "account";
945
+ "path": "bondingCurve";
946
+ },
947
+ {
948
+ "kind": "const";
949
+ "value": [
950
+ 6,
951
+ 221,
952
+ 246,
953
+ 225,
954
+ 215,
955
+ 101,
956
+ 161,
957
+ 147,
958
+ 217,
959
+ 203,
960
+ 225,
961
+ 70,
962
+ 206,
963
+ 235,
964
+ 121,
965
+ 172,
966
+ 28,
967
+ 180,
968
+ 133,
969
+ 237,
970
+ 95,
971
+ 91,
972
+ 55,
973
+ 145,
974
+ 58,
975
+ 140,
976
+ 245,
977
+ 133,
978
+ 126,
979
+ 255,
980
+ 0,
981
+ 169
982
+ ];
983
+ },
984
+ {
985
+ "kind": "account";
986
+ "path": "mint";
987
+ }
988
+ ];
989
+ "program": {
990
+ "kind": "const";
991
+ "value": [
992
+ 140,
993
+ 151,
994
+ 37,
995
+ 143,
996
+ 78,
997
+ 36,
998
+ 137,
999
+ 241,
1000
+ 187,
1001
+ 61,
1002
+ 16,
1003
+ 41,
1004
+ 20,
1005
+ 142,
1006
+ 13,
1007
+ 131,
1008
+ 11,
1009
+ 90,
1010
+ 19,
1011
+ 153,
1012
+ 218,
1013
+ 255,
1014
+ 16,
1015
+ 132,
1016
+ 4,
1017
+ 142,
1018
+ 123,
1019
+ 216,
1020
+ 219,
1021
+ 233,
1022
+ 248,
1023
+ 89
1024
+ ];
1025
+ };
1026
+ };
1027
+ },
1028
+ {
1029
+ "name": "userTokenAccount";
1030
+ "docs": [
1031
+ "User's token account"
1032
+ ];
1033
+ "writable": true;
1034
+ "pda": {
1035
+ "seeds": [
1036
+ {
1037
+ "kind": "account";
1038
+ "path": "user";
1039
+ },
1040
+ {
1041
+ "kind": "const";
1042
+ "value": [
1043
+ 6,
1044
+ 221,
1045
+ 246,
1046
+ 225,
1047
+ 215,
1048
+ 101,
1049
+ 161,
1050
+ 147,
1051
+ 217,
1052
+ 203,
1053
+ 225,
1054
+ 70,
1055
+ 206,
1056
+ 235,
1057
+ 121,
1058
+ 172,
1059
+ 28,
1060
+ 180,
1061
+ 133,
1062
+ 237,
1063
+ 95,
1064
+ 91,
1065
+ 55,
1066
+ 145,
1067
+ 58,
1068
+ 140,
1069
+ 245,
1070
+ 133,
1071
+ 126,
1072
+ 255,
1073
+ 0,
1074
+ 169
1075
+ ];
1076
+ },
1077
+ {
1078
+ "kind": "account";
1079
+ "path": "mint";
1080
+ }
1081
+ ];
1082
+ "program": {
1083
+ "kind": "const";
1084
+ "value": [
1085
+ 140,
1086
+ 151,
1087
+ 37,
1088
+ 143,
1089
+ 78,
1090
+ 36,
1091
+ 137,
1092
+ 241,
1093
+ 187,
1094
+ 61,
1095
+ 16,
1096
+ 41,
1097
+ 20,
1098
+ 142,
1099
+ 13,
1100
+ 131,
1101
+ 11,
1102
+ 90,
1103
+ 19,
1104
+ 153,
1105
+ 218,
1106
+ 255,
1107
+ 16,
1108
+ 132,
1109
+ 4,
1110
+ 142,
1111
+ 123,
1112
+ 216,
1113
+ 219,
1114
+ 233,
1115
+ 248,
1116
+ 89
1117
+ ];
1118
+ };
1119
+ };
1120
+ },
1121
+ {
1122
+ "name": "userPosition";
1123
+ "docs": [
1124
+ "User position account"
1125
+ ];
1126
+ "writable": true;
1127
+ "pda": {
1128
+ "seeds": [
1129
+ {
1130
+ "kind": "const";
1131
+ "value": [
1132
+ 117,
1133
+ 115,
1134
+ 101,
1135
+ 114,
1136
+ 95,
1137
+ 112,
1138
+ 111,
1139
+ 115,
1140
+ 105,
1141
+ 116,
1142
+ 105,
1143
+ 111,
1144
+ 110
1145
+ ];
1146
+ },
1147
+ {
1148
+ "kind": "account";
1149
+ "path": "tokenLaunch";
1150
+ },
1151
+ {
1152
+ "kind": "account";
1153
+ "path": "user";
1154
+ }
1155
+ ];
1156
+ };
1157
+ },
1158
+ {
1159
+ "name": "tokenProgram";
1160
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1161
+ },
1162
+ {
1163
+ "name": "associatedTokenProgram";
1164
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1165
+ },
1166
+ {
1167
+ "name": "systemProgram";
1168
+ "address": "11111111111111111111111111111111";
1169
+ }
1170
+ ];
1171
+ "args": [];
1172
+ },
1173
+ {
1174
+ "name": "completeLaunch";
1175
+ "docs": [
1176
+ "Complete the launch and migrate to DEX",
1177
+ "Requires: all 70% of curve tokens sold"
1178
+ ];
1179
+ "discriminator": [
1180
+ 118,
1181
+ 207,
1182
+ 250,
1183
+ 130,
1184
+ 44,
1185
+ 148,
1186
+ 251,
1187
+ 237
1188
+ ];
1189
+ "accounts": [
1190
+ {
1191
+ "name": "creator";
1192
+ "writable": true;
1193
+ "signer": true;
1194
+ },
1195
+ {
1196
+ "name": "launchpad";
1197
+ "writable": true;
1198
+ "pda": {
1199
+ "seeds": [
1200
+ {
1201
+ "kind": "const";
1202
+ "value": [
1203
+ 108,
1204
+ 97,
1205
+ 117,
1206
+ 110,
1207
+ 99,
1208
+ 104,
1209
+ 112,
1210
+ 97,
1211
+ 100
1212
+ ];
1213
+ }
1214
+ ];
1215
+ };
1216
+ },
1217
+ {
1218
+ "name": "tokenLaunch";
1219
+ "writable": true;
1220
+ "pda": {
1221
+ "seeds": [
1222
+ {
1223
+ "kind": "const";
1224
+ "value": [
1225
+ 116,
1226
+ 111,
1227
+ 107,
1228
+ 101,
1229
+ 110,
1230
+ 95,
1231
+ 108,
1232
+ 97,
1233
+ 117,
1234
+ 110,
1235
+ 99,
1236
+ 104
1237
+ ];
1238
+ },
1239
+ {
1240
+ "kind": "account";
1241
+ "path": "mint";
1242
+ }
1243
+ ];
1244
+ };
1245
+ },
1246
+ {
1247
+ "name": "bondingCurve";
1248
+ "writable": true;
1249
+ "pda": {
1250
+ "seeds": [
1251
+ {
1252
+ "kind": "const";
1253
+ "value": [
1254
+ 98,
1255
+ 111,
1256
+ 110,
1257
+ 100,
1258
+ 105,
1259
+ 110,
1260
+ 103,
1261
+ 95,
1262
+ 99,
1263
+ 117,
1264
+ 114,
1265
+ 118,
1266
+ 101
1267
+ ];
1268
+ },
1269
+ {
1270
+ "kind": "account";
1271
+ "path": "tokenLaunch";
1272
+ }
1273
+ ];
1274
+ };
1275
+ },
1276
+ {
1277
+ "name": "mint";
1278
+ "writable": true;
1279
+ },
1280
+ {
1281
+ "name": "vault";
1282
+ "docs": [
1283
+ "Vault holding collected SOL"
1284
+ ];
1285
+ "writable": true;
1286
+ "pda": {
1287
+ "seeds": [
1288
+ {
1289
+ "kind": "const";
1290
+ "value": [
1291
+ 118,
1292
+ 97,
1293
+ 117,
1294
+ 108,
1295
+ 116
1296
+ ];
1297
+ },
1298
+ {
1299
+ "kind": "account";
1300
+ "path": "tokenLaunch";
1301
+ }
1302
+ ];
1303
+ };
1304
+ },
1305
+ {
1306
+ "name": "curveTokenAccount";
1307
+ "docs": [
1308
+ "Token account holding curve tokens (20% LP reserve)"
1309
+ ];
1310
+ "writable": true;
1311
+ "pda": {
1312
+ "seeds": [
1313
+ {
1314
+ "kind": "account";
1315
+ "path": "bondingCurve";
1316
+ },
1317
+ {
1318
+ "kind": "const";
1319
+ "value": [
1320
+ 6,
1321
+ 221,
1322
+ 246,
1323
+ 225,
1324
+ 215,
1325
+ 101,
1326
+ 161,
1327
+ 147,
1328
+ 217,
1329
+ 203,
1330
+ 225,
1331
+ 70,
1332
+ 206,
1333
+ 235,
1334
+ 121,
1335
+ 172,
1336
+ 28,
1337
+ 180,
1338
+ 133,
1339
+ 237,
1340
+ 95,
1341
+ 91,
1342
+ 55,
1343
+ 145,
1344
+ 58,
1345
+ 140,
1346
+ 245,
1347
+ 133,
1348
+ 126,
1349
+ 255,
1350
+ 0,
1351
+ 169
1352
+ ];
1353
+ },
1354
+ {
1355
+ "kind": "account";
1356
+ "path": "mint";
1357
+ }
1358
+ ];
1359
+ "program": {
1360
+ "kind": "const";
1361
+ "value": [
1362
+ 140,
1363
+ 151,
1364
+ 37,
1365
+ 143,
1366
+ 78,
1367
+ 36,
1368
+ 137,
1369
+ 241,
1370
+ 187,
1371
+ 61,
1372
+ 16,
1373
+ 41,
1374
+ 20,
1375
+ 142,
1376
+ 13,
1377
+ 131,
1378
+ 11,
1379
+ 90,
1380
+ 19,
1381
+ 153,
1382
+ 218,
1383
+ 255,
1384
+ 16,
1385
+ 132,
1386
+ 4,
1387
+ 142,
1388
+ 123,
1389
+ 216,
1390
+ 219,
1391
+ 233,
1392
+ 248,
1393
+ 89
1394
+ ];
1395
+ };
1396
+ };
1397
+ },
1398
+ {
1399
+ "name": "tokenProgram";
1400
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1401
+ },
1402
+ {
1403
+ "name": "systemProgram";
1404
+ "address": "11111111111111111111111111111111";
1405
+ }
1406
+ ];
1407
+ "args": [];
1408
+ },
1409
+ {
1410
+ "name": "createTokenLaunch";
1411
+ "docs": [
1412
+ "Create a new token launch with Linear Bonding Curve (like pump.fun)",
1413
+ "Formula: price = k × sold_supply",
1414
+ "Simple model: 70% for bonding curve, 20% for LP, 10% for treasury, 1% trading fee",
1415
+ "If initial_k = 0, auto-calculates k for 69 SOL target"
1416
+ ];
1417
+ "discriminator": [
1418
+ 93,
1419
+ 87,
1420
+ 58,
1421
+ 126,
1422
+ 88,
1423
+ 75,
1424
+ 172,
1425
+ 233
1426
+ ];
1427
+ "accounts": [
1428
+ {
1429
+ "name": "creator";
1430
+ "writable": true;
1431
+ "signer": true;
1432
+ },
1433
+ {
1434
+ "name": "launchpad";
1435
+ "writable": true;
1436
+ "pda": {
1437
+ "seeds": [
1438
+ {
1439
+ "kind": "const";
1440
+ "value": [
1441
+ 108,
1442
+ 97,
1443
+ 117,
1444
+ 110,
1445
+ 99,
1446
+ 104,
1447
+ 112,
1448
+ 97,
1449
+ 100
1450
+ ];
1451
+ }
1452
+ ];
1453
+ };
1454
+ },
1455
+ {
1456
+ "name": "mint";
1457
+ "writable": true;
1458
+ "signer": true;
1459
+ },
1460
+ {
1461
+ "name": "tokenLaunch";
1462
+ "writable": true;
1463
+ "pda": {
1464
+ "seeds": [
1465
+ {
1466
+ "kind": "const";
1467
+ "value": [
1468
+ 116,
1469
+ 111,
1470
+ 107,
1471
+ 101,
1472
+ 110,
1473
+ 95,
1474
+ 108,
1475
+ 97,
1476
+ 117,
1477
+ 110,
1478
+ 99,
1479
+ 104
1480
+ ];
1481
+ },
1482
+ {
1483
+ "kind": "account";
1484
+ "path": "mint";
1485
+ }
1486
+ ];
1487
+ };
1488
+ },
1489
+ {
1490
+ "name": "bondingCurve";
1491
+ "writable": true;
1492
+ "pda": {
1493
+ "seeds": [
1494
+ {
1495
+ "kind": "const";
1496
+ "value": [
1497
+ 98,
1498
+ 111,
1499
+ 110,
1500
+ 100,
1501
+ 105,
1502
+ 110,
1503
+ 103,
1504
+ 95,
1505
+ 99,
1506
+ 117,
1507
+ 114,
1508
+ 118,
1509
+ 101
1510
+ ];
1511
+ },
1512
+ {
1513
+ "kind": "account";
1514
+ "path": "tokenLaunch";
1515
+ }
1516
+ ];
1517
+ };
1518
+ },
1519
+ {
1520
+ "name": "vault";
1521
+ "docs": [
1522
+ "Vault to hold SOL collected during trading"
1523
+ ];
1524
+ "writable": true;
1525
+ "pda": {
1526
+ "seeds": [
1527
+ {
1528
+ "kind": "const";
1529
+ "value": [
1530
+ 118,
1531
+ 97,
1532
+ 117,
1533
+ 108,
1534
+ 116
1535
+ ];
1536
+ },
1537
+ {
1538
+ "kind": "account";
1539
+ "path": "tokenLaunch";
1540
+ }
1541
+ ];
1542
+ };
1543
+ },
1544
+ {
1545
+ "name": "curveTokenAccount";
1546
+ "docs": [
1547
+ "Token account to hold curve tokens"
1548
+ ];
1549
+ "writable": true;
1550
+ "pda": {
1551
+ "seeds": [
1552
+ {
1553
+ "kind": "account";
1554
+ "path": "bondingCurve";
1555
+ },
1556
+ {
1557
+ "kind": "const";
1558
+ "value": [
1559
+ 6,
1560
+ 221,
1561
+ 246,
1562
+ 225,
1563
+ 215,
1564
+ 101,
1565
+ 161,
1566
+ 147,
1567
+ 217,
1568
+ 203,
1569
+ 225,
1570
+ 70,
1571
+ 206,
1572
+ 235,
1573
+ 121,
1574
+ 172,
1575
+ 28,
1576
+ 180,
1577
+ 133,
1578
+ 237,
1579
+ 95,
1580
+ 91,
1581
+ 55,
1582
+ 145,
1583
+ 58,
1584
+ 140,
1585
+ 245,
1586
+ 133,
1587
+ 126,
1588
+ 255,
1589
+ 0,
1590
+ 169
1591
+ ];
1592
+ },
1593
+ {
1594
+ "kind": "account";
1595
+ "path": "mint";
1596
+ }
1597
+ ];
1598
+ "program": {
1599
+ "kind": "const";
1600
+ "value": [
1601
+ 140,
1602
+ 151,
1603
+ 37,
1604
+ 143,
1605
+ 78,
1606
+ 36,
1607
+ 137,
1608
+ 241,
1609
+ 187,
1610
+ 61,
1611
+ 16,
1612
+ 41,
1613
+ 20,
1614
+ 142,
1615
+ 13,
1616
+ 131,
1617
+ 11,
1618
+ 90,
1619
+ 19,
1620
+ 153,
1621
+ 218,
1622
+ 255,
1623
+ 16,
1624
+ 132,
1625
+ 4,
1626
+ 142,
1627
+ 123,
1628
+ 216,
1629
+ 219,
1630
+ 233,
1631
+ 248,
1632
+ 89
1633
+ ];
1634
+ };
1635
+ };
1636
+ },
1637
+ {
1638
+ "name": "metadata";
1639
+ "docs": [
1640
+ "Metaplex metadata account (PDA derived from mint)"
1641
+ ];
1642
+ "writable": true;
1643
+ "pda": {
1644
+ "seeds": [
1645
+ {
1646
+ "kind": "const";
1647
+ "value": [
1648
+ 109,
1649
+ 101,
1650
+ 116,
1651
+ 97,
1652
+ 100,
1653
+ 97,
1654
+ 116,
1655
+ 97
1656
+ ];
1657
+ },
1658
+ {
1659
+ "kind": "account";
1660
+ "path": "metadataProgram";
1661
+ },
1662
+ {
1663
+ "kind": "account";
1664
+ "path": "mint";
1665
+ }
1666
+ ];
1667
+ "program": {
1668
+ "kind": "account";
1669
+ "path": "metadataProgram";
1670
+ };
1671
+ };
1672
+ },
1673
+ {
1674
+ "name": "tokenProgram";
1675
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1676
+ },
1677
+ {
1678
+ "name": "associatedTokenProgram";
1679
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1680
+ },
1681
+ {
1682
+ "name": "metadataProgram";
1683
+ "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";
1684
+ },
1685
+ {
1686
+ "name": "systemProgram";
1687
+ "address": "11111111111111111111111111111111";
1688
+ },
1689
+ {
1690
+ "name": "rent";
1691
+ "address": "SysvarRent111111111111111111111111111111111";
1692
+ }
1693
+ ];
1694
+ "args": [
1695
+ {
1696
+ "name": "name";
1697
+ "type": "string";
1698
+ },
1699
+ {
1700
+ "name": "symbol";
1701
+ "type": "string";
1702
+ },
1703
+ {
1704
+ "name": "uri";
1705
+ "type": "string";
1706
+ },
1707
+ {
1708
+ "name": "totalSupply";
1709
+ "type": "u64";
1710
+ },
1711
+ {
1712
+ "name": "initialK";
1713
+ "type": "u128";
1714
+ }
1715
+ ];
1716
+ },
1717
+ {
1718
+ "name": "initializeLaunchpad";
1719
+ "docs": [
1720
+ "Initialize the launchpad platform (one-time setup)"
1721
+ ];
1722
+ "discriminator": [
1723
+ 220,
1724
+ 172,
1725
+ 45,
1726
+ 121,
1727
+ 79,
1728
+ 84,
1729
+ 246,
1730
+ 3
1731
+ ];
1732
+ "accounts": [
1733
+ {
1734
+ "name": "authority";
1735
+ "writable": true;
1736
+ "signer": true;
1737
+ },
1738
+ {
1739
+ "name": "launchpad";
1740
+ "writable": true;
1741
+ "pda": {
1742
+ "seeds": [
1743
+ {
1744
+ "kind": "const";
1745
+ "value": [
1746
+ 108,
1747
+ 97,
1748
+ 117,
1749
+ 110,
1750
+ 99,
1751
+ 104,
1752
+ 112,
1753
+ 97,
1754
+ 100
1755
+ ];
1756
+ }
1757
+ ];
1758
+ };
1759
+ },
1760
+ {
1761
+ "name": "treasury";
1762
+ "docs": [
1763
+ "Treasury account to receive platform fees"
1764
+ ];
1765
+ },
1766
+ {
1767
+ "name": "systemProgram";
1768
+ "address": "11111111111111111111111111111111";
1769
+ }
1770
+ ];
1771
+ "args": [
1772
+ {
1773
+ "name": "feeBps";
1774
+ "type": "u16";
1775
+ }
1776
+ ];
1777
+ },
1778
+ {
1779
+ "name": "sellTokens";
1780
+ "docs": [
1781
+ "Sell tokens on the bonding curve",
1782
+ "Trading fee: 1% (0.5% admin immediate + 0.5% accumulated)"
1783
+ ];
1784
+ "discriminator": [
1785
+ 114,
1786
+ 242,
1787
+ 25,
1788
+ 12,
1789
+ 62,
1790
+ 126,
1791
+ 92,
1792
+ 2
1793
+ ];
1794
+ "accounts": [
1795
+ {
1796
+ "name": "contributor";
1797
+ "writable": true;
1798
+ "signer": true;
1799
+ },
1800
+ {
1801
+ "name": "launchpad";
1802
+ "writable": true;
1803
+ "pda": {
1804
+ "seeds": [
1805
+ {
1806
+ "kind": "const";
1807
+ "value": [
1808
+ 108,
1809
+ 97,
1810
+ 117,
1811
+ 110,
1812
+ 99,
1813
+ 104,
1814
+ 112,
1815
+ 97,
1816
+ 100
1817
+ ];
1818
+ }
1819
+ ];
1820
+ };
1821
+ },
1822
+ {
1823
+ "name": "adminWallet";
1824
+ "docs": [
1825
+ "Admin wallet to receive admin fees (0.5%)"
1826
+ ];
1827
+ "writable": true;
1828
+ },
1829
+ {
1830
+ "name": "tokenLaunch";
1831
+ "writable": true;
1832
+ "pda": {
1833
+ "seeds": [
1834
+ {
1835
+ "kind": "const";
1836
+ "value": [
1837
+ 116,
1838
+ 111,
1839
+ 107,
1840
+ 101,
1841
+ 110,
1842
+ 95,
1843
+ 108,
1844
+ 97,
1845
+ 117,
1846
+ 110,
1847
+ 99,
1848
+ 104
1849
+ ];
1850
+ },
1851
+ {
1852
+ "kind": "account";
1853
+ "path": "mint";
1854
+ }
1855
+ ];
1856
+ };
1857
+ },
1858
+ {
1859
+ "name": "bondingCurve";
1860
+ "writable": true;
1861
+ "pda": {
1862
+ "seeds": [
1863
+ {
1864
+ "kind": "const";
1865
+ "value": [
1866
+ 98,
1867
+ 111,
1868
+ 110,
1869
+ 100,
1870
+ 105,
1871
+ 110,
1872
+ 103,
1873
+ 95,
1874
+ 99,
1875
+ 117,
1876
+ 114,
1877
+ 118,
1878
+ 101
1879
+ ];
1880
+ },
1881
+ {
1882
+ "kind": "account";
1883
+ "path": "tokenLaunch";
1884
+ }
1885
+ ];
1886
+ };
1887
+ },
1888
+ {
1889
+ "name": "mint";
1890
+ "docs": [
1891
+ "Token mint"
1892
+ ];
1893
+ },
1894
+ {
1895
+ "name": "vault";
1896
+ "docs": [
1897
+ "Vault holding SOL"
1898
+ ];
1899
+ "writable": true;
1900
+ "pda": {
1901
+ "seeds": [
1902
+ {
1903
+ "kind": "const";
1904
+ "value": [
1905
+ 118,
1906
+ 97,
1907
+ 117,
1908
+ 108,
1909
+ 116
1910
+ ];
1911
+ },
1912
+ {
1913
+ "kind": "account";
1914
+ "path": "tokenLaunch";
1915
+ }
1916
+ ];
1917
+ };
1918
+ },
1919
+ {
1920
+ "name": "curveTokenAccount";
1921
+ "docs": [
1922
+ "Curve token account to receive tokens back"
1923
+ ];
1924
+ "writable": true;
1925
+ "pda": {
1926
+ "seeds": [
1927
+ {
1928
+ "kind": "account";
1929
+ "path": "bondingCurve";
1930
+ },
1931
+ {
1932
+ "kind": "const";
1933
+ "value": [
1934
+ 6,
1935
+ 221,
1936
+ 246,
1937
+ 225,
1938
+ 215,
1939
+ 101,
1940
+ 161,
1941
+ 147,
1942
+ 217,
1943
+ 203,
1944
+ 225,
1945
+ 70,
1946
+ 206,
1947
+ 235,
1948
+ 121,
1949
+ 172,
1950
+ 28,
1951
+ 180,
1952
+ 133,
1953
+ 237,
1954
+ 95,
1955
+ 91,
1956
+ 55,
1957
+ 145,
1958
+ 58,
1959
+ 140,
1960
+ 245,
1961
+ 133,
1962
+ 126,
1963
+ 255,
1964
+ 0,
1965
+ 169
1966
+ ];
1967
+ },
1968
+ {
1969
+ "kind": "account";
1970
+ "path": "mint";
1971
+ }
1972
+ ];
1973
+ "program": {
1974
+ "kind": "const";
1975
+ "value": [
1976
+ 140,
1977
+ 151,
1978
+ 37,
1979
+ 143,
1980
+ 78,
1981
+ 36,
1982
+ 137,
1983
+ 241,
1984
+ 187,
1985
+ 61,
1986
+ 16,
1987
+ 41,
1988
+ 20,
1989
+ 142,
1990
+ 13,
1991
+ 131,
1992
+ 11,
1993
+ 90,
1994
+ 19,
1995
+ 153,
1996
+ 218,
1997
+ 255,
1998
+ 16,
1999
+ 132,
2000
+ 4,
2001
+ 142,
2002
+ 123,
2003
+ 216,
2004
+ 219,
2005
+ 233,
2006
+ 248,
2007
+ 89
2008
+ ];
2009
+ };
2010
+ };
2011
+ },
2012
+ {
2013
+ "name": "userTokenAccount";
2014
+ "docs": [
2015
+ "User's token account to send tokens from"
2016
+ ];
2017
+ "writable": true;
2018
+ "pda": {
2019
+ "seeds": [
2020
+ {
2021
+ "kind": "account";
2022
+ "path": "contributor";
2023
+ },
2024
+ {
2025
+ "kind": "const";
2026
+ "value": [
2027
+ 6,
2028
+ 221,
2029
+ 246,
2030
+ 225,
2031
+ 215,
2032
+ 101,
2033
+ 161,
2034
+ 147,
2035
+ 217,
2036
+ 203,
2037
+ 225,
2038
+ 70,
2039
+ 206,
2040
+ 235,
2041
+ 121,
2042
+ 172,
2043
+ 28,
2044
+ 180,
2045
+ 133,
2046
+ 237,
2047
+ 95,
2048
+ 91,
2049
+ 55,
2050
+ 145,
2051
+ 58,
2052
+ 140,
2053
+ 245,
2054
+ 133,
2055
+ 126,
2056
+ 255,
2057
+ 0,
2058
+ 169
2059
+ ];
2060
+ },
2061
+ {
2062
+ "kind": "account";
2063
+ "path": "mint";
2064
+ }
2065
+ ];
2066
+ "program": {
2067
+ "kind": "const";
2068
+ "value": [
2069
+ 140,
2070
+ 151,
2071
+ 37,
2072
+ 143,
2073
+ 78,
2074
+ 36,
2075
+ 137,
2076
+ 241,
2077
+ 187,
2078
+ 61,
2079
+ 16,
2080
+ 41,
2081
+ 20,
2082
+ 142,
2083
+ 13,
2084
+ 131,
2085
+ 11,
2086
+ 90,
2087
+ 19,
2088
+ 153,
2089
+ 218,
2090
+ 255,
2091
+ 16,
2092
+ 132,
2093
+ 4,
2094
+ 142,
2095
+ 123,
2096
+ 216,
2097
+ 219,
2098
+ 233,
2099
+ 248,
2100
+ 89
2101
+ ];
2102
+ };
2103
+ };
2104
+ },
2105
+ {
2106
+ "name": "userPosition";
2107
+ "docs": [
2108
+ "User position account"
2109
+ ];
2110
+ "writable": true;
2111
+ "pda": {
2112
+ "seeds": [
2113
+ {
2114
+ "kind": "const";
2115
+ "value": [
2116
+ 117,
2117
+ 115,
2118
+ 101,
2119
+ 114,
2120
+ 95,
2121
+ 112,
2122
+ 111,
2123
+ 115,
2124
+ 105,
2125
+ 116,
2126
+ 105,
2127
+ 111,
2128
+ 110
2129
+ ];
2130
+ },
2131
+ {
2132
+ "kind": "account";
2133
+ "path": "tokenLaunch";
2134
+ },
2135
+ {
2136
+ "kind": "account";
2137
+ "path": "contributor";
2138
+ }
2139
+ ];
2140
+ };
2141
+ },
2142
+ {
2143
+ "name": "systemProgram";
2144
+ "address": "11111111111111111111111111111111";
2145
+ },
2146
+ {
2147
+ "name": "tokenProgram";
2148
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
2149
+ }
2150
+ ];
2151
+ "args": [
2152
+ {
2153
+ "name": "tokensToSell";
2154
+ "type": "u64";
2155
+ },
2156
+ {
2157
+ "name": "minSolOut";
2158
+ "type": "u64";
2159
+ }
2160
+ ];
2161
+ },
2162
+ {
2163
+ "name": "updateLaunchpad";
2164
+ "docs": [
2165
+ "Update launchpad settings (authority only)"
2166
+ ];
2167
+ "discriminator": [
2168
+ 73,
2169
+ 253,
2170
+ 42,
2171
+ 252,
2172
+ 2,
2173
+ 113,
2174
+ 239,
2175
+ 192
2176
+ ];
2177
+ "accounts": [
2178
+ {
2179
+ "name": "authority";
2180
+ "writable": true;
2181
+ "signer": true;
2182
+ },
2183
+ {
2184
+ "name": "launchpad";
2185
+ "writable": true;
2186
+ "pda": {
2187
+ "seeds": [
2188
+ {
2189
+ "kind": "const";
2190
+ "value": [
2191
+ 108,
2192
+ 97,
2193
+ 117,
2194
+ 110,
2195
+ 99,
2196
+ 104,
2197
+ 112,
2198
+ 97,
2199
+ 100
2200
+ ];
2201
+ }
2202
+ ];
2203
+ };
2204
+ }
2205
+ ];
2206
+ "args": [
2207
+ {
2208
+ "name": "newFeeBps";
2209
+ "type": {
2210
+ "option": "u16";
2211
+ };
2212
+ },
2213
+ {
2214
+ "name": "newTreasury";
2215
+ "type": {
2216
+ "option": "pubkey";
2217
+ };
2218
+ },
2219
+ {
2220
+ "name": "paused";
2221
+ "type": {
2222
+ "option": "bool";
2223
+ };
2224
+ }
2225
+ ];
2226
+ }
2227
+ ];
2228
+ "accounts": [
2229
+ {
2230
+ "name": "bondingCurve";
2231
+ "discriminator": [
2232
+ 23,
2233
+ 183,
2234
+ 248,
2235
+ 55,
2236
+ 96,
2237
+ 216,
2238
+ 172,
2239
+ 96
2240
+ ];
2241
+ },
2242
+ {
2243
+ "name": "launchpad";
2244
+ "discriminator": [
2245
+ 247,
2246
+ 20,
2247
+ 16,
2248
+ 242,
2249
+ 203,
2250
+ 38,
2251
+ 169,
2252
+ 160
2253
+ ];
2254
+ },
2255
+ {
2256
+ "name": "tokenLaunch";
2257
+ "discriminator": [
2258
+ 92,
2259
+ 242,
2260
+ 228,
2261
+ 230,
2262
+ 214,
2263
+ 216,
2264
+ 8,
2265
+ 148
2266
+ ];
2267
+ },
2268
+ {
2269
+ "name": "userPosition";
2270
+ "discriminator": [
2271
+ 251,
2272
+ 248,
2273
+ 209,
2274
+ 245,
2275
+ 83,
2276
+ 234,
2277
+ 17,
2278
+ 27
2279
+ ];
2280
+ }
2281
+ ];
2282
+ "events": [
2283
+ {
2284
+ "name": "adminWithdraw";
2285
+ "discriminator": [
2286
+ 218,
2287
+ 178,
2288
+ 1,
2289
+ 64,
2290
+ 41,
2291
+ 179,
2292
+ 24,
2293
+ 171
2294
+ ];
2295
+ },
2296
+ {
2297
+ "name": "curveComplete";
2298
+ "discriminator": [
2299
+ 121,
2300
+ 172,
2301
+ 68,
2302
+ 248,
2303
+ 143,
2304
+ 231,
2305
+ 180,
2306
+ 42
2307
+ ];
2308
+ },
2309
+ {
2310
+ "name": "launchCreated";
2311
+ "discriminator": [
2312
+ 59,
2313
+ 38,
2314
+ 190,
2315
+ 230,
2316
+ 33,
2317
+ 34,
2318
+ 89,
2319
+ 20
2320
+ ];
2321
+ },
2322
+ {
2323
+ "name": "tokensPurchased";
2324
+ "discriminator": [
2325
+ 214,
2326
+ 119,
2327
+ 105,
2328
+ 186,
2329
+ 114,
2330
+ 205,
2331
+ 228,
2332
+ 181
2333
+ ];
2334
+ },
2335
+ {
2336
+ "name": "tokensSold";
2337
+ "discriminator": [
2338
+ 217,
2339
+ 83,
2340
+ 68,
2341
+ 137,
2342
+ 134,
2343
+ 225,
2344
+ 94,
2345
+ 45
2346
+ ];
2347
+ }
2348
+ ];
2349
+ "errors": [
2350
+ {
2351
+ "code": 6000;
2352
+ "name": "mathOverflow";
2353
+ "msg": "Math overflow";
2354
+ },
2355
+ {
2356
+ "code": 6001;
2357
+ "name": "insufficientLiquidity";
2358
+ "msg": "Insufficient liquidity";
2359
+ },
2360
+ {
2361
+ "code": 6002;
2362
+ "name": "curveComplete";
2363
+ "msg": "Curve is complete - migrate to DEX";
2364
+ },
2365
+ {
2366
+ "code": 6003;
2367
+ "name": "curveNotComplete";
2368
+ "msg": "Curve is not complete";
2369
+ }
2370
+ ];
2371
+ "types": [
2372
+ {
2373
+ "name": "adminWithdraw";
2374
+ "docs": [
2375
+ "Event emitted when admin withdraws SOL and LP tokens after curve is complete"
2376
+ ];
2377
+ "type": {
2378
+ "kind": "struct";
2379
+ "fields": [
2380
+ {
2381
+ "name": "tokenLaunch";
2382
+ "docs": [
2383
+ "The token launch public key"
2384
+ ];
2385
+ "type": "pubkey";
2386
+ },
2387
+ {
2388
+ "name": "mint";
2389
+ "docs": [
2390
+ "The mint address (token address)"
2391
+ ];
2392
+ "type": "pubkey";
2393
+ },
2394
+ {
2395
+ "name": "admin";
2396
+ "docs": [
2397
+ "The admin wallet address"
2398
+ ];
2399
+ "type": "pubkey";
2400
+ },
2401
+ {
2402
+ "name": "creator";
2403
+ "docs": [
2404
+ "The creator's wallet address"
2405
+ ];
2406
+ "type": "pubkey";
2407
+ },
2408
+ {
2409
+ "name": "treasury";
2410
+ "docs": [
2411
+ "The treasury wallet address"
2412
+ ];
2413
+ "type": "pubkey";
2414
+ },
2415
+ {
2416
+ "name": "solWithdrawn";
2417
+ "docs": [
2418
+ "SOL amount withdrawn for LP (in lamports)"
2419
+ ];
2420
+ "type": "u64";
2421
+ },
2422
+ {
2423
+ "name": "tokensWithdrawn";
2424
+ "docs": [
2425
+ "LP tokens withdrawn (20%)"
2426
+ ];
2427
+ "type": "u64";
2428
+ },
2429
+ {
2430
+ "name": "feesToTreasury";
2431
+ "docs": [
2432
+ "Accumulated fees sent to treasury (in lamports)"
2433
+ ];
2434
+ "type": "u64";
2435
+ },
2436
+ {
2437
+ "name": "treasuryTokens";
2438
+ "docs": [
2439
+ "Treasury tokens sent to treasury (10%)"
2440
+ ];
2441
+ "type": "u64";
2442
+ },
2443
+ {
2444
+ "name": "timestamp";
2445
+ "docs": [
2446
+ "Timestamp"
2447
+ ];
2448
+ "type": "i64";
2449
+ }
2450
+ ];
2451
+ };
2452
+ },
2453
+ {
2454
+ "name": "bondingCurve";
2455
+ "docs": [
2456
+ "Linear Bonding Curve (like pump.fun)",
2457
+ "",
2458
+ "Formula: price = k × sold_supply",
2459
+ "",
2460
+ "Where:",
2461
+ "- k = 2 × target_sol / curve_supply² (slope coefficient)",
2462
+ "- target_sol ≈ 69 SOL (total SOL to fill the curve)",
2463
+ "",
2464
+ "When buying tokens:",
2465
+ "cost = (k/2) × (s2² - s1²)",
2466
+ "where s1 = current sold_supply, s2 = s1 + tokens_to_buy",
2467
+ "",
2468
+ "When selling tokens:",
2469
+ "refund = (k/2) × (s1² - s2²)",
2470
+ "where s1 = current sold_supply, s2 = s1 - tokens_to_sell",
2471
+ "",
2472
+ "Price rises linearly as more tokens are sold",
2473
+ "",
2474
+ "Simple model:",
2475
+ "- 70% of tokens available for trading on bonding curve",
2476
+ "- 20% reserved for DEX liquidity migration",
2477
+ "- 10% reserved for treasury",
2478
+ "- Trading continues until all 70% sold, then migrate to DEX"
2479
+ ];
2480
+ "type": {
2481
+ "kind": "struct";
2482
+ "fields": [
2483
+ {
2484
+ "name": "tokenLaunch";
2485
+ "docs": [
2486
+ "Associated token launch"
2487
+ ];
2488
+ "type": "pubkey";
2489
+ },
2490
+ {
2491
+ "name": "k";
2492
+ "docs": [
2493
+ "Price constant k (scaled by K_SCALE for precision)",
2494
+ "k_actual = k / K_SCALE",
2495
+ "Determines the steepness of the price curve"
2496
+ ];
2497
+ "type": "u128";
2498
+ },
2499
+ {
2500
+ "name": "totalSupply";
2501
+ "docs": [
2502
+ "Total token supply (with decimals)"
2503
+ ];
2504
+ "type": "u64";
2505
+ },
2506
+ {
2507
+ "name": "soldSupply";
2508
+ "docs": [
2509
+ "Tokens sold through the bonding curve so far",
2510
+ "This is the \"supply\" in the price formula"
2511
+ ];
2512
+ "type": "u64";
2513
+ },
2514
+ {
2515
+ "name": "realSolReserves";
2516
+ "docs": [
2517
+ "Real SOL collected from buyers (lamports)"
2518
+ ];
2519
+ "type": "u64";
2520
+ },
2521
+ {
2522
+ "name": "tokenReservesForLp";
2523
+ "docs": [
2524
+ "Amount of tokens reserved for LP migration (20% of total)"
2525
+ ];
2526
+ "type": "u64";
2527
+ },
2528
+ {
2529
+ "name": "tokenReservesForTreasury";
2530
+ "docs": [
2531
+ "Amount of tokens reserved for treasury (10% of total)"
2532
+ ];
2533
+ "type": "u64";
2534
+ },
2535
+ {
2536
+ "name": "tokensForCurve";
2537
+ "docs": [
2538
+ "Maximum tokens available for sale on bonding curve (70% of total)"
2539
+ ];
2540
+ "type": "u64";
2541
+ },
2542
+ {
2543
+ "name": "accumulatedFees";
2544
+ "docs": [
2545
+ "Accumulated trading fees (0.5% per trade, in lamports)"
2546
+ ];
2547
+ "type": "u64";
2548
+ },
2549
+ {
2550
+ "name": "complete";
2551
+ "docs": [
2552
+ "Whether the curve is complete (all 70% sold, ready for migration)"
2553
+ ];
2554
+ "type": "bool";
2555
+ },
2556
+ {
2557
+ "name": "bump";
2558
+ "docs": [
2559
+ "Bump seed for PDA"
2560
+ ];
2561
+ "type": "u8";
2562
+ }
2563
+ ];
2564
+ };
2565
+ },
2566
+ {
2567
+ "name": "curveComplete";
2568
+ "docs": [
2569
+ "Event emitted when bonding curve is complete and ready for migration"
2570
+ ];
2571
+ "type": {
2572
+ "kind": "struct";
2573
+ "fields": [
2574
+ {
2575
+ "name": "tokenLaunch";
2576
+ "docs": [
2577
+ "The token launch public key"
2578
+ ];
2579
+ "type": "pubkey";
2580
+ },
2581
+ {
2582
+ "name": "mint";
2583
+ "docs": [
2584
+ "The mint address"
2585
+ ];
2586
+ "type": "pubkey";
2587
+ },
2588
+ {
2589
+ "name": "totalSolRaised";
2590
+ "docs": [
2591
+ "Total SOL raised"
2592
+ ];
2593
+ "type": "u64";
2594
+ },
2595
+ {
2596
+ "name": "finalPrice";
2597
+ "docs": [
2598
+ "Final price (lamports per token)"
2599
+ ];
2600
+ "type": "u64";
2601
+ },
2602
+ {
2603
+ "name": "timestamp";
2604
+ "docs": [
2605
+ "Timestamp"
2606
+ ];
2607
+ "type": "i64";
2608
+ }
2609
+ ];
2610
+ };
2611
+ },
2612
+ {
2613
+ "name": "launchCreated";
2614
+ "docs": [
2615
+ "Event emitted when a new token launch is created"
2616
+ ];
2617
+ "type": {
2618
+ "kind": "struct";
2619
+ "fields": [
2620
+ {
2621
+ "name": "tokenLaunch";
2622
+ "docs": [
2623
+ "The token launch public key"
2624
+ ];
2625
+ "type": "pubkey";
2626
+ },
2627
+ {
2628
+ "name": "mint";
2629
+ "docs": [
2630
+ "The mint address"
2631
+ ];
2632
+ "type": "pubkey";
2633
+ },
2634
+ {
2635
+ "name": "creator";
2636
+ "docs": [
2637
+ "The creator's wallet address"
2638
+ ];
2639
+ "type": "pubkey";
2640
+ },
2641
+ {
2642
+ "name": "name";
2643
+ "docs": [
2644
+ "Token name"
2645
+ ];
2646
+ "type": "string";
2647
+ },
2648
+ {
2649
+ "name": "symbol";
2650
+ "docs": [
2651
+ "Token symbol"
2652
+ ];
2653
+ "type": "string";
2654
+ },
2655
+ {
2656
+ "name": "totalSupply";
2657
+ "docs": [
2658
+ "Total supply (with decimals)"
2659
+ ];
2660
+ "type": "u64";
2661
+ },
2662
+ {
2663
+ "name": "curveAllocation";
2664
+ "docs": [
2665
+ "Tokens allocated to bonding curve (70%)"
2666
+ ];
2667
+ "type": "u64";
2668
+ },
2669
+ {
2670
+ "name": "lpAllocation";
2671
+ "docs": [
2672
+ "Tokens reserved for LP (20%)"
2673
+ ];
2674
+ "type": "u64";
2675
+ },
2676
+ {
2677
+ "name": "treasuryAllocation";
2678
+ "docs": [
2679
+ "Tokens reserved for treasury (10%)"
2680
+ ];
2681
+ "type": "u64";
2682
+ },
2683
+ {
2684
+ "name": "initialK";
2685
+ "docs": [
2686
+ "Initial price constant k"
2687
+ ];
2688
+ "type": "u128";
2689
+ },
2690
+ {
2691
+ "name": "initialPrice";
2692
+ "docs": [
2693
+ "Initial price (lamports per token)"
2694
+ ];
2695
+ "type": "u64";
2696
+ },
2697
+ {
2698
+ "name": "timestamp";
2699
+ "docs": [
2700
+ "Timestamp of creation"
2701
+ ];
2702
+ "type": "i64";
2703
+ }
2704
+ ];
2705
+ };
2706
+ },
2707
+ {
2708
+ "name": "launchpad";
2709
+ "docs": [
2710
+ "Global launchpad configuration account",
2711
+ "Stores platform-wide settings and authority"
2712
+ ];
2713
+ "type": {
2714
+ "kind": "struct";
2715
+ "fields": [
2716
+ {
2717
+ "name": "authority";
2718
+ "docs": [
2719
+ "Platform authority (can update settings)"
2720
+ ];
2721
+ "type": "pubkey";
2722
+ },
2723
+ {
2724
+ "name": "treasury";
2725
+ "docs": [
2726
+ "Treasury wallet for collecting platform fees"
2727
+ ];
2728
+ "type": "pubkey";
2729
+ },
2730
+ {
2731
+ "name": "feeBps";
2732
+ "docs": [
2733
+ "Platform fee in basis points (100 = 1%)"
2734
+ ];
2735
+ "type": "u16";
2736
+ },
2737
+ {
2738
+ "name": "bump";
2739
+ "docs": [
2740
+ "Bump seed for PDA"
2741
+ ];
2742
+ "type": "u8";
2743
+ },
2744
+ {
2745
+ "name": "totalLaunches";
2746
+ "docs": [
2747
+ "Total launches created"
2748
+ ];
2749
+ "type": "u64";
2750
+ },
2751
+ {
2752
+ "name": "paused";
2753
+ "docs": [
2754
+ "Whether the platform is paused"
2755
+ ];
2756
+ "type": "bool";
2757
+ }
2758
+ ];
2759
+ };
2760
+ },
2761
+ {
2762
+ "name": "tokenLaunch";
2763
+ "docs": [
2764
+ "Token launch state - represents a single token launch",
2765
+ "Simple model:",
2766
+ "- 70% supply available for bonding curve trading",
2767
+ "- 20% supply reserved for DEX liquidity",
2768
+ "- 10% supply reserved for treasury",
2769
+ "- 1% trading fee (0.5% admin immediate + 0.5% accumulated in curve)"
2770
+ ];
2771
+ "type": {
2772
+ "kind": "struct";
2773
+ "fields": [
2774
+ {
2775
+ "name": "creator";
2776
+ "docs": [
2777
+ "Creator's wallet address"
2778
+ ];
2779
+ "type": "pubkey";
2780
+ },
2781
+ {
2782
+ "name": "mint";
2783
+ "docs": [
2784
+ "Token mint address"
2785
+ ];
2786
+ "type": "pubkey";
2787
+ },
2788
+ {
2789
+ "name": "vault";
2790
+ "docs": [
2791
+ "SOL vault PDA"
2792
+ ];
2793
+ "type": "pubkey";
2794
+ },
2795
+ {
2796
+ "name": "bondingCurve";
2797
+ "docs": [
2798
+ "Associated bonding curve account"
2799
+ ];
2800
+ "type": "pubkey";
2801
+ },
2802
+ {
2803
+ "name": "totalSupply";
2804
+ "docs": [
2805
+ "Total token supply"
2806
+ ];
2807
+ "type": "u64";
2808
+ },
2809
+ {
2810
+ "name": "curveAllocation";
2811
+ "docs": [
2812
+ "Tokens allocated for bonding curve (70%)"
2813
+ ];
2814
+ "type": "u64";
2815
+ },
2816
+ {
2817
+ "name": "lpAllocation";
2818
+ "docs": [
2819
+ "Tokens reserved for LP (20%)"
2820
+ ];
2821
+ "type": "u64";
2822
+ },
2823
+ {
2824
+ "name": "treasuryAllocation";
2825
+ "docs": [
2826
+ "Tokens reserved for treasury (10%)"
2827
+ ];
2828
+ "type": "u64";
2829
+ },
2830
+ {
2831
+ "name": "totalSolRaised";
2832
+ "docs": [
2833
+ "Total SOL raised during presale (after fees)"
2834
+ ];
2835
+ "type": "u64";
2836
+ },
2837
+ {
2838
+ "name": "tradingActive";
2839
+ "docs": [
2840
+ "Whether trading is currently active"
2841
+ ];
2842
+ "type": "bool";
2843
+ },
2844
+ {
2845
+ "name": "migrated";
2846
+ "docs": [
2847
+ "Whether curve is complete (migrated to DEX)"
2848
+ ];
2849
+ "type": "bool";
2850
+ },
2851
+ {
2852
+ "name": "initialK";
2853
+ "docs": [
2854
+ "Bonding curve k constant"
2855
+ ];
2856
+ "type": "u128";
2857
+ },
2858
+ {
2859
+ "name": "createdAt";
2860
+ "docs": [
2861
+ "Unix timestamp of creation"
2862
+ ];
2863
+ "type": "i64";
2864
+ },
2865
+ {
2866
+ "name": "migratedAt";
2867
+ "docs": [
2868
+ "Unix timestamp of migration (0 if not migrated)"
2869
+ ];
2870
+ "type": "i64";
2871
+ },
2872
+ {
2873
+ "name": "bump";
2874
+ "docs": [
2875
+ "Bump seed for PDA"
2876
+ ];
2877
+ "type": "u8";
2878
+ },
2879
+ {
2880
+ "name": "name";
2881
+ "docs": [
2882
+ "Token name (max 32 chars)"
2883
+ ];
2884
+ "type": "string";
2885
+ },
2886
+ {
2887
+ "name": "symbol";
2888
+ "docs": [
2889
+ "Token symbol (max 10 chars)"
2890
+ ];
2891
+ "type": "string";
2892
+ },
2893
+ {
2894
+ "name": "uri";
2895
+ "docs": [
2896
+ "Token description/URI (max 200 chars)"
2897
+ ];
2898
+ "type": "string";
2899
+ }
2900
+ ];
2901
+ };
2902
+ },
2903
+ {
2904
+ "name": "tokensPurchased";
2905
+ "docs": [
2906
+ "Event emitted when tokens are purchased on the bonding curve"
2907
+ ];
2908
+ "type": {
2909
+ "kind": "struct";
2910
+ "fields": [
2911
+ {
2912
+ "name": "tokenLaunch";
2913
+ "docs": [
2914
+ "The token launch public key"
2915
+ ];
2916
+ "type": "pubkey";
2917
+ },
2918
+ {
2919
+ "name": "mint";
2920
+ "docs": [
2921
+ "The mint address"
2922
+ ];
2923
+ "type": "pubkey";
2924
+ },
2925
+ {
2926
+ "name": "buyer";
2927
+ "docs": [
2928
+ "The buyer's wallet address"
2929
+ ];
2930
+ "type": "pubkey";
2931
+ },
2932
+ {
2933
+ "name": "solAmount";
2934
+ "docs": [
2935
+ "Total SOL amount paid by buyer (including fees)"
2936
+ ];
2937
+ "type": "u64";
2938
+ },
2939
+ {
2940
+ "name": "solAfterFees";
2941
+ "docs": [
2942
+ "SOL amount after fees (added to curve reserves)"
2943
+ ];
2944
+ "type": "u64";
2945
+ },
2946
+ {
2947
+ "name": "tokensReceived";
2948
+ "docs": [
2949
+ "Number of tokens received"
2950
+ ];
2951
+ "type": "u64";
2952
+ },
2953
+ {
2954
+ "name": "curveFee";
2955
+ "docs": [
2956
+ "Curve fee accumulated (in lamports)"
2957
+ ];
2958
+ "type": "u64";
2959
+ },
2960
+ {
2961
+ "name": "adminFee";
2962
+ "docs": [
2963
+ "Admin fee paid (in lamports)"
2964
+ ];
2965
+ "type": "u64";
2966
+ },
2967
+ {
2968
+ "name": "priceAfter";
2969
+ "docs": [
2970
+ "Current price after the trade (lamports per token)"
2971
+ ];
2972
+ "type": "u64";
2973
+ },
2974
+ {
2975
+ "name": "totalSold";
2976
+ "docs": [
2977
+ "Total tokens sold on curve after this trade"
2978
+ ];
2979
+ "type": "u64";
2980
+ },
2981
+ {
2982
+ "name": "progress";
2983
+ "docs": [
2984
+ "Progress percentage (0-100)"
2985
+ ];
2986
+ "type": "u8";
2987
+ },
2988
+ {
2989
+ "name": "timestamp";
2990
+ "docs": [
2991
+ "Timestamp of the trade"
2992
+ ];
2993
+ "type": "i64";
2994
+ },
2995
+ {
2996
+ "name": "isCurveComplete";
2997
+ "docs": [
2998
+ "True if this buy completed the curve (reached 70% sold)"
2999
+ ];
3000
+ "type": "bool";
3001
+ }
3002
+ ];
3003
+ };
3004
+ },
3005
+ {
3006
+ "name": "tokensSold";
3007
+ "docs": [
3008
+ "Event emitted when tokens are sold on the bonding curve"
3009
+ ];
3010
+ "type": {
3011
+ "kind": "struct";
3012
+ "fields": [
3013
+ {
3014
+ "name": "tokenLaunch";
3015
+ "docs": [
3016
+ "The token launch public key"
3017
+ ];
3018
+ "type": "pubkey";
3019
+ },
3020
+ {
3021
+ "name": "mint";
3022
+ "docs": [
3023
+ "The mint address"
3024
+ ];
3025
+ "type": "pubkey";
3026
+ },
3027
+ {
3028
+ "name": "seller";
3029
+ "docs": [
3030
+ "The seller's wallet address"
3031
+ ];
3032
+ "type": "pubkey";
3033
+ },
3034
+ {
3035
+ "name": "tokensSold";
3036
+ "docs": [
3037
+ "Number of tokens sold"
3038
+ ];
3039
+ "type": "u64";
3040
+ },
3041
+ {
3042
+ "name": "grossSolRefund";
3043
+ "docs": [
3044
+ "Gross SOL refund (before fees)"
3045
+ ];
3046
+ "type": "u64";
3047
+ },
3048
+ {
3049
+ "name": "netSolRefund";
3050
+ "docs": [
3051
+ "Net SOL received by seller (after fees)"
3052
+ ];
3053
+ "type": "u64";
3054
+ },
3055
+ {
3056
+ "name": "curveFee";
3057
+ "docs": [
3058
+ "Curve fee accumulated (in lamports)"
3059
+ ];
3060
+ "type": "u64";
3061
+ },
3062
+ {
3063
+ "name": "adminFee";
3064
+ "docs": [
3065
+ "Admin fee deducted (in lamports)"
3066
+ ];
3067
+ "type": "u64";
3068
+ },
3069
+ {
3070
+ "name": "priceAfter";
3071
+ "docs": [
3072
+ "Current price after the trade (lamports per token)"
3073
+ ];
3074
+ "type": "u64";
3075
+ },
3076
+ {
3077
+ "name": "totalSold";
3078
+ "docs": [
3079
+ "Total tokens sold on curve after this trade"
3080
+ ];
3081
+ "type": "u64";
3082
+ },
3083
+ {
3084
+ "name": "progress";
3085
+ "docs": [
3086
+ "Progress percentage (0-100)"
3087
+ ];
3088
+ "type": "u8";
3089
+ },
3090
+ {
3091
+ "name": "timestamp";
3092
+ "docs": [
3093
+ "Timestamp of the trade"
3094
+ ];
3095
+ "type": "i64";
3096
+ }
3097
+ ];
3098
+ };
3099
+ },
3100
+ {
3101
+ "name": "userPosition";
3102
+ "docs": [
3103
+ "User's position in a specific token launch",
3104
+ "Tracks contributions during presale and claim status"
3105
+ ];
3106
+ "type": {
3107
+ "kind": "struct";
3108
+ "fields": [
3109
+ {
3110
+ "name": "user";
3111
+ "docs": [
3112
+ "User's wallet address"
3113
+ ];
3114
+ "type": "pubkey";
3115
+ },
3116
+ {
3117
+ "name": "tokenLaunch";
3118
+ "docs": [
3119
+ "Associated token launch"
3120
+ ];
3121
+ "type": "pubkey";
3122
+ },
3123
+ {
3124
+ "name": "tokensAllocated";
3125
+ "docs": [
3126
+ "Total tokens allocated based on bonding curve price at contribution time"
3127
+ ];
3128
+ "type": "u64";
3129
+ },
3130
+ {
3131
+ "name": "solContributed";
3132
+ "docs": [
3133
+ "Total SOL contributed to presale"
3134
+ ];
3135
+ "type": "u64";
3136
+ },
3137
+ {
3138
+ "name": "claimed";
3139
+ "docs": [
3140
+ "Whether tokens have been claimed (post-launch)"
3141
+ ];
3142
+ "type": "bool";
3143
+ },
3144
+ {
3145
+ "name": "refunded";
3146
+ "docs": [
3147
+ "Whether contribution has been refunded"
3148
+ ];
3149
+ "type": "bool";
3150
+ },
3151
+ {
3152
+ "name": "bump";
3153
+ "docs": [
3154
+ "Bump seed for PDA"
3155
+ ];
3156
+ "type": "u8";
3157
+ }
3158
+ ];
3159
+ };
3160
+ }
3161
+ ];
3162
+ };
3163
+
3164
+ declare const PROGRAM_ID: anchor.web3.PublicKey;
3165
+ declare const ADMIN_WALLET: anchor.web3.PublicKey;
3166
+ declare const METADATA_PROGRAM_ID: anchor.web3.PublicKey;
3167
+ declare const K_SCALE = 10000000000000000000000n;
3168
+ declare const LAMPORTS = 1000000000;
3169
+ declare const TOKEN_DECIMALS = 6;
3170
+ declare const FEE_BPS = 100;
3171
+ declare const CURVE_PERCENT = 70;
3172
+ declare const LP_PERCENT = 20;
3173
+ declare const TREASURY_PERCENT = 10;
3174
+ interface TokenLaunchConfig {
3175
+ name: string;
3176
+ symbol: string;
3177
+ uri: string;
3178
+ totalSupply: number;
3179
+ k: number;
3180
+ creatorWallet?: PublicKey;
3181
+ }
3182
+ interface BondingCurveState {
3183
+ tokenLaunch: PublicKey;
3184
+ k: bigint;
3185
+ totalSupply: bigint;
3186
+ soldSupply: bigint;
3187
+ realSolReserves: bigint;
3188
+ tokenReservesForLp: bigint;
3189
+ tokenReservesForTreasury: bigint;
3190
+ tokensForCurve: bigint;
3191
+ accumulatedFees: bigint;
3192
+ complete: boolean;
3193
+ bump: number;
3194
+ }
3195
+ interface TokenLaunchState {
3196
+ creator: PublicKey;
3197
+ mint: PublicKey;
3198
+ vault: PublicKey;
3199
+ bondingCurve: PublicKey;
3200
+ totalSupply: bigint;
3201
+ curveAllocation: bigint;
3202
+ lpAllocation: bigint;
3203
+ treasuryAllocation: bigint;
3204
+ totalSolRaised: bigint;
3205
+ tradingActive: boolean;
3206
+ migrated: boolean;
3207
+ initialK: bigint;
3208
+ name: string;
3209
+ symbol: string;
3210
+ }
3211
+ interface LaunchAddresses {
3212
+ mint: PublicKey;
3213
+ tokenLaunch: PublicKey;
3214
+ bondingCurve: PublicKey;
3215
+ vault: PublicKey;
3216
+ curveTokenAccount: PublicKey;
3217
+ metadata: PublicKey;
3218
+ }
3219
+ interface TradeResult {
3220
+ txSignature: string;
3221
+ tokensTraded: bigint;
3222
+ solTraded: bigint;
3223
+ newProgress: number;
3224
+ isCurveComplete: boolean;
3225
+ }
3226
+ interface EstimateResult {
3227
+ tokensOut: bigint;
3228
+ solCost: bigint;
3229
+ pricePerToken: bigint;
3230
+ priceImpactBps: number;
3231
+ feeAmount: bigint;
3232
+ }
3233
+ interface LaunchCreatedEvent {
3234
+ tokenLaunch: PublicKey;
3235
+ mint: PublicKey;
3236
+ creator: PublicKey;
3237
+ name: string;
3238
+ symbol: string;
3239
+ totalSupply: bigint;
3240
+ curveAllocation: bigint;
3241
+ lpAllocation: bigint;
3242
+ treasuryAllocation: bigint;
3243
+ initialK: bigint;
3244
+ initialPrice: bigint;
3245
+ timestamp: bigint;
3246
+ }
3247
+ interface TokensPurchasedEvent {
3248
+ tokenLaunch: PublicKey;
3249
+ mint: PublicKey;
3250
+ buyer: PublicKey;
3251
+ solAmount: bigint;
3252
+ solAfterFees: bigint;
3253
+ tokensReceived: bigint;
3254
+ curveFee: bigint;
3255
+ adminFee: bigint;
3256
+ priceAfter: bigint;
3257
+ totalSold: bigint;
3258
+ progress: number;
3259
+ timestamp: bigint;
3260
+ isCurveComplete: boolean;
3261
+ }
3262
+ interface TokensSoldEvent {
3263
+ tokenLaunch: PublicKey;
3264
+ mint: PublicKey;
3265
+ seller: PublicKey;
3266
+ tokensSold: bigint;
3267
+ grossSolRefund: bigint;
3268
+ netSolRefund: bigint;
3269
+ curveFee: bigint;
3270
+ adminFee: bigint;
3271
+ priceAfter: bigint;
3272
+ totalSold: bigint;
3273
+ progress: number;
3274
+ timestamp: bigint;
3275
+ }
3276
+ interface CurveCompleteEvent {
3277
+ tokenLaunch: PublicKey;
3278
+ mint: PublicKey;
3279
+ totalSolRaised: bigint;
3280
+ finalPrice: bigint;
3281
+ timestamp: bigint;
3282
+ }
3283
+ interface AdminWithdrawEvent {
3284
+ tokenLaunch: PublicKey;
3285
+ mint: PublicKey;
3286
+ admin: PublicKey;
3287
+ creator: PublicKey;
3288
+ treasury: PublicKey;
3289
+ solWithdrawn: bigint;
3290
+ tokensWithdrawn: bigint;
3291
+ feesToTreasury: bigint;
3292
+ treasuryTokens: bigint;
3293
+ timestamp: bigint;
3294
+ }
3295
+ type PumpFunEvent = {
3296
+ name: "LaunchCreated";
3297
+ data: LaunchCreatedEvent;
3298
+ } | {
3299
+ name: "TokensPurchased";
3300
+ data: TokensPurchasedEvent;
3301
+ } | {
3302
+ name: "TokensSold";
3303
+ data: TokensSoldEvent;
3304
+ } | {
3305
+ name: "CurveComplete";
3306
+ data: CurveCompleteEvent;
3307
+ } | {
3308
+ name: "AdminWithdraw";
3309
+ data: AdminWithdrawEvent;
3310
+ };
3311
+ type EventCallback<T> = (event: T, slot: number, signature: string) => void;
3312
+ declare class PumpFunSDK {
3313
+ program: Program<PumpFunProgram>;
3314
+ connection: Connection;
3315
+ wallet: anchor.Wallet;
3316
+ launchpadPda: PublicKey;
3317
+ constructor(program: Program<PumpFunProgram>, wallet: anchor.Wallet);
3318
+ deriveAddresses(mint: PublicKey): LaunchAddresses;
3319
+ deriveUserPosition(tokenLaunch: PublicKey, user: PublicKey): PublicKey;
3320
+ initializeLaunchpad(platformFeeBps?: number): Promise<string>;
3321
+ createTokenLaunch(config: TokenLaunchConfig): Promise<{
3322
+ txSignature: string;
3323
+ addresses: LaunchAddresses;
3324
+ mintKeypair: Keypair;
3325
+ }>;
3326
+ buy(mint: PublicKey, solAmount: number, // In SOL (e.g., 1.5 for 1.5 SOL)
3327
+ options?: {
3328
+ computeUnits?: number;
3329
+ }): Promise<TradeResult>;
3330
+ sell(mint: PublicKey, tokenAmount: number, // In tokens (e.g., 1000000 for 1M tokens)
3331
+ minSolOut?: number, // Minimum SOL to receive (slippage protection)
3332
+ options?: {
3333
+ computeUnits?: number;
3334
+ }): Promise<TradeResult>;
3335
+ adminWithdraw(mint: PublicKey): Promise<{
3336
+ txSignature: string;
3337
+ solWithdrawn: bigint;
3338
+ tokensWithdrawn: bigint;
3339
+ feesToTreasury: bigint;
3340
+ treasuryTokens: bigint;
3341
+ }>;
3342
+ estimateBuy(mint: PublicKey, solAmount: number): Promise<EstimateResult>;
3343
+ estimateSell(mint: PublicKey, tokenAmount: number): Promise<EstimateResult>;
3344
+ getCurveState(mint: PublicKey): Promise<BondingCurveState>;
3345
+ getTokenLaunchState(mint: PublicKey): Promise<TokenLaunchState>;
3346
+ getProgress(mint: PublicKey): Promise<{
3347
+ percent: number;
3348
+ soldSupply: bigint;
3349
+ tokensForCurve: bigint;
3350
+ solRaised: bigint;
3351
+ currentPrice: bigint;
3352
+ isComplete: boolean;
3353
+ }>;
3354
+ /**
3355
+ * Listen for LaunchCreated events
3356
+ * @param callback Function to call when event is emitted
3357
+ * @returns Listener ID for removal
3358
+ */
3359
+ onLaunchCreated(callback: EventCallback<LaunchCreatedEvent>): number;
3360
+ /**
3361
+ * Listen for TokensPurchased events
3362
+ * @param callback Function to call when event is emitted
3363
+ * @returns Listener ID for removal
3364
+ */
3365
+ onTokensPurchased(callback: EventCallback<TokensPurchasedEvent>): number;
3366
+ /**
3367
+ * Listen for TokensSold events
3368
+ * @param callback Function to call when event is emitted
3369
+ * @returns Listener ID for removal
3370
+ */
3371
+ onTokensSold(callback: EventCallback<TokensSoldEvent>): number;
3372
+ /**
3373
+ * Listen for CurveComplete events
3374
+ * @param callback Function to call when event is emitted
3375
+ * @returns Listener ID for removal
3376
+ */
3377
+ onCurveComplete(callback: EventCallback<CurveCompleteEvent>): number;
3378
+ /**
3379
+ * Listen for AdminWithdraw events
3380
+ * @param callback Function to call when event is emitted
3381
+ * @returns Listener ID for removal
3382
+ */
3383
+ onAdminWithdraw(callback: EventCallback<AdminWithdrawEvent>): number;
3384
+ /**
3385
+ * Remove an event listener
3386
+ * @param listenerId The ID returned from addEventListener
3387
+ */
3388
+ removeEventListener(listenerId: number): Promise<void>;
3389
+ /** Calculate price at a given supply: price = k × supply / K_SCALE */
3390
+ calculatePrice(k: bigint, supply: bigint): bigint;
3391
+ /** Calculate cost to buy from s1 to s2: cost = (k/2) × (s2² - s1²) / K_SCALE */
3392
+ calculateCost(k: bigint, s1: bigint, s2: bigint): bigint;
3393
+ /** Calculate tokens received for SOL: s2 = sqrt(s1² + 2×sol×K_SCALE/k) */
3394
+ calculateTokensForSol(k: bigint, currentSupply: bigint, solIn: bigint): bigint;
3395
+ /** Calculate refund for selling tokens: refund = (k/2) × (s1² - s2²) / K_SCALE */
3396
+ calculateRefund(k: bigint, s1: bigint, s2: bigint): bigint;
3397
+ /** Integer square root using Newton's method */
3398
+ isqrt(n: bigint): bigint;
3399
+ /** Calculate K for a given target SOL and curve supply */
3400
+ static calculateK(curveSupply: bigint, targetSol: bigint): bigint;
3401
+ }
3402
+ /** Format raw token amount to human-readable */
3403
+ declare function formatTokens(raw: bigint): string;
3404
+ /** Format lamports to SOL */
3405
+ declare function formatSol(lamports: bigint): string;
3406
+ /** Parse SOL to lamports */
3407
+ declare function parseSol(sol: number): bigint;
3408
+ /** Parse tokens to raw */
3409
+ declare function parseTokens(tokens: number): bigint;
3410
+
3411
+ export { ADMIN_WALLET, type AdminWithdrawEvent, type BondingCurveState, CURVE_PERCENT, type CurveCompleteEvent, type EstimateResult, type EventCallback, FEE_BPS, K_SCALE, LAMPORTS, LP_PERCENT, type LaunchAddresses, type LaunchCreatedEvent, METADATA_PROGRAM_ID, PROGRAM_ID, type PumpFunEvent, type PumpFunProgram, PumpFunSDK, TOKEN_DECIMALS, TREASURY_PERCENT, type TokenLaunchConfig, type TokenLaunchState, type TokensPurchasedEvent, type TokensSoldEvent, type TradeResult, formatSol, formatTokens, parseSol, parseTokens };