Skip to main content

Errors

Errors

This library provides a set of error codes as string constants for handling exceptions and revert messages in the library.

CodeName
NEFLNOT_ENOUGH_FREE_LIQUIDITY
TSATOO_SMALL_AMOUNT
IOVINVALID_ORACLE_VERSION
EMREXCEED_MARGIN_RANGE
UTFRUNSUPPORTED_TRADING_FEE_RATE
AROALREADY_REGISTERED_ORACLE_PROVIDER
ARTALREADY_REGISTERED_TOKEN
URTUNREGISTERED_TOKEN
IRNIINTEREST_RATE_NOT_INITIALIZED
IROFINTEREST_RATE_OVERFLOW
IRPTINTEREST_RATE_PAST_TIMESTAMP
IRNAINTEREST_RATE_NOT_APPENDABLE
IRAAINTEREST_RATE_ALREADY_APPLIED
USPUNSETTLED_POSITION
IPQINVALID_POSITION_QTY
NPPNOT_POSITIVE_PRICE

NOT_ENOUGH_FREE_LIQUIDITY

string constant NOT_ENOUGH_FREE_LIQUIDITY = "NEFL";

Error code indicating that there is not enough free liquidity available in liquidity pool when open a new poisition.

TOO_SMALL_AMOUNT

string constant TOO_SMALL_AMOUNT = "TSA";

Error code indicating that the specified amount is too small when add liquidity to each bin.

INVALID_ORACLE_VERSION

string constant INVALID_ORACLE_VERSION = "IOV";

Error code indicating that the provided oracle version is invalid or unsupported.

EXCEED_MARGIN_RANGE

string constant EXCEED_MARGIN_RANGE = "EMR";

Error code indicating that the specified value exceeds the allowed margin range when claim a position.

UNSUPPORTED_TRADING_FEE_RATE

string constant UNSUPPORTED_TRADING_FEE_RATE = "UTFR";

Error code indicating that the provided trading fee rate is not supported.

ALREADY_REGISTERED_ORACLE_PROVIDER

string constant ALREADY_REGISTERED_ORACLE_PROVIDER = "ARO";

Error code indicating that the oracle provider is already registered.

ALREADY_REGISTERED_TOKEN

string constant ALREADY_REGISTERED_TOKEN = "ART";

Error code indicating that the settlement token is already registered.

UNREGISTERED_TOKEN

string constant UNREGISTERED_TOKEN = "URT";

Error code indicating that the settlement token is not registered.

INTEREST_RATE_NOT_INITIALIZED

string constant INTEREST_RATE_NOT_INITIALIZED = "IRNI";

Error code indicating that the interest rate has not been initialized.

INTEREST_RATE_OVERFLOW

string constant INTEREST_RATE_OVERFLOW = "IROF";

Error code indicating that the provided interest rate exceeds the maximum allowed rate.

INTEREST_RATE_PAST_TIMESTAMP

string constant INTEREST_RATE_PAST_TIMESTAMP = "IRPT";

Error code indicating that the provided timestamp for an interest rate is in the past.

INTEREST_RATE_NOT_APPENDABLE

string constant INTEREST_RATE_NOT_APPENDABLE = "IRNA";

Error code indicating that the provided interest rate record cannot be appended to the existing array.

INTEREST_RATE_ALREADY_APPLIED

string constant INTEREST_RATE_ALREADY_APPLIED = "IRAA";

Error code indicating that an interest rate has already been applied and cannot be modified further.

UNSETTLED_POSITION

string constant UNSETTLED_POSITION = "USP";

Error code indicating that the position is unsettled.

INVALID_POSITION_QTY

string constant INVALID_POSITION_QTY = "IPQ";

Error code indicating that the position quantity is invalid.

NOT_POSITIVE_PRICE

string constant NOT_POSITIVE_PRICE = "NPP";

Error code indicating that the oracle price is not positive.

CLBToken

CLBToken is an ERC1155 token contract that represents Liquidity Bin tokens. CLBToken allows minting and burning of tokens by the Chromatic Market contract.

OnlyAccessableByMarket

error OnlyAccessableByMarket()

Throws an error indicating that the caller is not a registered market.

ChromaticMarketFactory

Contract for managing the creation and registration of Chromatic markets.

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

AlreadySetVault

error AlreadySetVault()

Throws an error indicating that the chromatic vault address is already set.

NotRegisteredOracleProvider

error NotRegisteredOracleProvider()

Throws an error indicating that the oracle provider is not registered.

NotRegisteredSettlementToken

error NotRegisteredSettlementToken()

Throws an error indicating that the settlement token is not registered.

ExistMarket

error ExistMarket()

Throws an error indicating that a market already exists for the given oracle provider and settlement token.

ChromaticVault

A contract that implements the ChromaticVault interface and provides functionality for managing positions, liquidity, and fees in Chromatic markets.

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

OnlyAccessableByFactoryOrDao

error OnlyAccessableByFactoryOrDao()

Throws an error indicating that the caller is nether the chormatic factory contract nor the DAO.

OnlyAccessableByMarket

error OnlyAccessableByMarket()

Throws an error indicating that the caller is not a registered market.

