Secured Finance Docs
HomeBlogGitHubCommunityStablecoin ↗Fixed Income ↗
  • Introduction
    • ⚜️About Secured Finance
    • 🎏Vision & Mission
    • 🌍Ecosystem Overview
    • 🏁Roadmap
      • Roadmap 2024
      • Roadmap 2023
    • 📚DeFi Starter Guide
      • 🔄DeFi vs CeFi
      • 👛Wallet Setup
      • ⛽Gas Fees
      • 🤝DApps
      • 🏦DEX
      • 📝Smart Contracts
      • 🪙Governance Tokens
      • 🏛️DAOs
  • USDFC Stablecoin
    • 📢Overview
    • 🧙Getting Started
      • ⛽Creating Your First Trove
      • 👛Minting USDFC Step-by-Step
      • 🤝Managing Collateral Effectively
      • 🏦Monitoring Your Position
      • 🏊Using the Stability Pool
      • 💸Redeeming USDFC
    • 🔦Core Mechanics
      • 🏗️System Overview
      • ✏️The Trove System
      • 💰Mint & Borrow
      • 🚰Liquidation
      • 💸Redemption
      • 🧀Protocol Fees
    • 🎓Advanced Topics
      • 🚨Recovery Mode
    • 📔Contracts and Security
    • ❓FAQs
  • Fixed-Rate Lending
    • 📢Overview
      • 📖White Paper
      • 🎓Concept Paper
    • 🧙‍♂️Getting Started
      • 💵Lending Assets
      • 🏦Borrowing Assets
      • 📈Managing Positions
      • 🎮Platform Guide
        • 💰Trading
          • 💲Supported Currencies
        • 📈Markets
        • 🐋Portfolio
        • Bridge
        • 🚀Points
        • 📣Campaign
    • 🔦Core Mechanics
      • 🧩Order Book System
        • 🆎Order Type
        • 🪃Order Life Cycle
          • 💫Case Study: Order Status & Transition
      • 📐Standardization
        • 💠Zero-Coupon Bonds
        • ⏳Fixed Maturity
      • 🏋️Collateralization
      • 🪙Tokenization
      • 🚰Liquidation
        • ⚖️Mark to Market
        • 👮‍♂️Liquidators
          • ✏️How Liquidation Works
        • 📋Liquidation Case Study
      • 🧀Protocol Fees
    • 🎓Advanced Topics
      • 📈APR vs APY
      • ➗ZC Bond Price to APR
      • 📉Discount Factor
      • 🏋️‍♀️ZC Bond Collateral
        • 🏍️ZC Collateral Case Study
      • 🧬Market Dynamics
        • ♻️Auto-Rolling
          • 💰Price Discovery for Auto-Rolling
        • 🗓️New Market Listing and Delisting
          • 🤝Itayose - Fair Price Discovery
      • 🛡️Safety Measures
        • 🚦Circuit Breaker
          • 🛑Price Range Limits
        • 🪄Base Price Adjustment
        • 🌎Emergency Global Settlement
      • ⛓️Orderbook Deep Dive
        • 🎡Orderbook Rotation
        • 🎋Red Black Tree
        • ⏯️Lazy Evaluation
        • ⏮️Genesis Value
        • 🔄Compound Factor
    • 📔Contracts and Security
    • ❓FAQs
  • Developer Portal
    • 🧑‍💻Introduction
    • 🔌API Reference
      • 📈Fixed-Rate Lending Subgraph
        • 🔍Query Examples
    • 📦SDK Reference
      • ⛽Fixed-Rate Lending SDK
      • 👛USDFC SDK
    • 🐛Bug Bounty
  • Community
    • 🤝Overview
    • 🏛️Governance
    • 🪙Tokenomics
      • 🔵Secured Finance Coin (SFC)
      • 🔶Secured Finance Points (SFP) v2
        • 🔶Secured Finance Points (SFP) v1
    • 🎗️Support & Contacts
  • Resources
    • 🖼️Media Kit
      • 🖼️Secured Finance Logo
      • 💲USDFC Logo
    • ⚖️Legal
      • 📜Terms of Use
      • 🔒Privacy Policy
      • ⚠️Risk Disclaimer
