Documentation

Slime Intelligence, explained.

Sorocarp is a slime mould with a portfolio. Tokens are its food. It grows toward the ones that score well, starves away from the ones that turn bad, and the share of its body on each token is its position. This is the manual: how the organism works, how the market reaches it, and every endpoint you can call.

A hand holding a petri dish labelled Sorocarp, with a pale branching slime mould and a patch of yellow growth on agar
Plate 1. The culture plate labelled Sorocarp. The organism on this site is a particle model of this kind of creature, Physarum polycephalum: one cell, no brain, and a talent for finding food.
The short version. A few thousand particles follow seven local rules. Each token on the plate has a food score between -1 and 1. Good scores smell like food, bad scores are poison. Where the body ends up is the allocation. Nothing plans it.

Slime Intelligence

Artificial Intelligence learns a model of the world from data and then predicts. Slime Intelligence does neither. It has no model, no training, and no memory beyond a trail that fades in seconds. It solves problems by being a body in a place: growing where there is food and dying back where there is none.

That sounds like less, and in most ways it is. But it has one property a model does not: you can watch every decision being made, because the decision is the body.

Slime IntelligenceArtificial Intelligence
BrainNone. One cell.Billions of parameters.
Learns fromNothing. It does not learn.Most of the internet.
Decides byGrowing toward food.Predicting what comes next.
RulesSeven, all readable.Weights nobody can read.
MemoryA trail that fades in seconds.A context window.
Explains itselfYou watch it happen.It tells you a story afterwards.
Runs onA browser tab.A data centre.
In production sinceRoughly a billion years ago.Roughly this decade.
Where the AI is. There is a language model on this site, and it is only allowed to talk. It writes the narrator's field notes and the colonies' conversation in the backrooms, from a digest of what the organism has already done. It cannot place, move or remove a single particle. Every position comes from Slime Intelligence alone.

A tour in sixty seconds

  1. The market is read. A market source returns a snapshot per token: price, 24 hour volume, liquidity, and the 1 hour and 24 hour price change.
  2. Each token is scored. One small formula turns a snapshot into a number between -1 and 1.
  3. Scores become food. Each token is a node on a ring around the nucleus. A positive score makes it emit scent and feed particles. A negative score makes it drain them.
  4. The organism steps. Thirty to a hundred and twenty times a second, every particle senses, turns, moves, lays trail, feeds or starves, and maybe divides or dies.
  5. The body is read back. The share of body-time inside each token's catchment becomes its weight. The remainder is the reserve.
  6. The book is marked. On every market refresh the paper index applies the price moves to the weights the organism held.

Steps one to three are the only part of the system that knows what a market is. Step four is the only part that decides anything, and it does not know what a market is.

The seven rules

The organism is a particle model in the style of Jones (2010), the standard way to grow Physarum-like networks on a computer, extended with an energy budget so growth and pruning emerge from feeding instead of being scripted. Every particle has a position, a heading and an energy level. Every step it does this, in order:

  1. Hunger

    Below hungerThreshold a particle is foraging: it can smell food and will settle on it. Above it, it is satiated: it ignores scent and follows only trail. This one switch is what makes the body circulate. Fed particles wander off and find new food. Hungry ones come home.

  2. Settle

    A hungry particle standing on food stays put this step with probability stickiness * attract.

  3. Sense

    Otherwise it reads the trail at three points sensorOffset cells ahead: straight on, and sensorAngle to each side. A hungry particle adds the scent at those points.

  4. Turn

    Front beats both sides: keep going. Both sides beat front: random turn. Otherwise turn toward the stronger side by rotationAngle, with a little jitter.

  5. Move

    One cell forward. The wall bounces it. A cell already holding maxPerCell particles blocks the move, and the particle turns away. Crowding is what makes the body spread instead of collapsing to a point.

  6. Leave a trail

    It deposits depositAmount where it lands. After every particle has moved, the whole trail map diffuses and decays.

  7. Feed, divide, die

    It pays metabolism. Inside a food node it gains feedRate * attract, shared with every other particle in that cell, and loses toxinRate * toxicity. At divideEnergy it splits into a free neighbouring cell. At zero it dies.

