PEX docs
PEX Synthetic Primitive
A concise technical reference for the PEX synthetic primitive design.
Overview
PEX: PEN synthetic DeFi primitive
PEX is a synthetic decentralized finance primitive implemented on the Stacks blockchain. It is modeled as a single-purpose smart-contract system that mints a PEN-tracking synthetic token in a one-way burn-to-mint flow.
The protocol addresses reserve-custody risk by avoiding centralized collateral custody and eliminates redemption-run risk by making tokens non-redeemable on demand. Instead, it relies on deterministic algorithmic redemption math and settlement finalized through an oracle-based consensus.
Key properties:
- One-way issuance: users burn approved collateral and receive PEX tokens at a deterministic rate.
- Price reference: PEX is designed to track PEN using a weighted oracle feed and market price mechanism.
- Composable on Stacks: tokens can be used in liquidity pools, swaps, and other DeFi primitives without centralized custody.
Problem
Why PEX synthetic primitive
Traditional stablecoins depend on reserves and redemption, which introduce custody and liquidity run risks. PEX decouples synthetic value issuance from redemption by using on-chain collateral math and deterministic minting.
Because PEX does not support direct redemption, risks are controlled through protocol-level caps, collateral ratio checks, and oracle finalization logic. This shifts risk management to programmable rules rather than off-chain liquidity guarantees.
- Robust oracle-based pricing: multiple feed sources with validity and staleness checks.
- Deterministic mechanics: Burn-to-mint formulas are fixed and verifiable.
- Composability: PEX tokens are designed as modular assets for liquidity and swaps.
Design
Design principles
1) Primitive-first: PEX views the synthetic token as a protocol-native primitive with fixed behavior and invariant rules. This makes reasoning easier and integration more predictable.
2) One-way issuance: Collateral burns enable minting; there is no symmetric redemption path. This minimizes liquidity run vectors and simplifies risk controls.
3) Deterministic math: Mint and settlement formulas are deterministic, on-chain, and verifiable, enabling audits and testability.
4) Oracle-backed finalization: PEX derives value from multi-source oracle consensus with stale-data protection and finalization windows for settlement consistency.
5) On-chain governance risk controls: Issuance caps, CR limits, and fee parameter updates are controlled by governance with timelocks and explicit update procedures.
Model
Issuance model
PEX issues synthetic tokens using a one-way mint process: users lock collateral (e.g. STX or other approved asset), trigger the burn operation, and receive exactly calculated PEX tokens.
Core steps:
- User submits collateral and calls `mint` with desired amount.
- Contract fetches current oracle price and applies deterministic mint formula plus fees.
- Collateral is burned/locked, PEX tokens are minted to user wallet.
- Protocol updates total supply and collateral ratio state variables.
Core formulas
- mintAmount = floor(collateralAmount * (1 - mintFee) / price)
- totalCollateral = totalCollateral + collateralAmount
- collateralRatio = totalCollateral / totalPEXSupply
Stacks
Stacks technical features
PEX is implemented on Stacks to leverage Clarity's deterministic smart contracts and Bitcoin settlement security via Proof of Transfer (PoX). The architecture is designed for composability with Stacks DeFi patterns while keeping execution semantics simple and auditable.
- Clarity contracts: deterministic evaluation, no Turing loops, and explicit data types make PEX behavior precisely predictable and audit-friendly.
- PoX anchoring: PEX state transitions are anchored on Bitcoin through Stacks blocks, providing a high-assurance settlement layer for value finality.
- Multi-oracle integration: PEX miners/oracle registries provide signed feeds; the contract aggregates and validates against staleness thresholds.
- Governance and timelock controls: risk parameters (fees, issuance caps, CR floors) are controlled by governance contracts and require a delay before activation.
- Composable asset flows: minted PEX tokens can be used in liquidity pools, AMMs, and other Stacks dapps for arbitrage and utility without centralized custody dependencies.
Pricing
Pricing and oracle
Pricing uses an oracle pipeline: each mint/burn query the latest valid weighted price and applies protocol fees and slippage adjustment. The protocol enforces a price validity window and rejects stale data to avoid price manipulation.
- Oracle aggregation: combines multiple trusted data sources into a single derived price using median and weighting rules.
- Staleness protection: data older than N blocks is rejected, and fallback paths are defined for missing feeds.
- Dynamic slippage model: in high-utilization scenarios, mint/burn slippage scales to maintain collateral ratio stability.
Pricing formula
mintPrice = oraclePrice * (1 + protocolFee + utilizationSlippage)
Safety
Safety and risk caps
Safety is enforced by multiple on-chain guardrails that run at the protocol level, not by off-chain liquidity backstops. This includes parameterized caps, collateral checks, and fallback procedures for oracle failures.
- Per-asset issuance caps: limit how much PEX can be minted per collateral type to avoid concentration risk.
- Global open interest limit: caps total supply to keep collateralization within safe bounds.
- Collateral ratio enforcement: each mint and burn validates that resulting CR stays above the minimum threshold.
- Emergency pause and governance: protocol can pause new issuance and parameter updates via timelocked governance in abnormal events.
Next steps
- Review contract spec and Clarity implementation details.
- Build integration tests for mint/burn and oracle behavior.
- Document pool economics and on-chain risk parameter flows.