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

Maker only mode #101

Merged
merged 30 commits into from
Feb 5, 2019
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2a9f13e
1 - added support for submit mode
nikhilsaraf Jan 16, 2019
ce30d6b
2 - framework support for submit filters
nikhilsaraf Jan 16, 2019
14b4390
t - started implementing sdex filter
nikhilsaraf Jan 17, 2019
68efa68
A - started actual logic of maker mode
nikhilsaraf Jan 18, 2019
51535dc
B
nikhilsaraf Jan 19, 2019
9e53a0c
C
nikhilsaraf Jan 19, 2019
246c9b5
D - untested impl. of shouldKeepOfferMakerMode using topBid/topAsk pr…
nikhilsaraf Jan 23, 2019
f71861d
E - temp refactored to accommodate for transformOfferTakerMode
nikhilsaraf Jan 23, 2019
d4e4666
F only do maker_only mode for now
nikhilsaraf Jan 24, 2019
d87971b
G - convert ops to dropped state (modify to delete op etc.)
nikhilsaraf Jan 24, 2019
cda3a26
H - fix keep logic to count dropped correctly, actually return filter…
nikhilsaraf Jan 24, 2019
6d99478
fix usage of deleteAllOffersAndExit in trade.go
nikhilsaraf Jan 31, 2019
bd79d18
TODO testing
nikhilsaraf Jan 24, 2019
fd90938
fix TODO price when logging
nikhilsaraf Jan 31, 2019
8b73354
incorporate get orderbook call into submitMode's sdexMaker filter
nikhilsaraf Jan 31, 2019
5bbd9ee
default submitMode to empty string
nikhilsaraf Jan 31, 2019
72b2db5
remove numDropped var
nikhilsaraf Jan 31, 2019
6da6162
Revert "remove numDropped var"
nikhilsaraf Jan 31, 2019
7b38d7a
count numTransformed ops, including in list of ops to be submitted
nikhilsaraf Jan 31, 2019
5c96250
log num kept ops
nikhilsaraf Jan 31, 2019
f451ca5
1
nikhilsaraf Jan 31, 2019
cf5262f
2
nikhilsaraf Jan 31, 2019
0694fbd
3 - remove redundant trading account
nikhilsaraf Feb 1, 2019
ecf92e3
4 - untested logic for getting top price excluding trader's offers
nikhilsaraf Feb 1, 2019
2382ac3
5 - log keep value
nikhilsaraf Feb 2, 2019
9cc1a87
6 cleanup
nikhilsaraf Feb 2, 2019
c372fca
7 - cleanup logging of sdexMakerFilter
nikhilsaraf Feb 2, 2019
556c158
8 - new files
nikhilsaraf Feb 2, 2019
6c41262
9 remove TODOs
nikhilsaraf Feb 2, 2019
9c3dade
10 resolve compile errors after moving to api/plugins
nikhilsaraf Feb 2, 2019
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
fix TODO price when logging
nikhilsaraf committed Jan 31, 2019
commit fd909383f534780be8067e42bfa2527356fb2fab
10 changes: 8 additions & 2 deletions trader/submitMode.go
Original file line number Diff line number Diff line change
@@ -84,6 +84,7 @@ func (f *sdexMakerFilter) filterOps(ops []build.TransactionMutator, ob *model.Or
if e != nil {
return nil, fmt.Errorf("could not get sdex assets: %s", e)
}
log.Printf("ob: \nasks=%v, \nbids=%v\n", ob.Asks(), ob.Bids())
topBid := ob.TopBid()
topAsk := ob.TopAsk()

@@ -137,6 +138,7 @@ func (f *sdexMakerFilter) transformOfferMakerMode(
if e != nil {
return nil, false, fmt.Errorf("error when running the isSelling check: %s", e)
}
log.Printf(" ----> isSell: %v\n", isSell)

// TODO test pricing mechanism here manually
sellPrice := float64(op.MO.Price.N) / float64(op.MO.Price.D)
@@ -149,9 +151,13 @@ func (f *sdexMakerFilter) transformOfferMakerMode(
keep = sellPrice > topBid.Price.AsFloat()
log.Printf(" ----> selling, (op price) %.7f > %.7f (topAsk): keep = %v", sellPrice, topBid.Price.AsFloat(), keep)
} else {
keep = true
// TODO always hitting this case even when there is a top bid and a top ask! :(
log.Printf(" ----> no market isSell=%v, op price = %.7f: keep = %v", isSell, sellPrice, keep)
price := sellPrice
if !isSell {
price = 1 / price
}
keep = true
log.Printf(" ----> no market isSell=%v, op price = %.7f: keep = %v", isSell, price, keep)
}

if keep {