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

Fill tracker returns incorrect order action for sdex #193

@nikhilsaraf

Description

@nikhilsaraf

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions