# `gno.land/p/moul/x/daily/ratelimit/v0` **Deterministic token-bucket rate limiter** โ€” a port of `golang.org/x/time/rate` with the wall clock replaced by a caller-supplied monotonic tick (on-chain, the block height). A `Limiter` owns a set of per-key token buckets sharing one `rate`/`burst` config. Each bucket refills at `rate` tokens per tick up to `burst`; the caller picks what a key is (typically an address) and passes the current tick on every call. Pure integer/float math over persistent avl state โ€” no chain imports, no ambient state, fully replayable. ```go import "gno.land/p/moul/x/daily/ratelimit/v0" l := ratelimit.New(0.5, 5.0) // 0.5 tokens/tick, capacity 5 l.Allow("g1caller", height) // consume one token; false if empty l.AllowN("g1caller", height, 3) // consume 3 atomically; false if <3 l.Tokens("g1caller", height) // read-only balance (whole tokens) ``` **Live demo:** [`r/moul/x/daily/ratelimitdemo`](https://github.com/moul/gno-contracts/tree/main/r/moul/x/daily/ratelimitdemo/v0) ยท render it at [`/r/moul/x/daily/ratelimitdemo/v0`](https://gno.land/r/moul/x/daily/ratelimitdemo/v0). --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** โ€” moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. **Dependency graph:** ![gno.land/p/moul/x/daily/ratelimit/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/p/moul/x/daily/ratelimit/v0/deps.png) > ๐Ÿงช **Highly experimental โ€” potentially vibe-coded.** Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).