OnlyAccessableByEarningDistributor

error OnlyAccessableByEarningDistributor()

Throws an error indicating that the caller is not the Vault earning distribute contract.

NotEnoughBalance

error NotEnoughBalance()

Throws an error indicating that the flash loan amount exceeds the available balance in the vault.

NotEnoughFeePaid

error NotEnoughFeePaid()

Throws an error indicating that the recipient has not paid the sufficient flash loan fee.

TradingLockAlreadyAcquired

error TradingLockAlreadyAcquired()

NotTradingLockOwner

error NotTradingLockOwner()

KeeperFeePayer

A contract that pays keeper fees using a Uniswap router.

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

OnlyAccessableByFactoryOrDao

error OnlyAccessableByFactoryOrDao()

Throws an error indicating that the caller is nether the chormatic factory contract nor the DAO.

KeeperFeeTransferFailure

error KeeperFeeTransferFailure()

Throws an error indicating that the transfer of keeper fee has failed.

InvalidSwapValue

error InvalidSwapValue()

Throws an error indicating that the swap value for the Uniswap trade is invalid.

LiquidatorBase

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

OnlyAccessableByMarket

error OnlyAccessableByMarket()

Throws an error indicating that the caller is not a registered market.

Mate2MarketSettlement

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

OnlyAccessableByFactoryOrDao

error OnlyAccessableByFactoryOrDao()

Throws an error indicating that the caller is neither the chromatic factory contract nor the DAO.

ExistMarketSettlementTask

error ExistMarketSettlementTask()

Throws an error indicating that a market settlement task already exists.

InsufficientKeeperFee

error InsufficientKeeperFee()

Throws an error indicating that the keeper fee is insufficient

PayKeeperFeeFailed

error PayKeeperFeeFailed()

Throws an error indicating that the payment of the keeper fee has failed.

EthTransferFailed

error EthTransferFailed()

Throws an error indicating that the transfer of Ether has failed.

VaultEarningDistributorBase

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

OnlyAccessableByVault

error OnlyAccessableByVault()

Throws an error indicating that the caller is not the chromatch vault contract.

ExistMakerEarningDistributionTask

error ExistMakerEarningDistributionTask()

Throws an error indicating that a maker earning distribution task already exists.

ExistMarketEarningDistributionTask

error ExistMarketEarningDistributionTask()

Throws an error indicating that a market earning distribution task already exists.

IMarketErrors

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

OnlyAccessableByFactoryOrDao

error OnlyAccessableByFactoryOrDao()

Throws an error indicating that the caller is nether the chormatic factory contract nor the DAO.

OnlyAccessableByLiquidator

error OnlyAccessableByLiquidator()

Throws an error indicating that the caller is not the chromatic liquidator contract.

OnlyAccessableByVault

error OnlyAccessableByVault()

Throws an error indicating that the caller is not the chromatch vault contract.

TooSmallAmount

error TooSmallAmount()

Throws an error indicating that the amount of liquidity is too small. This error is thrown when attempting to remove liquidity with an amount of zero.

NotExistLpReceipt

error NotExistLpReceipt()

Throws an error indicating that the specified liquidity receipt does not exist.

NotClaimableLpReceipt

error NotClaimableLpReceipt()

Throws an error indicating that the liquidity receipt is not claimable.

NotWithdrawableLpReceipt

error NotWithdrawableLpReceipt()

Throws an error indicating that the liquidity receipt is not withdrawable.

InvalidLpReceiptAction

error InvalidLpReceiptAction()

Throws an error indicating that the liquidity receipt action is invalid.

InvalidTransferredTokenAmount

error InvalidTransferredTokenAmount()

Throws an error indicating that the transferred token amount is invalid. This error is thrown when the transferred token amount does not match the expected amount.

DuplicatedTradingFeeRate

error DuplicatedTradingFeeRate()

AddLiquidityDisabled

error AddLiquidityDisabled()

RemoveLiquidityDisabled

error RemoveLiquidityDisabled()

TooSmallTakerMargin

error TooSmallTakerMargin()

Throws an error indicating that the taker margin provided is smaller than the minimum required margin for the specific settlement token. The minimum required margin is determined by the DAO and represents the minimum amount required for operations such as liquidation and payment of keeper fees.

NotEnoughMarginTransferred

error NotEnoughMarginTransferred()

Throws an error indicating that the margin settlement token balance does not increase by the required margin amount after the callback.

NotPermitted

error NotPermitted()

Throws an error indicating that the caller is not permitted to perform the action as they are not the owner of the position.

ExceedMaxAllowableTradingFee

error ExceedMaxAllowableTradingFee()

Throws an error indicating that the total trading fee (including protocol fee) exceeds the maximum allowable trading fee.

ExceedMaxAllowableLeverage

error ExceedMaxAllowableLeverage()

Throws an error indicating thatwhen the specified leverage exceeds the maximum allowable leverage level set by the Oracle Provider. Each Oracle Provider has a specific maximum allowable leverage level, which is determined by the DAO. The default maximum allowable leverage level is 0, which corresponds to a leverage of up to 10x.

NotAllowableMakerMargin

