stellar-deprecated / kelp

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
https://kelpbot.io
Other
1.1k stars 260 forks source link

[3] If short of assets, the error message should be a lot more user friendly #104

Open skirsch opened 5 years ago

skirsch commented 5 years ago

// see a sample bug report here: https://github.com/interstellar/kelp/issues/1

Describe the bug

// A succinct description of the buggy behavior. // This section includes what the bot is doing and why you think it is incorrect.

kelp log says: Feb 07 06:12:46 steve-kelp bash[2072]: 2019/02/07 06:12:46 error in selling sub-strategy: unable to create preceding offers: unable to create new preceding offer: error: (programmer?) unable to create offer but available capacities were more than the attempted offer amounts, sellingCapacity=77297.7136387, incrementalSellAmount=5.0000000, buying Capacity=17976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817154045895351438246423432132688946418276846754670353751698604991 0576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0000000, incrementalBuyAmount=68.6164885

Expected behavior

// A succinct description of what you expected to happen.

Just tell me I need to put more of asset XXX in the account to be able to cover the orders!

Frequency

// How often does this happen? // Unpredictable = it's hard to predict when it will happen // Sometimes = it happens every now and then but there's no pattern to it // Always = it always happens consistently at the same point

The frequency is: ...

Steps To Reproduce

// A concise description of the steps to reproduce the buggy behavior along with screenshots wherever applicable:

Here are the steps to reproduce the issue (see attachments in section below):

  1. Set up your configuration file with these parameters: ...
  2. Start the bot using this command: ... ...

Possible Solution

// Optional, suggest a fix.

This bug can be fixed by ...

Your Environment

// Run kelp version to get the version and build information and paste it here // version: v1.0.0-rc1 // git hash: 1bcc4e9fa4012867a549472dbdf61cb008041305 // build date: 20180813T013016Z // GOOS: linux // GOARCH: amd64

...

Context

// A succinct description of how has this bug has affected you or prevented you from accomplishing what you wanted.

I am unable to ... because of this bug.

Attachments

// Attach any relevant configuration files, logs, tx hashes, etc. here.

nikhilsaraf commented 4 years ago

@debnil To reproduce: 1) run the bot with 1000 “TEST_A” tokens and 2 XLM. Try and run the buy sell strategy from the sample configuration file. Since there is not enough XLM you will see two errors, one is the error indicating that we have run out of assets, the other that it may be a programmer error (which is a red herring). The error message (Hintf) should clearly say we need to deposit more assets.

2) same as above but trade TEST_A vs TEST_B with sufficient balance of both tokens. XLM balance should be 2.0000600 (to account for trustlines). Running the buysell strategy on SDEX testnet will give a similar error to 1 because there will not be enough XLM to pay fees. The error message to be added (Hintf) should clearly say this.