Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOTH "buy or sell cycle" mode idea #673

Open
NemesisZAUK opened this issue Aug 27, 2019 · 5 comments
Open

KOTH "buy or sell cycle" mode idea #673

NemesisZAUK opened this issue Aug 27, 2019 · 5 comments

Comments

@NemesisZAUK
Copy link

Expected Behavior

When starting KOTH strategy bot should either Sell or Buy depending on which of the traded pair has the largest balance. ( Balance must also not = 0 )

Actual Behavior

When starting KOTH strategy Bot attempts to buy and sell at the same time. If one of the traded pair has a 0 balance an error is displayed. "Cannot place order with 0 balance." Then bot is disabled.

##Solution:
Bot should check for the following before trading:

  1. Spread >0
  2. If one of the traded pairs >0 then start with the positive balance either buying or selling.
  3. Bot should operate on a cycle as mentioned below.

Do NOT trade both pairs at the same time. Bot should either buy or sell not both.

For eg:

BTC / BTS Pair: BTS Largest Balance.

  1. Bot starts a cycle,
  2. Checks if spread is >0
  3. Checks for balances on traded pair. Largest balance wins for starting trade.
  4. Bot Sells BTS for BTC
  5. Checks if spread is >0
  6. Bot then Sells BTC for BTS if conditions of spread are met.
  7. Cycle repeats.

Note:
At this time, if you set the KOTH strategy to sell only 90% of BTS in the above example, the bot makes an initial trade then tries to make another with the remaining 10% of BTS, causing you to run out of funds to pay the fees. ( if fees BTS ) This could be remedied by preventing the bot from buying and selling at the same time within a single cycle.

The BUY OR SELL cycle strategy above is a desirable feature for future iterations of DEXBot.

@bitphage
Copy link
Collaborator

Hmm this is a huge change in logic, @PermieBTS we need cabinet input for this.

@NemesisZAUK how would you define "largest balance"? Measure QUOTE value in BASE using current center price and compare to BASE amount?

@PermieBTS
Copy link
Collaborator

This is enhancement would be an additional option for the KOTH strategy correct?

1 Buy
2 Sell
3 Buy AND Sell
4 Buy OR Sell Cycle

We can look at developing this feature after the backlog in other areas is reduced

@bitphage
Copy link
Collaborator

Yeah correct, this could be a separate mode.

@bitphage
Copy link
Collaborator

bitphage commented Sep 3, 2019

@NemesisZAUK in this mode, if order gets partially filled and top price changed, should we move the reminder only? E.g. say we're selling 1000 BTS for BTC, 700 BTS gets filled at 400 sats, 300 BTS reminder. We need to move order down to 390 sats, should we use only the reminder (300 BTS) or place full-sized order?

@NemesisZAUK
Copy link
Author

Hello again.

In the case mentioned above where 70% of the sale has been completed, I would suggest the remaining 300bts order be left as originally placed and a new cycle started with whatever balances are currently available. As we know the prices fluctuate so much the order would be filled soon enough at the original profit margin.

Note:
The above could pose a problem by locking up funds on either one of the traded pair if the price moves too far in either direction, but we could have an option providing some tolerance. Perhaps a % price change option?
eg: Cancel partially filled order if price changes x%

@bitphage bitphage changed the title DEXBot - King of the Hill - Cannot trade with 0 balance. KOTH "buy or sell cycle" mode idea Mar 11, 2020
@bitphage bitphage removed their assignment Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants