Skip to main content

Oracles

Oracles in TokenMaster allow dynamic adjustment of transaction values by referencing external data, such as market conditions or token price feeds. They enable greater flexibility in token mechanics and creator-defined customizations.

Key Features:

  • Dynamic Adjustments: Modify transaction requirements (e.g., token value or spend amount) based on external inputs.
  • Transaction Types Supported:
    • Buy Orders: Specify the minimum required paired token value for token purchases.
    • Sell Orders: Determine the paired token value received for token sales.
    • Spend Orders: Define the per-multiple spend amount in paired tokens.

Oracle Parameters and Flow:

Key Parameters:

  • Base Value: The required token value for the transaction. If no oracle is used, tokenMasterOracle is set to address(0) in the SignedOrder.
  • Extra Data: Optional additional information passed to the oracle via the extraData field for advanced logic.

Transaction Type Values:

TransactionType Value
Buy0
Sell1
Spend2

Example Use Cases:

  1. Price Pegging: Use oracles to dynamically adjust token requirements to maintain a stable price (e.g., pegged to a stablecoin).
  2. Discounts and Promotions: Apply promotional rates or discounts by dynamically altering the required token value based on demand or time-limited campaigns.

Developer Notes:

  • Implementation Requirement: Must implement ITokenMasterOracle.
    //SPDX-License-Identifier: LicenseRef-PolyForm-Strict-1.0.0
    pragma solidity 0.8.24;

    /**
    * @title ITokenMasterOracle
    * @author Limit Break, Inc.
    * @notice Interface that must be implemented by contracts acting as an oracle
    * @notice for advanced orders.
    */
    interface ITokenMasterOracle {
    function adjustValue(
    uint256 transactionType,
    address executor,
    address tokenMasterToken,
    address baseToken,
    uint256 baseValue,
    bytes calldata oracleExtraData
    ) external view returns(uint256 tokenValue);
    }
  • Data Decoding: Decoding and validating the extraData field is the responsibility of the oracle logic.

Limit Break

TwitterLimitBreak.comMedium

© 2026 Limit Break International, Inc. All rights reserved.

Privacy PolicyTerms of ServiceCookie PolicyDo Not Sell My Info