public IList<BitfinexActiveCreditsResponse> GetActiveCredits()
        {
            var activeCreditsPost = new BitfinexPostBase();
            activeCreditsPost.Request = ActiveCreditsRequestUrl;
            activeCreditsPost.Nonce = Common.UnixTimeStampUtc().ToString();

            var client = GetRestClient(activeCreditsPost.Request);
            var response = GetRestResponse(client, activeCreditsPost);
            var activeCreditsResponseObj = JsonConvert.DeserializeObject<IList<BitfinexActiveCreditsResponse>>(response.Content);
            ActiveCreditsMsg(activeCreditsResponseObj);

            Logger.Log.InfoFormat("Active Credits:");
            foreach (var activeCredits in activeCreditsResponseObj)
                Logger.Log.InfoFormat("Credits: {0}", activeCredits.ToString());

            return activeCreditsResponseObj;
        }
        /// <summary>
        /// In the Total Return Swaps page you will see a horizontal header "Swaps used in margin position"
        /// This function returns information about what you have borrowed. If you want to close the 
        /// swap you must pass the id returned here to the "CloseSwap" function. 
        /// If you want to 'cash out' and claim the position you must pass the position id to the "ClaimPosition" function. 
        /// </summary>
        /// <returns></returns>
        public IList<BitfinexActiveSwapsInMarginResponse> GetActiveSwapsUsedInMarginPosition()
        {
            var activeSwapsInMarginPost = new BitfinexPostBase();
            activeSwapsInMarginPost.Request = ActiveMarginSwapsRequestUrl;
            activeSwapsInMarginPost.Nonce = Common.UnixTimeStampUtc().ToString();

            var client = GetRestClient(activeSwapsInMarginPost.Request);
            var response = GetRestResponse(client, activeSwapsInMarginPost);
            var activeSwapsInMarginResponseObj = JsonConvert.DeserializeObject<IList<BitfinexActiveSwapsInMarginResponse>>(response.Content);
            ActiveSwapsUsedInMarginMsg(activeSwapsInMarginResponseObj);

            Logger.Log.InfoFormat("Active Swaps In Margin Pos:");
            foreach (var activeSwaps in activeSwapsInMarginResponseObj)
                Logger.Log.InfoFormat("Swaps used in margin: {0}", activeSwaps.ToString());

            return activeSwapsInMarginResponseObj;
        }
        public BitfinexMarginInfoResponse GetMarginInformation()
        {
            var marginPost = new BitfinexPostBase();
            marginPost.Request = MarginInfoRequstUrl;
            marginPost.Nonce = Common.UnixTimeStampUtc().ToString();

            var client = GetRestClient(marginPost.Request);
            var response = GetRestResponse(client, marginPost);

            var jArr = JsonConvert.DeserializeObject(response.Content) as JArray;
            if (jArr == null || jArr.Count == 0)
                return null;

            var marginInfoStr = jArr[0].ToString();
            var marginInfoResponseObj = JsonConvert.DeserializeObject<BitfinexMarginInfoResponse>(marginInfoStr);
            MarginInformationMsg(marginInfoResponseObj);

            Logger.Log.InfoFormat("Margin Info: {0}", marginInfoResponseObj.ToString());

            return marginInfoResponseObj;
        }
        /// <summary>
        /// This never worked for me...
        /// </summary>
        /// <returns></returns>
        public object GetAccountInformation()
        {
            var accountPost = new BitfinexPostBase();
            accountPost.Request = AccountInfoRequestUrl;
            accountPost.Nonce = Common.UnixTimeStampUtc().ToString();

            var client = GetRestClient(accountPost.Request);
            var response = GetRestResponse(client, accountPost);
            Logger.Log.InfoFormat("Account Information: {0}", response.Content);
            return response.Content;
        }
        public IList<BitfinexBalanceResponse> GetBalances()
        {
            try
            {
                var balancePost = new BitfinexPostBase();
                balancePost.Request = BalanceRequestUrl;
                balancePost.Nonce = Common.UnixTimeStampUtc().ToString();

                var client = GetRestClient(BalanceRequestUrl);
                var response = GetRestResponse(client, balancePost);

                var balancesObj = JsonConvert.DeserializeObject<IList<BitfinexBalanceResponse>>(response.Content);
                BalanceResponseMsg(balancesObj);

                Logger.Log.InfoFormat("Balances:");
                foreach (var balance in balancesObj)
                    Logger.Log.Info(balance);

                return balancesObj;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return null;
            }
        }
        public BitfinexOrderStatusResponse[] GetActiveOrders()
        {
            var activeOrdersPost = new BitfinexPostBase();
            activeOrdersPost.Request = ActiveOrdersRequestUrl;
            activeOrdersPost.Nonce = Common.UnixTimeStampUtc().ToString();

            var client = GetRestClient(activeOrdersPost.Request);
            var response = GetRestResponse(client, activeOrdersPost);
            if (response.Content != "[]" && response.Content.StartsWith("["))
            {
                var activeOrdersResponseObj = JsonConvert.DeserializeObject<BitfinexOrderStatusResponse[]>(response.Content);
                //ActiveOrdersMsg(activeOrdersResponseObj);

                Logger.Log.InfoFormat("Active Orders:");
                foreach (var activeOrder in activeOrdersResponseObj)
                    Logger.Log.InfoFormat("Order: {0}", activeOrder.ToString());

                return activeOrdersResponseObj;
            }
            return null;
        }
        public string CancellAllActiveOrders()
        {
            var url = OrderCancelRequestUrl + CancelAllRequestUrl;
            var cancelAllPost = new BitfinexPostBase();
            cancelAllPost.Request = url;
            cancelAllPost.Nonce = Common.UnixTimeStampUtc().ToString();

            var client = GetRestClient(url);
            var response = GetRestResponse(client, cancelAllPost);
            CancelAllActiveOrdersMsg(response.Content);
            return response.Content;
        }