Get order book.
 @abstract
 @return [hash] array of market depth
   asks: [Array] 売りオーダー
      price : [BigDecimal]
      size : [BigDecimal]
   bids: [Array] 買いオーダー
      price : [BigDecimal]
      size : [BigDecimal]
   ltimestamp: [int] ローカルタイムスタンプ
354412
def depth
      h = get_ssl(@url_public + "/getboard?product_code=#{@product_code}")
      {
        "asks"       => h["asks"].map{|x| [BigDecimal.new(x["price"].to_s), BigDecimal.new(x["size"].to_s)]},
        "bids"       => h["bids"].map{|x| [BigDecimal.new(x["price"].to_s), BigDecimal.new(x["size"].to_s)]},
        "ltimestamp" => Time.now.to_i,
      }
    end
584289
def order_book(self, group=True, base="btc", quote="usd"):
        
        params = {'group': group}
        url = self._construct_url("order_book/", base, quote)
        return self._get(url, params=params, return_json=True, version=2)
1324774
def trading_pnl(self):
        
        last_price = self._data_proxy.get_last_price(self._order_book_id)
        return self._contract_multiplier * (self._trade_quantity * last_price - self._trade_cost)
1265502
@Override
  public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {

    // Request data
    ANXDepthWrapper anxDepthWrapper = null;
    if (args != null && args.length > 0) {
      if (args[0] instanceof String) {
        if ("full" == args[0]) {
          anxDepthWrapper = getANXFullOrderBook(currencyPair);
        } else {
          anxDepthWrapper = getANXPartialOrderBook(currencyPair);
        }
      } else {
        throw new ExchangeException("Orderbook type argument must be a String!");
      }
    } else { // default to full orderbook
      anxDepthWrapper = getANXFullOrderBook(currencyPair);
    }

    // Adapt to XChange DTOs
    List<LimitOrder> asks =
        ANXAdapters.adaptOrders(
            anxDepthWrapper.getAnxDepth().getAsks(),
            currencyPair.base.getCurrencyCode(),
            currencyPair.counter.getCurrencyCode(),
            "ask",
            "");
    List<LimitOrder> bids =
        ANXAdapters.adaptOrders(
            anxDepthWrapper.getAnxDepth().getBids(),
            currencyPair.base.getCurrencyCode(),
            currencyPair.counter.getCurrencyCode(),
            "bid",
            "");
    Date date = new Date(anxDepthWrapper.getAnxDepth().getMicroTime() / 1000);
    return new OrderBook(date, asks, bids);
  }
114376
public function getOrderItem()
    {
        if (null === $this->orderItem && null !== $this->getOrderItemId()) {
            $oOrderItem = TdbShopOrderItem::GetNewInstance();
            if (false === $oOrderItem->Load($this->getOrderItemId())) {
                $sMsg = "unable to load the shop_order_item [{$this->getOrderItemId()}]";
                throw new TPkgCmsException_LogAndMessage(
                    TPkgShopPaymentTransactionManager::MESSAGE_ERROR,
                    array('sMessage' => $sMsg),
                    $sMsg,
                    array('item' => $this)
                );
            } else {
                $this->orderItem = $oOrderItem;
            }
        }

        return $this->orderItem;
    }
1358507
public function order()
    {
        $options = array(
            'order' => 'desc',
            'sort' => 'created',
            'limit' => array(0, $this->config->get('dashboard_limit', 10)));

        $items = $this->order->getList($options);

        array_walk($items, function (&$item) {
            $this->setItemTotalFormatted($item, $this->price);
            $this->setItemOrderNew($item, $this->order_history);
        });

        return $items;
    }
652985
function OrderBook(currencyPair) {
    this._currencyPair = currencyPair;

    this._updateBufferMaxSize = OrderBook.DEFAULT_UPDATE_BUFFER_MAX_SIZE;

    this._wrapperPush = new PushWrapper();
    this._wrapperPublic = new PublicWrapper();

    this._statusRunning = false;
    this._statusSync = OrderBook.SYNC_STATUS_DESYNCHRONIZED;

    this._asks = new Table();
    this._bids = new Table();

    this._lastHandledSeq = -1;

    this._updateBuffer = new Array();

    this._eventEmitter = new events.EventEmitter();

    this._metrics = {
        "spread": 0,
        "askSumAmount": 0,
        "askSumTotal": 0,
        "bidSumAmount": 0,
        "bidSumTotal": 0
    };
}
344730
public function getSold()
    {
        $items = Auth::user()->items()
            ->leftJoin('purchases')
            ->where(function ($query) {
                $query->typeFixed()->whereNotNull('purchases.purchase_id');
            });

        // Allows sorting by buyer username
        $items->getBaseQuery()
            ->join('users', 'users.user_id', '=', 'purchases.user_id');

        if (mustard_loaded('auctions')) {
            $items->leftJoin('winningBid')
                ->orWhere(function ($query) {
                    $query->typeAuction()->whereNotNull('bids.bid_id');
                });
        }

        $table = new InventorySold($items);

        return view('mustard::inventory.sold', [
            'table' => $table,
            'items' => $table->paginate(),
        ]);
    }
