Economic Model
Token flow, slashing, disputes, and incentives
Token Flow
All tokens flow through a PDA-owned vault. No admin key can drain it.
| Action | Direction | Description |
|---|---|---|
create_job | Creator → Vault | Reward deposited into vault on job creation |
register_worker | Worker → Vault | Stake locked when worker registers |
approve_result | Vault → Worker | Reward released to worker on approval |
reclaim_expired (terminal) | Vault → Creator | Full reward returned when retries exhausted |
reclaim_expired (retry) | Vault → Cranker | Slash share paid to cranker; reward stays in vault for next worker |
resolve_dispute (worker wins) | Vault → Worker | Reward released to worker |
resolve_dispute (worker loses) | Vault → Creator | Reward + slash share returned to creator |
Slashing
When a worker fails to deliver before the deadline:
- Slash amount =
worker_stake * slash_rate_bps / 10,000 - Crank reward =
slash_amount * crank_reward_bps / 10,000 - Creator share =
slash_amount - crank_reward
Example
With slash_rate_bps = 1000 (10%), crank_reward_bps = 2000 (20% of slash):
| Metric | Value |
|---|---|
| Worker stake | 100 tokens |
| Slash amount | 10 tokens |
| Cranker reward | 2 tokens (20% of 10) |
| Creator share | 8 tokens (remaining) |
| Creator also receives | Original reward back (if terminal expiry) |
All calculations use u128 checked arithmetic to prevent overflow.
Retry Behavior
If retry_count < max_retries on expiry:
- Job re-opens as Open — reward stays in vault for the next worker
- Worker still gets slashed
- Cranker still gets paid
If retries are exhausted:
- Job goes to Expired (terminal)
- Full reward returned to creator
Dispute Resolution
The arbiter (designated at queue creation) resolves disputes:
| Outcome | Reward | Slash | Status |
|---|---|---|---|
| Worker wins | Released to worker | None | Completed |
| Worker loses | Returned to creator | Full slash to creator | Expired |
The arbiter should ideally be a multisig (e.g., Squads Protocol) so no single party can rule unilaterally.
Cost Comparison
| Operation | AWS SQS | IronQ (Solana) |
|---|---|---|
| Send message | $0.40 / million | ~$0.000005 (1 tx fee) + rent |
| Storage | Free (4-day retention) | ~0.002 SOL rent per job (reclaimable) |
| Monthly (10k jobs) | ~$0.01 | ~$0.10 (tx fees) + rent (reclaimable via close_job) |
Rent is recoverable — the true cost is just transaction fees.