Contract reference
For integrators. Calls are alkanes cellpacks [block, tx, opcode, args...]. An AlkaneId argument is two words, block then tx. View results are little-endian u128 words, 16 bytes each with no framing; an empty result means "no such thing". Read views with metashrew_view("simulate", ...). USD and prices are 1e8 fixed point and times are unix seconds.
"admin" means the pool's SABLITAL-ADMIN token must be among the incoming alkanes, "SIGIL" the SABLITAL-SIGIL, and "holder" the stream's NFT. Tokens sent in for authorization come back in the same call.
Payroll pool
| op | name | args | who |
|---|---|---|---|
| 0 | Initialize | token, stream_template, orbital_template, pricebook | deployer; mints ADMIN + SIGIL |
| 1 | Deposit | none (send the token in) | anyone |
| 2 | Withdraw | amount | admin; at most balance − debt |
| 3 | CreateStream | start, interval, initial_usd, usd_per_tick, budget_usd, cancelable, min_price, max_diesel_per_tick, twap_window, cap, name, symbol | admin; returns the stream NFT, data = stream id |
| 4 | Authorize | stream, cap | admin; cap ≥ drawn + debt, 0 = unlimited |
| 5 | Revoke | stream | admin; booked debt stays drawable |
| 6 | Draw | amount | authorized stream only (caller) |
| 7 | SigilSweep | token, amount (0 = all) | SIGIL |
| 8 | SigilRepoint | pricebook | SIGIL; for streams created afterwards |
| op | view | returns |
|---|---|---|
| 10 | GetBalance | balance |
| 11 | GetToken | block ‖ tx |
| 12 | GetAuthToken | admin token block ‖ tx |
| 13 | GetStreamCount | count |
| 14 | GetStream(index) | block ‖ tx |
| 15 | GetAllowance(stream) | active ‖ cap ‖ drawn ‖ debt |
| 16 | GetDebt | total debt |
| 17 | GetConfig | stream_template ‖ orbital_template ‖ pricebook block ‖ tx |
| 18 | GetSigil | block ‖ tx |
Payroll stream
Created by a pool's CreateStream; never deploy one by hand.
| op | name | args | who |
|---|---|---|---|
| 1 | Settle | max_ticks (0 = default 4) | anyone |
| 2 | Claim | none | holder; settles, then pays |
| 3 | Cancel | none | admin; cancelable streams only |
| 4 | Extend | add_usd | admin |
| 5 | Amend | usd_per_tick, interval, next_tick_time (0 = keep), budget_usd | admin |
| 6 | Bonus | usd | admin |
| 7 | Advance | usd | admin |
| 8 | SigilSweep | token, amount (0 = all) | SIGIL; freezes the stream |
| 9 | Collect | none | holder; no external calls |
| 30 | SigilRepoint | pricebook | SIGIL |
| op | view | returns |
|---|---|---|
| 10 | GetConfig | pool, pricebook, admin, token (2 words each) ‖ start ‖ interval ‖ initial_usd ‖ usd_per_tick ‖ budget_usd ‖ cancelable ‖ min_price ‖ max_diesel_per_tick ‖ twap_window ‖ base_k ‖ base_time ‖ base_usd ‖ sigil (2 words) |
| 11 | GetTick(k) | time ‖ height ‖ price ‖ usd ‖ diesel ‖ flags |
| 12 | GetTotals | usd_vested ‖ diesel_vested ‖ diesel_drawn ‖ diesel_claimed ‖ usd_scheduled ‖ advance_outstanding ‖ bonus_usd |
| 13 | GetProgress | ticks_settled ‖ ticks_due_unsettled ‖ next_tick_time ‖ scheduled_usd_remaining ‖ canceled ‖ end_time ‖ swept |
| 14 | GetOrbital | NFT block ‖ tx |
| 15 | IsCanceled | 0 or 1 |
| 16 | GetPool | block ‖ tx |
| 17 | GetGrantCount | count |
| 18 | GetGrant(i) | time ‖ height ‖ price ‖ usd ‖ diesel ‖ kind (1 bonus, 2 advance) |
| 99 / 100 | GetName / GetSymbol | string |
Tick flags are a bitfield: 1 gap, 2 late, 4 interpolated.
Schedule arithmetic
Tick 0 is at start and pays initial_usd. After an Amend, tick base_k + j is at base_time + j·interval and pays usd_per_tick. Scheduled USD never exceeds budget_usd, so the last tick is clipped. An outstanding advance is recovered from each tick's gross USD before conversion. DIESEL for a tick is floor(usd · 1e8 / max(price, min_price)), capped at max_diesel_per_tick when that is set.
Pricebook
One per oracle feed (DIESEL/USD: TUNDRACLE 4:9010, key 3).
| op | name | args | returns |
|---|---|---|---|
| 0 | Initialize | oracle, key, max_stale (blocks) | none |
| 1 | Record | none | 1 if a new oracle write was recorded |
| 2 | RecordAndQuote | t0, step, n | as PricesAtTimes, after recording |
| 10 | PriceAt | height | price ‖ entry_height ‖ status ‖ flags |
| 11 | PricesAtTimes | t0, step, n (≤ 64) | n × (price ‖ height ‖ status ‖ flags) |
| 12 | GetEntry | index | oracle_height ‖ price ‖ updates ‖ gap |
| 13 | GetCount | none | entries |
| 14 | GetSource | none | oracle block ‖ tx ‖ key ‖ max_stale ‖ observed_height |
| 15 | HeightAt | time | height ‖ status ‖ flags |
| 16 | GetAnchor | index | height ‖ time |
| 17 | GetAnchorCount | none | anchors |
| 18 | TwapAt | time, window | twap ‖ status ‖ flags |
| 19 | TwapsAtTimes | t0, step, n, window | n × (twap ‖ status ‖ flags) |
Status: 0 ok, 1 not yet knowable (record later), 2 stale (waiting for the next oracle write).
Vest controller
Template 4:1792; each vest is its own instance.
| op | name | args | who |
|---|---|---|---|
| 0 | Initialize | vesting_token, orbital_template, start, cliff, duration, initial_unlock_bps, cancelable, name, symbol | deployer; mints the admin NFT |
| 1 | Seed | none (send the token in) | anyone |
| 2 | CreatePositions | quantities (witness: u32 count, then count × u128) | admin |
| 3 | Claim | none | holder |
| 4 | Cancel | position_id | admin |
| 5 | WithdrawExcess | none | admin |
| op | view | returns |
|---|---|---|
| 10 | GetVested(position) | amount |
| 11 | GetClaimed(position) | amount |
| 12 | GetWithdrawable(position) | amount |
| 13 | GetQuantity(position) | amount |
| 14 | GetPositionOf(orbital) | position id, or u128::MAX |
| 15 | GetCount | positions |
| 16 | GetChild(index) | orbital block ‖ tx |
| 17 | GetSchedule | start ‖ cliff ‖ duration ‖ initial_unlock_bps |
| 18 | GetTotals | deposited ‖ committed ‖ claimed |
| 19 | GetVestingToken | block ‖ tx |
| 20 | IsCanceled(position) | 0 or 1 |
| 21 | GetCancelable | 0 or 1 |
| 99 / 100 | GetName / GetSymbol | string |