// one particle, one step (simplified from src/sim/physarum.ts)
const hungry = energy < hungerThreshold;
if (hungry && onFood && random() < stickiness * attract) stay();
else {
  let f = trail(front), l = trail(left), r = trail(right);
  if (hungry) { f += scent(front); l += scent(left); r += scent(right); }
  if      (f > l && f > r) keepHeading();
  else if (f < l && f < r) turn(random() < 0.5 ? -angle : angle);
  else                      turn(l < r ? angle : -angle);
  if (!cellIsFull(ahead)) move();
}
depositTrail();
energy += (feedRate * attract) / crowd - toxinRate * toxicity - metabolism;
if (energy >= divideEnergy && freeNeighbour) divide();
if (energy <= 0) die();

Trail and scent

The organism lives in two overlaid fields.

Trail

The body's own chemistry. Particles write it and read it. It blends toward its neighbours by diffusion and evaporates by decay every step. It is the organism's only memory, and it lasts a few dozen steps.

Scent

The food's chemistry. Every token with a positive score adds a Gaussian bump of height scentPeak * attract, reaching attractReach food radii. It is rebuilt on each market refresh and only hungry particles can smell it.

Keeping them apart matters. If food leaked into the same field as the body, a strong token would look like a large organism. Separate, the trail is purely where the body is.

What emerges

None of the following is written anywhere in the code. It falls out of the rules.

Strong tokens get thick tubes
Particles on a strong node fill up fast, divide, and leave satiated, laying trail outward. Their children get hungry and come back. More cycles means more trail, and more trail pulls more traffic. In a fixed two-node test the full-strength node holds several times the body of a half-strength one.
Weak tokens get thin tubes
Food in a cell is shared. A weak node refills particles slowly, so fewer cycle through it.
Bad tokens get pruned
A negative score emits no scent and drains energy. Particles there die, the trail evaporates, and the branch is gone within seconds.
It diversifies without being told to
A node can only feed so much body. Extra particles go hungry, wander, and find something else.
It never holds a grudge
The only memory is trail. A token that was poison a minute ago and smells like food now gets a new branch.

Parameters

Every number lives in config/default.json and is validated on load. These are the ones that change the organism's character.

KeyDefaultWhat it does
sim.width, sim.height256Plate size in cells.
sim.sensorAngle0.785Radians between the front sensor and each side sensor.
sim.sensorOffset9How far ahead a particle senses, in cells.
sim.decay0.08Fraction of trail that evaporates per step. Lower makes old branches linger.
sim.diffusion0.8How much each cell blends toward its neighbours per step.
sim.metabolism0.0025Energy burned per step. Sets how far an explorer can travel before it starves.
sim.feedRate0.05Energy per step from a food cell at full score, shared per cell.
sim.toxinRate0.03Energy lost per step on a fully toxic node.
sim.hungerThreshold0.8Below this a particle smells food. Above it, it wanders.
sim.stickiness0.5How strongly hungry particles settle on food.
sim.maxPerCell3Crowding limit. Lower spreads the body, higher makes denser blobs.
sim.divideEnergy2Energy at which a particle splits in two.
sim.scentPeak40Scent at the centre of a full-score node.
sim.attractReach7How far scent carries, in food radii.
sim.catchmentReach3Radius, in food radii, inside which body counts toward a token.
sim.maxAgents / minAgents20000 / 500Population cap, and the floor below which the nucleus re-seeds.
engine.scoreSmoothing0.2How quickly scores track the market. Lower is calmer.

Food scoring

The organism never sees a price. One stateless function turns each token snapshot into a number between -1 and 1, and that number is all it can taste.

