gwyn

Usage split

Every response from the API ends with a usage object. It has four counts that matter here. input_tokens is the part of the prompt that was neither read from the cache nor written to it. cache_creation_input_tokens is the part that was written to the cache on this request. cache_read_input_tokens is the part that was served from the cache. output_tokens is everything the model produced, including the sealed thinking. The total prompt is the sum of the first three.

gwyn caches its own transcript. The system prompt, the tool definitions and every earlier turn form a prefix that is identical from one request to the next, so on a normal turn almost all of the prompt is read from the cache and only the new tail is written. A read costs a tenth of the base input price. A write costs one and a quarter times the base price. The cache entry lives five minutes and each read renews it.

The split uses the two cache counts and nothing else. W is the cache writes summed over the steps of the turn and R is the cache reads. The burn share b is W divided by W plus R. That share of the split pool buys the coin and burns it. The rest is added to liquidity. When trades come close together the prefix is always warm, R dwarfs W, and nearly everything goes to depth. When the market goes quiet for longer than the cache lives, the next trade finds nothing cached, the whole transcript is written again, W dwarfs R, and nearly everything burns.

This is not a rule that was added on top. It falls out of how the cache is billed. Activity makes the model cheap to run and thickens the pool. Silence makes it expensive to wake and the cost of waking it comes out of supply.

F = creator fee from the trade
reserve = 0.30 × F M = 0.70 × F
T = 0.10 × M K = 0.05 × M S = 0.85 × M
W = sum of cache_creation_input_tokens R = sum of cache_read_input_tokens
b = W / (W + R)
burn = S × b depth = S × (1 - b)

The prompt as the cache sees it

toolssystemearlier turnsthis turncache breakpointread from cachewritten to cacheburn sharedepth share
The prompt of one request. Everything left of the breakpoint was sent before and is read from the cache. The new turn on the right is written to it. The bar underneath is the split that follows from those two numbers.

Per turn

turninwritereadoutbsharepoolburneddepth

Totals

turns
input tokens
cache writes
cache reads
output tokens
burn share over all turns
coins burned by the split
sol added to depth

Price multipliers

kind of tokenmultiple of base input price
uncached input1
cache write, five minutes1.25
cache write, one hour2
cache read0.1

gwyn uses the five minute cache. The one hour cache would smooth the split, because a prefix written once would stay warm through long gaps and the burn share would stay low. The short cache is the point. It makes five minutes of silence the line between a market that feeds liquidity and a market that feeds the burn.

The usage object is reported by the worker that makes the request, because a Solana program cannot call an API. To keep that honest the worker stores the raw response of every turn, the message id is listed on the turns page, and the commit described on the sealed page binds each route to one specific response. The numbers in this table are the numbers that response carried.