DeribitErrorCode

Enum DeribitErrorCode 

Source
pub enum DeribitErrorCode {
Show 133 variants Success, AuthorizationRequired, Error, QtyTooLow, OrderOverlap, OrderNotFound, PriceTooLow, PriceTooLow4Idx, PriceTooHigh, NotEnoughFunds, AlreadyClosed, PriceNotAllowed, BookClosed, PmeMaxTotalOpenOrders, PmeMaxFutureOpenOrders, PmeMaxOptionOpenOrders, PmeMaxFutureOpenOrdersSize, PmeMaxOptionOpenOrdersSize, NonPmeMaxFuturePositionSize, LockedByAdmin, InvalidOrUnsupportedInstrument, InvalidAmount, InvalidQuantity, InvalidPrice, InvalidMaxShow, InvalidOrderId, PricePrecisionExceeded, NonIntegerContractAmount, TooManyRequests, NotOwnerOfOrder, MustBeWebsocketRequest, InvalidArgsForInstrument, WholeCostTooLow, NotImplemented, TriggerPriceTooHigh, TriggerPriceTooLow, InvalidMaxShowAmount, NonPmeTotalShortOptionsPositionsSize, PmeMaxRiskReducingOrders, NotEnoughFundsInCurrency, Retry, SettlementInProgress, PriceWrongTick, TriggerPriceWrongTick, CanNotCancelLiquidationOrder, CanNotEditLiquidationOrder, MatchingEngineQueueFull, NotOnThisServer, CancelOnDisconnectFailed, TooManyConcurrentRequests, DisabledWhilePositionLock, AlreadyFilled, MaxSpotOpenOrders, PostOnlyPriceModificationNotPossible, MaxSpotOrderQuantity, InvalidArguments, OtherReject, OtherError, NoMoreTriggers, InvalidTriggerPrice, OutdatedInstrumentForIvOrder, NoAdvForFutures, NoAdvPostonly, NotAdvOrder, PermissionDenied, BadArgument, NotOpenOrder, InvalidEvent, OutdatedInstrument, UnsupportedArgCombination, WrongMaxShowForOption, BadArguments, BadRequest, SystemMaintenance, SubscribeErrorUnsubscribed, TransferNotFound, PostOnlyReject, PostOnlyNotAllowed, UnauthenticatedPublicRequestsTemporarilyDisabled, InvalidAddr, InvalidTransferAddress, AddressAlreadyExist, MaxAddrCountExceeded, InternalServerError, DisabledDepositAddressCreation, AddressBelongsToUser, NoDepositAddress, AccountLocked, TooManySubaccounts, WrongSubaccountName, LoginOverLimit, RegistrationOverLimit, CountryIsBanned, TransferNotAllowed, SecurityKeyAuthorizationOverLimit, InvalidCredentials, PwdMatchError, SecurityError, UserNotFound, RequestFailed, Unauthorized, ValueRequired, ValueTooShort, UnavailableInSubaccount, InvalidPhoneNumber, CannotSendSms, InvalidSmsCode, InvalidInput, InvalidContentType, OrderbookClosed, NotFound, Forbidden, MethodSwitchedOffByAdmin, TemporarilyUnavailable, MmpTrigger, VerificationRequired, NonUniqueOrderLabel, NoMoreSecurityKeysAllowed, ActiveComboLimitReached, UnavailableForComboBooks, IncompleteKycData, MmpRequired, CodNotEnabled, QuotesFrozen, ScopeExceeded, Unavailable, RequestCancelledByUser, Replaced, RawSubscriptionsNotAvailableForUnauthorized, MovePositionsOverLimit, CouponAlreadyUsed, KycTransferAlreadyInitiated, Unknown(i32),
}
Expand description

Deribit RPC Error Codes

Complete enumeration of all error codes returned by the Deribit API as documented in the official API documentation v2.1.1

Variants§

§

Success

Success, No error

§

AuthorizationRequired

Authorization issue, invalid or absent signature etc.

§

Error

Some general failure, no public information available

§

QtyTooLow

Order quantity is too low

§

OrderOverlap

Rejection, order overlap is found and self-trading is not enabled

§

OrderNotFound

Attempt to operate with order that can’t be found by specified id or label

§

PriceTooLow

Price is too low, limit defines current limit for the operation

§

PriceTooLow4Idx

Price is too low for current index, limit defines current bottom limit

§

PriceTooHigh

Price is too high, limit defines current up limit for the operation

§

NotEnoughFunds

Account has not enough funds for the operation

§

AlreadyClosed

Attempt of doing something with closed order

§

PriceNotAllowed

This price is not allowed for some reason

§

BookClosed

Operation for an instrument which order book had been closed

§

PmeMaxTotalOpenOrders

Total limit of open orders has been exceeded (PME users)

§