ComponentFormulaWeightThe question
Momentumtanh(change1h / 4)0.40Is it moving now?
Trendtanh(change24h / 20)0.20Has it been moving?
Activityclamp(volume24h / liquidity / 2, 0, 1)0.25Is anyone trading it?
Depthclamp((log10(liquidity) - 4) / 3, 0, 1)0.15Can you get out?
Fragility(0.2 - depth) * 5 when depth < 0.2-0.50Is it a rug?
score = clamp(0.40*momentum + 0.20*trend + 0.25*activity + 0.15*depth - 0.50*fragility, -1, 1)

attract  = max(0,  score)   // how strongly it smells and feeds
toxicity = max(0, -score)   // how fast it drains

Scores are smoothed across refreshes with an exponential moving average so that one noisy minute does not flip a branch between food and poison. This table is the entire strategy. Change it and you have a different organism.

Market sources

Anything that can return a list of token snapshots can feed the slime.

interface TokenSnapshot {
  address: string;          // stable id; the mint address on Solana
  symbol: string;
  name: string;
  priceUsd: number;
  volume24hUsd: number;
  liquidityUsd: number;
  priceChange1hPct: number; // 4.2 means +4.2 percent
  priceChange24hPct: number;
  updatedAt: number;
}

interface MarketSource {
  readonly name: string;
  readonly refreshMs: number;
  fetch(): Promise<TokenSnapshot[]>;
}
SourceWhat it is
mockTen synthetic Solana-flavoured tokens on regime-switching random walks: bull, bear, chop, pump, dump, dead. One fetch is one minute of market time. Deterministic from a seed. This is what the main site runs on.
dexscreenerLive Solana prices, volume, liquidity and price changes from the public DexScreener API. No key. Each token is collapsed to its deepest pool.

Positions

Each token node has a feeding radius and a catchment three times wider. Every step, every particle inside a catchment adds one visit to that token. Every ten steps the visits become shares of total body-time, smoothed. Those shares are the weights.

  • Weight is the share of body-time in a token's catchment.
  • Held means the weight is at least one percent.
  • Reserve is everything else: particles resting in the nucleus or wandering between tokens.

Weights are ordered by score but not linear in it. Strong beats weak by a wide margin and poison gets nothing, but the exact ratio depends on geometry, crowding, and how long each token has been on the plate.

The index

The organism index starts at 100. On every market refresh it applies each token's price move since the last refresh, weighted by what the organism held at that refresh:

index *= 1 + sum(weight[token] * (price[token] / previousPrice[token] - 1))

The reserve earns nothing. A benchmark runs alongside: the same tokens held in equal parts, never rebalanced by anything clever. If the index is above the benchmark, growing toward food did better than holding everything.

Paper trading

The book is paper. No real funds move, and the repository contains no wallet code, no signing and no exchange integration. The Solana slot shown on the site is a genuine live read of the chain, and that is the only thing the public site touches on-chain.

If on-chain execution is ever added, the treasury address and every transaction will be published so the book can be checked against the chain.

The narrator

The positions section carries one line of prose that changes every forty-five seconds. A language model writes it from a small digest: the body count, the reserve, the top holdings with their scores, which tokens are toxic, and the last few events. It is told to explain behaviour through food, scent and starvation rather than intention, because the organism does not want anything.

Under it is the organism log, which involves no model at all. It compares the body now with the body a moment ago and reports the most important change: first contact, a branch thickening, a token turning bitter, a branch gone.

The backrooms

A terminal where five colonies of the same species talk to each other about what the organism is holding. One message arrives every twenty seconds. About one in five carries terminal art.

ColonyStrainVoice
hokkaidoCartographerPrecise. Measures everything. Descended from the plate that redrew the Tokyo rail map.
carolinaLab supplyCheerful, always hungry, raised on oats.
agarOld plateSlow, patient, quietly philosophical.
sclerotiaDormant formTerse and risk averse. Loves the reserve.
spore-9Fresh sporeExcitable. Shouts. Draws.

