mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* Exchanges: Initial implementation after rebase of depth (WIP) * orderbook/buffer: convert and couple orderbook interaction functionality from buffer to orderbook linked list - Use single point reference for orderbook depth * buffer/orderbook: conversion continued (WIP) * exchange: buffer/linkedlist handover (WIP) * Added some tests for yesterday * linkedList: added more testing and trying to figure out broken things * Started tying everything in * continuous integration and testing * orderbook: expanded tests * go mod tidy * Add in different synchornisation levels for protocols Add in timer for the streaming system to reduce updates to datahandler Add in more test code as I integrate more exchanges * Depth: Add tests, add length check to call linked list updating, add in constructor. Linked List: Improve tests, add in checks for zero liquidity on books. Node: Added in cleaner POC, add in contructor. Buffer: Fixed tests, checked benchmarks. * orderbook: reinstate dispatch calls * Addr glorious & madcozbad nits * fix functionality and add tests * Address linterinos * remove label * expanded comment * fix races and and bitmex test * reinstate go routine for alerting changes * rm line :D * fix more tests * Addr glorious nits * rm glorious field * depth: defer unlock to stop deadlock * orderbook: remove unused vars * buffer: fix test to what it should be * nits: madcosbad addr * nits: glorious nits * linkedlist: remove unused params * orderbook: shift time call to outside of push to inline, add in case for update inster price for zero liquidity, nits * orderbook: nits addressed * engine: change stream -> websocket convention and remove unused function * nits: glorious nits * Websocket Buffer: Add verbosity switch * linked list: Add comment * linked list: fix spelling * nits: glorious nits * orderbook: Adds in test and explicit time type with constructor, fix nits * linter * spelling: removed the dere fence * depth: Update alerting mechanism to a more battle tested state * depth: spelling * nits: glorious nits * linked list: match cases * buffer: fix linter issue * golangci: increase timeout by 30 seconds * nodes: update atomic checks * spelling: fix * node: add in commentary * exchanges/syncer: add function to switch over to REST when websocket functionality is not available for a specific asset type * linter: exchange linter issues * syncer: Add in warning * nits: glorious nits * AssetWebsocketSupport: unexport map * Nits: Adrr * rm letter * exchanges: Orderbook verification change for naming, deprecate checksum bypass as it has the potential to obfuscate errors that are at the tail end of the book, add in verification for websocket stream updates * general: fix spelling remove breakpoint * nits: fix more glorious nits until more are found * orderbook: fix tests * orderbook: fix wait tests and add in more checks * nits: addr * orderbook: remove dispatch reference * linkedlist: consolidate bid/ask functions * linked lisdt: remove words * fix spelling
63 lines
1.5 KiB
Go
63 lines
1.5 KiB
Go
package engine
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
|
)
|
|
|
|
// CurrencyPairSyncerConfig stores the currency pair config
|
|
type CurrencyPairSyncerConfig struct {
|
|
SyncTicker bool
|
|
SyncOrderbook bool
|
|
SyncTrades bool
|
|
SyncContinuously bool
|
|
SyncTimeoutREST time.Duration
|
|
SyncTimeoutWebsocket time.Duration
|
|
NumWorkers int
|
|
Verbose bool
|
|
}
|
|
|
|
// ExchangeSyncerConfig stores the exchange syncer config
|
|
type ExchangeSyncerConfig struct {
|
|
SyncDepositAddresses bool
|
|
SyncOrders bool
|
|
}
|
|
|
|
// ExchangeCurrencyPairSyncer stores the exchange currency pair syncer object
|
|
type ExchangeCurrencyPairSyncer struct {
|
|
Cfg CurrencyPairSyncerConfig
|
|
CurrencyPairs []CurrencyPairSyncAgent
|
|
tickerBatchLastRequested map[string]time.Time
|
|
mux sync.Mutex
|
|
initSyncWG sync.WaitGroup
|
|
|
|
initSyncCompleted int32
|
|
initSyncStarted int32
|
|
initSyncStartTime time.Time
|
|
shutdown int32
|
|
}
|
|
|
|
// SyncBase stores information
|
|
type SyncBase struct {
|
|
IsUsingWebsocket bool
|
|
IsUsingREST bool
|
|
IsProcessing bool
|
|
LastUpdated time.Time
|
|
HaveData bool
|
|
NumErrors int
|
|
}
|
|
|
|
// CurrencyPairSyncAgent stores the sync agent info
|
|
type CurrencyPairSyncAgent struct {
|
|
Created time.Time
|
|
Exchange string
|
|
AssetType asset.Item
|
|
Pair currency.Pair
|
|
Ticker SyncBase
|
|
Orderbook SyncBase
|
|
Trade SyncBase
|
|
}
|