Powered by GitBook
On this page
  • Overview
  • How It Works
  • Orderbook Lifecycle
  • Key Parameters
  • Examples
  • Example 1: Complete Orderbook Rotation Cycle
  • Example 2: Pre-Order Placement and Itayose
  • Example 3: Gas Optimization Through Limited Orderbooks
  • Common Questions
  • Why limit the number of orderbooks to 9 per currency?
  • How does the pre-order period benefit the protocol?
  • What happens to my positions when an orderbook matures?
  • How is the Itayose price determined for new orderbooks?
  • Can I place orders in inactive orderbooks?
  • Related Resources

Was this helpful?

Edit on GitHub
Export as PDF
  1. Fixed-Rate Lending
  2. Advanced Topics
  3. Orderbook Deep Dive

Orderbook Rotation

Understanding how orderbooks rotate and recycle in the Fixed-Rate Lending Protocol

PreviousOrderbook Deep DiveNextRed Black Tree

Last updated 1 month ago

Was this helpful?

Overview

Orderbook Rotation is a key mechanism in the Secured Finance protocol that ensures continuous market operation and efficient resource utilization. Under our protocol, there are currently 8 active orderbooks and 1 inactive orderbook operating for each currency. This rotation system allows for seamless transitions between orderbooks as they mature, maintaining liquidity and market efficiency.

How It Works

The orderbook rotation process follows a specific cycle that ensures continuous market operation while optimizing for efficiency.

Orderbook Lifecycle

The inactive orderbook undergoes a pre-order period lasting 168 hours (7 days) up to 1 hour before the expiration date of the shortest orderbook. At that point, the Itayose process is initiated, leading to the opening of the orderbook at the specified date. Simultaneously, the orderbook rotation takes place.

During this action, if the nearest orderbook has already reached maturity, it will move to the end, and auto-roll will be executed concurrently. The moved orderbook is then recycled and transformed into an inactive, awaiting the next pre-order period.

This cycle ensures a seamless and continuous operation of our orderbooks, facilitating efficient utilization of resources and promoting a dynamic and robust lending ecosystem.

In this cycle, the number of orderbooks per currency is limited to 9. This means that the increase in order data subject to lazy evaluation can be limited, resulting in lower gas costs.

Key Parameters

Parameter
Description
Value

Active Orderbooks

Number of active orderbooks per currency

8

Inactive Orderbooks

Number of inactive orderbooks per currency

1

Pre-Order Period

Duration before new orderbook opens

168 hours (7 days)

Orderbook Freeze

Time before opening when orderbook is frozen

1 hour

Total Orderbooks

Maximum number of orderbooks per currency

9

Rotation Trigger

Event that initiates orderbook rotation

Maturity of shortest orderbook

Maturity Spacing

Typical time between consecutive maturities

3 months

Rotation Frequency

How often orderbook rotation typically occurs

Every 3 months

Examples

Example 1: Complete Orderbook Rotation Cycle

Let's follow a complete rotation cycle for ETH orderbooks:

  1. Initial State: 8 active orderbooks (maturities: Mar 2024, Jun 2024, Sep 2024, Dec 2024, Mar 2025, Jun 2025, Sep 2025, Dec 2025) and 1 inactive orderbook (future Mar 2026)

  2. Pre-Order Period: 7 days before Mar 2024 maturity, the inactive Mar 2026 orderbook enters pre-order period

    • Users can place pre-orders for the Mar 2026 market

    • These orders will be matched during the Itayose process

  3. Maturity and Rotation: When Mar 2024 orderbook matures:

    • Mar 2024 orderbook is moved to the end of the queue and becomes inactive

    • Mar 2026 orderbook becomes active after Itayose process completes

    • Auto-roll executes for positions in the Mar 2024 orderbook

  4. New State: 8 active orderbooks (Jun 2024, Sep 2024, Dec 2024, Mar 2025, Jun 2025, Sep 2025, Dec 2025, Mar 2026) and 1 inactive orderbook (recycled Mar 2024, which will become Jun 2026)

