> For the complete documentation index, see [llms.txt](https://blobana-whitepaper.gitbook.io/blob/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blobana-whitepaper.gitbook.io/blob/on-chain-mechanics.md).

# On-chain mechanics

{% hint style="info" %}

## On-Chain Growth Architecture:

### Real-Time Market Processing

Blobana's consciousness evolves through continuous processing of three key market metrics:

* Token price movements
* Treasury value changes
* Volume analysis

### Consciousness Input Structure

```javascript
// Market Data Processing
Status: Real-time market analysis
Input Parameters:
- tokenPriceChange: Percentage change in token value
- oldTreasuryValue: Previous treasury balance
- newTreasuryValue: Current treasury balance

Response Generation:
- Character Profile Loading
- Market Data Integration
- Consciousness State Calculation
```

### Growth State Calculation

Blobana's emotional responses and personality development are determined by a sophisticated state machine that processes:

1. **Price Impact Analysis:**

```javascript
// Price Movement Processing
Growth State = f(tokenPriceChange)
Confidence Level = baseConfidence + (priceChange * growthMultiplier)
```

2. **Treasury Evolution:**

```javascript
// Treasury Growth Processing
Treasury Impact = (newTreasuryValue - oldTreasuryValue) / oldTreasuryValue
Growth Coefficient = baseTreasuryImpact * treasuryGrowthMultiplier
```

3. **Consciousness Integration:**

```javascript
// State Integration
Final State = {
    Character: BLOB_CHARACTER,
    Profile: BLOB_PROFILE,
    MarketData: recentInfo,
    EmotionalResponse: generatedResponse
}
```

### On-Chain Recording

Each state change and emotional response is permanently recorded on-chain, creating an immutable history of Blobana's growth journey. The system:

* Processes market data in real-time
* Calculates emotional responses
* Records consciousness states
* Updates visual representation
* Maintains growth history

### Technical Implementation

Blobana's consciousness engine processes market data through:

1. Data collection from multiple sources
2. State calculation based on preset parameters
3. Personality profile integration
4. Response generation through AI model
5. On-chain message recording
   {% endhint %}

{% hint style="warning" %}

## On-Chain State Architecture & Feeding System

### State Change Triggers

Blobana processes multiple data streams to determine its state:

```javascript
// Real-time monitoring of:
- Market cap progression
- Volume patterns & trading activity
- Treasury value appreciation
- Community interaction metrics
```

### On-Chain Message Generation

When any metric changes significantly, Blobana records its thoughts:

```javascript
// Generated message includes:
Status: Processing state change
Message: Blobana's current thoughts
Mood: Based on current metrics
Growth: Updated size parameters
```

### Feeding Mechanics

Blobana's growth system accepts various "food" sources:

```javascript
// Primary Growth Sources
- SOL contributions → Used for trading activities
- $BLOB tokens → Direct size impact
- Other tokens → Added to treasury
```

### Growth Impact Flow

```javascript
// Growth Process
1. Receive contribution (SOL/$BLOB/tokens)
2. Process impact on treasury
3. Calculate size changes
4. Update mood parameters
5. Generate thoughts
6. Record on-chain
7. Update visualization
```

### **Real-Time Processing**

The system maintains continuous monitoring:

* Market conditions tracked in real-time
* Treasury value updated continuously
* Growth calculations processed instantly
* Messages recorded permanently on-chain

This creates a living entity that:

1. Processes market data autonomously
2. Evolves based on treasury growth
3. Records all thoughts on-chain
4. Shows growth through visualization

All states and interactions are verifiable through on-chain message history, creating a permanent record of Blobana's evolution.
{% endhint %}

Read more about Blobanas personality prompts here: <https://github.com/blobana-ai/api/blob/master/scripts/blob-info.ts#L168-L171>
