Simplify and stabilize trade evaluation #305
No reviewers
Labels
No labels
blocked
breaking
bug
dependencies
duplicate
enhancement
good first issue
help wanted
question
tech debt
testing
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
scion/arbitrader!305
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "simplify-trade-evaluation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Getting rate limiting on this branch but using
fixedExposureseems to prevent it. All the new concurrency callsgetMaximumExposure()too often and that makes an API call to the exchange.@ -0,0 +1,86 @@package com.r307.arbitrader.service.cache;I suggest to return optional instead of null. To avoid possible nasty NPE in the future
@ -0,0 +68,4 @@// add the new key to the cachecache.put(computeCacheKey(exchange, orderId), volume);keys.add(computeCacheKey(exchange, orderId));What is the advantage of using a
Listhere (keys) just to get the size of the cache? Isn'tcache.size()enough? Or worst case we can do something likecache.keySet().size()@ -0,0 +68,4 @@// add the new key to the cachecache.put(computeCacheKey(exchange, orderId), volume);keys.add(computeCacheKey(exchange, orderId));Oh, I guess it is because of the ordering?! Otherwise on the map we have no order guarantee...
@ -0,0 +68,4 @@// add the new key to the cachecache.put(computeCacheKey(exchange, orderId), volume);keys.add(computeCacheKey(exchange, orderId));Correct. The List is to give an ordered way to identify the oldest entry so we can evict it from the cache. But we still need the Map too so we can return arbitrary things from the cache without iterating.
@ -0,0 +1,86 @@package com.r307.arbitrader.service.cache;Good idea. I'm converting all three caches to use
Optional.