Errors
Errors
This library provides a set of error codes as string constants for handling exceptions and revert messages in the library.
Code | Name |
---|---|
NEFL | NOT_ENOUGH_FREE_LIQUIDITY |
TSA | TOO_SMALL_AMOUNT |
IOV | INVALID_ORACLE_VERSION |
EMR | EXCEED_MARGIN_RANGE |
UTFR | UNSUPPORTED_TRADING_FEE_RATE |
ARO | ALREADY_REGISTERED_ORACLE_PROVIDER |
ART | ALREADY_REGISTERED_TOKEN |
URT | UNREGISTERED_TOKEN |
IRNI | INTEREST_RATE_NOT_INITIALIZED |
IROF | INTEREST_RATE_OVERFLOW |
IRPT | INTEREST_RATE_PAST_TIMESTAMP |
IRNA | INTEREST_RATE_NOT_APPENDABLE |
IRAA | INTEREST_RATE_ALREADY_APPLIED |
USP | UNSETTLED_POSITION |
IPQ | INVALID_POSITION_QTY |
NPP | NOT_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
Signature | Error name |
---|---|
0x1353f3f1 | OnlyAccessableByMarket() |
0x808ca14f | OnlyAccessableByDao() |
0xb661034d | AlreadySetVault() |
0x3c9b5739 | NotRegisteredOracleProvider() |
0x12a5f552 | NotRegisteredSettlementToken() |
0xde70de22 | ExistMarket() |
0x6119ddb9 | OnlyAccessableByFactoryOrDao() |
0x6d0340d7 | OnlyAccessableByEarningDistributor() |
0xad3a8b9e | NotEnoughBalance() |
0x3244470d | NotEnoughFeePaid() |
0x1d380aa1 | TradingLockAlreadyAcquired() |
0x859ea5ee | NotTradingLockOwner() |
0x0a73bac7 | KeeperFeeTransferFailure() |
0x33017967 | InvalidSwapValue() |
0xc671c2bd | ExistMarketSettlementTask() |
0x2eeda15c | InsufficientKeeperFee() |
0xc0314164 | PayKeeperFeeFailed() |
0x6d963f88 | EthTransferFailed() |
0x6c7e0fa5 | OnlyAccessableByVault() |
0xf953ee45 | ExistMakerEarningDistributionTask() |
0x3d8ff6d7 | ExistMarketEarningDistributionTask() |
0x5660035a | OnlyAccessableByLiquidator() |
0x22313ae9 | TooSmallAmount() |
0xc47b3480 | NotExistLpReceipt() |
0xd54b6688 | NotClaimableLpReceipt() |
0xcc93170c | NotWithdrawableLpReceipt() |
0x35c67ed1 | InvalidLpReceiptAction() |
0xa5bde9fe | InvalidTransferredTokenAmount() |
0x5852c23d | DuplicatedTradingFeeRate() |
0x862d206b | AddLiquidityDisabled() |
0x3e67bf30 | RemoveLiquidityDisabled() |
0xc9b05689 | TooSmallTakerMargin() |
0x65f10725 | NotEnoughMarginTransferred() |
0x39218f3b | NotPermitted() |
0x444f42ff | ExceedMaxAllowableTradingFee() |
0xa4c6cd8a | ExceedMaxAllowableLeverage() |
0xd6b3c14c | NotAllowableMakerMargin() |
0x5690b016 | NotExistPosition() |
0x7a5f85be | ClaimPositionCallbackError() |
0x33fceb32 | AlreadyClosedPosition() |
0x22b76217 | NotClaimablePosition() |
0x33720687 | OpenPositionDisabled() |
0x2872ba49 | ClosePositionDisabled() |
0x192105d7 | InitializationFunctionReverted(address _initializationContractAddress, bytes _calldata) |
0x68e7727f | UnableToSyncError() |
0x3d8461ae | PriceFeedNotExist() |
0x036896be | WrongData() |
0x52347554 | InvalidOracleRound() |
0x91655201 | NotRouter() |
0x30cd7471 | NotOwner() |
0x0dc149f0 | AlreadyInitialized() |
0xc4bbea69 | NotMarket() |