Ejemplo n.º 1
0
        /// <summary>
        /// Ok... so from what I gather is:
        /// If you leverage usd for btc, and the price moved in your favor the trade
        /// you can physically claim the btc in your wallet as yours. You will notice the
        /// object return this function is the same as the GetActiveSwapUsedInMarginPosition
        /// </summary>
        /// <param name="positionId"></param>
        /// <returns></returns>
        public BitfinexMarginPositionResponse ClaimPosition(int positionId)
        {
            var claimPosPost = new BitfinexClaimPositionPost
            {
                Request    = ClaimPosRequestUrl,
                Nonce      = Common.UnixTimeStampUtc().ToString(CultureInfo.InvariantCulture),
                PositionId = positionId
            };

            var response            = GetRestResponse(claimPosPost);
            var claimPosResponseObj = JsonConvert.DeserializeObject <BitfinexMarginPositionResponse>(response);

            Log.Info("Claim Position Id: {0}, Response from Exchange: {1}", positionId, claimPosResponseObj);

            return(claimPosResponseObj);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Ok... so from what I gather is:
        /// If you leverage usd for btc, and the price moved in your favor the trade
        /// you can physically claim the btc in your wallet as yours. You will notice the
        /// object return this function is the same as the GetActiveSwapUsedInMarginPosition
        /// </summary>
        /// <param name="positionId"></param>
        /// <returns></returns>
        public BitfinexMarginPositionResponse ClaimPosition(int positionId)
        {
            var claimPosPost = new BitfinexClaimPositionPost();

            claimPosPost.Request    = ClaimPosRequestUrl;
            claimPosPost.Nonce      = Common.UnixTimeStampUtc().ToString();
            claimPosPost.PositionId = positionId;

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

            var claimPosResponseObj = JsonConvert.DeserializeObject <BitfinexMarginPositionResponse>(response.Content);

            Log.Trace(string.Format("BitfinexApi.ClaimPosition(): Claim Position Id: {0}, Response from Exchange: {1}", positionId, claimPosResponseObj.ToString()));

            return(claimPosResponseObj);
        }