Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Jito Bundle Detection
- ## Overview
- 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**.
- ## Updated Token Model Fields
- ```javascript
- // Simplified Token model
- {
- jitoBundleDetected: Boolean, // True if token has any Jito bundles
- jitoBundleFirstDetected: Date // When first bundle was found
- }
- ```
- ## API Endpoints
- ### GET `/api/token/get_bundled_tokens`
- Returns tokens with Jito bundles detected, with complete bundle history from JitoBundle collection.
- **Response:**
- ```json
- {
- "count": 25,
- "tokens": [
- {
- "mintAddr": "token_mint_address",
- "name": "Token Name",
- "ticker": "SYMBOL",
- "creatorUsername": "creator_name",
- "creatorWallet": "creator_wallet_address",
- "jitoBundleFirstDetected": "2024-01-01T00:00:00.000Z",
- "bundleSummary": {
- "totalBundles": 3,
- "firstBlockNumber": 123456789,
- "latestBlockNumber": 123456800,
- "totalBuyCount": 15,
- "totalAmount": 1500.5
- },
- "creationTime": "2024-01-01T00:00:00.000Z",
- "currentPrice": 0.00123,
- "marketCap": 123000
- }
- ],
- "detectionMethod": "Jito Bundle Detection",
- "description": "Detects coordinated buying via multiple transactions in the same block",
- "timestamp": "2024-01-01T00:00:00.000Z"
- }
- ```
- ### GET `/api/token/check_jito_status`
- Returns detailed Jito bundle information for a specific token.
- **Response:**
- ```json
- {
- "success": true,
- "data": {
- "mintAddr": "token_mint_address",
- "jitoBundleDetected": true,
- "jitoBundleFirstDetected": "2024-01-01T00:00:00.000Z",
- "bundleSummary": {
- "totalBundles": 2,
- "firstBlockNumber": 123456789,
- "latestBlockNumber": 123456790,
- "totalBuyCount": 8,
- "totalAmount": 800.25,
- "firstDetected": "2024-01-01T00:00:00.000Z",
- "latestDetected": "2024-01-01T01:00:00.000Z"
- },
- "bundles": [
- {
- "blockNumber": 123456789,
- "buyCount": 5,
- "totalAmount": 500.25,
- "detectedAt": "2024-01-01T00:00:00.000Z",
- "transactions": ["tx_sig_1", "tx_sig_2", ...]
- }
- ]
- }
- }
- ```
- ### GET `/api/token/jito_stats`
- Returns comprehensive Jito bundle statistics.
- **Response:**
- ```json
- {
- "success": true,
- "data": {
- "totalBundles": 42,
- "tokensWithBundles": 15,
- "avgBuyCount": 4.2,
- "avgTotalAmount": 420.5
- }
- }
- ```
- ## Handling Multiple Bundles Per Token
- The system now properly handles **multiple Jito bundles per token**:
- - All bundles are stored in the `JitoBundle` collection
- - Token model only indicates if any bundles exist (`jitoBundleDetected`)
- - Full bundle history is available via API endpoints
- - **Automatic cleanup** of redundant fields occurs when APIs are accessed
- - Data consistency between Token and JitoBundle collections
- ## Automatic Migration (no need to do anything manually after updating the backend to migrate to the new API)
- - **No manual migration required** - cleanup happens automatically on API access
- - **No standalone scripts** - all migration is handled internally
- - **Backward compatible** - APIs continue to work seamlessly
- - **Zero-downtime** - gradual cleanup as tokens are accessed
- ## Database Collections
- - **Token**: Stores basic detection flag and first detection time
- - **JitoBundle**: Stores complete bundle history for all tokens
- - **TokenTrade**: Individual trade transactions linked to bundles
- ## API Usage
- All endpoints automatically handle:
- - Detection of Jito bundles
- - Cleanup of redundant fields
- - Aggregation of bundle statistics
- - Multiple bundles per token support
Advertisement
Add Comment
Please, Sign In to add comment