I am running the following sample code snippet with SOL/USDC address and programID:
`import { Account, Connection, PublicKey } from '@solana/web3.js';
import { Market } from '@project-serum/serum';
let connection = new Connection('https://api.mainnet-beta.solana.com');
let marketAddress = new PublicKey('7xMDbYTCqQEcK2aM9LbetGtNFJpzKdfXzLL5juaLh4GJ');
let programId = new PublicKey('EUqojwWA2rd19FZrzeBncJsm38Jm1hEhE3zsmX3bRc2o');
let marketOptions = {};
let market = await Market.load(connection, marketAddress, marketOptions, programId);
// Fetching orderbooks
let bids = await market.loadBids(connection);
let asks = await market.loadAsks(connection);
// L2 orderbook data
for (const [price, size] of bids.getL2(20)) {
console.log(price, size);
}`
Output is:
3.51 23.6
0.003 0.1
0.001 0.4
This does not appear to be price/size data for SOL/USDC. What am I looking at here? Thanks!
I am running the following sample code snippet with SOL/USDC address and programID:
`import { Account, Connection, PublicKey } from '@solana/web3.js'; import { Market } from '@project-serum/serum';
let connection = new Connection('https://api.mainnet-beta.solana.com'); let marketAddress = new PublicKey('7xMDbYTCqQEcK2aM9LbetGtNFJpzKdfXzLL5juaLh4GJ'); let programId = new PublicKey('EUqojwWA2rd19FZrzeBncJsm38Jm1hEhE3zsmX3bRc2o'); let marketOptions = {}; let market = await Market.load(connection, marketAddress, marketOptions, programId);
// Fetching orderbooks let bids = await market.loadBids(connection); let asks = await market.loadAsks(connection);
// L2 orderbook data for (const [price, size] of bids.getL2(20)) { console.log(price, size); }`
Output is:
3.51 23.6 0.003 0.1 0.001 0.4
This does not appear to be price/size data for SOL/USDC. What am I looking at here? Thanks!