Running payroll
This guide is for whoever pays. You need a wallet with DIESEL and a little BTC for fees.
1. Create a pool
A pool is your payroll account. Creating one mints two tokens to your wallet:
- SABLITAL-ADMIN-n, the everyday key. It creates streams, withdraws spare DIESEL and changes terms.
- SABLITAL-SIGIL-n, the failsafe. Move it to an offline wallet straight away and leave it there. See Security and the SIGIL.
n is the pool's own id number, so each pool's tokens are easy to tell apart.
2. Fund it
Send DIESEL to the pool with Deposit. Anyone can deposit, so a treasury or a co-signer can top it up too. Keep enough in the pool for at least the next payday of every stream. If the pool runs short, nobody loses pay: the stream records what it is owed and draws it after the next deposit (see Shortfalls).
3. Add a person
Create stream sets up one person's pay. The terms:
| term | meaning |
|---|---|
| start | the first payday (unix time). Leave empty for "now". |
| back pay | a one-off amount paid on the first payday, for pay that is already late |
| amount per payday | USD paid on every later payday |
| interval | time between paydays: 14 days is 1209600 seconds. Paydays follow the clock, not block counts. |
| budget | the total USD this stream may pay, back pay included. The last payday is partial if the budget runs out mid-period. |
| cancelable | whether you can stop the stream later. A non-cancelable stream's terms can only improve. |
| price floor | the lowest DIESEL price a payday will use. If the oracle ever reports something absurdly low, the stream pays at the floor instead of draining the pool. |
| max per payday | an optional hard cap on DIESEL per payday |
| TWAP window | 0 uses the price at the payday. Up to 1 day averages the price over that window instead. |
| pool cap | an optional lifetime limit on DIESEL this stream may draw from the pool |
The pool returns your admin token and a stream NFT. Send the NFT to the person. Holding it is what lets them collect.
Example
Someone joins on the 1st, you set things up on the 20th, and pay is $2,500 every two weeks for six months:
- start: the 20th
- back pay: what they are owed for the 1st to the 20th
- amount per payday: $2,500, interval 14 days
- budget: back pay plus 13 × $2,500
They can collect the back pay straight away, priced at that day's DIESEL rate. Every two weeks after that, another $2,500 of DIESEL becomes theirs at that payday's rate.
Changing terms
Hold the admin token and use these on a stream:
- Amend sets a new amount per payday, interval, next payday and budget. Any payday that has already come is paid at the old terms first, so a change never reaches back. The budget can't drop below what has already been paid.
- Extend raises the budget, for example to renew a contract.
- Bonus pays a one-off amount now, at today's price, on top of the budget.
- Advance pays an amount now and takes it back out of the next paydays. The total and the schedule stay the same. You can't advance more than the pay still to come.
- Cancel stops future paydays. Everything already due stays theirs and they can still collect it.
On a non-cancelable stream, Amend may only raise the rate, raise the budget or shorten the interval.
Shortfalls
When a payday comes and the pool can't cover it, the stream still fixes the DIESEL amount at that day's price. The part it couldn't draw becomes debt on the pool. Debt is reserved: Withdraw can only take the pool's balance minus its debt. The next deposit pays the debt first.
Withdrawing
Withdraw returns DIESEL you don't need. It is limited to the free balance, which is the pool balance minus debt.
Keeping things moving
Paydays settle when someone touches the stream: the person collecting, you changing terms, or a Settle call, which anyone may make. A stream that has been idle a long time catches up a few paydays per call. Settle accepts a smaller batch if a transaction ever runs short of fuel.
Revoke (emergency brake)
Revoke on the pool stops a stream from drawing anything new. Pay already recorded as debt stays reserved and drawable. Use Cancel for normal offboarding. Revoke is for a stream you believe is misbehaving.