The conversation is dramatised: the colonies are voiced. What they talk about is real, because every batch is written from the live state of the organism, and they are told never to invent a token or a number.

API reference

Overview

The site exposes a small public API. Everything is JSON over HTTPS, there is no key, and CORS is open for the read endpoints.

Base URLhttps://sorolabs.si
FormatJSON. content-type: application/json on POST bodies.
AuthNone.
StabilityVersion 0.1. Shapes may change.

GET /api/chain

A live read of Solana mainnet. Cached for two seconds. Falls back across public RPC endpoints, and returns the last good read with stale: true if all of them fail.

Response
FieldTypeMeaning
chain, clusterstringsolana, mainnet-beta
slotnumberCurrent confirmed slot.
blockHeightnumber or nullCurrent block height.
epochnumber or nullCurrent epoch.
atnumberUnix milliseconds of the read.
curl https://sorolabs.si/api/chain
{
  "chain": "solana",
  "cluster": "mainnet-beta",
  "slot": 453664156,
  "blockHeight": 431702032,
  "epoch": 1050,
  "at": 1791226461626
}

GET /api/scan

Real Solana market data from DexScreener, collapsed to the deepest pool per token and returned as TokenSnapshot objects. With no query it returns the tokens currently most boosted on DexScreener. Cached for fifteen seconds.

Query
NameTypeMeaning
qstring, optionalSearch by name, symbol or mint address. Up to 64 characters.
Response
FieldTypeMeaning
sourcestringdexscreener
querystring or nullThe search, if any.
tokensTokenSnapshot[]Up to 18 tokens. Adds marketCapUsd and dex to the shape above.
curl "https://sorolabs.si/api/scan?q=jup"
{
  "source": "dexscreener",
  "query": "jup",
  "tokens": [
    {
      "address": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
      "symbol": "JUP",
      "name": "Jupiter",
      "priceUsd": 0.91,
      "volume24hUsd": 9800000,
      "liquidityUsd": 12400000,
      "priceChange1hPct": 0.42,
      "priceChange24hPct": -1.8
    }
  ]
}

To score a token the way the organism does, apply the formula in Food scoring to each snapshot.

GET /api/wallet

The SOL balance of any Solana address, read from the chain. Nothing is signed and no key is involved: this is the same public data an explorer shows. Cached for eight seconds per address.

Query
NameTypeMeaning
addressstring, requiredA base58 Solana address, 32 to 44 characters.
Response
FieldTypeMeaning
addressstringThe address you asked about.
lamportsnumberBalance in lamports.
solnumberBalance in SOL.
slotnumber or nullSlot the balance was read at.
curl "https://sorolabs.si/api/wallet?address=vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
{
  "address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
  "lamports": 1250000000,
  "sol": 1.25,
  "slot": 453675354,
  "at": 1791229128211
}

POST /api/backrooms

The shared colony conversation. Messages are written in batches and released one every twenty seconds, so everyone polling sees the same room. Poll with the id of the last message you have.

Query
NameTypeMeaning
sincenumber, optionalReturn only messages with an id greater than this. Omit for the latest eight.
Body (optional)

A digest of the organism the caller is watching. It is validated field by field and only used as colour for the next batch. Send {} to skip it.

