         if market.shorts_available
             Wallet.get_setting("market.advanced").then (result) ->
                 $scope.advanced = (if result then result.value else false)
-        price_decimals = if market.price_precision > 9 then (market.price_precision+"").length - 2 else market.price_precision - 2
+        price_decimals = if market.price_precision > 9 then (market.price_precision + "").length - 2 else market.price_precision - 2
         Observer.registerObserver(market_data_observer)
         Observer.registerObserver(market_status_observer)
         balances = {}

    market_name = $stateParams.name
    promise = MarketService.init(market_name)
    promise.then (market) ->
        $scope.tabs.forEach (tab) -> tab.active = $scope.active_tab(tab.route)
        $scope.market = current_market = market
        $scope.actual_market = market.get_actual_market()
        $scope.market_inverted_url = MarketService.inverted_url

            account.quantity_balance = data[market.asset_quantity_symbol] / market.quantity_precision
            account.short_balance = if market.inverted then account.base_balance else account.quantity_balance
        Observer.registerObserver(account_balances_observer)
        q = []
        q.push Blockchain.get_info().then (config) ->
            $scope.blockchain_symbol = config.symbol #XTS or BTSX
            WalletAPI.get_transaction_fee($scope.blockchain_symbol).then (blockchain_tx_fee) ->
                Blockchain.get_asset(blockchain_tx_fee.asset_id).then (blockchain_tx_fee_asset) ->
                    $scope.blockchain_tx_fee = Utils.formatDecimal(
                            blockchain_tx_fee.amount / blockchain_tx_fee_asset.precision,
                        blockchain_tx_fee_asset.precision)

        q.push WalletAPI.get_transaction_fee(market.asset_base_symbol).then (tx_fee) ->
            Blockchain.get_asset(tx_fee.asset_id).then (tx_fee_asset) ->
                $scope.tx_fee = Utils.formatDecimal(tx_fee.amount / tx_fee_asset.precision, tx_fee_asset.precision)

        $q.all(q).then()

    promise.catch (error) ->
        Growl.error("", error)
    $scope.showLoadingIndicator(promise)

    Wallet.refresh_accounts().then ->
