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

new filter: price feed filter, closes #329 #335

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
11 - consolidate drop case for volumeFilter and makerModeFilter
nikhilsaraf committed Jan 8, 2020
commit 046350a2c62975678e2b9b460471d6279d7a0e41
11 changes: 2 additions & 9 deletions plugins/makerModeFilter.go
Original file line number Diff line number Diff line change
@@ -170,13 +170,6 @@ func (f *makerModeFilter) transformOfferMakerMode(
return op, nil
}

// figure out how to convert the offer to a dropped state
if op.OfferID == 0 {
// new offers can be dropped
return nil, nil
} else if op.Amount != "0" {
// modify offers should be converted to delete offers (happens automatically in filterOps)
return nil, nil
}
return nil, fmt.Errorf("unable to transform manageOffer operation: offerID=%d, amount=%s, price=%.7f", op.OfferID, op.Amount, sellPrice)
// we don't want to keep it so return the dropped command
return nil, nil
}
11 changes: 2 additions & 9 deletions plugins/volumeFilter.go
Original file line number Diff line number Diff line change
@@ -203,15 +203,8 @@ func (f *volumeFilter) volumeFilterFn(dailyOTB *VolumeFilterConfig, dailyTBB *Vo
// TODO buying side
}

// convert the offer to a dropped state
if op.OfferID == 0 {
// new offers can be dropped
return nil, nil
} else if op.Amount != "0" {
// modify offers should be converted to delete offers (happens automatically in filterOps)
return nil, nil
}
return nil, fmt.Errorf("unable to transform manageOffer operation: offerID=%d, amount=%s, price=%.7f", op.OfferID, op.Amount, sellPrice)
// we don't want to keep it so return the dropped command
return nil, nil
}

func (c *VolumeFilterConfig) isEmpty() bool {