error NotAllowableMakerMargin()

Throws an error indicating that the maker margin value is not within the allowable range based on the absolute quantity and the specified minimum/maximum take-profit basis points (BPS). The maker margin must fall within the range calculated based on the absolute quantity of the position and the specified minimum/maximum take-profit basis points (BPS) set by the Oracle Provider. The default range for the minimum/maximum take-profit basis points is 10% to 1000%.

NotExistPosition

error NotExistPosition()

Throws an error indicating that the requested position does not exist.

ClaimPositionCallbackError

error ClaimPositionCallbackError()

Throws an error indicating that an error occurred during the claim position callback.

AlreadyClosedPosition

error AlreadyClosedPosition()

Throws an error indicating that the position has already been closed.

NotClaimablePosition

error NotClaimablePosition()

Throws an error indicating that the position is not claimable.

OpenPositionDisabled

error OpenPositionDisabled()

ClosePositionDisabled

error ClosePositionDisabled()

InitializationFunctionReverted

error InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata)

ChainlinkFeedOracle

Chainlink implementation of the IOracle interface.

One instance per Chainlink price feed should be deployed. Multiple products may use the same ChainlinkOracle instance if their payoff functions are based on the same underlying oracle. This implementation only support non-negative prices.

UnableToSyncError

error UnableToSyncError()

PythFeedOracle

PriceFeedNotExist

error PriceFeedNotExist()

WrongData

error WrongData()

IOracleProvider

InvalidOracleRound

error InvalidOracleRound()

Error for invalid oracle round

ChromaticAccount

This contract manages user accounts and positions.

NotRouter

error NotRouter()

Throws an error indicating that the caller is not the chromatic router contract.

NotOwner

error NotOwner()

Throws an error indicating that the caller is not the owner of this account contract.

AlreadyInitialized

error AlreadyInitialized()

Throws an error indicating that the account is already initialized, and calling the initialization function again is not allowed.

NotEnoughBalance

error NotEnoughBalance()

Throws an error indicating that the account does not have sufficient balance to perform a particular operation, such as withdrawing an amount of tokens.

NotExistPosition

error NotExistPosition()

Throws an error indicating that the caller is not the owner of this account contractthat the caller is not the owner of this account contract.

AccountFactory

Abstract contract for creating and managing user accounts.

OnlyAccessableByDao

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

VerifyCallback

Abstract contract for verifying callback functions from registered markets.

NotMarket

error NotMarket()

Throws an error indicating that the caller is not a registered market.

Custom Error Selectors

SignatureError name
0x1353f3f1OnlyAccessableByMarket()
0x808ca14fOnlyAccessableByDao()
0xb661034dAlreadySetVault()
0x3c9b5739NotRegisteredOracleProvider()
0x12a5f552NotRegisteredSettlementToken()
0xde70de22ExistMarket()
0x6119ddb9OnlyAccessableByFactoryOrDao()
0x6d0340d7OnlyAccessableByEarningDistributor()
0xad3a8b9eNotEnoughBalance()
0x3244470dNotEnoughFeePaid()
0x1d380aa1TradingLockAlreadyAcquired()
0x859ea5eeNotTradingLockOwner()
0x0a73bac7KeeperFeeTransferFailure()
0x33017967InvalidSwapValue()
0xc671c2bdExistMarketSettlementTask()
0x2eeda15cInsufficientKeeperFee()
0xc0314164PayKeeperFeeFailed()
0x6d963f88EthTransferFailed()
0x6c7e0fa5OnlyAccessableByVault()
0xf953ee45ExistMakerEarningDistributionTask()
0x3d8ff6d7ExistMarketEarningDistributionTask()
0x5660035aOnlyAccessableByLiquidator()
0x22313ae9TooSmallAmount()
0xc47b3480NotExistLpReceipt()
0xd54b6688NotClaimableLpReceipt()
0xcc93170cNotWithdrawableLpReceipt()
0x35c67ed1InvalidLpReceiptAction()
0xa5bde9feInvalidTransferredTokenAmount()
0x5852c23dDuplicatedTradingFeeRate()
0x862d206bAddLiquidityDisabled()
0x3e67bf30RemoveLiquidityDisabled()
0xc9b05689TooSmallTakerMargin()
0x65f10725NotEnoughMarginTransferred()
0x39218f3bNotPermitted()
0x444f42ffExceedMaxAllowableTradingFee()
0xa4c6cd8aExceedMaxAllowableLeverage()
0xd6b3c14cNotAllowableMakerMargin()
0x5690b016NotExistPosition()
0x7a5f85beClaimPositionCallbackError()
0x33fceb32AlreadyClosedPosition()
0x22b76217NotClaimablePosition()
0x33720687OpenPositionDisabled()
0x2872ba49ClosePositionDisabled()
0x192105d7InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata)
0x68e7727fUnableToSyncError()
0x3d8461aePriceFeedNotExist()
0x036896beWrongData()
0x52347554InvalidOracleRound()
0x91655201NotRouter()
0x30cd7471NotOwner()
0x0dc149f0AlreadyInitialized()
0xc4bbea69NotMarket()