Skip to content
KYZEN DOCUMENTATIONLaunch app

DocsProductsGateway

Balance and settlement

The prepaid $KYZN balance, what a request costs, the daily settlement and the burn.

Credited after
10 blocks
Settlement
Every 24 hours
Sold
10/11
Burned
1/11

#Prepaid balance

Requests spend a prepaid balance of $KYZN, kept for each wallet. To top up, the wallet sends $KYZN to the Gateway contract, 0xe4EdA9·9415D2. The transfer is credited to the wallet that sent it once it is ten blocks deep. In the app, step by step: Top up.

RuleValue
DepositA $KYZN transfer to the Gateway contract
Credited toThe wallet that sends it: send from the wallet your key belongs to
Credited afterTen blocks; the worker reads new transfers every minute
Not credited$KYZN routed into the contract straight from a pool buy
BalanceCredited minus charged
WithdrawalNone

The contract is exempt from the trade tax, so a pool buy routed straight into it skipped the tax. That is why it is not credited.

The contract has no withdrawal function. $KYZN sent to it leaves only in a settlement sent by the operator wallet: sold for ETH to the host payout address, or burned, with at least 1/11 of each settlement burned. Send what you plan to spend.

Read a balance
curl https://app.kyzen.network/v1/balance/0xYourWallet

What a request costs

Each request is charged from the host’s token counts at the host’s dollar rate plus 10%, in $KYZN at the median pool price of the last 15 minutes.

A request's charge
host cost = input tokens × input rate + output tokens × output rate
charge = host cost × 1.10 ÷ $KYZN price
rates
The host’s dollars per token for the tier, before the margin
$KYZN price
The median of the last 15 minutes, in dollars
charge
In $KYZN, rounded up to the wei
RuleValue
Price samplesOne a minute, from the pool’s reserves and the Chainlink ETH/USD feed
PriceThe median of the samples of the last 15 minutes
FreshThe newest sample at most 10 minutes old, the ETH/USD answer at most 24 hours old
No fresh price503 price_unavailable: nothing is charged
No token countsCounted from the text at four bytes a token, and marked estimated

Before a request runs, the Gateway holds the most it can cost: the prompt at three bytes a token, plus every output token the request may produce. The hold must fit in the balance not already held, or the request gets 402 insufficient_balance.

When the answer ends, the charge replaces the hold. A charge is never more than the wallet’s balance. A request the host fails costs nothing; a stream that stops is charged for what arrived.

Worked exampleOne request
Tokens
1,000 input, 500 output
Host rates
$1.00 and $2.00 per million tokens
Host cost
$0.0020
With the 10% margin
$0.0022
$KYZN price
$0.0001
Charge
22 $KYZN
At settlement
20 $KYZN sold, 2 $KYZN burned

Example rates and price, not the Gateway’s. GET /v1/models lists each tier’s prices with the 10% margin included: the host’s rate times 1.10.

#Daily settlement

Every 24 hours the Gateway settles what requests used since the last settlement. The operator wallet calls the Gateway contract, which sells 10/11 of that $KYZN for ETH to the host payout address and burns the other 1/11.

A settlement
sold = charged × 10 ÷ 11, rounded down
burned = charged − sold
charged
All $KYZN charged since the last settlement
sold
Sold for ETH through Uniswap v2 Router02

Enforced by the contract

RuleValue
SenderThe operator wallet, 0x2Ba4C9·C839Bb, the only caller the contract accepts
Burn floorAt least 1/11 of what each settlement sells and burns; the contract refuses a settlement that burns less
ETH toThe host payout address, 0x965200·Ddd16e, which pays the inference host

The contract’s sales pay no tax because the token exempts its address: a rule of the token, not of this contract (The 4% tax). The contract checks the caller and the burn floor, not each charge: the amounts sold and burned come from the operator. The contract’s owner can name the operator and the host payout address. Neither touches the burn: every settlement still burns at least 1/11. What this asks of holders: Risk.

Run by the worker

The server’s worker holds the operator key and follows these rules. The contract does not check them.

RuleValue
Amounts10/11 sold and 1/11 burned, of all $KYZN charged since the last settlement
Interval24 hours after the last settlement; the first, 24 hours after the oldest charge
HoldingsA settlement runs only when the contract holds all that was charged
Minimum ETH out99% of Router02’s quote
A sale too small for any ETHAll of it is burned
After a failed settlementThe next try comes an hour later
SigningSimulated first, then signed once

The signed bytes are stored before they are sent, so a worker that stops sends the same bytes again: it never signs a second settlement for the same charges.

#The burn

A request costs the host’s rate times 1.10, so 0.10 of every 1.10 charged, 1/11, is margin. Every settlement burns it.

The burn calls the token’s own burn, so the total supply falls by exactly the amount burned. The contract’s sales pay no tax, so the whole margin burns. Backing per $KYZN is the Reserve’s value divided by the total supply, so a burn leaves a larger share of the Reserve behind each remaining $KYZN (The Reserve).

ReadHolds
totalBurned()All $KYZN the Gateway contract has burned
totalSold(), totalToHost()All $KYZN it has sold, and the ETH sent to the host payout address
Settled(sold, burned, ethToHost)One event per settlement
GET /v1/statsburned_last_24h_wei: burned in the last 24 hours
DashboardBurned by usage, read from totalBurned()
Read the total burned
cast call 0xe4EdA9794c24c81fB68871AF6e08f2d0519415D2 "totalBurned()(uint256)" \
  --rpc-url https://rpc.mainnet.chain.robinhood.com
# wei of $KYZN, 18 decimals
Esc
  • OverviewGet started
  • Quick startGet started
  • Wallets and networkGet started
  • Where the app opensGet started
  • GuidesGuides
  • Buy $KYZNGuides