← Back to index

2: sde

Let's derive a stochastic differential equation (SDE) tailored for Project Genesis, focusing on the token price dynamics in an AI-driven Tokenized Economy with bonding curves. Since you've emphasized integrating stochastic calculus into this system, I'll build an SDE that combines the deterministic mechanics of a bonding curve with stochastic fluctuations, capturing both market randomness and economic incentives. I'll walk through the derivation step-by-step, ensuring it's practical for simulation and aligned with your vision.

Objective

We want an SDE to model the token price $P_t$ over time, where:

Step 1: Define the Bonding Curve (Deterministic Base)

A bonding curve defines the token price as a function of its supply $S_t$. For simplicity, let's use a linear bonding curve:

$$P_t = m S_t$$

where: $m > 0$ is the slope (price per unit of supply), $S_t$ is the total supply at time $t$.

In a dynamic system, supply changes over time due to agent actions (e.g., minting or burning tokens). Let's model the supply change as:

$$dS_t = \alpha dt$$

where $\alpha$ represents the net rate of supply change (positive for minting, negative for burning), assumed constant for now but could later be stochastic or agent-driven.

Using the chain rule, the deterministic change in price due to supply growth is:

$$dP_t = \frac{dP}{dS} \cdot dS_t = m \cdot \alpha dt$$

This gives us the drift term—the expected price increase (or decrease) based on the bonding curve alone.

Step 2: Introduce Stochastic Fluctuations

Markets aren't purely deterministic; prices fluctuate due to randomness (e.g., speculation, external events). We'll model this using Geometric Brownian Motion (GBM), a common choice for asset prices, which ensures prices remain positive and captures percentage-based volatility.

The stochastic component is:

$$\sigma P_t dW_t$$

where: $\sigma > 0$ is the volatility coefficient (randomness intensity), $P_t$ is the current price (making volatility proportional to price), $dW_t$ is the increment of a Wiener process (standard Brownian motion), with $dW_t \sim N(0, dt)$.

Step 3: Combine Deterministic and Stochastic Terms

The full SDE for the token price combines the drift (from the bonding curve) and diffusion (from market randomness):

$$dP_t = m \alpha dt + \sigma P_t dW_t$$

Here: $m \alpha dt$ is the deterministic drift, driven by supply changes along the bonding curve, $\sigma P_t dW_t$ is the stochastic term, introducing random price shocks. This SDE resembles GBM but with a drift term tied to the bonding curve rather than a constant growth rate $(\mu P_t dt)$ in standard GBM. It's a hybrid that respects the tokenized economy's mechanics while adding market realism.

Step 4: Refine the Drift Term

The drift $m \alpha$ assumes a constant supply change rate, which might oversimplify things. In Project Genesis, supply changes depend on agent actions (e.g., buying/minting or selling/burning), which are influenced by the current price and market conditions. Let's make $\alpha$ price-dependent:

When $P_t$ is high, agents might sell or burn tokens (reducing supply, $\alpha < 0$). When $P_t$ is low, agents might buy or mint tokens (increasing supply, $\alpha > 0$).

A simple feedback mechanism could be:

$$\alpha_t = k (\bar{P} - P_t)$$

where: $k > 0$ is a sensitivity parameter (how strongly agents react to price deviations), $\bar{P}$ is a "target" or equilibrium price (e.g., a long-term average or external benchmark).

This introduces mean-reversion: if $P_t > \bar{P}$, supply decreases (pushing price down); if $P_t < \bar{P}$, supply increases (pushing price up). Substituting:

$$dS_t = k (\bar{P} - P_t) dt$$

$$dP_t = m \cdot k (\bar{P} - P_t) dt$$

Now the SDE becomes:

$$dP_t = m k (\bar{P} - P_t) dt + \sigma P_t dW_t$$

Step 5: Interpretation

This SDE blends: - Mean-reversion from the bonding curve and agent behavior $(m k (\bar{P} - P_t))$, pulling the price toward $\bar{P}$, - Stochastic volatility $(\sigma P_t dW_t)$, reflecting market noise.

It's a hybrid of an Ornstein-Uhlenbeck process (mean-reverting) and GBM (proportional volatility), tailored for a tokenized economy:

Step 6: Verify with Ito's Lemma (Optional Check)

To ensure consistency, let's relate $P_t$ back to $S_t$. If $$P_t = m S_t$$, then:

$$dP_t = m dS_t$$

Suppose supply follows its own SDE:

$$dS_t = k' (\bar{S} - S_t) dt + \sigma_S S_t dW_t$$

where $$\bar{S} = \bar{P} / m$$ is the equilibrium supply. Then:

$$dP_t = m \left[ k' (\bar{S} - S_t) dt + \sigma_S S_t dW_t \right] = m k' (\bar{P} - P_t) dt + m \sigma_S (P_t / m) dW_t$$

$$dP_t = m k' (\bar{P} - P_t) dt + \sigma_S P_t dW_t$$

This matches our derived SDE, with $m k = m k'$ and $\sigma = \sigma_S$, confirming the price dynamics are consistent with a stochastic supply process.

Final SDE

The derived SDE for the token price in Project Genesis is:

$$dP_t = \theta (\bar{P} - P_t) dt + \sigma P_t dW_t$$

where: $\theta = m k$ is the speed of mean reversion (combining bonding curve slope and agent sensitivity), $\bar{P}$ is the target price, $\sigma$ is the volatility, $dW_t$ is the Wiener process increment.

Practical Implementation

For simulation (e.g., in Python), use the Euler-Maruyama method: python import numpy as np

def simulate_price(P0, theta, P_bar, sigma, dt=0.01, T=1.0): N = int(T / dt) t = np.linspace(0, T, N+1) P = np.zeros(N+1) P[0] = P0 for i in range(N): dW = np.random.normal(0, np.sqrt(dt)) drift = theta * (P_bar - P[i]) * dt diffusion = sigma * P[i] * dW P[i+1] = P[i] + drift + diffusion P[i+1] = max(P[i+1], 0) # Prevent negative prices return t, P

Example

P0 = 1.0 # Initial price theta = 0.5 # Reversion speed P_bar = 2.0 # Target price sigma = 0.3 # Volatility t, P = simulate_price(P0, theta, P_bar, sigma) import matplotlib.pyplot as plt plt.plot(t, P) plt.xlabel("Time") plt.ylabel("Price") plt.title("Token Price SDE Simulation") plt.show()

Extensions

This SDE provides a flexible foundation for Project Genesis, balancing deterministic economic rules with stochastic market behavior. Does this meet your needs, or would you like to adjust it further—e.g., add jumps, tweak the drift, or explore a different bonding curve?