Skip to content

Amounts and Fees ​

Veilix notes are not fixed denominations. Fees are charged on the way out, not on the way in.

Amounts ​

An amount is an integer in the asset’s base units: lamports for SOL and VEILIX, 10⁻⁶ for USDC, 10⁻⁸ for wBTC and wETH. Any positive integer is valid, subject to two limits:

  • it must be at most that tree’s maxDepositAmount
  • a withdrawal must leave the recipient a positive amount after fees

There is one tree per asset. A 0.2 SOL note and a 40 SOL note sit in the same SOL tree and are indistinguishable to the proof except through their secrets. They are not indistinguishable to someone comparing public amounts. If the number you withdraw is rare, amount correlation gets easier. Withdrawing a round or otherwise common size, or withdrawing only part of a distinctive deposit, is the practical mitigation. The protocol will not round an amount for you.

The configuration authority can raise or lower maxDepositAmount per tree. Read the live cap from the tree account before depositing. Do not bake an old cap into a client.

What a withdrawal costs ​

Deposits pay no protocol fee. The depositor pays the ordinary Solana transaction fee for the deposit itself.

A withdrawal fee has two parts, both in the same asset as the note:

text
relayer fee  = floor(amount × relayerBps / 10_000)
platform fee = sum over fee wallets of floor(amount × walletBps / 10_000)
fee          = relayer fee + platform fee
recipient gets amount − fee

relayerBps comes from the relayer you selected. Each relayer publishes its own percent. The client converts that percent into basis points and floors.

walletBps is the feeSplit stored on each platform wallet in network state. Splits are basis points of the withdrawn amount. Each wallet’s share is floored on its own, then the shares are added. The program checks this exact total. A proof with any other fee is invalid.

The platform percentage, as a human-readable number, is the sum of those basis points divided by 100. It is configuration, not a constant in the client. Read it from network state or from a quote.

If fee is greater than or equal to the withdrawn amount, the withdrawal is refused. Very small amounts cannot be withdrawn.

Where the fee goes ​

The public withdrawal amount leaves the treasury. The recipient account is credited amount − fee. The relayer reward account is credited the relayer share. Each configured platform wallet is credited its share.

The change note, if any, is not a fee. It is the unspent remainder of the input note, and it never leaves the tree.

Quotes ​

A quote is a preview, fetched from the indexer before the user signs:

  • the amount you asked to send
  • relayer fee, platform fee, and the total
  • the amount the recipient would receive
  • the relayer that was selected
  • an ETA

Ask for a quote with a human amount ("1.5") or with base units. Pass the asset as SOL or as a mint address. The quote is specific to a relayer and a moment. The number the program will enforce is the formula above, applied to the relayer you actually bind into the proof and to the fee wallets at execution time.

Worked shape ​

Suppose a relayer charges 0.50% (50 bps) and the platform wallets sum to 80 bps, and you withdraw 10 SOL:

LineSOL
Withdrawn amount10
Relayer fee0.05
Platform fee0.08
Recipient receives9.87

Those rates are an illustration of the formula. Live rates are whatever the selected relayer and the current fee wallets say. Flooring can shave a base unit off each share.

A partial withdrawal uses the same formula on the withdrawn amount, not on the whole note. Withdrawing 2 SOL from a 10 SOL note fees the 2 SOL. The 8 SOL change note is uncharged until it is spent.