Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Orderbook

Orderbook class

Hierarchy

  • Orderbook

Index

Constructors

constructor

Properties

Private _market

_market: Market

Market of the orderbook

Private _slabAsks

_slabAsks: Slab

Slab that contains asks

Private _slabBids

_slabBids: Slab

Slab that contains bids

Accessors

market

slabAsks

  • get slabAsks(): Slab
  • Returns the asks slab of the orderbook

    Returns Slab

slabBids

  • get slabBids(): Slab
  • Returns the bids slab of the orderbook

    Returns Slab

Methods

getL2

  • getL2(depth: number, asks: boolean, uiAmount?: boolean): Price[]
  • Parameters

    • depth: number

      Depth of orders to deserialize

    • asks: boolean

      Asks or bids boolean

    • Optional uiAmount: boolean

      Optional, whether to return the amounts in uiAmount

    Returns Price[]

    Returns an L2 orderbook

getL2JS

  • getL2JS(depth: number, asks: boolean, uiAmount?: boolean): Price[]
  • Parameters

    • depth: number
    • asks: boolean
    • Optional uiAmount: boolean

    Returns Price[]

Static load

  • load(connection: Connection, marketAddress: PublicKey): Promise<Orderbook>
  • Parameters

    • connection: Connection

      The solana connection object to the RPC node

    • marketAddress: PublicKey

      The address of the market

    Returns Promise<Orderbook>

    Returns an orderbook object

Static loadSlab

  • loadSlab(connection: any, slabAddress: PublicKey): Promise<Slab>
  • Parameters

    • connection: any

      The solana connection object to the RPC node

    • slabAddress: PublicKey

      The address of the Slab

    Returns Promise<Slab>

    A deserialized Slab object

Generated using TypeDoc