t27.aiEnglish

Сгорающие токены

Вы узнаете

Когда сгорает партия токенов и какая партия тратится раньше.

Правило владельца от 2026-10-01: все деньги уходят в токены, а токены, не потраченные за месяц, сгорают, так что заплативший делает контент, а не копит токены. Каждая партия живёт MONTH_DAYS, 30 дней, и days_left отсчитывает её от дня зачисления. На 25-й день у пакета месяца с дня 0 осталось 5 дней, у стартового подарка с дня 3 — 8, у пополнения с дня 12 — 17. Тратится раньше та, что сгорит раньше.

Попробовать

Найдите день, когда сгорает пакет месяца; затем найдите последний день, когда остаётся хоть одна партия.

Открыть интерактивный урок →

Tokens that burn: a month to spend them
Tokens that burn: a month to spend them ↗

Three batches of tokens, each burning 30 days after it lands. Drag today across two months: days_left counts down every batch, and the one that burns soonest is spent first.

specs/automation/token-wallet.t27

// SPDX-License-Identifier: Apache-2.0
// specs/automation/token-wallet.t27 -- the token wallet of the agent market: every dollar a
// person pays becomes tokens at ONE rate, every operation is sold at twice what it costs, and
// tokens that are not spent within a month burn.
// Host: 999-multibots-telegraf apps/vibee-editor/packages/vibee-atoms/src/token-wallet.ts
//       (the month a package buys, what it is worth in reels and portraits, when it burns),
//       read by the mini app's welcome screen and package cards (player/src/pages/Welcome.tsx,
//       player/src/components/Agents/PackageCards.tsx) and by render's billing
//       (render/src/agent/billing-shared.ts: the rate and the markup every price is made with).
// Generated: `t27c gen-ts` of this file is vendored into the host as
//       apps/vibee-editor/packages/vibee-atoms/src/spec/token-wallet.gen.ts. The host imports
//       the numbers from there and never restates them; a host test runs this file's vectors
//       against the host.
// Why a burn: the owner, 2026-10-01: all money goes into tokens, and the tokens must be spent
// within the month or they burn -- so a person who paid makes content instead of saving
// tokens. Kling and Runway burn a month of plan credits the same way; Kling spends the
// credits that burn soonest first, and so does this.
// Why one rate: every price is made at $0.005 a token, but the Stars packs (render-server.ts
// PACKS) sell a token for 1.1-1.5 Stars, about three times that (tools.ts SALE_USD_PER_TOKEN).
// A package month is sold at THIS rate; moving the Stars packs onto it is the owner's call.
// Claim status: v1 (2026-10-01). The rate, the markup and the start gift are what the host
// already charges. The month, the burn and the spend order are DECIDED but not yet in the
// ledger: render/src/token-ledger.ts keeps one balance with no dates; the batches with an
// expiry are the next change, and the burn must not be sold before it lands.
// Owner decision still open: whether tokens bought on top of a package burn in 30 days like
// the package month (the owner's rule, kept here) or live longer, as Kling's and Runway's
// bought credits do (TOPUP_DAYS is the one line to change).
// phi^2 + 1/phi^2 = 3 | TRINITY

module automation::token_wallet {

    pub const KIND : str = "automation";
    pub const ID : str = "token-wallet";
    pub const REPO : str = "999-multibots-telegraf";
    pub const VERSION : u8 = 1;

    // ---- One rate, one markup -----------------------------------------------------------
    pub const TOKEN_MICRO_USD : u32 = 5000;  // one token is half a cent, everywhere
    pub const MARKUP_PCT : u32 = 200;  // an operation is sold at twice what it costs us
    pub const MICRO_PER_USD : u32 = 1000000;

    // ---- What a month buys ----------------------------------------------------------------
    // A package's monthly price, in whole dollars, becomes tokens at the one rate: nothing is
    // kept back, the margin is the markup on what is spent and whatever burns.
    pub const SETUP_INCLUDES_MONTH : bool = true;  // the launch price carries the first month

