> For the complete documentation index, see [llms.txt](https://virtus-organization.gitbook.io/virtu-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://virtus-organization.gitbook.io/virtu-network/bundling-tool-using-ai/bundling.md).

# Bundling

## Introduction

Virtu Network’s bundling tool is designed for developers who need full control over their project's supply. Powered by our dedicated bot, it simplifies the process of setting up supply, estimating market cap, and managing token distribution—all in one easy-to-use interface. With this tool, you can handle your project’s assets with greater precision and efficiency.

{% code title="Intro" overflow="wrap" lineNumbers="true" fullWidth="true" %}

```python
//import tensorflow as tf
import numpy as np

# Virtu Network Initialization Message
print("Welcome to Virtu Network's TPU-Powered Bundling Tool!")

# Check and initialize the TPU system for Virtu Network
try:
    resolver = tf.distribute.cluster_resolver.TPUClusterResolver()  # Detect TPU
    tf.config.experimental_connect_to_cluster(resolver)
    tf.tpu.experimental.initialize_tpu_system(resolver)
    strategy = tf.distribute.TPUStrategy(resolver)
    print("All Virtu Network TPU cores successfully connected!")
except ValueError:
    strategy = tf.distribute.get_strategy()  # Use default strategy if no TPU available
    print("Virtu Network running without TPU acceleration. Consider switching to a TPU setup for faster bundling.")

# Simulated trade data: Example trade features [price, volume, trend]
trade_data = np.array([
    [100, 50, 1], [101, 45, 1], [98, 60, -1], [102, 30, 1], [97, 70, -1],
    [99, 55, -1], [105, 40, 1], [96, 75, -1]
])

# Labels for the trades (e.g., positive trend = 1, negative trend = 0)
trade_labels = np.array([1, 1, 0, 1, 0, 0, 1, 0])

# Define a simple neural network model for trade categorization
def create_model():
    model = tf.keras.Sequential([
        tf.keras.layers.Input(shape=(3,)),  # Input shape matches the features: [price, volume, trend]
        tf.keras.layers.Dense(16, activation='relu'),
        tf.keras.layers.Dense(8, activation='relu'),
        tf.keras.layers.Dense(2, activation='softmax')  # Binary classification
    ])
    model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
    return model

# Training and Model Optimization using Virtu Network's TPUs
with strategy.scope():
    model = create_model()
    print("Training the model on Virtu Network's TPU for optimized bundling...")
    model.fit(trade_data, trade_labels, epochs=5, batch_size=4)

# Predict and categorize trades using the trained model
predictions = model.predict(trade_data)
categorized_bundles = {'positive_trend': [], 'negative_trend': []}

# Bundle trades into Virtu Network's categorized structure
for trade, pred in zip(trade_data, predictions):
    category = 'positive_trend' if np.argmax(pred) == 1 else 'negative_trend'
    categorized_bundles[category].append(trade)

# Output Virtu Network's categorized trade bundles
print("\nBundled Trade Data for Virtu Network:")
for category, trades in categorized_bundles.items():
    print(f"{category}: {trades}")

# Final summary
print("\nVirtu Network's bundling tool successfully categorized and bundled trading data using TPU acceleration.")


```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://virtus-organization.gitbook.io/virtu-network/bundling-tool-using-ai/bundling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
