Constructors
constructor
- new DexMarket(address: PublicKey, serumMarket: Market, baseCoin: Coin, quoteCoin: Coin): DexMarket
Parameters
address: PublicKey
serumMarket: Market
baseCoin: Coin
quoteCoin: Coin
Properties
address
address: PublicKey
marketSymbol
marketSymbol: string
serumMarket
serumMarket: Market
Methods
Static cancelOrder
- cancelOrder(connection: Connection, owner: Keypair, serumMarket: Market, order: Order): Promise<string>
Parameters
connection: Connection
owner: Keypair
serumMarket: Market
order: Order
Returns Promise<string>
Static createMarketAccountsInstructions
- createMarketAccountsInstructions(accounts: MarketAccounts, payer: Keypair, connection: Connection, dexProgram: PublicKey): Promise<TransactionInstruction[]>
Parameters
payer: Keypair
connection: Connection
dexProgram: PublicKey
Returns Promise<TransactionInstruction[]>
Static createMarketVaultsTransaction
- createMarketVaultsTransaction(payer: Keypair, vaultOwner: PublicKey, baseVault: Keypair, quoteVault: Keypair, baseCoin: Coin, quoteCoin: Coin, connection: Connection): Promise<Transaction>
Parameters
payer: Keypair
vaultOwner: PublicKey
baseVault: Keypair
quoteVault: Keypair
baseCoin: Coin
quoteCoin: Coin
connection: Connection
Returns Promise<Transaction>
Static getCancelOrderTransaction
- getCancelOrderTransaction(connection: Connection, owner: Keypair, serumMarket: Market, order: Order): Promise<TransactionWithSigners>
Parameters
connection: Connection
owner: Keypair
serumMarket: Market
order: Order
Static getOrCreateOpenOrderAccount
- getOrCreateOpenOrderAccount(owner: Keypair, serumMarket: Market, connection: Connection): Promise<OpenOrders>
Parameters
owner: Keypair
serumMarket: Market
connection: Connection
Returns Promise<OpenOrders>
Static getPlaceOrderTransaction
- getPlaceOrderTransaction(connection: Connection, owner: Keypair, serumMarket: Market, side: "buy" | "sell", size: number, price: number): Promise<TransactionWithSigners>
Parameters
connection: Connection
owner: Keypair
serumMarket: Market
side: "buy" | "sell"
size: number
price: number
Static load
- load(connection: Connection, programID: PublicKey, marketAddress: PublicKey, baseCoin: Coin, quoteCoin: Coin): Promise<DexMarket>
Parameters
connection: Connection
programID: PublicKey
marketAddress: PublicKey
baseCoin: Coin
quoteCoin: Coin
Static placeOrder
- placeOrder(connection: Connection, owner: Keypair, serumMarket: Market, side: "buy" | "sell", size: number, price: number): Promise<string>
Parameters
connection: Connection
owner: Keypair
serumMarket: Market
side: "buy" | "sell"
size: number
price: number
Returns Promise<string>
Static sanityCheck
- sanityCheck(serumMarket: Market, price: number, size: number): void
Parameters
serumMarket: Market
price: number
size: number
Returns void