-
Notifications
You must be signed in to change notification settings - Fork 21
/
errors.go
64 lines (62 loc) · 4.72 KB
/
errors.go
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
package common
import (
"errors"
)
var (
// ErrMarketClosed signals that an action have been tried to be applied on a closed market.
ErrMarketClosed = errors.New("market closed")
// ErrPartyDoNotExists signals that the party used does not exists.
ErrPartyDoNotExists = errors.New("party does not exist")
// ErrMarginCheckFailed signals that a margin check for a position failed.
ErrMarginCheckFailed = errors.New("margin check failed")
// ErrMarginCheckInsufficient signals that a margin had not enough funds.
ErrMarginCheckInsufficient = errors.New("insufficient margin")
// ErrMissingGeneralAccountForParty ...
ErrMissingGeneralAccountForParty = errors.New("missing general account for party")
// ErrNotEnoughVolumeToZeroOutNetworkOrder ...
ErrNotEnoughVolumeToZeroOutNetworkOrder = errors.New("not enough volume to zero out network order")
// ErrInvalidAmendRemainQuantity signals incorrect remaining qty for a reduce by amend.
ErrInvalidAmendRemainQuantity = errors.New("incorrect remaining qty for a reduce by amend")
// ErrEmptyMarketID is returned if processed market has an empty id.
ErrEmptyMarketID = errors.New("invalid market id (empty)")
// ErrInvalidOrderType is returned if processed order has an invalid order type.
ErrInvalidOrderType = errors.New("invalid order type")
// ErrInvalidExpiresAtTime is returned if the expire time is before the createdAt time.
ErrInvalidExpiresAtTime = errors.New("invalid expiresAt time")
// ErrGFAOrderReceivedDuringContinuousTrading is returned is a gfa order hits the market when the market is in continuous trading state.
ErrGFAOrderReceivedDuringContinuousTrading = errors.New("gfa order received during continuous trading")
// ErrGFNOrderReceivedAuctionTrading is returned if a gfn order hits the market when in auction state.
ErrGFNOrderReceivedAuctionTrading = errors.New("gfn order received during auction trading")
// ErrIOCOrderReceivedAuctionTrading is returned if a ioc order hits the market when in auction state.
ErrIOCOrderReceivedAuctionTrading = errors.New("ioc order received during auction trading")
// ErrFOKOrderReceivedAuctionTrading is returned if a fok order hits the market when in auction state.
ErrFOKOrderReceivedAuctionTrading = errors.New("fok order received during auction trading")
// ErrUnableToReprice we are unable to get a price required to reprice.
ErrUnableToReprice = errors.New("unable to reprice")
// ErrOrderNotFound we cannot find the order in the market.
ErrOrderNotFound = errors.New("unable to find the order in the market")
// ErrTradingNotAllowed no trading related functionalities are allowed in the current state.
ErrTradingNotAllowed = errors.New("trading not allowed")
// ErrCommitmentSubmissionNotAllowed no commitment submission are permitted in the current state.
ErrCommitmentSubmissionNotAllowed = errors.New("commitment submission not allowed")
// ErrNotEnoughStake is returned when a LP update results in not enough commitment.
ErrNotEnoughStake = errors.New("commitment submission rejected, not enough stake")
// ErrPartyNotLiquidityProvider is returned when a LP update or cancel does not match an LP party.
ErrPartyNotLiquidityProvider = errors.New("party is not a liquidity provider")
// ErrPartyAlreadyLiquidityProvider is returned when a LP is submitted by a party which is already LP.
ErrPartyAlreadyLiquidityProvider = errors.New("party is already a liquidity provider")
// ErrCannotRejectMarketNotInProposedState.
ErrCannotRejectMarketNotInProposedState = errors.New("cannot reject a market not in proposed state")
// ErrCannotStateOpeningAuctionForMarketNotInProposedState.
ErrCannotStartOpeningAuctionForMarketNotInProposedState = errors.New("cannot start the opening auction for a market not in proposed state")
// ErrCannotRepriceDuringAuction.
ErrCannotRepriceDuringAuction = errors.New("cannot reprice during auction")
// ErrPartyInsufficientAssetBalance is returned when a party does not have sufficient balance of the required asset to perform an action.
ErrPartyInsufficientAssetBalance = errors.New("party has insufficient balance in asset")
ErrMaxStopOrdersPerPartyReached = errors.New("max stop orders per party reached")
ErrStopOrderSubmissionNotAllowedWithoutExistingPosition = errors.New("stop order submission not allowed without existing position")
ErrStopOrderSideNotClosingThePosition = errors.New("side used in stop order does not close the position")
ErrStopOrderMustBeReduceOnly = errors.New("stop order must be reduce only")
ErrStopOrderExpiryInThePast = errors.New("stop order expiry in the past")
ErrPartyHasNoExistingLiquidityProvision = errors.New("party has no existing liquidity provision")
)