Example 2: Pre-Order Placement and Itayose

A trader wants to participate in the pre-order period for a new orderbook:

  1. The trader sees that the Sep 2025 orderbook will be opening in 5 days

  2. They place a pre-order to lend 10 ETH at a 5% APR

  3. Other traders place various pre-orders at different rates

  4. One hour before the orderbook opens, the pre-order period ends

  5. The Itayose process runs, finding the equilibrium price where supply meets demand

  6. The orderbook opens with the fair price determined by Itayose

  7. The trader's order is filled at the fair price (which may differ from their requested 5%)

Example 3: Gas Optimization Through Limited Orderbooks

Consider the impact of limiting orderbooks to 9 per currency:

  1. Without the limit: If we had 20 orderbooks per currency, each new order would potentially need to check 20 different price points

  2. With the 9 orderbook limit: Each new order only needs to check a maximum of 9 price points

  3. Result: Gas costs for order placement are reduced by more than 50%

  4. Additionally, the lazy evaluation process has fewer data points to process

  5. This optimization is especially important during high network congestion periods

Common Questions

Why limit the number of orderbooks to 9 per currency?

Limiting the number of orderbooks to 9 per currency (8 active and 1 inactive) serves several important purposes:

  1. Gas Optimization: Fewer orderbooks means less data to process during order placement and matching, resulting in lower gas costs

  2. Liquidity Concentration: Concentrating trading in fewer markets increases liquidity depth in each market

  3. Simplified User Experience: Users can more easily understand and navigate a limited number of maturity options

  4. Efficient Lazy Evaluation: The lazy evaluation process becomes more efficient with fewer data points to process

  5. Predictable Market Cycle: Users can anticipate when new markets will open and old ones will close

How does the pre-order period benefit the protocol?

The pre-order period provides several benefits:

  1. Price Discovery: It allows for fair price discovery through the Itayose process before the market officially opens

  2. Liquidity Bootstrapping: New markets start with existing liquidity rather than empty orderbooks

  3. Reduced Slippage: Initial trades face less slippage due to pre-established liquidity

  4. Market Signals: Pre-orders provide signals about market sentiment for the new maturity

  5. Smooth Transitions: It ensures a smooth transition between maturing markets and new ones

What happens to my positions when an orderbook matures?

When an orderbook reaches maturity:

  1. Auto-Roll: Your positions will automatically roll over to a suitable maturity at the prevailing market rate. This is a protocol-wide feature that applies to everyone and does not need to be enabled.

  2. Unwinding: The only way to settle and exit your position is by manually unwinding it. There is no automatic settlement functionality.

  3. Tokenization: You can tokenize your lending position as an ERC20 token before maturity.

Note that Manual Roll is not applicable as all positions are subject to Auto-Roll by default.

How is the Itayose price determined for new orderbooks?

The Itayose price is determined through a process that maximizes the matching volume:

  1. All pre-orders are collected during the pre-order period

  2. The system sorts all buy (borrow) and sell (lend) orders by price

  3. It identifies the price point where the maximum number of orders can be matched

  4. This becomes the opening price for the new orderbook

  5. Orders that can be matched at this price are executed

  6. Remaining orders become limit orders in the new active orderbook

Can I place orders in inactive orderbooks?

Yes, you can place orders in the inactive orderbook during its pre-order period:

  1. The pre-order period starts 7 days before the expiration of the shortest active orderbook

  2. During this time, you can place orders that will be included in the Itayose process

  3. These orders will help establish the opening price for the new orderbook

  4. If your pre-order matches during Itayose, it will be executed when the orderbook becomes active

  5. If not, it will remain as a limit order in the newly activated orderbook

Related Resources

🎓
⛓️
🎡
Orderbook Deep Dive
Itayose Fair Price Discovery
Auto-Rolling
Lazy Evaluation
Compound Factor
Market Life Cycle