755469
public static OrderBook adaptOrderBook(
      MercadoBitcoinOrderBook mercadoBitcoinOrderBook, CurrencyPair currencyPair) {

    List<LimitOrder> asks =
        createOrders(currencyPair, OrderType.ASK, mercadoBitcoinOrderBook.getAsks());
    List<LimitOrder> bids =
        createOrders(currencyPair, OrderType.BID, mercadoBitcoinOrderBook.getBids());
    return new OrderBook(null, asks, bids);
  }
362123
protected function getEncodeBook()
    {
        if (self::$encodeBook === null) {
            self::$encodeBook = array_flip(self::$decodeBook);
        }

        return self::$encodeBook;
    }
438020
public function getShelfList()
    {
        $result = $this->httpGet(self::WECHAT_SHOP_SHELF_LIST_URL . 'access_token=' . $this->getAccessToken());
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['shelves'] : false;
    }
1131082
public static OrderBook adaptOrderBook(
      CCEXGetorderbook ccexOrderBook, CurrencyPair currencyPair) {

    List<LimitOrder> asks =
        createOrders(currencyPair, Order.OrderType.ASK, ccexOrderBook.getAsks());
    List<LimitOrder> bids =
        createOrders(currencyPair, Order.OrderType.BID, ccexOrderBook.getBids());
    Date date = new Date();
    return new OrderBook(date, asks, bids);
  }
1001092
public function getAdditionalBooksToShow()
    {
        $additionalBooksToShow = [];
        $processedAddressBooks = [];
        $additionalFromConfig = $this->helper->getAddressBookIdsToShow($this->getCustomer()->getStore()->getWebsite());
        $contactFromTable = $this->getContactFromTable();
        if (! empty($additionalFromConfig) && $contactFromTable->getContactId()) {
            $contact = $this->getConnectorContact();
            if (isset($contact->id) && $contact->status !== 'PendingOptIn') {
                $addressBooks = $this->_getApiClient()
                    ->getContactAddressBooks(
                        $contact->id
                    );
                if (is_array($addressBooks)) {
                    foreach ($addressBooks as $addressBook) {
                        $processedAddressBooks[$addressBook->id]
                            = $addressBook->name;
                    }
                }
            }
        }

        return $this->getProcessedAdditionalBooks(
            $additionalFromConfig,
            $processedAddressBooks,
            $additionalBooksToShow
        );
    }
759194
public static OrderBook adaptOrderBook(
      CoinsuperResponse<CoinsuperOrderbook> coinsuperOrderbook, CurrencyPair currencyPair) {
    List<LimitOrder> asks = new ArrayList<LimitOrder>();
    List<LimitOrder> bids = new ArrayList<LimitOrder>();

    for (Ask coinsuperAsk : coinsuperOrderbook.getData().getResult().getAsks()) {
      asks.add(
          new LimitOrder(
              OrderType.ASK,
              new BigDecimal(coinsuperAsk.getQuantity()),
              currencyPair,
              null,
              null,
              new BigDecimal(coinsuperAsk.getLimitPrice())));
    }

    for (Bid coinsuperBid : coinsuperOrderbook.getData().getResult().getBids()) {
      bids.add(
          new LimitOrder(
              OrderType.BID,
              new BigDecimal(coinsuperBid.getQuantity()),
              currencyPair,
              null,
              null,
              new BigDecimal(coinsuperBid.getLimitPrice())));
    }

    return new OrderBook(new Date(), asks, bids);
  }
1217193
def underlying_order_book_id(self):
        
        try:
            return self.__dict__["underlying_order_book_id"]
        except (KeyError, ValueError):
            raise AttributeError(
                "Instrument(order_book_id={}) has no attribute 'underlying_order_book_id' ".format(self.order_book_id)
            )
141261
def raw_order_book(self, pair, prec=None, **kwargs):
        
        prec = 'R0' if prec is None else prec
        self._subscribe('book', pair=pair, prec=prec, **kwargs)
882349
def _get_hash(self):
        
        if self.optionals and self.optionals.ISBN:
            isbn = self.optionals.ISBN.replace("-", "")

            if len(isbn) <= 10:
                return "97880" + isbn

            return isbn

        if self.optionals and self.optionals.EAN:
            return self.optionals.EAN

        return self.title + ",".join(map(lambda x: x.name, self.authors))