1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
use anchor_lang::prelude::*;

#[error_code]
pub enum FixedTermErrorCode {
    #[msg("overflow occured on checked_add")]
    ArithmeticOverflow,
    #[msg("underflow occured on checked_sub")]
    ArithmeticUnderflow,
    #[msg("bad fixed-point division")]
    FixedPointDivision,
    #[msg("owner does not own the ticket")]
    DoesNotOwnTicket,
    #[msg("signer does not own the event adapter")]
    DoesNotOwnEventAdapter,
    #[msg("queue does not have room for another event")]
    EventQueueFull,
    #[msg("failed to deserialize the SplitTicket or ClaimTicket")]
    FailedToDeserializeTicket,
    #[msg("ticket is not mature and cannot be claimed")]
    ImmatureTicket,
    #[msg("not enough seeds were provided for the accounts that need to be initialized")]
    InsufficientSeeds,
    #[msg("order price is prohibited")]
    InvalidOrderPrice,
    #[msg("failed to invoke account creation")]
    InvokeCreateAccount,
    #[msg("failed to properly serialize or deserialize a data structure")]
    IoError,
    #[msg("this market state account is not owned by the current program")]
    MarketStateNotProgramOwned,
    #[msg("tried to access a missing adapter account")]
    MissingEventAdapter,
    #[msg("tried to access a missing split ticket account")]
    MissingSplitTicket,
    #[msg("consume_events instruction failed to consume a single event")]
    NoEvents,
    #[msg("expected additional remaining accounts, but there were none")]
    NoMoreAccounts,
    #[msg("expected a term loan with a different sequence number")]
    TermLoanHasWrongSequenceNumber,
    #[msg("there was a problem loading the price oracle")]
    OracleError,
    #[msg("id was not found in the user's open orders")]
    OrderNotFound,
    #[msg("Orderbook is not taking orders")]
    OrderbookPaused,
    #[msg("aaob did not match or post the order. either posting is disabled or the order was too small")]
    OrderRejected,
    #[msg("price could not be accessed from oracle")]
    PriceMissing,
    #[msg("claim ticket is not from this manager")]
    TicketNotFromManager,
    #[msg("tickets are paused")]
    TicketsPaused,
    #[msg("this signer is not authorized to place a permissioned order")]
    UnauthorizedCaller,
    #[msg("this user does not own the user account")]
    UserDoesNotOwnAccount,
    #[msg("this adapter does not belong to the user")]
    UserDoesNotOwnAdapter,
    #[msg("this user account is not associated with this fixed term market")]
    UserNotInMarket,
    #[msg("the wrong adapter account was passed to this instruction")]
    WrongAdapter,
    #[msg("asks account does not belong to this market")]
    WrongAsks,
    #[msg("the market is configured for a different airspace")]
    WrongAirspace,
    #[msg("the signer is not authorized to perform this action in the current airspace")]
    WrongAirspaceAuthorization,
    #[msg("bids account does not belong to this market")]
    WrongBids,
    #[msg("adapter does not belong to given market")]
    WrongMarket,
    #[msg("wrong authority for this crank instruction")]
    WrongCrankAuthority,
    #[msg("event queue account does not belong to this market")]
    WrongEventQueue,
    #[msg("this market state is not associated with this market")]
    WrongMarketState,
    #[msg("wrong TicketManager account provided")]
    WrongTicketManager,
    #[msg("this market owner does not own this market")]
    DoesNotOwnMarket,
    #[msg("the wrong account was provided for the token account that represents a user's claims")]
    WrongClaimAccount,
    #[msg(
        "the wrong account was provided for the token account that represents a user's collateral"
    )]
    WrongCollateralAccount,
    #[msg("the wrong account was provided for the claims token mint")]
    WrongClaimMint,
    #[msg("the wrong account was provided for the collateral token mint")]
    WrongCollateralMint,
    #[msg("wrong fee destination")]
    WrongFeeDestination,
    #[msg("wrong oracle address was sent to instruction")]
    WrongOracle,
    #[msg("wrong margin user account address was sent to instruction")]
    WrongMarginUser,
    #[msg("wrong authority for the margin user account address was sent to instruction")]
    WrongMarginUserAuthority,
    #[msg("incorrect authority account")]
    WrongProgramAuthority,
    #[msg("not the ticket mint for this fixed term market")]
    WrongTicketMint,
    #[msg("wrong ticket settlement account")]
    WrongTicketSettlementAccount,
    #[msg("wrong underlying settlement account")]
    WrongUnderlyingSettlementAccount,
    #[msg("wrong underlying token mint for this fixed term market")]
    WrongUnderlyingTokenMint,
    #[msg("wrong user account address was sent to instruction")]
    WrongUserAccount,
    #[msg("wrong vault address was sent to instruction")]
    WrongVault,
    #[msg("attempted to divide with zero")]
    ZeroDivision,
}