On-chain account

pay per request

Deposit ENERGY once and the API spends from it. Usage is settled and burned on-chain every hour, and you can withdraw what you don't need. 

Vault stats · live from the chain

// 01 · HOW IT WORKS

From wallet to API call

01

Get ENERGY

Stake STARDUST and claim, or buy with USDG. Both put ENERGY in your wallet.

02

Deposit in the vault

ENERGY in your wallet isn't spendable yet. Only the vault balance pays for API requests.

03

Use the API

Each paid request uses Energy from your vault right away, with any API key you create.

04

Settled every hour

Once an hour the used Energy is charged on-chain and burned, so the vault balance catches up.

// 02 · ON-CHAIN FLOW

Deposit, use, settle

Requests are metered off-chain so they stay fast; the vault contract is the source of truth for what you hold and what was charged.

Sequence · deposit and hourly settlementswipe →

You

wallet / API key

EnergyVault

your balance

Stardust API

meters usage

ENERGY

token

1

deposit(amount)after approve

2

API request

3

read your vault balancebefore the request

4

response, Energy used is reserved

5

charge(batchId, users, amounts)every hour

6

burn the total used

call payout / reply you smart contract off-chain

Sequence · withdraw

You

wallet

EnergyVault

your balance

1

requestWithdraw(amount)starts the delay

2

wait withdrawDelaypending usage settles first

3

withdraw()

4

ENERGY back to your wallet

call payout / reply you smart contract off-chain

Holds the ENERGY you deposit for API usage. Only the settlement role can charge it, and every charge burns the Energy used.

Functions

  • deposit(uint256 amount)

    Move ENERGY from your wallet into your vault balance.

  • requestWithdraw(uint256 amount) · cancelWithdraw()

    Start or cancel a withdrawal.

  • withdraw()

    Pay out the withdrawal after the delay.

  • accountOf(address) · spendable(address)

    Your balance, pending withdrawal and what the API may use.

Guarantees

  • A charge can never take more than your balance or the per-user limit.
  • Batch numbers run in order and each can be used once: no double charging.
  • Used Energy is burned, not moved to anyone.
  • Withdrawals keep working even while deposits are paused; the delay is capped at 7 days.

// 04 · FAQ

Questions

Why does my Energy number not change?

Three usual reasons: the ENERGY is still in your wallet (deposit it), part of it is set aside for a withdrawal you requested (cancel it to use it again), or it is staked in the liquidity pool (withdraw it first).

What happens to Energy I use?

It is burned. Every hour the settlement batch lowers each user's vault balance by what they used and burns the total, so ENERGY supply goes down as the API is used.

Can Stardust take more than I used?

A batch can never charge more than your vault balance, never more than the per-user limit set in the contract, and every batch has a number that can only be used once, so the same usage can't be charged twice. Every charge is a public event on the explorer.

How do I get my ENERGY back?

Request a withdrawal, wait the withdrawal delay (2 hours now; the contract only allows 1 hour to 7 days), then withdraw. The delay makes sure usage from the last hour is settled first.

Do withdrawals work if the vault is paused?

Yes. Pausing only stops new deposits. Requesting and completing a withdrawal always works.

Earn USDG with spare ENERGY