PmeMaxFutureOpenOrders

Limit of count of futures’ open orders has been exceeded (PME users)

§

PmeMaxOptionOpenOrders

Limit of count of options’ open orders has been exceeded (PME users)

§

PmeMaxFutureOpenOrdersSize

Limit of size for futures has been exceeded (PME users)

§

PmeMaxOptionOpenOrdersSize

Limit of size for options has been exceeded (PME users)

§

NonPmeMaxFuturePositionSize

Limit of size for futures has been exceeded (non-PME users)

§

LockedByAdmin

Trading is temporary locked by the admin

§

InvalidOrUnsupportedInstrument

Instrument name is not valid

§

InvalidAmount

Amount is not valid

§

InvalidQuantity

Quantity was not recognized as a valid number (for API v1)

§

InvalidPrice

Price was not recognized as a valid number

§

InvalidMaxShow

max_show parameter was not recognized as a valid number

§

InvalidOrderId

Order id is missing or its format was not recognized as valid

§

PricePrecisionExceeded

Extra precision of the price is not supported

§

NonIntegerContractAmount

Futures contract amount was not recognized as integer

§

TooManyRequests

Allowed request rate has been exceeded

§

NotOwnerOfOrder

Attempt to operate with not own order

§

MustBeWebsocketRequest

REST request where Websocket is expected

§

InvalidArgsForInstrument

Some of the arguments are not recognized as valid

§

WholeCostTooLow

Total cost is too low

§

NotImplemented

Method is not implemented yet

§

TriggerPriceTooHigh

Trigger price is too high

§

TriggerPriceTooLow

Trigger price is too low

§

InvalidMaxShowAmount

Max Show Amount is not valid

§

NonPmeTotalShortOptionsPositionsSize

Limit of total size for short options positions has been exceeded (non-PME users)

§

PmeMaxRiskReducingOrders

Limit of open risk reducing orders has been reached (PME users)

§

NotEnoughFundsInCurrency

User does not have sufficient spot reserves or negative impact on portfolio margin

§

Retry

Request can’t be processed right now and should be retried

§

SettlementInProgress

Settlement is in progress

§

PriceWrongTick

Price has to be rounded to an instrument tick size

§

TriggerPriceWrongTick

Trigger Price has to be rounded to an instrument tick size

§

CanNotCancelLiquidationOrder

Liquidation order can’t be cancelled

§

CanNotEditLiquidationOrder

Liquidation order can’t be edited

§

MatchingEngineQueueFull

Reached limit of pending Matching Engine requests for user

§

NotOnThisServer

The requested operation is not available on this server

§

CancelOnDisconnectFailed

Enabling Cancel On Disconnect for the connection failed

§

TooManyConcurrentRequests

The client has sent too many public requests that have not yet been executed

§

DisabledWhilePositionLock

Spot trading is disabled for users in reduce only mode

§

AlreadyFilled

This request is not allowed in regards to the filled order

§

MaxSpotOpenOrders

Total limit of open orders on spot instruments has been exceeded

§

PostOnlyPriceModificationNotPossible

Price modification for post only order is not possible

§

MaxSpotOrderQuantity

Limit of quantity per currency for spot instruments has been exceeded

§

InvalidArguments

Some invalid input has been detected

§

OtherReject

Some rejects which are not considered as very often

§

OtherError

Some errors which are not considered as very often

§

NoMoreTriggers

Allowed amount of trigger orders has been exceeded

§

InvalidTriggerPrice

Invalid trigger price in relation to the last trade, index or market price

§

OutdatedInstrumentForIvOrder

Instrument already not available for trading

§

NoAdvForFutures

Advanced orders are not available for futures

§

NoAdvPostonly

Advanced post-only orders are not supported yet

§

NotAdvOrder

Advanced order properties can’t be set if the order is not advanced

§

PermissionDenied

Permission for the operation has been denied

§

BadArgument

Bad argument has been passed

§

NotOpenOrder

Attempt to do open order operations with the not open order

§

InvalidEvent

Event name has not been recognized

§

OutdatedInstrument

At several minutes to instrument expiration, advanced IV orders are not allowed

§

UnsupportedArgCombination

The specified combination of arguments is not supported

§

WrongMaxShowForOption

Wrong Max Show for options

§

BadArguments

Several bad arguments have been passed

§

BadRequest

Request has not been parsed properly

§

SystemMaintenance

System is under maintenance

§

SubscribeErrorUnsubscribed

Subscription error

§

TransferNotFound

Specified transfer is not found

§

PostOnlyReject

Request rejected due to reject_post_only flag

§

PostOnlyNotAllowed

Post only flag not allowed for given order type

§

UnauthenticatedPublicRequestsTemporarilyDisabled

Unauthenticated public requests were temporarily disabled

§

InvalidAddr

Invalid address

§

