enclave - a private prop amm on solana
enclave is a private proprietary market-making amm on solana, designed to run its swap logic inside a magicblock tee (trusted execution environment) enclave, so trade amounts, pricing, and execution stay hidden from validators and mev bots until the trade is already settled on-chain. the on-chain program itself is a lean, zero-copy settlement layer that only ever sees enclave-signed results, never raw swap data.
rather than quoting a fixed spread around the oracle mid price, enclave implements the avellaneda-stoikov (2008) market-making model, dynamically skewing its bid/ask quotes based on current inventory and a configurable risk-aversion parameter, so the amm prices more aggressively to offload inventory when it's overexposed, and more conservatively when it's balanced. mid-price comes from a live pyth oracle feed, and the amm also exposes a jupiter-compatible interface so it can be routed to by jupiter's swap aggregator.
tech stack
- on-chain program: rust, pinocchio
- pricing oracle: pyth network
- market-making model: avellaneda-stoikov inventory-based quoting
- integrations: jupiter amm interface
- languages: rust
links
note: this was a capstone project for q1 accelerated builders (turbin3)