|
13 | 13 |
|
14 | 14 | (log :message "β
Connected to Pump.fun event stream" :value stream-id) |
15 | 15 | (log :message "π Monitoring for Buy/Sell transactions...") |
16 | | -(println "") |
| 16 | +(log :message "") |
17 | 17 |
|
18 | 18 | ;; Initialize counters |
19 | 19 | (define buy-count 0) |
|
43 | 43 | (if (string-contains logs-text "Instruction: Buy") |
44 | 44 | (do |
45 | 45 | (set! buy-count (+ buy-count 1)) |
46 | | - (println (format "π BUY #{} | Signature: {}" buy-count signature))) |
| 46 | + (log :message "π BUY" :value (str "#" buy-count))) |
47 | 47 | null) |
48 | 48 |
|
49 | 49 | ;; Check for Sell transactions |
50 | 50 | (if (string-contains logs-text "Instruction: Sell") |
51 | 51 | (do |
52 | 52 | (set! sell-count (+ sell-count 1)) |
53 | | - (println (format "π SELL #{} | Signature: {}" sell-count signature))) |
| 53 | + (log :message "π SELL" :value (str "#" sell-count))) |
54 | 54 | null) |
55 | 55 |
|
56 | 56 | ;; Check for Token Graduation (migration to Raydium) |
|
59 | 59 | (string-contains logs-text "bonding curve complete")) |
60 | 60 | (do |
61 | 61 | (set! graduation-count (+ graduation-count 1)) |
62 | | - (println "") |
63 | | - (println (format "π GRADUATION DETECTED #{} π" graduation-count)) |
64 | | - (println (format " Signature: {}" signature)) |
65 | | - (println " Token has migrated to Raydium!") |
66 | | - (println "")) |
| 62 | + (log :message "π GRADUATION DETECTED!" :value (str "Count: " graduation-count)) |
| 63 | + (log :message "Signature" :value signature)) |
67 | 64 | null)) |
68 | | - null)) |
69 | | - |
70 | | - ;; Sleep for 500ms before next poll |
71 | | - (if (= (length events) 0) |
72 | | - null ;; Sleep handled by stream-wait if needed |
73 | | - null)) |
| 65 | + null))) |
74 | 66 |
|
75 | 67 | ;; Print summary statistics |
76 | | -(println "") |
77 | | -(println "βββββββββββββββββββββββββββββββββββ") |
78 | | -(println "π Streaming Summary") |
79 | | -(println "βββββββββββββββββββββββββββββββββββ") |
80 | | -(println (format "Duration: {} seconds" duration)) |
81 | | -(println (format "π Buy Transactions: {}" buy-count)) |
82 | | -(println (format "π Sell Transactions: {}" sell-count)) |
83 | | -(println (format "π Graduations: {}" graduation-count)) |
84 | | -(println (format "π¦ Total Events: {}" (+ buy-count sell-count graduation-count))) |
85 | | -(println "βββββββββββββββββββββββββββββββββββ") |
| 68 | +(log :message "βββββββββββββββββββββββββββββββββββ") |
| 69 | +(log :message "π Streaming Summary") |
| 70 | +(log :message "βββββββββββββββββββββββββββββββββββ") |
| 71 | +(log :message "Duration" :value (str duration " seconds")) |
| 72 | +(log :message "π Buy Transactions" :value buy-count) |
| 73 | +(log :message "π Sell Transactions" :value sell-count) |
| 74 | +(log :message "π Graduations" :value graduation-count) |
| 75 | +(log :message "π¦ Total Events" :value (+ buy-count sell-count graduation-count)) |
| 76 | +(log :message "βββββββββββββββββββββββββββββββββββ") |
86 | 77 |
|
87 | 78 | ;; Close stream |
88 | 79 | (stream-close stream-id) |
|
0 commit comments