InvalidTransferAddress

Invalid address for the transfer

§

AddressAlreadyExist

The address already exists

§

MaxAddrCountExceeded

Limit of allowed addresses has been reached

§

InternalServerError

Some unhandled error on server

§

DisabledDepositAddressCreation

Deposit address creation has been disabled by admin

§

AddressBelongsToUser

Withdrawal instead of transfer

§

NoDepositAddress

Deposit address not specified

§

AccountLocked

Account locked

§

TooManySubaccounts

Limit of subaccounts is reached

§

WrongSubaccountName

The input is not allowed as the name of subaccount

§

LoginOverLimit

The number of failed login attempts is limited

§

RegistrationOverLimit

The number of registration requests is limited

§

CountryIsBanned

The country is banned (possibly via IP check)

§

TransferNotAllowed

Transfer is not allowed

§

SecurityKeyAuthorizationOverLimit

Too many failed security key authorizations

§

InvalidCredentials

Invalid credentials have been used

§

PwdMatchError

Password confirmation error

§

SecurityError

Invalid Security Code

§

UserNotFound

User’s security code has been changed or wrong

§

RequestFailed

Request failed because of invalid input or internal failure

§

Unauthorized

Wrong or expired authorization token or bad signature

§

ValueRequired

Invalid input, missing value

§

ValueTooShort

Input is too short

§

UnavailableInSubaccount

Subaccount restrictions

§

InvalidPhoneNumber

Unsupported or invalid phone number

§

CannotSendSms

SMS sending failed – phone number is wrong

§

InvalidSmsCode

Invalid SMS code

§

InvalidInput

Invalid input

§

InvalidContentType

Invalid content type of the request

§

OrderbookClosed

Closed, expired order book

§

NotFound

Instrument is not found, invalid instrument name

§

Forbidden

Not enough permissions to execute the request, forbidden

§

MethodSwitchedOffByAdmin

API method temporarily switched off by the administrator

§

TemporarilyUnavailable

The requested service is not responding or processing takes too long

§

MmpTrigger

Order has been rejected due to the MMP trigger

§

VerificationRequired

API method allowed only for verified users

§

NonUniqueOrderLabel

Request allowed only for orders uniquely identified by given label

§

NoMoreSecurityKeysAllowed

Maximal number of tokens allowed reached

§

ActiveComboLimitReached

Limit of active combo books was reached

§

UnavailableForComboBooks

Action is temporarily unavailable for combo books

§

IncompleteKycData

KYC verification data is insufficient for external service provider

§

MmpRequired

User is not a MMP user

§

CodNotEnabled

Cancel-on-Disconnect is not enabled for the connection

§

QuotesFrozen

Quotes are still frozen after previous cancel

§

ScopeExceeded

Error returned after the user tried to edit/delete an API key with insufficient scope

§

Unavailable

Method is currently not available

§

RequestCancelledByUser

Request was cancelled by the user with other api request

§

Replaced

Edit request was replaced by other one

§

RawSubscriptionsNotAvailableForUnauthorized

Raw subscriptions are not available for unauthorized requests

§

MovePositionsOverLimit

The client cannot execute the request yet, should wait

§

CouponAlreadyUsed

The coupon has already been used by current account

§

KycTransferAlreadyInitiated

Sharing of KYC data with a third party provider was already initiated

§

Unknown(i32)

Unknown error code

Implementations§

Source§

impl DeribitErrorCode

Source

pub fn code(&self) -> i32

Get the numeric error code

Source

pub fn message(&self) -> &'static str

Get the short error message

Source

pub fn is_success(&self) -> bool

Check if this is a success code

Source

pub fn is_authorization_error(&self) -> bool

Check if this is an authorization error

Source

pub fn is_rate_limit_error(&self) -> bool

Check if this is a rate limiting error

Source

pub fn is_validation_error(&self) -> bool

Check if this is a validation error

Source

pub fn is_trading_error(&self) -> bool

Check if this is a trading error

Trait Implementations§

Source§

impl Clone for DeribitErrorCode

Source§

fn clone(&self) -> DeribitErrorCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeribitErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DeribitErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DeribitErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for DeribitErrorCode

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DeribitErrorCode> for DeribitError

Source§

fn from(error_code: DeribitErrorCode) -> Self

Converts to this type from the input type.
Source§

impl From<DeribitErrorCode> for i32

Source§

fn from(error: DeribitErrorCode) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for DeribitErrorCode

Source§

fn from(code: i32) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for DeribitErrorCode

Source§

fn from(status: u16) -> Self

Converts to this type from the input type.
Source§

impl Hash for DeribitErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DeribitErrorCode

Source§

fn eq(&self, other: &DeribitErrorCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DeribitErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for DeribitErrorCode

Source§

impl StructuralPartialEq for DeribitErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,