Perps Contract Error Codes

KanaPerps Error Codes

perpetual_core.move

Error Messag

Error Code

Description

E_NOT_KANA

1001

Indicates that the caller is not Kana

E_PAUSED

1002

System or functionality is paused

E_MARKET_NOT_FOUND

1003

Market ID is not available in the perpetual market registry

E_LEVERAGE_MISMATCH_CLOSE_POSITION

1004

Leverage given while closing position does not match the current leverage

E_LEVERAGE_MISMATCH_INCREASE_POSITION

1005

Leverage given while increasing position does not match the current leverage

E_INVALID_LEVERAGE

1006

Leverage is either greater than the maximum allowed for the market or zero

E_INSUFFICIENT_LIQUIDITY_IN_ORDERBOOK

1007

Not enough liquidity in orderbook to fill the order

E_INSUFFICIENT_BALANCE_TO_EXIT_POSITION

1008

Not enough balance available to exit the position

E_INSUFFICIENT_BALANCE_IN_TRADING_ACCOUNT_TO_WITHDRAW

1009

User doesn't have enough balance in trading account to withdraw

E_INSUFFICIENT_FUND_IN_USER_DEPOSITS

1010

User doesn't have enough funds in UserDeposits to withdraw

E_TRADE_SIZE_EXCEEDS_EXISTING_FILLED

1011

Given order size is greater than the existing filled position size

E_LOSS_GREATER_THAN_COLLATERAL

1012

Loss is greater than available collateral

E_INVALID_MAINTENANCE_MARGIN

1013

Given maintenance margin is greater than the divisor

E_INVALID_INITIAL_MARGIN

1014

Given max leverage allows the initial margin to be less than the maintenance margin

E_INSUFFICIENT_FUND_IN_COLLATERAL_STORE

1015

Not enough funds available in the collateral store to withdraw

E_INSUFFICIENT_FUND_IN_INSURANCE_FUND

1016

Not enough funds available in the insurance fund to withdraw

E_SIZE_TOO_LARGE

1017

Order size exceeds the maximum allowed lots for the market

E_INSUFFICIENT_BASE_IN_MARKET_ACCOUNT

1018

Not enough base asset in market account to withdraw

E_INSUFFICIENT_QUOTE_IN_MARKET_ACCOUNT

1019

Not enough quote asset in market account to withdraw

E_LIMIT_ORDER_FOUND_CANNOT_RESET

1020

Long Limit orders found in the position registry cannot be reset

E_LIQUIDATION_PRICE_NOT_REACHED

1021

Liquidation price not reached to liquidate the position

E_LIQUIDATION_SIZE_ZERO

1022

Liquidation size is zero

E_ZERO_FILLED_SIZE_FOR_TPSL_EXECUTION

1023

Zero filled size for take profit/stop loss orders

E_TAKE_PROFIT_ORDER_NOT_FILLED

1024

Take profit order not filled completely

E_STOP_LOSS_ORDER_NOT_FILLED

1025

Stop loss order not filled completely

E_NO_BIDS_IN_ORDERBOOK

1026

No bids present in the orderbook

E_NO_ASKS_IN_ORDERBOOK

1027

No asks present in the orderbook

E_TAKE_PROFIT_PRICE_NOT_REACHED

1028

Take profit price is not reached for the position

E_STOP_LOSS_PRICE_NOT_REACHED

1029

Stop loss price is not reached for the position

E_TAKE_PROFIT_NOT_SET

1030

Take profit price is not set

E_STOP_LOSS_NOT_SET

1031

Stop loss price is not set

E_CANCEL_VECTOR_LEN_MISMATCH

1032

Cancel order ID vector length not equal to sides vector length

E_VECTOR_LENGTH_MISMATCH_IN_MULTIPLE_ORDER_PLACING

1033

Input vector lengths for placing multiple orders are not equal

E_NOT_MARKET_CREATOR

1034

Caller is not the market creator

E_UNSUPPORTED_RESTRICTION_TYPE

1035

Unsupported restriction type

E_INSUFFICIENT_QUOTE_IN_MARKET_ACCOUNT_TO_COLLAPSE

1036

Insufficient quote asset in the market account to collapse

E_INSUFFICIENT_BASE_IN_MARKET_ACCOUNT_TO_COLLAPSE

1037

Insufficient base asset in the market account to collapse

E_NO_FILLED_OPEN_POSITION_ON_ONE_SIDE

1038

Attempted collapse with no active position on one side

E_ZERO_FILLED_SIZE_FOR_UPDATE_TPSL

1039

Zero filled size for updating take profit/stop loss

E_NO_OPEN_POSITION

1040

No open position available

E_MARGIN_ADDITION_EXCEEDS_POSITION_VALUE

1041

Attempting to add margin would exceed the total position value

E_LESS_THAN_MIN_MARGIN_ADDITION

1042

Amount less than the minimum margin addition amount

E_TRADE_PROFILE_DOESNT_EXISTS

1043

Trade profile doesn't exist

E_DEPRECATED

1044

Function is deprecated

utils.move

Error Code

Error Message

Description

E_VALUE_TOO_LARGE_U64

4001

Value is greater than the maximum possible u64

E_ZERO_TRADE_ID

4002

Generated Trade ID is zero

E_INVALID_MARKET_ID_ZERO

4003

Given market ID is zero

E_INVALID_TRADE_COUNTER_ZERO

4004

Given trade counter is zero

E_INVALID_TAKE_PROFIT_PRICE_LONG

4005

Given take profit price is less than the entry price for long position

E_INVALID_STOP_LOSS_PRICE_LONG

4006

Given stop loss price is greater than the entry price for long position

E_INVALID_TAKE_PROFIT_PRICE_SHORT

4007

Given take profit price is greater than the entry price for short position

E_INVALID_STOP_LOSS_PRICE_SHORT

4008

Given stop loss price is less than the entry price for short position

E_STOP_LOSS_LESS_THAN_LIQUIDATION_PRICE_LONG

4009

Stop loss price is less than the liquidation price for long position

E_STOP_LOSS_GREATER_THAN_LIQUIDATION_PRICE_SHORT

4010

Stop loss price is greater than the liquidation price for short position

E_INSUFFICIENT_LIQUIDITY_IN_ORDERBOOK

4011

Not enough liquidity in orderbook to fill

E_DIVISION_BY_ZERO

4012

Denominator is zero

E_INVALID_PROFILE_ID

4013

Invalid Profile ID

price_oracle.move

Error Code

Error Message

Description

E_NOT_KANA

2001

Caller is not Kana

E_MARKET_ID_EXISTS

2002

Market ID already exists

E_INVALID_PRICE_FEED

2003

Price feed does not exist

E_INVALID_PYTH_PRICE_EXPONENT

2004

Pyth price exponent is less than the quote exponent

delegate_proxy.move

Error Code

Error Message

Description

E_ALREADY_DELEGATED

5001

Already Delegated

E_NOT_DELEGATED

5002

Not Delegated

E_NOT_DELEGATED_PROXY_ADDRESS

5003

Not Delegated proxy address

E_DELEGATION_EXPIRED

5004

Delegation expired

Last updated