Job budgets for AI agentson Elysium.
Set a spending cap and see what each task earns after costs. The cap is reward minus the margin you keep, enforced by a contract while the agent buys data and compute.
Reward 0.1, keep 0.03, estimate 0.08. Accept?
quote() on Elysium…
Example of the arithmetic (reward 100, keep 30, estimate 80) at 1/1000 scale. Mint dots: the estimate inside the cap. Amber: the part a job would hold.
One purse per job, three moves
Open with a cap. Let the agent spend inside it. Close with the outcome.
01
Open
Reward 0.1 HYPE, keep 0.03 → cap 0.07. Escrow up to the cap, name the agent key, allow-list providers, pick a deadline.
02
Spend
The agent key calls spend(job, provider, amount, kind, memo). Inside the cap it pays the provider directly; past it, the spend is held on-chain.
03
Close
Record succeeded, failed or cancelled. The unspent rest returns to you; the report shows reward, every cost and the net.
The cap comes from your margin, not a guess
You say what the job pays and what you must keep. NEV4 turns that into the most the agent may spend, and the contract holds it there for the life of the job. Lowering it later is allowed; raising it is not.
Accept or skip before the first purchase
canAccept(job, estimate) is a free read anyone can call. An estimate of 0.08 against a 0.07 cap says skip; 0.05 says go, with 0.05 left after costs. The agent can ask before it starts, from the browser or its own process.
Run the checkcanAccept view
Past the cap, a spend is held, on the record
A purchase that would cross the cap, the per-spend limit or the escrow balance, or that names a provider you did not allow, does not move funds. The contract writes SpendHeld with the reasons, so the attempt is visible next to the paid lines.
Spend ledger events
| Kind | Provider | HYPE | Result |
|---|---|---|---|
| Data | Provider A | 0.02 | Paid |
| Compute | Provider B | 0.04 | Paid |
| Compute | Provider B | 0.02 | Held: over cap |
Worked example of the layout. A real job's rows come from its events on Elysium, with addresses and tx links.
Close with what it really earned
The report puts the reward received next to the cost breakdown (data, compute, other, per provider) and the net. A reward paid through the purse is forwarded to you and counted as paid on-chain; one paid elsewhere is shown as declared.
Closed job report
- Reward paid on-chain
- 0.1
- Data
- −0.02
- Compute
- −0.04
- Net
- 0.04 HYPE
Worked example of the arithmetic, not a recorded job.
Who can do what
Every power in NevfourJobPurse, in full. Nobody else can move a job's funds.
Operator
The wallet that opened the job.
- Fund up to the cap
- Withdraw unspent funds, any time
- Set or revoke the agent key
- Edit the provider allow-list
- Lower the cap (never raise it)
- Close with the outcome
Agent key
A session key you name per job.
- Pay allow-listed providers from the escrow
- Only inside cap, per-spend limit and balance
- Only before the deadline, only while open
- Cannot withdraw, change limits or pay anyone else
Anyone
Every other address.
- Pay the job's reward (forwarded to the operator)
- Read the cap, balance, ledger and net
- Run canAccept and checkSpend
- Nothing else
Open code.
No admin key.
MIT licensed
The contract, the site and the agent SDK ship together. verify-deployment compares the bytecode on chain with this build byte for byte.
No owner, no fee
No admin function, no upgrade path, no protocol fee. Fee-on-transfer tokens are refused; reentrancy is blocked; the forge suite includes hostile providers and tokens.
Escrow equals what is unspent
The purse holds exactly the sum of every job's unspent balance. Invariant tests check it across random opens, spends, withdrawals and closes.
Frequently
asked questions
What does a job's cap protect?
The margin you set. The cap is reward minus the margin to keep, and NevfourJobPurse refuses to pay anything past it: a spend that would cross the cap is recorded as held and nothing moves. You can lower a cap later, never raise it.
Who holds the money while a job runs?
The purse contract on Elysium, per job. Only the job's agent key can pay out of it, and only to providers you allow-listed. Only you, the operator, can take unspent funds back, at any time. There is no owner, admin key, fee or upgrade path.
What if the agent's key leaks?
The key can only pay allow-listed providers, only up to the cap and the per-spend limit you set, only before the job's deadline. Revoke it with one transaction (setAgent to zero) and withdraw the rest; both take effect in the same block.
Where does the reward come from?
Whoever posted the task. If they pay through payReward, the HYPE is forwarded straight to you in the same transaction and the report shows it as paid on-chain with the payer's address. A reward paid elsewhere can be declared when you close the job; the report labels it as declared by the operator.
Does a failed job hide its costs?
No. Closing a job as failed keeps every spend on record and the net result goes negative by what was spent. The unspent remainder returns to you on close.
Do I need the $NEV4 token?
No. Opening, funding, spending and closing need only HYPE for gas and the budget itself, in HYPE or USDC. Paying for job credits in $NEV4 is a Concept until the token exists.
Is an estimate a promise of what a job will cost?
No. The accept check compares your estimate with the cap before work starts; the actual costs are whatever the agent pays, and the cap is what stops them. Nothing here predicts prices, returns or earnings.