Concepts

Fees and the ALBA token

The protocol fee, the relay fee, what each action pays, and what the fees do with ALBA.

Alba charges two fees, both inside the payment's own proof. The protocol fee buys ALBA on the market and burns it.

The two fees#

The protocol fee is a share of the seller's price, charged on each payment from a grant to a seller. The rate is a number of basis points held in the program's Config account.

text
protocolFee = floor(price × protocolFeeBps / 10000)

The relay fee is a flat amount per relayed transaction, one number of raw units held in Config. It repays the facilitator's relayer, which signs and pays the network cost of the transaction so that no wallet of the owner or the agent appears on it.

Both are charged on top of the price. A seller that asks for 10000 raw units receives 10000 raw units, and the grant goes down by the price plus the two fees.

What each action pays#

ActionProtocol feeRelay fee
Deposit, signed by the owner's wallet, which pays the network fee in SOLnonenone
Create a grantnoneyes
Top up a grantnoneyes
Revoke a grantnoneyes
Send to an Alba addressnoneyes
Withdrawnoneyes
An agent's payment to a selleryesyes

The owner's actions take the relay fee from the notes they spend: a revoke returns the grant's remainder less the fee, and the others take it from the owner's own notes. A payment takes both fees from the grant.

Reading the current rates#

The rates are read from the facilitator, which reads them from Config:

ts
import { createClient } from '@alba/contract'

const api = createClient(facilitatorUrl)
const fees = await api.fees()
FieldTypeMeaning
protocolFeeBpsnumber | nullThe protocol fee rate, in basis points of the price.
feeRecipientstring | nullThe wallet that receives the protocol fee.
mints{ mint, symbol, decimals, relayFee }[]Each pool's mint with the relay fee in that mint's raw units.

The app shows both fees on the grant form before the owner signs, and every ledger row lists the fees its payment paid.

The fee is part of what a proof proves, and the program recomputes it from Config when it executes. When the program's authority changes a rate, a payment proved under the old rate is refused with fee_mismatch, and the payer proves it again at the new rate.

Where the fees go#

The relay fee goes from the vault to the relayer's token account in the same transaction.

The protocol fee goes, in the same transaction, to the fee recipient named in Config: the ALBA launch wallet. It is paid from the vault to that wallet's token account for the mint. The program rounds the protocol fee down, so the rounding stays with the grant.

The ALBA token#

ALBA has a fixed supply of 1,000,000,000. It launches as a fair launch: the whole supply goes to the public launch, and the developer's allocation is the developer's own first buy in the launch.

The token's work is the protocol fee. Every payment an agent makes through Alba sends its protocol fee to the launch wallet in the asset the seller priced in. A keeper swaps what has gathered there for ALBA on the market and burns what it bought. All of the protocol fee goes this way.