Versions in this module Expand all Collapse all v1 v1.4.2 Nov 4, 2022 v1.4.1 Aug 16, 2022 Changes in this version + const AccountFlagAsks + const AccountFlagBids + const AccountFlagDisabled + const AccountFlagEventQueue + const AccountFlagInitialized + const AccountFlagMarket + const AccountFlagOpenOrders + const AccountFlagRequestQueue + const EVENT_BYTE_SIZE + const EventFlagBid + const EventFlagFill + const EventFlagMaker + const EventFlagOut + const EventFlagReleaseFunds + const OrderTypeImmediateOrCancel + const OrderTypeLimit + const OrderTypePostOnly + const RequestFlagBid + const RequestFlagCancelOrder + const RequestFlagDecrementTakeOnSelfTrade + const RequestFlagImmediateOrCancel + const RequestFlagNewOrder + const RequestFlagPostOnly + const SelfTradeBehaviorAbortTransaction + const SelfTradeBehaviorCancelProvide + const SelfTradeBehaviorDecrementTake + const SideAsk + const SideBid + var DEXProgramIDV2 = solana.MustPublicKeyFromBase58("EUqojwWA2rd19FZrzeBncJsm38Jm1hEhE3zsmX3bRc2o") + var InstructionDefVariant = bin.NewVariantDefinition(bin.Uint32TypeIDEncoding, []bin.VariantType{ ... }) + var SlabFactoryImplDef = bin.NewVariantDefinition(bin.Uint32TypeIDEncoding, []bin.VariantType{ ... }) + func F() *big.Float + func GetSeqNum(orderId string, side Side) (uint64, error) + func Has(b, flag uint8) bool + func I() *big.Int + func IsBitZero(v bin.Uint128, bitIndex uint32) (bool, error) + func PriceLotsToNumber(price, baseLotSize, quoteLotSize, baseDecimals, quoteDecimals uint64) *big.Float + func StreamOpenOrders(client *ws.Client) error + type AccountFlag uint64 + func (a *AccountFlag) Is(flag AccountFlag) bool + func (a *AccountFlag) String() string + type CancelOrderAccounts struct + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + RequestQueue *solana.AccountMeta + type CancelOrderByClientIdAccounts struct + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + RequestQueue *solana.AccountMeta + type CancelOrderByClientIdV2Accounts struct + Asks *solana.AccountMeta + Bids *solana.AccountMeta + EventQueue *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + type CancelOrderV2Accounts struct + Asks *solana.AccountMeta + Bids *solana.AccountMeta + EventQueue *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + type ConsumeEventsAccounts struct + CoinFeeReceivable *solana.AccountMeta + EventQueue *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders []*solana.AccountMeta + PCFeeReceivable *solana.AccountMeta + type DisableMarketAccounts struct + DisableAuthority *solana.AccountMeta + Market *solana.AccountMeta + type Event struct + ClientOrderID uint64 + FeeTier uint8 + Flag EventFlag + NativeFeeOrRebate uint64 + NativeQtyPaid uint64 + NativeQtyReleased uint64 + OrderID OrderID + Owner solana.PublicKey + OwnerSlot uint8 + Padding [5]uint8 + func (e *Event) Equal(other *Event) bool + func (e *Event) Filled() bool + func (e *Event) Side() Side + type EventFlag uint8 + func (e EventFlag) IsBid() bool + func (e EventFlag) IsFill() bool + func (e EventFlag) IsMaker() bool + func (e EventFlag) IsOut() bool + func (e EventFlag) IsReleaseFunds() bool + func (e EventFlag) String() string + type EventQueue struct + AccountFlags AccountFlag + Count bin.Uint64 + EndPadding [7]byte + Events []*Event + Head bin.Uint64 + SeqNum bin.Uint64 + SerumPadding [5]byte + func (q *EventQueue) Decode(data []byte) error + func (q *EventQueue) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) + func (q EventQueue) MarshalWithEncoder(encoder *bin.Encoder) error + type InitializeMarketAccounts struct + CoinMint *solana.AccountMeta + Market *solana.AccountMeta + PriceMint *solana.AccountMeta + SPLCoinToken *solana.AccountMeta + SPLPriceToken *solana.AccountMeta + type Instruction struct + Version uint8 + func DecodeInstruction(accounts []*solana.AccountMeta, data []byte) (*Instruction, error) + func (i *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error + func (i *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) + func (i Instruction) MarshalWithEncoder(encoder *bin.Encoder) error + type InstructionCancelOrder struct + Accounts *CancelOrderAccounts + OpenOrderSlot uint8 + OpenOrders solana.PublicKey + OrderID bin.Uint128 + Side Side + func (i *InstructionCancelOrder) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionCancelOrderByClientId struct + Accounts *CancelOrderByClientIdAccounts + ClientID uint64 + func (i *InstructionCancelOrderByClientId) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionCancelOrderByClientIdV2 struct + Accounts *CancelOrderByClientIdV2Accounts + ClientID uint64 + func (i *InstructionCancelOrderByClientIdV2) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionCancelOrderV2 struct + Accounts *CancelOrderV2Accounts + OrderID bin.Uint128 + Side Side + func (i *InstructionCancelOrderV2) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionConsumeEvents struct + Accounts *ConsumeEventsAccounts + Limit uint16 + func (i *InstructionConsumeEvents) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionDisableMarketAccounts struct + Accounts *DisableMarketAccounts + func (i *InstructionDisableMarketAccounts) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionInitializeMarket struct + Accounts *InitializeMarketAccounts + BaseLotSize uint64 + FeeRateBps uint16 + QuoteDustThreshold uint64 + QuoteLotSize uint64 + VaultSignerNonce uint64 + func (i *InstructionInitializeMarket) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionMatchOrder struct + Accounts *MatchOrderAccounts + Limit uint16 + func (i *InstructionMatchOrder) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionNewOrder struct + Accounts *NewOrderAccounts + ClientID uint64 + LimitPrice uint64 + MaxQuantity uint64 + OrderType OrderType + Side Side + func (i *InstructionNewOrder) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionNewOrderV2 struct + Accounts *NewOrderV2Accounts + ClientID uint64 + LimitPrice uint64 + MaxQuantity uint64 + OrderType OrderType + SelfTradeBehavior SelfTradeBehavior + Side Side + func (i *InstructionNewOrderV2) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionNewOrderV3 struct + Accounts *NewOrderV3Accounts + ClientOrderID uint64 + Limit uint16 + LimitPrice uint64 + MaxCoinQuantity uint64 + MaxNativePCQuantityIncludingFees uint64 + OrderType OrderType + SelfTradeBehavior SelfTradeBehavior + Side Side + func (i *InstructionNewOrderV3) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionSendTake struct + Accounts *InstructionSendTakeAccounts + Limit uint16 + LimitPrice uint64 + MaxCoinQuantity uint64 + MaxNativePCQuantityIncludingFees uint64 + MinCoinQuantity uint64 + MinNativePCQuantity uint64 + Side Side + func (i *InstructionSendTake) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionSendTakeAccounts struct + Asks *solana.AccountMeta + Bids *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + type InstructionSettleFunds struct + Accounts *SettleFundsAccounts + func (i *InstructionSettleFunds) SetAccounts(accounts []*solana.AccountMeta) error + type InstructionSweepFees struct + Accounts *SweepFeesAccounts + func (i *InstructionSweepFees) SetAccounts(accounts []*solana.AccountMeta) error + type MarketMeta struct + Address solana.PublicKey + BaseMint token.Mint + Deprecated bool + MarketV2 MarketV2 + Name string + QuoteMint token.Mint + func FetchMarket(ctx context.Context, rpcCli *rpc.Client, marketAddr solana.PublicKey) (*MarketMeta, error) + func KnownMarket() ([]*MarketMeta, error) + func (m *MarketMeta) BaseSizeLotsToNumber(size *big.Int) *big.Float + func (m *MarketMeta) PriceLotsToNumber(price *big.Int) *big.Float + func (m *MarketMeta) PriceNumberToLots(price *big.Int) *big.Float + type MarketV2 struct + AccountFlags AccountFlag + Asks solana.PublicKey + BaseDepositsTotal bin.Uint64 + BaseFeesAccrued bin.Uint64 + BaseLotSize bin.Uint64 + BaseMint solana.PublicKey + BaseVault solana.PublicKey + Bids solana.PublicKey + EndPadding [7]byte + EventQueue solana.PublicKey + FeeRateBPS bin.Uint64 + OwnAddress solana.PublicKey + QuoteDepositsTotal bin.Uint64 + QuoteDustThreshold bin.Uint64 + QuoteFeesAccrued bin.Uint64 + QuoteLotSize bin.Uint64 + QuoteMint solana.PublicKey + QuoteVault solana.PublicKey + ReferrerRebatesAccrued bin.Uint64 + RequestQueue solana.PublicKey + SerumPadding [5]byte + VaultSignerNonce bin.Uint64 + func (m *MarketV2) Decode(in []byte) error + type MatchOrderAccounts struct + Asks *solana.AccountMeta + Bids *solana.AccountMeta + CoinFeeReceivable *solana.AccountMeta + EventQueue *solana.AccountMeta + Market *solana.AccountMeta + PCFeeReceivable *solana.AccountMeta + RequestQueue *solana.AccountMeta + type NewOrderAccounts struct + CoinVault *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + PCVault *solana.AccountMeta + Payer *solana.AccountMeta + Rent *solana.AccountMeta + RequestQueue *solana.AccountMeta + SPLTokenProgram *solana.AccountMeta + SRMDiscountAccount *solana.AccountMeta + type NewOrderV2Accounts struct + CoinVault *solana.AccountMeta + FeeDiscount *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + PCVault *solana.AccountMeta + Payer *solana.AccountMeta + RentSysvar *solana.AccountMeta + RequestQueue *solana.AccountMeta + SPLTokenProgram *solana.AccountMeta + type NewOrderV3Accounts struct + Asker *solana.AccountMeta + Bidder *solana.AccountMeta + CoinVault *solana.AccountMeta + EventQueue *solana.AccountMeta + FeeDiscount *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + PCVault *solana.AccountMeta + Payer *solana.AccountMeta + RentSysvar *solana.AccountMeta + RequestQueue *solana.AccountMeta + SPLTokenProgram *solana.AccountMeta + type OpenOrders struct + AccountFlags AccountFlag + ClientOrderIDs [128]bin.Uint64 + EndPadding [7]byte + FreeSlotBits bin.Uint128 + IsBidBits bin.Uint128 + Market solana.PublicKey + NativeBaseTokenFree bin.Uint64 + NativeBaseTokenTotal bin.Uint64 + NativeQuoteTokenFree bin.Uint64 + NativeQuoteTokenTotal bin.Uint64 + Orders [128]OrderID + Owner solana.PublicKey + ReferrerRebatesAccrued bin.Uint64 + SerumPadding [5]byte + func (o *OpenOrders) Decode(in []byte) error + func (o *OpenOrders) GetOrder(index uint32) *Order + type OpenOrdersMeta struct + OpenOrders OpenOrders + func FetchOpenOrders(ctx context.Context, rpcCli *rpc.Client, openOrdersAddr solana.PublicKey) (*OpenOrdersMeta, error) + type Order struct + ID OrderID + Side Side + func (o *Order) Price() uint64 + func (o *Order) SeqNum() uint64 + type OrderID bin.Uint128 + func NewOrderID(orderID string) (OrderID, error) + func (o OrderID) HexString(withPrefix bool) string + func (o OrderID) Price() uint64 + func (o OrderID) SeqNum(side Side) uint64 + type OrderType uint32 + type Orderbook struct + AccountFlags AccountFlag + BumpIndex uint32 + FreeListHead uint32 + FreeListLen uint32 + LeafCount uint32 + Nodes []*Slab + Root uint32 + SerumPadding [5]byte + ZeroPaddingA [4]byte + ZeroPaddingB [4]byte + ZeroPaddingC [4]byte + func (o *Orderbook) Items(descending bool, f func(node *SlabLeafNode) error) error + type Request struct + ClientOrderID bin.Uint64 + FeeTier uint8 + MaxCoinQtyOrCancelId bin.Uint64 + NativePCQtyLocked bin.Uint64 + OpenOrders [4]bin.Uint64 + OrderID bin.Uint128 + OwnerSlot uint8 + Padding [4]byte + RequestFlags RequestFlag + SelfTradeBehavior uint8 + func (r *Request) Equal(other *Request) bool + type RequestFlag uint8 + func (f RequestFlag) String() string + func (r RequestFlag) IsBid() bool + func (r RequestFlag) IsCancelOrder() bool + func (r RequestFlag) IsDecrementTakeOnSelfTrade() bool + func (r RequestFlag) IsImmediateOrCancel() bool + func (r RequestFlag) IsNewOrder() bool + func (r RequestFlag) IsPostOnly() bool + type RequestQueue struct + AccountFlags AccountFlag + Count bin.Uint64 + EndPadding [7]byte + Head bin.Uint64 + NextSeqNum bin.Uint64 + Requests []*Request + SerumPadding [5]byte + func (q *RequestQueue) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) + func (q RequestQueue) MarshalWithEncoder(encoder *bin.Encoder) error + func (r *RequestQueue) Decode(data []byte) error + type SelfTradeBehavior uint32 + type SettleFundsAccounts struct + CoinVault *solana.AccountMeta + CoinWallet *solana.AccountMeta + Market *solana.AccountMeta + OpenOrders *solana.AccountMeta + Owner *solana.AccountMeta + PCVault *solana.AccountMeta + PCWallet *solana.AccountMeta + ReferrerPCWallet *solana.AccountMeta + SPLTokenProgram *solana.AccountMeta + Signer *solana.AccountMeta + type Side uint32 + type SideLayout uint32 + type SideLayoutType string + const SideLayoutTypeAsk + const SideLayoutTypeBid + const SideLayoutTypeUnknown + type Slab struct + func (s *Slab) UnmarshalWithDecoder(decoder *bin.Decoder) error + func (s Slab) MarshalWithEncoder(encoder *bin.Encoder) error + type SlabFreeNode struct + Next uint32 + Padding [64]byte + type SlabInnerNode struct + Children [2]uint32 + Key bin.Uint128 + Padding [40]byte + PrefixLen uint32 + type SlabLastFreeNode struct + Padding [4]byte + PaddingA [64]byte + type SlabLeafNode struct + ClientOrderId bin.Uint64 + FeeTier uint8 + Key bin.Uint128 + Owner solana.PublicKey + OwnerSlot uint8 + Padding [2]byte + Quantity bin.Uint64 + func (s *SlabLeafNode) GetPrice() *big.Int + type SlabUninitialized struct + Padding [4]byte + PaddingA [64]byte + type SweepFeesAccounts struct + FeeReceivableAccount *solana.AccountMeta + FeeSweepingAuthority *solana.AccountMeta + Market *solana.AccountMeta + PCVault *solana.AccountMeta + SPLTokenProgram *solana.AccountMeta + VaultSigner *solana.AccountMeta