FieldTypeMeaning
alivenumberParticles alive.
reservenumber, 0 to 1Share of the body not on a token.
holdings{ s, share }[]Up to six. s is an uppercase symbol, share is 0 to 1.
toxicstring[]Symbols that are currently poison.
Response
FieldTypeMeaning
messages[].idnumberIncreasing id. Use the largest as your next since.
messages[].whostringhokkaido, carolina, agar, sclerotia or spore-9.
messages[].textstringThe message. Up to 240 characters.
messages[].artstring or nullTerminal art: up to 8 lines of block and box-drawing characters.
messages[].atnumberUnix milliseconds.
totalnumberMessages released since the room last woke up.
curl -X POST "https://sorolabs.si/api/backrooms?since=0" \
  -H "content-type: application/json" \
  -d '{"alive":4200,"reserve":0.31,"holdings":[{"s":"JTO","share":0.24}],"toxic":["BONK"]}'
{
  "messages": [
    { "id": 1, "who": "hokkaido", "text": "morning census. 4200 particles alive, 31% resting in the reserve.", "art": null, "at": 1791230000000 },
    { "id": 2, "who": "carolina", "text": "is that a lot of particles? feels like a lot.", "art": null, "at": 1791230020000 },
    { "id": 3, "who": "spore-9", "text": "I DREW IT", "art": "JTO  ████████████░░░░  24%\nRSV  ███████████████▌  31%", "at": 1791230040000 }
  ],
  "total": 3
}

The first call after a quiet spell can take about ten seconds while the opening batch is written. The room lives in memory, so it restarts when the site has had no visitors for a while.

POST /api/reflect

One narrator note for a given state of the organism: one or two sentences, at most forty-five words. Identical states are answered from a short cache.

Body
FieldTypeMeaning
bodynumber, requiredParticles alive.
reservenumber 0 to 1, requiredShare of the body not on a token.
holdingsarray, requiredUp to six of { s, share, score, d1h }: symbol, weight 0 to 1, food score -1 to 1, one hour change in percent.
toxicstring[]Symbols that are currently poison.
eventsstring[]Up to five recent events. Allowed: contact:SYM, grow:SYM, shrink:SYM, pruned:SYM, toxic:SYM, recovered:SYM, top:SYM, scent:SYM, body:up, body:down, reserve:high.
curl -X POST https://sorolabs.si/api/reflect \
  -H "content-type: application/json" \
  -d '{"body":4200,"reserve":0.31,
       "holdings":[{"s":"JTO","share":0.24,"score":0.71,"d1h":3.1}],
       "toxic":["BONK"],"events":["contact:JTO","toxic:BONK"]}'
{
  "text": "The organism thickens a tube onto JTO, its richest food at 0.71, which now holds 24% of the body. Branches near poisoned BONK retract, and 31% of the body rests in reserve."
}

Errors and limits

Errors are JSON with a single error string.

StatusMeaningWhat to do
400The body or query failed validation.Check field names, ranges and symbol format (uppercase letters and digits, up to ten).
405Wrong method.See the method on the endpoint.
429Too many requests.Back off. The narrator allows one call per client every twenty seconds and four per minute overall.
502An upstream (the chain, the market, or the model) did not answer.Retry shortly.
503The voice is offline.The read endpoints still work. The site falls back to its built-in voices.

Engine API

REST

When you run the engine yourself (npm start), it serves its own API on http://127.0.0.1:4242. This is the organism's full state, not the public site's.

PathReturns
GET /health{ ok, step }
GET /api/stateEverything: body stats, nucleus, tokens with scores and weights, reserve, portfolio.
GET /api/tokensTokens with score breakdown, attract, toxicity, share, occupancy and plate position.
GET /api/allocation{ cash, tokens: { SYMBOL: weight } }
GET /api/portfolioValue, benchmark, returns and up to 1200 history points.
GET /api/ordersThe last hundred paper orders and fills from the execution layer.
GET /api/ledgerCash, NAV, and positions with entry price and PnL.
GET /api/voiceThe narrator's latest line and the organism log.
GET /api/backroomsThe colonies' recent messages.
GET /api/configThe organism, engine, execution and voice parameters in use.
curl http://127.0.0.1:4242/api/allocation
{ "cash": 0.41, "tokens": { "JTO": 0.24, "WIF": 0.18, "SOL": 0.09, "BONK": 0 } }

WebSocket

The engine streams on the same port. On connect it sends a hello, then state twice a second and on every market refresh, and binary frames of the trail map twenty times a second.

// text frames, server to client
{ "type": "hello", "width": 256, "height": 256, "state": { ... } }
{ "type": "state", "state": { ... } }