    // ---- The burn -----------------------------------------------------------------------
    pub const MONTH_DAYS : u16 = 30;  // a package month burns 30 days after it lands
    pub const TOPUP_DAYS : u16 = 30;  // owner's rule: bought tokens burn the same way
    pub const START_DAYS : u16 = 30;  // the start gift burns too
    pub const SPEND_ORDER : str = "soonest-burn-first";
    pub const BURNS_BACKDATED : bool = false;  // tokens held before v1 never burn
    pub const WARN_DAYS_FIRST : u16 = 7;
    pub const WARN_DAYS_SECOND : u16 = 3;
    pub const WARN_DAYS_LAST : u16 = 1;

    // ---- The start gift -------------------------------------------------------------------
    pub const START_TOKENS : u32 = 20;  // granted once, on the first paid call

    // ---- What tokens are worth, in things a person can picture ----------------------------
    // The reference reel is the story reel's own estimate (crm-story-reel.t27
    // PRICE_ESTIMATE_TOKENS: three stills, three lines, 13 s of lip-sync, one cut); the
    // portrait is the lead magnet's price (crm-lead-magnet.t27 OP_TOKENS). A host test holds
    // both to those specs, so the welcome screen cannot promise a reel at an old price.
    pub const REEL_TOKENS : u32 = 270;
    pub const PORTRAIT_TOKENS : u32 = 12;

    // Dollars a month to tokens a month.
    fn month_tokens(usd: u32) -> u32 {
        return usd * MICRO_PER_USD / TOKEN_MICRO_USD;
    }

    // An operation's price in tokens from what it costs us, in micro-dollars: rounded up, so
    // nothing is sold below twice its cost.
    fn price_tokens(cost_micro_usd: u32) -> u32 {
        return (cost_micro_usd * MARKUP_PCT / 100 + TOKEN_MICRO_USD - 1) / TOKEN_MICRO_USD;
    }

    // Whole reels a number of tokens buys.
    fn reels_in(tokens: u32) -> u32 {
        return tokens / REEL_TOKENS;
    }

    // Whole portraits a number of tokens buys.
    fn portraits_in(tokens: u32) -> u32 {
        return tokens / PORTRAIT_TOKENS;
    }

    // Days left before a batch granted on `granted_day` burns, on `today` (0 when gone).
    fn days_left(granted_day: u16, today: u16, life: u16) -> u16 {
        if (today >= granted_day + life) {
            return 0;
        }
        return granted_day + life - today;
    }

    test "every dollar of a package month becomes tokens at the one rate" {
        assert(month_tokens(15) == 3000);
        assert(month_tokens(35) == 7000);
        assert(month_tokens(50) == 10000);
        assert(SETUP_INCLUDES_MONTH);
    }

    test "an operation is sold at twice its cost, rounded up" {
        assert(MARKUP_PCT == 200);
        assert(price_tokens(30000) == 12);
        assert(price_tokens(20000) == 8);
        assert(price_tokens(1) == 1);
    }

    test "a month burns on day thirty and nothing held before it burns" {
        assert(days_left(0, 0, MONTH_DAYS) == 30);
        assert(days_left(0, 23, MONTH_DAYS) == 7);
        assert(days_left(0, 30, MONTH_DAYS) == 0);
        assert(TOPUP_DAYS == MONTH_DAYS);
        assert(SPEND_ORDER == "soonest-burn-first");
        assert(!BURNS_BACKDATED);
    }

    test "the warnings come at seven, three and one day left" {
        assert(WARN_DAYS_FIRST > WARN_DAYS_SECOND);
        assert(WARN_DAYS_SECOND > WARN_DAYS_LAST);
        assert(WARN_DAYS_FIRST < MONTH_DAYS);
    }

    test "the start gift buys one portrait and no reel" {
        assert(portraits_in(START_TOKENS) == 1);
        assert(reels_in(START_TOKENS) == 0);
    }

    test "a Blogger month is twenty-five reels" {
        assert(reels_in(month_tokens(35)) == 25);
        assert(reels_in(month_tokens(15)) == 11);
        assert(reels_in(month_tokens(50)) == 37);
        assert(portraits_in(month_tokens(35)) == 583);
    }
}

// phi^2 + 1/phi^2 = 3 | TRINITY

Открыть спеку урока в плеере ↗

Все уроки