Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Fill tracker returns incorrect order action for sdex #193

Closed
nikhilsaraf opened this issue Jul 1, 2019 · 1 comment
Closed

Fill tracker returns incorrect order action for sdex #193

nikhilsaraf opened this issue Jul 1, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nikhilsaraf
Copy link
Contributor

This needs verification if this is an actual bug or if is already doing the correct thing

Describe the bug

The orderAction for the fill tracker should return 'buy' when the bot has bought the base asset, and 'sell' when the bot has sold the base asset.

I think it is currently doing the opposite.

This affects the fill handlers, in particular the balanced strategy and the mirror strategy.

Expected behavior

I think the correct behavior in this situation is for the bot to return 'buy' when the bot has bought the base asset, and 'sell' when the bot has sold the base asset.

Frequency

The frequency is: always

Steps To Reproduce

  1. Run the sell strategy with fill tracking enabled, this will display "buy" log statements, which is not possible since the bot is only selling. The balance of the base asset goes down, indicating that the fill tracker should treat this as a "sell" Trade.

  2. Mirror strategy should offset "sell" trades with "buy" trades on the backing exchange. This should be reflected in beyond the log lines. the balance of the bot on sdex should reflect this. Currently the log lines will be correct but the balances of the bot will indicate otherwise, similar to the first point above this.

Possible Solution

This bug can be fixed by fixing the getOrderAction() function in sdex.go to do the inverse when checking for trade.BaseIsSeller.

Your Environment

N/A

Context

I am unable to run the mirror strategy correctly or add custom fill tracking handlers because of this bug.

See nikhilsaraf@12c03ce for solution -- need to merge it in to kelp:master

@nikhilsaraf nikhilsaraf added the bug Something isn't working label Jul 1, 2019
@nikhilsaraf nikhilsaraf self-assigned this Jul 1, 2019
@nikhilsaraf nikhilsaraf added this to the v1.8.0 milestone Jul 1, 2019
@nikhilsaraf nikhilsaraf modified the milestones: v1.8.0, v1.7.1 Jul 18, 2019
@nikhilsaraf
Copy link
Contributor Author

turns out that /trades does not surface the correct information and we need to go to /operations to get this by using the link of the related operation from the /trades result. see issue filed for horizon: stellar/go#1514

nikhilsaraf added a commit that referenced this issue Jul 18, 2019
…#200), closes #193

uses /operations to get buyer and seller data which is missing in /trades endpoint
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant