Skip to main content

Smart Contracts Overview

Buttonwood V1 consists of two contract packages: Core (the protocol's fundamental logic) and Periphery (user-facing helpers and vaults).

Contract Properties

ContractUpgradeablePausablePermissionsNotes
OriginationPoolSchedulerYes (UUPS)YesYes
OriginationPoolNoYesYesERC20 receipt tokens
GeneralManagerYes (UUPS)YesYes
LoanManagerNoNoNoFlash-swaps via Consol
MortgageNFTNoNoNoERC721
OrderPoolNoNoYes
SubConsolNoNoYesERC20 (not rebasing)
USDXNoNoYesRebasing
ConsolNoNoYesRebasing
ForfeitedAssetsPoolNoYesYesERC20 (not rebasing)
ConversionQueueNoNoYesLenderQueue + MortgageQueue
UsdxQueueNoYesYesLenderQueue
ForfeitedAssetsQueueNoYesYesLenderQueue
PythPriceOracleNoNoNoPyth pull-oracle
PythInterestRateOracleNoNoNoPyth pull-oracle

Core Contracts

Token Contracts

ContractDescription
USDXUnified USD-pegged vault wrapping multiple stablecoins with configurable scaling factors into a standard 18-decimal rebasing token
ConsolThe protocol's main rebasing treasury token — backed by USDX, ForfeitedAssetsPool, and SubConsol tokens. Provides flash swap functionality for efficient asset swapping. Withdrawal restricted to authorized queues.
SubConsolCollateral-specific vault that accepts a single collateral type, mints tokens based on principal borrowed, and can deploy collateral to yield strategies for additional returns. Not rebasing.
RebasingERC20Abstract shares-based ERC20 where balances adjust based on underlying asset value — enables passive yield accrual
MultiTokenVaultAbstract vault accepting multiple ERC20 deposits, minting a single rebasing token. Provides relative token caps and registry.

Lending & Borrowing

ContractDescription
GeneralManagerCentral upgradeable orchestrator. Validates and routes mortgage requests through OriginationPools, coordinates oracles, manages collateral types and terms, handles balance sheet expansions.
LoanManagerManages full mortgage lifecycle — creation (depositing collateral into SubConsols), payment processing with automatic late fees, redemption, refinancing, foreclosure, and conversions
MortgageNFTERC-721 representing ownership of a mortgage position. Manages user-chosen MortgageId labels.
OriginationPoolNon-upgradeable lending pool. Accepts USDX deposits (Deposit phase), flash-deploys for origination receiving Consol repayment (Deploy phase), allows proportional USDX+Consol redemption (Redemption phase). Withdrawals never affected by pause.
OriginationPoolSchedulerCreates new OriginationPools on a weekly schedule. Manages pool configurations including limits, growth rates, and multipliers.
OrderPoolOrder book holding PurchaseOrders for collateral. Authorized fulfillers process orders by providing collateral in exchange for USDX, while expired orders are deleted and NFTs burned.

Queues & Processing

ContractDescription
ConversionQueueDouble-queue: lenders deposit Consol to get collateral with a premium; borrowers submit mortgages to be converted when prices trigger. Processes by liquidating portions of qualified mortgages at market prices with lump-sum interest rewarded to withdrawers.
UsdxQueueFIFO withdrawal queue — users deposit Consol and receive USDX. Permissionless processing with gas fee collection.
ForfeitedAssetsQueueFIFO withdrawal queue — users deposit Consol to burn ForfeitedAssetsPool tokens for underlying foreclosed collateral. Value received may exceed Consol deposited.
MortgageQueueSorted linked-list of mortgage positions ordered by trigger price (lowest to highest) for efficient conversion processing
LenderQueueAbstract base for FIFO withdrawal queues with gas fees, minimum amounts, and cancellation logic
QueueProcessorProcesses items across the various queues

Oracles

ContractDescription
PythPriceOraclePull-oracle for real-time collateral/USD prices. Validates freshness (max 60s) and confidence thresholds.
PythInterestRateOracleReads 3yr and 5yr US Treasury rates from Pyth, multiplies by 2, adds 100 bps (+100 bps more if no payment plan). Reverts if age > 60s or confidence > 100 bps.
StaticInterestRateOracleFallback fixed interest rate oracle

Other

ContractDescription
ForfeitedAssetsPoolHolds collateral from foreclosed mortgages, issues liability tokens. Users burn Consol to redeem proportional foreclosed collateral at a discount, removing bad debt from the protocol.

Periphery Contracts

ContractDescription
RouterEntry point for all user transactions — handles multi-step flows (wrap, approve, deposit)
RolloverVaultAutomated vault that re-invests lender capital across pool epochs
FulfillmentVaultVault providing liquidity for order fulfillment on Hyperliquid
LiquidityVaultAbstract base for vault share token mechanics

Contract Interactions

                    ┌────────────────┐
│ Router │ ◄── User entry point
└───────┬────────┘

┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────────┐ ┌─────────────┐ ┌──────────────┐
│GeneralManager│ │ USDX │ │ Origination │
│ │ │ │ │ Pool │
└──────┬───────┘ └──────┬──────┘ └──────┬───────┘
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌─────────────┐ ┌──────────────┐
│ LoanManager │ │ Consol │◄│ OrderPool │
└──────┬───────┘ └──────┬──────┘ └──────────────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐ ┌─────────────┐
│ MortgageNFT │ │ SubConsol │ │ UsdxQueue │
└──────────────┘ │ (escrow) │ ├─────────────┤
└──────┬───────┘ │ForfeitedAsQ │
│ ├─────────────┤
▼ │Conversion Q │
┌──────────────┐ └─────────────┘
│ Conversion │
│ Queue │
└──────────────┘

Access Control

The protocol uses role-based access control across multiple contracts. See the Glossary — Roles section for a complete reference of all roles, their intended holders, and applicable contracts.

Key roles:

  • Default Admin (Governance) — Manage supported tokens, set caps, assign roles, upgrade contracts
  • Withdraw Role — Authorized contracts that can withdraw/flash-swap from Consol
  • Pause Role (Governance + automated safety) — Emergency pause of deposits, deployments, and operations
  • Fulfillment Role (Market maker) — Sell collateral to OrderPool and receive USDX
  • Deploy Role (GeneralManager) — Flash-loan USDX from OriginationPools

Key Interfaces

InterfacePurpose
IInterestRateOracleDynamic interest rates based on term length and payment structure
IPriceOracleReal-time collateral pricing in USDX terms
IConsolFlashSwapFlash swap callback for temporarily borrowing from Consol
IOriginationPoolDeployCallbackCallback for origination pool fund deployment (flash-lending)
IYieldStrategyYield-generating strategies for SubConsol collateral
INFTMetadataGeneratorDynamic metadata generation for Mortgage NFTs

Deployment

All contracts are deployed on HyperEVM (Hyperliquid's EVM). The protocol uses deterministic deployment via Foundry scripts for reproducible addresses.