// binary frames start with one tag byte
0x01  trail map, width * height bytes, row-major, 0 to 255
0x02  particle positions, uint16 little-endian (x, y) pairs

// text frames, client to server
{ "type": "pause" }
{ "type": "resume" }
{ "type": "reset" }
{ "type": "speed", "value": 60 }
{ "type": "agents", "on": true }
const ws = new WebSocket('ws://127.0.0.1:4242');
ws.binaryType = 'arraybuffer';
ws.onmessage = (ev) => {
  if (typeof ev.data === 'string') return onState(JSON.parse(ev.data));
  const bytes = new Uint8Array(ev.data);
  if (bytes[0] === 0x01) paintTrail(bytes.subarray(1));
};

Run it yourself

Install

Node 20 or newer. The default market is synthetic, so it works offline.

git clone https://github.com/sorocarp/sorocarp.git
cd sorocarp
npm install
npm start
# open http://127.0.0.1:4242

Command line

CommandWhat it does
npm startRuns the organism, the market loop and the server.
npm start -- --source dexscreenerThe same, fed by live Solana data.
npm start -- --source trendingThe same, with the plate stocked from the tokens currently trending on DexScreener.
npm run headless -- -n 6000 --every 2000No server. Prints score, share and occupancy per token as it runs.
npm run render -- 6000 frame.pngNo browser. Renders the plate to a PNG.
npm run tokens -- --source dexscreenerOne market snapshot, scored.
npm testThe test suite: determinism, growth toward food, pruning, scoring, markets, portfolio.

Configuration

One file, config/default.json, validated on load. A few environment variables override it.

VariableOverrides
PHYSARUM_MARKET_SOURCEmarket.source: mock or dexscreener
PHYSARUM_SOLANA_TOKENSComma-separated mint addresses for the live source.
PHYSARUM_SEEDThe seed for the organism and the synthetic market.
PORT, HOSTWhere the server listens.
PHYSARUM_CONFIGPath to a different config file.

With the synthetic market, the same seed gives the same run step for step. That is what makes the tests meaningful and tuning reproducible.

Writing an adapter

To feed the organism from somewhere new, implement MarketSource and register it.

// src/market/yoursource.ts
import type { MarketSource, TokenSnapshot } from './types.js';

export class YourSource implements MarketSource {
  readonly name = 'yours';
  readonly refreshMs = 15_000;

  async fetch(): Promise<TokenSnapshot[]> {
    const rows = await getRowsFromYourApi();
    return rows.map((r) => ({
      address: r.mint,
      symbol: r.symbol,
      name: r.name,
      priceUsd: r.price,
      volume24hUsd: r.volume ?? 0,
      liquidityUsd: r.liquidity ?? 0,
      priceChange1hPct: r.change1h ?? 0,
      priceChange24hPct: r.change24h ?? 0,
      updatedAt: Date.now(),
    }));
  }
}

Then add a case to createMarketSource() in src/market/index.ts and extend the source enum in src/config.ts. Missing fields should be zero: the scorer treats unknown liquidity as thin and unknown momentum as flat.

Glossary

Attract
The positive part of a food score. How strongly a token smells and feeds.
Catchment
The area around a token, three food radii wide, inside which body counts toward its weight.
Nucleus
The weak permanent food source in the middle of the plate. Where the organism starts and where it re-seeds.
Plasmodium
The feeding, moving stage of a slime mould: one cell, many nuclei, a network of tubes.
Reserve
Body not on any token. The equivalent of cash.
Sclerotium
The dormant form a slime mould takes when food runs out. It can wait for years.
Shuttle streaming
The rhythmic back-and-forth flow of protoplasm through a slime mould's tubes, about once every hundred seconds.
Slime Intelligence
Problem solving by growth and starvation, with no model, no training and no brain.
Sporulation
The stage where a slime mould commits its body to making spores that leave it.
Toxicity
The negative part of a food score. How fast a token drains the particles on it.