ftx: add basic exchange order execution limits for lower bound (#725)

* ftx: add basic exchange order execution limits for lower bound

* ftx/binance: conform to standard logger output

* ftx: fix field from SizeIncrement -> MinProvideSize

* limits: fix whoopsie

* limit: add tests

* ftx: fix comment
This commit is contained in:
Ryan O'Hara-Reid
2021-07-29 09:15:02 +10:00
committed by GitHub
parent a6e158ab0c
commit 9ea72f2193
7 changed files with 163 additions and 22 deletions

View File

@@ -20,6 +20,22 @@ func TestLoadLimits(t *testing.T) {
t.Fatalf("expected error %v but received %v", errCannotLoadLimit, err)
}
invalidAsset := []MinMaxLevel{
{
Pair: btcusd,
MinPrice: 100000,
MaxPrice: 1000000,
MinAmount: 1,
MaxAmount: 10,
},
}
err = e.LoadLimits(invalidAsset)
if !errors.Is(err, asset.ErrNotSupported) {
t.Fatalf("expected error %v but received %v",
asset.ErrNotSupported,
err)
}
newLimits := []MinMaxLevel{
{
Pair: btcusd,
@@ -79,6 +95,32 @@ func TestLoadLimits(t *testing.T) {
if !errors.Is(err, nil) {
t.Fatalf("expected error %v but received %v", nil, err)
}
noCompare := []MinMaxLevel{
{
Pair: btcusd,
Asset: asset.Spot,
MinAmount: 10,
},
}
err = e.LoadLimits(noCompare)
if !errors.Is(err, nil) {
t.Fatalf("expected error %v but received %v", nil, err)
}
noCompare = []MinMaxLevel{
{
Pair: btcusd,
Asset: asset.Spot,
MinPrice: 10,
},
}
err = e.LoadLimits(noCompare)
if !errors.Is(err, nil) {
t.Fatalf("expected error %v but received %v", nil, err)
}
}
func TestGetOrderExecutionLimits(t *testing.T) {