Krypto-trading-bot
Krypto-trading-bot copied to clipboard
Sometimes it's good to be a taker -> "Sniper"/scalper option
Hello everyone,
Here is a new idea for an improvement that imho can add a few extra % to Tribeca's profit.
There are two times when it can be interesting to be a taker, the first one is when your asset moves quicker than the fee you would pay remaining a 'taker' + the spread. The idea is that it's not rational to keep your asset to save 0.2% in fees when it's falling by 3 or 4% that or to not jump in when it's going up very quickly. This case is discussed in the Safeties issue https://github.com/ctubio/tribeca/issues/32 so no need to come back here too much.
The second case is when there are big "hollows" in the market. Thanks to @ctubio great work with the bw? option Tribeca never creates hollow but it's not the case of other traders around.
I believe we can use that to our advantage in precise situations. It needs a bit of explanation so know when it works and when it doesn't so here I go. I explain first the general idea, in a second time the conditions to respect and in a third time some ideas about implementation.
General explanation:
This situation happens when the best bid or best offer on the market is far away from the 2nd best bid or best ask. The idea is to match this order being a taker and resell it just below the 2nd best ask and vice versa.
Here is an example on ZEC/USD:
You can see that between the order at 272 and the one at 275.35 there is a big hollow of 1.23% exactly.
If we can match the order and sell it at 275.35 we can make a good profit of: 1.23 (size of the hollow) - 0.2 (buy taker fee) - 0.1 (sell maker fee) = 0.93%
Very interesting for just playing a bit with the market!
Conditions for it to work and implementation:
Now that we have seen the general functioning we have to remember that it is not interesting all the time and that we need to comply certain conditions to take the risk.
-
the orders we're matching should be smaller or equal our orderSize: If we don't match this condition, we just buy/sell and are not sure to ever be able to sell higher/lower.
-
Our position + the order we want to match should respect pdiv + tbp
-
Following 2) If APR is on or pdiv + tbp is not respected we should just be able to do it on the depleted side.
-
It might be interesting to check for volatility with STDEV if the "hollow" is big enough (ie. hollow > to STDEV)
Some implementation ideas:
What we need to do here is to calculate the % between the best.bid and the second best bid and the best ask and the second best ask. (Excluding ourselves!)
Then check if the conditions are met (described above) and verifying that the hollow is superior at the target put by the user. We can discuss the conditions maybe it's interesting to someone to buy even if the order is bigger than its order size because it hopes that someone else will try to get that order as well.
When we need to send a limit order (not post only) of the size and at the price of the order. I really think a limit order is way better than a market order here because if someone outrun us we would not send the order out to the unknown. Time is going to be crucial for that to work so it will not be surprising if we have to fight for those orders against other bots.
Tell me what you think in my opinion it can really boost Tribeca and even 'trick' other bots while increasing width. I believe I'm not ultra clear on this post so please ask if you have questions.
Ps: I think it goes well with the name 'sniper' because we hide for a long time and "shoot" the first order if all the conditions are met.
yea im arround this idea for the last month xD thanks for the write up'¡! will carefully read it, let me come back to you after sort my ideas and intersect them with yours :dancer:
This and #32 are two issues, that if resolved, would allow me to let Tribeca manage a larger portion of my BTC stack in active trading.
ok so my idea was to make a Sniper shoot only if profit % is > than X configurable value.
let me reread yours and see what can be done :D
@ctubio This option looks like a lot to what I'm describing in the safety post ;)
Look at the long comment I added I develop the idea in length but replacing profit by the evolution of the price. I also join an explanation at the end to beegmon why it is preferable to use the evolution of the price rather than the evolution of our profit/loss as a base to do some sniper shots !
right let me reread your both posts before continue keystroking the keyboard :dancer:
ok understood your point 2 of Sniper shoots over indefense lonely top orders in the market always that % is greater than fees, nice'¡ (and awesome idea)
Yes exactly!
But here we look at the difference between the top order and the 2nd top to calculate the % to see if it's worth it! :)
I'm happy you like it :D
Is this still being considered? Adjustable % profit for sniper orders would be great, but I'd be more than happy with even just a calculation that adds the fee % and we can just modify pongwidth. Would be very useful for locking in profits.