Docs · Reference
Fees and MESA
Every fee Mesa charges, when it is taken and where it goes, what the protocol does with its share, and the MESA token.
Mesa charges for three things: a spot fill, a loan, and opening or closing a perp. Each fee goes to the liquidity providers of the market, pool or vault that served the action, less a protocol share. The protocol's whole share buys MESA on the market and burns it.
The fees
| Who pays | Where it goes |
|---|---|
| Traders, on each fill | The market’s liquidity vault, less the protocol share |
| Borrowers, as interest | The pool’s suppliers, less the reserve share |
| Perp traders, on open and close, and funding | The perps vault, less the protocol share |
| Every transaction | The pool's tree fee of 5,000 lamports and Solana's fees, carried by the relayer |
| The protocol share | Swept to the launch wallet as one amount; a crank buys MESA on the market and burns it. |
| Rate | In the program’s config now |
|---|---|
| Trading fee | Reading |
| Reserve share of borrow interest | Reading |
| Perp open fee | Reading |
| Perp close fee | Reading |
| Protocol share of fees | Reading |
Every rate is a field of a public account. Read it from the chain, from GET /v1/config for the protocol share, or from GET /v1/markets, /v1/pools and /v1/perps for each market's own rates.
On a spot fill
A market's fee_bps is taken from the output of each fill when the batch settles: from the base asset a buyer receives, or the quote asset a seller receives. An order that does not fill pays nothing. The fee stays in the market's liquidity vault as part of its reserves, where it raises the value of every vault share, less the protocol share, which the vault records as owed.
On a loan
A borrower pays interest at the pool's borrow rate, which follows the pool's utilization along its rate curve. Interest accrues each time the pool clears a batch. The pool's reserve_factor_bps of it goes to the pool's reserves, which are the protocol's, and the rest raises the pool's share price for its suppliers. Supplying and redeeming carry no fee.
On a perp
A perp market has an open_fee_bps, charged on the position's size at its entry price, and a close_fee_bps, charged on its size at the oracle price of the close. Both are taken together from the position's payout when it closes, and go to the perps vault, less the protocol share.
Funding is paid between longs and shorts through the vault and is not a fee. See Funding.
On a liquidation
The liquidator's bonus, liq_bonus_bps of the pool or perp market, is paid from the liquidated position's collateral to the liquidator. The protocol takes none of it.
Network costs
Each Mesa transaction pays Solana's transaction fee, and each instruction that updates the Privacy Rings state tree pays the pool's tree fee of 5,000 lamports. The relayer pays both for every relayed action, so placing, renewing, repaying and withdrawing need no SOL in any wallet. A deposit into Mesa is signed and paid by your own wallet.
The protocol share
protocol_share_bps, set in Config, is the part of each trade and perp fee that is the protocol's. Together with the pools' reserves it is the protocol's whole income.
The share accrues in the open: each vault and pool keeps a public counter of protocol fees owed per asset. sweep_fees transfers a vault's or pool's whole counter to the fee recipient named in Config and sets it to zero. Anyone can call it, since the destination is fixed, and it needs no proof, because the amount is already a public number.
MESA
| MESA | |
|---|---|
| Name | Mesa |
| Ticker | MESA |
| Supply | 1,000,000,000, fixed |
| Launch | Fair launch with a developer allocation |
| Developer allocation | Set at launch |
| Mint | Set at launch |
| What the fees do | The protocol’s whole fee share buys MESA on the market and burns it. |
Mesa's fee recipient is the token's launch wallet, and a crank that signs as that wallet takes what sweep_fees delivers, buys MESA through Jupiter, and burns what the swap returned. Fees paid on Mesa therefore remove MESA from supply in proportion to their size.
The supply is fixed at 1,000,000,000 and the whole of it goes to the public launch. The developer allocation is the developer's own first buy in that launch, on the same terms as every other buyer.
The burns are ordinary Solana transactions from the launch wallet, and the amounts swept are in each vault's and pool's public account, so anyone can add up what the protocol earned and what was burned.
Addresses
| Account | Address |
|---|---|
| Mesa program | 54GypueTVXksmm6m9vkFDincnUPJ7VrpKWx2SkWKZwHB |
| Solana Privacy Program | ring1GaLCuJnkUMVkX2JeZLTTX17wKsV4fZmPVzXANW |
| User registry | regy3WAeRXMYuMYxr5iK3Bf9Arr3PcxGxyzAddbiqDQ |
| State tree | 777pvSGe5LaBd9nCczvE2FXEauiwtfGJ5XRpjKyniGor |