Docs/ Developers/ Architecture

Developers

Architecture

How Moony is structured onchain: the accounts that hold its state, the PDAs that address them, and the instruction set that governs them.

#Overview

Moony runs on a single Solana program, the open-source Flipcash Reserve Contract. Moony is described entirely by a small set of onchain accounts: an SPL token mint, a currency configuration account, a liquidity pool, and two token vaults. Everything about Moony's behavior, its supply, its price, and its redemption liquidity, is a function of these accounts and the immutable code that operates on them.

Program ID
The deployed Flipcash program. Its immutable code governs Moony; no party can alter or override it.
ccJYP5gjZqcEHaphcxAZvkxCrnTVfYMjyhSYkpQtf8ZVerify ↗
Flipcash program ccJYP5…Qtf8Z
immutably governs
SPL MintMNY · 21M cap · 10 dp
CurrencyConfigidentity · authority
LiquidityPoolthe Reserve · fees · sell rate
vault_aMNY treasury
vault_bUSDF treasury

#Account model

Two program-owned accounts hold a currency's state. Both are plain, fixed-layout structs, readable by anyone.

CurrencyConfig

Stores the currency's identity: its authority, mint, human-readable name and symbol, and the seed used to derive its PDAs.

state/currency.rs
// PDA seeds: ["currency", mint]pub struct CurrencyConfig {    authority: Pubkey,   // set at init (Flipcash)    mint:      Pubkey,   // SPL mint (target)    name:      [u8; 32], // currency name    symbol:    [u8; 8],  // currency symbol    seed:      [u8; 32], // PDA seed    // + bump seeds}
MNY Token Mint
4muAfB6m1P7C3Znad1VUsoqYFwvGQRkWGpJ3A4vupxz6Verify ↗

LiquidityPool

The Reserve itself: it links the currency to its USDF base, tracks both vaults, accrued fees, and the sell-fee rate. The base mint is hardcoded to USDF.

state/pool.rs
// PDA seeds: ["pool", currency]pub struct LiquidityPool {    authority: Pubkey,         // set at init (Flipcash)    currency:  Pubkey,         // currency for this pool    mint_a:    Pubkey,         // target (MNY)    mint_b:    Pubkey,         // base (USDF, hardcoded)    vault_a:   Pubkey,         // target vault    vault_b:   Pubkey,         // base vault    fees_accumulated: u64,     // USDF, burned permissionlessly (anyone)    sell_fee:  u16,            // basis points (100 = 1%)    // + bump seeds}
Reserve (Pool)
5Ztd1ECKq4cXYt7BiRXK999hK2eQqtjJF9J3F1zw2jYCVerify ↗
MNY Vault · vault_a
HWVNBLfwKyDAkV4YFffZrThsEke3kUko1VVuGjuDAHefVerify ↗
USDF Vault · vault_b
8VhsmHR25oQSfNMT8nJNFZirsLZLAnz3eH9rr43pgY9FVerify ↗
Read the live pool state at any time with get-currency from the CLI reference.

#PDA derivation

Every account is a Program-Derived Address, deterministically derived from fixed seeds. Given a currency's authority, name, and seed, anyone can recompute the full account hierarchy offline, no indexer or lookup required.

mint["mint", authority, name, seed]
currency["currency", mint]
pool["pool", currency]
vault a["treasury", pool, mint_a]  // MNY
vault b["treasury", pool, mint_b]  // USDF
metadataMetaplex standard derivation (mint)

#Instruction set

These are the instructions that operate on Moony's Reserve. All of these are open to anyone; even burn_fees is permissionless (it only burns the pool’s accumulated fee USDF and pays the caller nothing).

InstructionPurposeAccess
buyDeposit USDF, receive MNY at the curve price.Anyone
sellReturn MNY, receive USDF less the sell fee.Anyone
buy_and_deposit_into_vmBuy and deposit MNY into a Flipcash VM account in one transaction.Anyone
sell_and_deposit_into_vmSell and deposit USDF proceeds into a VM account in one transaction.Anyone
burn_feesBurn accumulated USDF fees from the pool vault; reset the counter.Anyone
Build against these directly
The program ships Rust instruction builders (api/src/sdk.rs) and a client crate that produce these exact instructions. The CLI reference covers the same operations from the command line.

#Fixed parameters

Several values are compile-time constants in the program (api/src/consts.rs) that define Moony's hard limits.

ConstantValue
MAX_TOKEN_SUPPLY21,000,000
TOKEN_DECIMALS10
QUARKS_PER_TOKEN10,000,000,000
USDF_BASE_MINT5AMAA9JV…4RYAUQ
© 2026 Moony Labs, LLC · MIT View the program →