Lissanro

Scopium - Jito Bundle Detection

Sep 5th, 2025 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. # Jito Bundle Detection
  2.  
  3. ## Overview
  4. The system has been updated from time-based "bundle" detection to proper **Jito bundle detection** that identifies buying via multiple transactions in the same block. The implementation now handles **multiple bundles per token**.
  5.  
  6. ## Updated Token Model Fields
  7. ```javascript
  8. // Simplified Token model
  9. {
  10. jitoBundleDetected: Boolean, // True if token has any Jito bundles
  11. jitoBundleFirstDetected: Date // When first bundle was found
  12. }
  13. ```
  14.  
  15. ## API Endpoints
  16.  
  17. ### GET `/api/token/get_bundled_tokens`
  18. Returns tokens with Jito bundles detected, with complete bundle history from JitoBundle collection.
  19.  
  20. **Response:**
  21. ```json
  22. {
  23. "count": 25,
  24. "tokens": [
  25. {
  26. "mintAddr": "token_mint_address",
  27. "name": "Token Name",
  28. "ticker": "SYMBOL",
  29. "creatorUsername": "creator_name",
  30. "creatorWallet": "creator_wallet_address",
  31. "jitoBundleFirstDetected": "2024-01-01T00:00:00.000Z",
  32. "bundleSummary": {
  33. "totalBundles": 3,
  34. "firstBlockNumber": 123456789,
  35. "latestBlockNumber": 123456800,
  36. "totalBuyCount": 15,
  37. "totalAmount": 1500.5
  38. },
  39. "creationTime": "2024-01-01T00:00:00.000Z",
  40. "currentPrice": 0.00123,
  41. "marketCap": 123000
  42. }
  43. ],
  44. "detectionMethod": "Jito Bundle Detection",
  45. "description": "Detects coordinated buying via multiple transactions in the same block",
  46. "timestamp": "2024-01-01T00:00:00.000Z"
  47. }
  48. ```
  49.  
  50. ### GET `/api/token/check_jito_status`
  51. Returns detailed Jito bundle information for a specific token.
  52.  
  53. **Response:**
  54. ```json
  55. {
  56. "success": true,
  57. "data": {
  58. "mintAddr": "token_mint_address",
  59. "jitoBundleDetected": true,
  60. "jitoBundleFirstDetected": "2024-01-01T00:00:00.000Z",
  61. "bundleSummary": {
  62. "totalBundles": 2,
  63. "firstBlockNumber": 123456789,
  64. "latestBlockNumber": 123456790,
  65. "totalBuyCount": 8,
  66. "totalAmount": 800.25,
  67. "firstDetected": "2024-01-01T00:00:00.000Z",
  68. "latestDetected": "2024-01-01T01:00:00.000Z"
  69. },
  70. "bundles": [
  71. {
  72. "blockNumber": 123456789,
  73. "buyCount": 5,
  74. "totalAmount": 500.25,
  75. "detectedAt": "2024-01-01T00:00:00.000Z",
  76. "transactions": ["tx_sig_1", "tx_sig_2", ...]
  77. }
  78. ]
  79. }
  80. }
  81. ```
  82.  
  83. ### GET `/api/token/jito_stats`
  84. Returns comprehensive Jito bundle statistics.
  85.  
  86. **Response:**
  87. ```json
  88. {
  89. "success": true,
  90. "data": {
  91. "totalBundles": 42,
  92. "tokensWithBundles": 15,
  93. "avgBuyCount": 4.2,
  94. "avgTotalAmount": 420.5
  95. }
  96. }
  97. ```
  98.  
  99. ## Handling Multiple Bundles Per Token
  100. The system now properly handles **multiple Jito bundles per token**:
  101. - All bundles are stored in the `JitoBundle` collection
  102. - Token model only indicates if any bundles exist (`jitoBundleDetected`)
  103. - Full bundle history is available via API endpoints
  104. - **Automatic cleanup** of redundant fields occurs when APIs are accessed
  105. - Data consistency between Token and JitoBundle collections
  106.  
  107. ## Automatic Migration (no need to do anything manually after updating the backend to migrate to the new API)
  108. - **No manual migration required** - cleanup happens automatically on API access
  109. - **No standalone scripts** - all migration is handled internally
  110. - **Backward compatible** - APIs continue to work seamlessly
  111. - **Zero-downtime** - gradual cleanup as tokens are accessed
  112.  
  113. ## Database Collections
  114. - **Token**: Stores basic detection flag and first detection time
  115. - **JitoBundle**: Stores complete bundle history for all tokens
  116. - **TokenTrade**: Individual trade transactions linked to bundles
  117.  
  118. ## API Usage
  119. All endpoints automatically handle:
  120. - Detection of Jito bundles
  121. - Cleanup of redundant fields
  122. - Aggregation of bundle statistics
  123. - Multiple bundles per token support
Advertisement
Add Comment
Please, Sign In to add comment