Write NiceHash bot, make lots of profit

CSZiggy avatar
CSZiggy
Archived posts: 627
Joined: Jan 31, 2018

Re: Write NiceHash bot, make lots of profit

by CSZiggy · · Post #17504

Think this was a better idea back when you could change multiple times per minute to always pick the highest payout coin to static mine.
Pick a coin, when its not the highest anymore, swap to the new high coin.


But now that the system only allows you to change every 12 mins? or whatever it is now the bot wouldn't be able to swap but 4 times per hour.
With the time constraints put on the system not even worth modifying the bots we did have to keep running with that much of a time lapse.
Steve Sokolowski avatar
Steve Sokolowski
Archived posts: 4559
Joined: Aug 27, 2014

Re: Write NiceHash bot, make lots of profit

by Steve Sokolowski · · Post #17506

CSZiggy wrote:Think this was a better idea back when you could change multiple times per minute to always pick the highest payout coin to static mine.
Pick a coin, when its not the highest anymore, swap to the new high coin.


But now that the system only allows you to change every 12 mins? or whatever it is now the bot wouldn't be able to swap but 4 times per hour.
With the time constraints put on the system not even worth modifying the bots we did have to keep running with that much of a time lapse.
We decided to relax that constraint for this week to see what happens. We discovered other issues that were affecting profits and this issue probably did not cause much impact on dynamic miners' profitability.

We reserve the right to reenable the restrictions next week, depending on what we find.
d2391
Archived posts: 6
Joined: Jun 12, 2017

Re: Write NiceHash bot, make lots of profit

by d2391 · · Post #17565

CSZiggy wrote:Think this was a better idea back when you could change multiple times per minute to always pick the highest payout coin to static mine.
Pick a coin, when its not the highest anymore, swap to the new high coin.
So you can make more by targeting the highest payout coin while being in pps mode? Or are you talking about solo mining? I always thought that all shares were equal in pps mode.
bitmonkeys
Archived posts: 3
Joined: Mar 27, 2018

Re: Write NiceHash bot, make lots of profit

by bitmonkeys · · Post #17640

I am trying to connect to the wamp API using WampSharp implementation, but i am getting "AuthenticationException: A call to SSPI failed, see inner exception." on the line

Code:

IDisposable disposable = RunAsync().Result;
this is the code i am using to connect. Is anybody able to help?

Code:

        public static void Main(string[] args)
        {

            IDisposable disposable = RunAsync().Result;
            Console.ReadLine();
            disposable.Dispose();
        }

        private static async Task<IDisposable> RunAsync()
        {
            DefaultWampChannelFactory channelFactory = new DefaultWampChannelFactory();
            IWampClientAuthenticator authenticator;
            authenticator = new WampCraClientAuthenticator(authenticationId: "web", secret: "web");

            const string serverAddress = "wss://live.prohashing.com:443/ws";

            IWampChannel channel =
                channelFactory.CreateJsonChannel(serverAddress, "mining", authenticator);

            channel.RealmProxy.Monitor.ConnectionEstablished +=
        (sender, args) =>
        {
            Console.WriteLine("connected session with ID " + args.SessionId);

            dynamic details = args.WelcomeDetails.OriginalValue.Deserialize<dynamic>();

            Console.WriteLine("authenticated using method '{0}' and provider '{1}'", details.authmethod,
                              details.authprovider);

            Console.WriteLine("authenticated with authid '{0}' and authrole '{1}'", details.authid,
                              details.authrole);
        };

            channel.RealmProxy.Monitor.ConnectionBroken += (sender, args) =>
            {
                dynamic details = args.Details.OriginalValue.Deserialize<dynamic>();
                Console.WriteLine("disconnected " + args.Reason + " " + details.reason + details);
            };

            IWampRealmProxy realmProxy = channel.RealmProxy;

            await channel.Open().ConfigureAwait(false);


            IWampSubject topic =
                realmProxy.Services.GetSubject("profitability_updates");

            IDisposable disposable =
                topic.Subscribe(OnTopic2);

            return disposable;
        }

        private static void OnTopic2(IWampSerializedEvent serializedEvent)
        {
            int[] arguments =
                serializedEvent.Arguments.Select(argument => argument.Deserialize<int>())
                 .ToArray();

            string c =
                serializedEvent.ArgumentsKeywords["c"].Deserialize<string>();

            ComplexContract d =
                serializedEvent.ArgumentsKeywords["d"].Deserialize<ComplexContract>();

            var deserializedArguments =
                new
                {
                    arguments,
                    argumentsKeywords = new
                    {
                        c,
                        d
                    }
                };

            Console.WriteLine("Got event: args: [{0}], kwargs: {{ {1} }}",
                              string.Join(", ", deserializedArguments.arguments),
                              deserializedArguments.argumentsKeywords);
        }

        public class ComplexContract
        {
            [JsonProperty("counter")]
            public int Counter { get; set; }

            [JsonProperty("foo")]
            public int[] Foo { get; set; }

            public override string ToString()
            {
                return $"counter: {Counter}, foo: [{string.Join(", ", Foo)}]";
            }
        }
    }
}
Steve Sokolowski avatar
Steve Sokolowski
Archived posts: 4559
Joined: Aug 27, 2014

