示例#1
0
        public string Visit(NewFutureRequest msg)
        {
            IEnumerable <KV> param = new KV[]
            {
                new KV("contract_type", Serialization.AsString(msg.Product.FutureType)),
                new KV("amount", Serialization.AsString(msg.Amount.Quantity)),
                new KV("type", Serialization.AsString(msg.Amount.Side, msg.PositionType)),
                new KV("lever_rate", Serialization.AsString(msg.Leverage)),
                new KV("symbol", Serialization.AsString(msg.Product.CoinType, msg.Product.Currency)),
            };

            if (msg.OrderType == OrderType.Limit)
            {
                param = param.Append(new KV("price", Serialization.AsString(msg.Amount.Price)))
                        .Append(new KV("match_price", "0"));
            }
            else
            {
                param = param.Append(new KV("match_price", "1"));
            }
            return(AuthenticatedRequest(msg, param));
        }
示例#2
0
 public string Visit(NewFutureRequest msg)
 {
     return(NewOrder(ProductType.Future, msg.Product.Currency));
 }