Re: Write NiceHash bot, make lots of profit

by Steve Sokolowski · · Post #17647

bitmonkeys wrote:I am trying to connect to the wamp API using WampSharp implementation, but i am getting "AuthenticationException: A call to SSPI failed, see inner exception." on the line

Code:

IDisposable disposable = RunAsync().Result;
this is the code i am using to connect. Is anybody able to help?

Code:

        public static void Main(string[] args)
        {

            IDisposable disposable = RunAsync().Result;
            Console.ReadLine();
            disposable.Dispose();
        }

        private static async Task<IDisposable> RunAsync()
        {
            DefaultWampChannelFactory channelFactory = new DefaultWampChannelFactory();
            IWampClientAuthenticator authenticator;
            authenticator = new WampCraClientAuthenticator(authenticationId: "web", secret: "web");

            const string serverAddress = "wss://live.prohashing.com:443/ws";

            IWampChannel channel =
                channelFactory.CreateJsonChannel(serverAddress, "mining", authenticator);

            channel.RealmProxy.Monitor.ConnectionEstablished +=
        (sender, args) =>
        {
            Console.WriteLine("connected session with ID " + args.SessionId);

            dynamic details = args.WelcomeDetails.OriginalValue.Deserialize<dynamic>();

            Console.WriteLine("authenticated using method '{0}' and provider '{1}'", details.authmethod,
                              details.authprovider);

            Console.WriteLine("authenticated with authid '{0}' and authrole '{1}'", details.authid,
                              details.authrole);
        };

            channel.RealmProxy.Monitor.ConnectionBroken += (sender, args) =>
            {
                dynamic details = args.Details.OriginalValue.Deserialize<dynamic>();
                Console.WriteLine("disconnected " + args.Reason + " " + details.reason + details);
            };

            IWampRealmProxy realmProxy = channel.RealmProxy;

            await channel.Open().ConfigureAwait(false);


            IWampSubject topic =
                realmProxy.Services.GetSubject("profitability_updates");

            IDisposable disposable =
                topic.Subscribe(OnTopic2);

            return disposable;
        }

        private static void OnTopic2(IWampSerializedEvent serializedEvent)
        {
            int[] arguments =
                serializedEvent.Arguments.Select(argument => argument.Deserialize<int>())
                 .ToArray();

            string c =
                serializedEvent.ArgumentsKeywords["c"].Deserialize<string>();

            ComplexContract d =
                serializedEvent.ArgumentsKeywords["d"].Deserialize<ComplexContract>();

            var deserializedArguments =
                new
                {
                    arguments,
                    argumentsKeywords = new
                    {
                        c,
                        d
                    }
                };

            Console.WriteLine("Got event: args: [{0}], kwargs: {{ {1} }}",
                              string.Join(", ", deserializedArguments.arguments),
                              deserializedArguments.argumentsKeywords);
        }

        public class ComplexContract
        {
            [JsonProperty("counter")]
            public int Counter { get; set; }

            [JsonProperty("foo")]
            public int[] Foo { get; set; }

            public override string ToString()
            {
                return $"counter: {Counter}, foo: [{string.Join(", ", Foo)}]";
            }
        }
    }
}
Look for the "innerException" property of that .NET exception and read its "message" property. That should tell you more about the issue.