├── vendor ├── github.com │ ├── modern-go │ │ ├── reflect2 │ │ │ ├── reflect2_amd64.s │ │ │ ├── relfect2_386.s │ │ │ ├── relfect2_arm.s │ │ │ ├── relfect2_arm64.s │ │ │ ├── relfect2_mipsx.s │ │ │ ├── relfect2_s390x.s │ │ │ ├── relfect2_amd64p32.s │ │ │ ├── relfect2_mips64x.s │ │ │ ├── relfect2_ppc64x.s │ │ │ ├── .gitignore │ │ │ ├── go_below_17.go │ │ │ ├── go_above_17.go │ │ │ ├── .travis.yml │ │ │ ├── go_below_19.go │ │ │ ├── go_above_19.go │ │ │ ├── test.sh │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ └── safe_struct.go │ │ └── concurrent │ │ │ ├── README.md │ │ │ ├── executor.go │ │ │ ├── go_above_19.go │ │ │ └── go_below_19.go │ ├── piquette │ │ └── finance-go │ │ │ ├── VERSION │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── Makefile │ │ │ └── Gopkg.toml │ ├── go-test │ │ └── deep │ │ │ ├── .gitignore │ │ │ └── SECURITY.md │ ├── gorilla │ │ └── websocket │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── .editorconfig │ │ │ ├── tls_handshake.go │ │ │ └── mask_safe.go │ ├── preichenberger │ │ └── go-coinbasepro │ │ │ └── v2 │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── error.go │ │ │ ├── fees.go │ │ │ ├── currency.go │ │ │ ├── transfer.go │ │ │ ├── stringnumber.go │ │ │ └── fill.go │ ├── jackc │ │ ├── pgconn │ │ │ └── .gitignore │ │ ├── pgio │ │ │ ├── .travis.yml │ │ │ ├── doc.go │ │ │ ├── README.md │ │ │ └── write.go │ │ ├── pgpassfile │ │ │ ├── .travis.yml │ │ │ └── README.md │ │ ├── pgproto3 │ │ │ └── v2 │ │ │ │ ├── .travis.yml │ │ │ │ ├── doc.go │ │ │ │ ├── README.md │ │ │ │ ├── chunkreader.go │ │ │ │ ├── notice_response.go │ │ │ │ ├── big_endian.go │ │ │ │ ├── sync.go │ │ │ │ ├── flush.go │ │ │ │ └── no_data.go │ │ ├── chunkreader │ │ │ └── v2 │ │ │ │ ├── .travis.yml │ │ │ │ └── README.md │ │ ├── pgservicefile │ │ │ ├── .travis.yml │ │ │ └── README.md │ │ ├── pgx │ │ │ └── v4 │ │ │ │ ├── .gitignore │ │ │ │ └── messages.go │ │ └── pgtype │ │ │ ├── typed_range_gen.sh │ │ │ ├── README.md │ │ │ ├── typed_multirange_gen.sh │ │ │ ├── cidr.go │ │ │ └── database_sql.go │ ├── sirupsen │ │ └── logrus │ │ │ ├── .gitignore │ │ │ ├── terminal_check_js.go │ │ │ ├── terminal_check_appengine.go │ │ │ ├── terminal_check_no_terminal.go │ │ │ ├── terminal_check_solaris.go │ │ │ ├── terminal_check_unix.go │ │ │ ├── appveyor.yml │ │ │ ├── terminal_check_bsd.go │ │ │ ├── terminal_check_notappengine.go │ │ │ ├── .travis.yml │ │ │ ├── terminal_check_windows.go │ │ │ ├── doc.go │ │ │ └── buffer_pool.go │ ├── jinzhu │ │ ├── now │ │ │ ├── Guardfile │ │ │ └── time.go │ │ ├── copier │ │ │ └── errors.go │ │ └── inflection │ │ │ └── wercker.yml │ ├── json-iterator │ │ └── go │ │ │ ├── .codecov.yml │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── test.sh │ │ │ ├── build.sh │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── fuzzy_mode_convert_table.md │ │ │ └── jsoniter.go │ ├── mattn │ │ └── go-sqlite3 │ │ │ ├── .codecov.yml │ │ │ ├── .gitignore │ │ │ ├── sqlite3_solaris.go │ │ │ ├── sqlite3_opt_fts5.go │ │ │ ├── sqlite3_opt_math_functions.go │ │ │ ├── sqlite3_opt_os_trace.go │ │ │ ├── sqlite3_opt_stat4.go │ │ │ ├── sqlite3_opt_introspect.go │ │ │ ├── sqlite3_opt_secure_delete.go │ │ │ ├── sqlite3_opt_foreign_keys.go │ │ │ ├── sqlite3_opt_vacuum_full.go │ │ │ ├── sqlite3_opt_vacuum_incr.go │ │ │ ├── sqlite3_opt_secure_delete_fast.go │ │ │ ├── sqlite3_opt_allow_uri_authority.go │ │ │ ├── sqlite3_opt_app_armor.go │ │ │ ├── sqlite3_other.go │ │ │ ├── sqlite3_windows.go │ │ │ ├── sqlite3_opt_column_metadata.go │ │ │ ├── sqlite3_opt_preupdate.go │ │ │ ├── sqlite3_opt_serialize_omit.go │ │ │ ├── sqlite3_opt_icu.go │ │ │ ├── sqlite3_load_extension_omit.go │ │ │ ├── sqlite3_libsqlite3.go │ │ │ └── sqlite3_opt_preupdate_omit.go │ ├── valyala │ │ ├── fasthttp │ │ │ ├── .gitignore │ │ │ ├── fasthttputil │ │ │ │ ├── doc.go │ │ │ │ ├── ecdsa.key │ │ │ │ └── ecdsa.pem │ │ │ ├── bytesconv_32.go │ │ │ ├── bytesconv_64.go │ │ │ ├── stackless │ │ │ │ └── doc.go │ │ │ ├── TODO │ │ │ ├── uri_unix.go │ │ │ ├── uri_windows.go │ │ │ ├── coarseTime.go │ │ │ ├── nocopy.go │ │ │ └── methods.go │ │ └── bytebufferpool │ │ │ ├── doc.go │ │ │ ├── .travis.yml │ │ │ └── README.md │ ├── shopspring │ │ └── decimal │ │ │ ├── .gitignore │ │ │ └── .travis.yml │ ├── andybalholm │ │ └── brotli │ │ │ ├── util.go │ │ │ ├── README.md │ │ │ ├── find_match_length.go │ │ │ ├── symbol_list.go │ │ │ ├── encoder_dict.go │ │ │ └── cluster.go │ ├── buger │ │ └── jsonparser │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── Dockerfile │ │ │ └── bytes_safe.go │ ├── falzm │ │ └── golang-ring │ │ │ ├── makefile │ │ │ ├── .gitignore │ │ │ └── README.md │ ├── go-numb │ │ └── go-ftx │ │ │ ├── rest │ │ │ ├── interface.go │ │ │ ├── errors.go │ │ │ ├── private │ │ │ │ ├── options │ │ │ │ │ ├── my-quotes.go │ │ │ │ │ ├── cancel-quote.go │ │ │ │ │ ├── accept-quote.go │ │ │ │ │ ├── my-quote-request.go │ │ │ │ │ ├── common.go │ │ │ │ │ ├── positons.go │ │ │ │ │ ├── modify-quote-request.go │ │ │ │ │ └── trades.go │ │ │ │ ├── wallet │ │ │ │ │ ├── balances-all.go │ │ │ │ │ ├── coins.go │ │ │ │ │ ├── deposit-address.go │ │ │ │ │ ├── balances.go │ │ │ │ │ ├── withdraw.go │ │ │ │ │ └── withdraw-histories.go │ │ │ │ ├── leveraged │ │ │ │ │ ├── token.go │ │ │ │ │ └── balances.go │ │ │ │ ├── subaccount │ │ │ │ │ ├── delete.go │ │ │ │ │ ├── all.go │ │ │ │ │ ├── change.go │ │ │ │ │ ├── balance.go │ │ │ │ │ └── create.go │ │ │ │ ├── spotmargin │ │ │ │ │ ├── get-borrow-rates.go │ │ │ │ │ ├── get-lending-rates.go │ │ │ │ │ ├── submit-lending-offer.go │ │ │ │ │ ├── get-lending-info.go │ │ │ │ │ ├── get-borrow-history.go │ │ │ │ │ └── get-lending-history.go │ │ │ │ ├── account │ │ │ │ │ └── leverage.go │ │ │ │ ├── orders │ │ │ │ │ ├── cancel.go │ │ │ │ │ ├── cancel-all.go │ │ │ │ │ └── get-open-trigger-order.go │ │ │ │ └── funding │ │ │ │ │ └── funding.go │ │ │ ├── client.go │ │ │ └── public │ │ │ │ └── markets │ │ │ │ └── orderbook.go │ │ │ └── types │ │ │ └── models.go │ ├── google │ │ └── uuid │ │ │ ├── CONTRIBUTORS │ │ │ ├── doc.go │ │ │ ├── node_js.go │ │ │ └── README.md │ ├── lfritz │ │ └── env │ │ │ └── .travis.yml │ ├── dustin │ │ └── go-humanize │ │ │ ├── humanize.go │ │ │ ├── ordinals.go │ │ │ ├── .travis.yml │ │ │ ├── big.go │ │ │ └── commaf.go │ ├── sklinkert │ │ ├── circularbuffer │ │ │ ├── .gitignore │ │ │ └── README.md │ │ └── igmarkets │ │ │ └── helper.go │ ├── AMekss │ │ └── assert │ │ │ ├── .gitignore │ │ │ ├── boolean.go │ │ │ ├── .travis.yml │ │ │ ├── inclusion.go │ │ │ └── formatters.go │ └── markcheno │ │ └── go-talib │ │ └── .gitignore ├── gorm.io │ ├── driver │ │ ├── sqlite │ │ │ ├── .gitignore │ │ │ ├── errors.go │ │ │ └── README.md │ │ └── postgres │ │ │ └── README.md │ └── gorm │ │ ├── clause │ │ ├── with.go │ │ ├── delete.go │ │ ├── from.go │ │ ├── returning.go │ │ ├── update.go │ │ ├── insert.go │ │ └── locking.go │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── callbacks │ │ ├── raw.go │ │ ├── row.go │ │ ├── transaction.go │ │ ├── interfaces.go │ │ └── callmethod.go │ │ ├── schema │ │ └── pool.go │ │ ├── model.go │ │ └── migrator │ │ └── table_type.go └── golang.org │ └── x │ ├── sys │ ├── unix │ │ ├── .gitignore │ │ ├── ptrace_ios.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── ptrace_darwin.go │ │ ├── constants.go │ │ ├── mmap_nomremap.go │ │ ├── endian_big.go │ │ ├── sysvshm_unix_other.go │ │ ├── asm_aix_ppc64.s │ │ ├── syscall_linux_gc_arm.go │ │ ├── endian_little.go │ │ ├── asm_solaris_amd64.s │ │ ├── readdirent_getdents.go │ │ ├── pagesize_unix.go │ │ ├── aliases.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo_linux_amd64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_hurd_386.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sysvshm_linux.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── race0.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_hurd.go │ │ ├── zptrace_linux_arm64.go │ │ ├── syscall_unix_gc.go │ │ ├── race.go │ │ ├── readdirent_getdirentries.go │ │ ├── asm_openbsd_mips64.s │ │ ├── bluetooth_linux.go │ │ ├── asm_bsd_arm.s │ │ ├── dev_darwin.go │ │ ├── env_unix.go │ │ ├── asm_bsd_386.s │ │ ├── dev_aix_ppc.go │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_amd64.s │ │ ├── fcntl_darwin.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── dev_zos.go │ │ ├── fdset.go │ │ ├── dev_aix_ppc64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ └── dev_netbsd.go │ └── windows │ │ ├── empty.s │ │ ├── aliases.go │ │ ├── mksyscall.go │ │ ├── race0.go │ │ ├── str.go │ │ ├── race.go │ │ ├── eventlog.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm64.go │ │ ├── types_windows_386.go │ │ └── types_windows_arm.go │ ├── text │ ├── secure │ │ ├── bidirule │ │ │ ├── bidirule10.0.0.go │ │ │ └── bidirule9.0.0.go │ │ └── precis │ │ │ └── doc.go │ ├── internal │ │ └── language │ │ │ ├── common.go │ │ │ ├── coverage.go │ │ │ └── compact.go │ └── width │ │ ├── trieval.go │ │ └── kind_string.go │ └── net │ └── proxy │ └── direct.go ├── docs ├── overview.png ├── backtest-result.png └── backtest-equity-curve.png ├── docker └── zoneinfo.zip ├── internal ├── broker │ ├── backtest │ │ └── README.md │ ├── ftx │ │ └── README.md │ ├── order_test.go │ └── broker.go ├── paperwallet │ └── README.md └── trader │ └── performance_tracking_test.go ├── pkg ├── chart │ ├── amcharts │ │ └── assets │ │ │ └── Makefile │ ├── chart.go │ └── plotly │ │ └── assets │ │ └── chart.html ├── indicator │ ├── indicator.go │ └── sma │ │ ├── sma.go │ │ └── sma_test.go ├── tick │ └── tick_test.go ├── volatility │ └── volatility.go ├── performance │ └── performance.go └── eo │ └── eo_test.go ├── .gitignore ├── cmd └── backtesting │ └── run.sh └── .github ├── dependabot.yml └── workflows └── ci.yaml /vendor/github.com/modern-go/reflect2/reflect2_amd64.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_386.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm64.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mipsx.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_s390x.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mips64x.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/piquette/finance-go/VERSION: -------------------------------------------------------------------------------- 1 | 1.0.0 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-test/deep/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.out 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.gitignore: -------------------------------------------------------------------------------- 1 | coverage.coverprofile 2 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgconn/.gitignore: -------------------------------------------------------------------------------- 1 | .envrc 2 | vendor/ 3 | .vscode 4 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /coverage.txt 3 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | vendor 3 | 4 | .idea/ 5 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/with.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type With struct{} 4 | -------------------------------------------------------------------------------- /docs/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bullTo/go-trading-bot/HEAD/docs/overview.png -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/now/Guardfile: -------------------------------------------------------------------------------- 1 | guard 'gotest' do 2 | watch(%r{\.go$}) 3 | end 4 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "output_tests/.*" 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/README.md: -------------------------------------------------------------------------------- 1 | # concurrent 2 | concurrency utilities 3 | -------------------------------------------------------------------------------- /docker/zoneinfo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bullTo/go-trading-bot/HEAD/docker/zoneinfo.zip -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | skip-dirs: 3 | - examples/*.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /bug_test.go 3 | /coverage.txt 4 | /.idea 5 | -------------------------------------------------------------------------------- /vendor/github.com/piquette/finance-go/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .env 3 | *.test 4 | *.coverprofile 5 | -------------------------------------------------------------------------------- /docs/backtest-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bullTo/go-trading-bot/HEAD/docs/backtest-result.png -------------------------------------------------------------------------------- /docs/backtest-equity-curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bullTo/go-trading-bot/HEAD/docs/backtest-equity-curve.png -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: off 4 | patch: off 5 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/.gitignore: -------------------------------------------------------------------------------- 1 | TODO* 2 | documents 3 | coverage.txt 4 | _book 5 | .idea 6 | vendor 7 | .vscode 8 | -------------------------------------------------------------------------------- /vendor/github.com/piquette/finance-go/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.0.0 - 2018-09-01 4 | * Initial version 5 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | *.pprof 3 | *.fasthttp.gz 4 | *.fasthttp.br 5 | .idea 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/fasthttputil/doc.go: -------------------------------------------------------------------------------- 1 | // Package fasthttputil provides utility functions for fasthttp. 2 | package fasthttputil 3 | -------------------------------------------------------------------------------- /vendor/github.com/shopspring/decimal/.gitignore: -------------------------------------------------------------------------------- 1 | .git 2 | *.swp 3 | 4 | # IntelliJ 5 | .idea/ 6 | *.iml 7 | 8 | # VS code 9 | *.code-workspace 10 | -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/brotli/util.go: -------------------------------------------------------------------------------- 1 | package brotli 2 | 3 | func assert(cond bool) { 4 | if !cond { 5 | panic("assertion failure") 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgio/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | 3 | package logrus 4 | 5 | func isTerminal(fd int) bool { 6 | return false 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgpassfile/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/bytesconv_32.go: -------------------------------------------------------------------------------- 1 | // +build !amd64,!arm64,!ppc64,!ppc64le 2 | 3 | package fasthttp 4 | 5 | const ( 6 | maxHexIntChars = 7 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/bytesconv_64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 arm64 ppc64 ppc64le 2 | 3 | package fasthttp 4 | 5 | const ( 6 | maxHexIntChars = 15 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/chunkreader/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgservicefile/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/executor.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import "context" 4 | 5 | type Executor interface { 6 | Go(handler func(ctx context.Context)) 7 | } -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | script: 5 | - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && go test ./...' 6 | -------------------------------------------------------------------------------- /internal/broker/backtest/README.md: -------------------------------------------------------------------------------- 1 | # Backtest 2 | 3 | Backtest runs a simulation of historical prices. It uses `paperwallet` for position managament and feeds the ticks into `trader`. -------------------------------------------------------------------------------- /vendor/github.com/buger/jsonparser/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.test 3 | 4 | *.out 5 | 6 | *.mprof 7 | 8 | .idea 9 | 10 | vendor/github.com/buger/goterm/ 11 | prof.cpu 12 | prof.mem 13 | -------------------------------------------------------------------------------- /vendor/github.com/falzm/golang-ring/makefile: -------------------------------------------------------------------------------- 1 | .PHONY: ring test doc 2 | 3 | ring: test doc 4 | 5 | test: 6 | go fmt 7 | go test -v 8 | 9 | doc: 10 | godocdown > README.md 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/interface.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | type Requester interface { 4 | Path() string 5 | Method() string 6 | Query() string 7 | Payload() []byte 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | bmatsuo 3 | shawnps 4 | theory 5 | jboverfelt 6 | dsymonds 7 | cd1 8 | wallclockbuilder 9 | dansouza 10 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/stackless/doc.go: -------------------------------------------------------------------------------- 1 | // Package stackless provides functionality that may save stack space 2 | // for high number of concurrently running goroutines. 3 | package stackless 4 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | type Map struct { 8 | sync.Map 9 | } 10 | 11 | func NewMap() *Map { 12 | return &Map{} 13 | } -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_17.go: -------------------------------------------------------------------------------- 1 | //+build !go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/buger/jsonparser/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | arch: 3 | - amd64 4 | - ppc64le 5 | go: 6 | - 1.7.x 7 | - 1.8.x 8 | - 1.9.x 9 | - 1.10.x 10 | - 1.11.x 11 | script: go test -v ./. 12 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/error.go: -------------------------------------------------------------------------------- 1 | package coinbasepro 2 | 3 | type Error struct { 4 | Message string `json:"message"` 5 | } 6 | 7 | func (e Error) Error() string { 8 | return e.Message 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go: -------------------------------------------------------------------------------- 1 | // +build js nacl plan9 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.exe 3 | *.dll 4 | *.o 5 | 6 | # VSCode 7 | .vscode 8 | 9 | # Exclude from upgrade 10 | upgrade/*.c 11 | upgrade/*.h 12 | 13 | # Exclude upgrade binary 14 | upgrade/upgrade 15 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/TODO: -------------------------------------------------------------------------------- 1 | - SessionClient with referer and cookies support. 2 | - ProxyHandler similar to FSHandler. 3 | - WebSockets. See https://tools.ietf.org/html/rfc6455 . 4 | - HTTP/2.0. See https://tools.ietf.org/html/rfc7540 . 5 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_17.go: -------------------------------------------------------------------------------- 1 | //+build go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | //go:linkname resolveTypeOff reflect.resolveTypeOff 8 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer 9 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgio/doc.go: -------------------------------------------------------------------------------- 1 | // Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. 2 | /* 3 | pgio provides functions for appending integers to a []byte while doing byte 4 | order conversion. 5 | */ 6 | package pgio 7 | -------------------------------------------------------------------------------- /vendor/github.com/lfritz/env/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | before_install: 4 | go get github.com/golang/lint/golint 5 | 6 | script: 7 | - go test -v ./... 8 | - golint -set_exit_status ./... 9 | - go vet ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8.x 5 | - 1.x 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | 10 | script: 11 | - ./test.sh 12 | 13 | after_success: 14 | - bash <(curl -s https://codecov.io/bash) 15 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package pgproto3 is a encoder and decoder of the PostgreSQL wire protocol version 3. 2 | // 3 | // See https://www.postgresql.org/docs/current/protocol-message-formats.html for meanings of the different messages. 4 | package pgproto3 5 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/now/time.go: -------------------------------------------------------------------------------- 1 | package now 2 | 3 | import "time" 4 | 5 | func formatTimeToList(t time.Time) []int { 6 | hour, min, sec := t.Clock() 7 | year, month, day := t.Date() 8 | return []int{t.Nanosecond(), sec, min, hour, day, int(month), year} 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shopspring/decimal/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | arch: 4 | - amd64 5 | - ppc64le 6 | 7 | go: 8 | - 1.7.x 9 | - 1.14.x 10 | - 1.15.x 11 | - 1.16.x 12 | - 1.17.x 13 | - tip 14 | 15 | install: 16 | - go build . 17 | 18 | script: 19 | - go test -v 20 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/fasthttputil/ecdsa.key: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIBpQbZ6a5jL1Yh4wdP6yZk4MKjYWArD/QOLENFw8vbELoAoGCCqGSM49 3 | AwEHoUQDQgAEKQCZWgE2IBhb47ot8MIs1D4KSisHYlZ41IWyeutpjb0fjwwIhimh 4 | pl1Qld1/d2j3Z3vVyfa5yD+ncV7qCFZuSg== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/uri_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package fasthttp 4 | 5 | func addLeadingSlash(dst, src []byte) []byte { 6 | // add leading slash for unix paths 7 | if len(src) == 0 || src[0] != '/' { 8 | dst = append(dst, '/') 9 | } 10 | 11 | return dst 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/uri_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package fasthttp 4 | 5 | func addLeadingSlash(dst, src []byte) []byte { 6 | // zero length and "C:/" case 7 | if len(src) == 0 || (len(src) > 2 && src[1] != ':') { 8 | dst = append(dst, '/') 9 | } 10 | 11 | return dst 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8.x 5 | - 1.x 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | - go get -t -v github.com/modern-go/reflect2-tests/... 10 | 11 | script: 12 | - ./test.sh 13 | 14 | after_success: 15 | - bash <(curl -s https://codecov.io/bash) 16 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_solaris.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | // IsTerminal returns true if the given file descriptor is a terminal. 8 | func isTerminal(fd int) bool { 9 | _, err := unix.IoctlGetTermio(fd, unix.TCGETA) 10 | return err == nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/errors.go: -------------------------------------------------------------------------------- 1 | package sqlite 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrConstraintsNotImplemented = errors.New("constraints not implemented on sqlite, consider using DisableForeignKeyConstraintWhenMigrating, more details https://github.com/go-gorm/gorm/wiki/GORM-V2-Release-Note-Draft#all-new-migrator") 7 | ) 8 | -------------------------------------------------------------------------------- /pkg/chart/amcharts/assets/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PHONY: deploy 3 | deploy: 4 | aws s3 cp ../chart.html s3://at-data/chart.html 5 | # aws s3 cp ../candles.csv s3://at-data/candles.csv 6 | aws s3api put-object-acl --bucket at-data --key chart.html --acl public-read 7 | # aws s3api put-object-acl --bucket at-data --key candles.csv --acl public-read 8 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux aix zos 2 | // +build !js 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TCGETS 9 | 10 | func isTerminal(fd int) bool { 11 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 12 | return err == nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/humanize.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package humanize converts boring ugly numbers to human-friendly strings and back. 3 | 4 | Durations can be turned into strings such as "3 days ago", numbers 5 | representing sizes like 82854982 into useful strings like, "83 MB" or 6 | "79 MiB" (whichever you prefer). 7 | */ 8 | package humanize 9 | -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/brotli/README.md: -------------------------------------------------------------------------------- 1 | This package is a brotli compressor and decompressor implemented in Go. 2 | It was translated from the reference implementation (https://github.com/google/brotli) 3 | with the `c2go` tool at https://github.com/andybalholm/c2go. 4 | 5 | I am using it in production with https://github.com/andybalholm/redwood. 6 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/doc.go: -------------------------------------------------------------------------------- 1 | // Package bytebufferpool implements a pool of byte buffers 2 | // with anti-fragmentation protection. 3 | // 4 | // The pool may waste limited amount of memory due to fragmentation. 5 | // This amount equals to the maximum total size of the byte buffers 6 | // in concurrent use. 7 | package bytebufferpool 8 | -------------------------------------------------------------------------------- /pkg/indicator/indicator.go: -------------------------------------------------------------------------------- 1 | package indicator 2 | 3 | import ( 4 | "errors" 5 | "github.com/sklinkert/at/pkg/ohlc" 6 | ) 7 | 8 | type Indicator interface { 9 | Insert(o *ohlc.OHLC) 10 | ValueResultKeys() []string 11 | Value() (map[string]float64, error) 12 | } 13 | 14 | var ErrNotEnoughData = errors.New("not enough data to calculate indicator") 15 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | platform: x64 3 | clone_folder: c:\gopath\src\github.com\sirupsen\logrus 4 | environment: 5 | GOPATH: c:\gopath 6 | branches: 7 | only: 8 | - master 9 | install: 10 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 11 | - go version 12 | build_script: 13 | - go get -t 14 | - go test 15 | -------------------------------------------------------------------------------- /pkg/chart/chart.go: -------------------------------------------------------------------------------- 1 | package chart 2 | 3 | import ( 4 | "github.com/sklinkert/at/internal/broker" 5 | "github.com/sklinkert/at/pkg/ohlc" 6 | "io" 7 | ) 8 | 9 | type Chart interface { 10 | OnPosition(position broker.Position) 11 | OnCandle(candle ohlc.OHLC) 12 | RenderChart(w io.Writer) error 13 | RenderChartToHTML() (string, error) 14 | Start() error 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype, cap) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd netbsd openbsd 2 | // +build !js 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TIOCGETA 9 | 10 | func isTerminal(fd int) bool { 11 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 12 | return err == nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,!windows,!nacl,!plan9 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func checkIfTerminal(w io.Writer) bool { 11 | switch v := w.(type) { 12 | case *os.File: 13 | return isTerminal(int(v.Fd())) 14 | default: 15 | return false 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/json-iterator/go $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6 5 | 6 | script: 7 | # build test for supported platforms 8 | - GOOS=linux go build 9 | - GOOS=darwin go build 10 | - GOOS=freebsd go build 11 | - GOOS=windows go build 12 | - GOARCH=386 go build 13 | 14 | # run tests on a standard platform 15 | - go test -v ./... 16 | -------------------------------------------------------------------------------- /internal/paperwallet/README.md: -------------------------------------------------------------------------------- 1 | # Paperwallet 2 | 3 | A paperwallet can be used any broker implementation. It's useful for brokers that don't offer testing accounts for trading without real money. It keeps track of all trades (broker.Positions), trading fees, and the balance. 4 | 5 | For example the broker `backtest` consists of a paperwallet and reading ticks from various sources. 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/errors.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // APIError return the api error 8 | type APIError struct { 9 | Status int 10 | Message string 11 | } 12 | 13 | // Error return the error message 14 | func (e APIError) Error() string { 15 | return fmt.Sprintf("APIError: status=%d, message=%s", e.Status, e.Message) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/copier/errors.go: -------------------------------------------------------------------------------- 1 | package copier 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrInvalidCopyDestination = errors.New("copy destination is invalid") 7 | ErrInvalidCopyFrom = errors.New("copy from is invalid") 8 | ErrMapKeyNotMatch = errors.New("map's key type doesn't match") 9 | ErrNotSupported = errors.New("not supported") 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/sirupsen/logrus 3 | git: 4 | depth: 1 5 | env: 6 | - GO111MODULE=on 7 | go: 1.15.x 8 | os: linux 9 | install: 10 | - ./travis/install.sh 11 | script: 12 | - cd ci 13 | - go run mage.go -v -w ../ crossBuild 14 | - go run mage.go -v -w ../ lint 15 | - go run mage.go -v -w ../ test 16 | -------------------------------------------------------------------------------- /vendor/github.com/sklinkert/circularbuffer/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build solaris 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -D__EXTENSIONS__=1 12 | #cgo LDFLAGS: -lc 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/sklinkert/igmarkets/helper.go: -------------------------------------------------------------------------------- 1 | package igmarkets 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | func timeZoneOffset2Location(timeZoneOffset int) *time.Location { 9 | var name = fmt.Sprintf("UTC+%d", timeZoneOffset) 10 | if timeZoneOffset < 0 { 11 | name = fmt.Sprintf("UTC-%d", timeZoneOffset) 12 | } 13 | return time.FixedZone(name, timeZoneOffset) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | // +build ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 11 | return ENOTSUP 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgservicefile/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgservicefile?status.svg)](https://godoc.org/github.com/jackc/pgservicefile) 2 | [![Build Status](https://travis-ci.org/jackc/pgservicefile.svg)](https://travis-ci.org/jackc/pgservicefile) 3 | 4 | # pgservicefile 5 | 6 | Package pgservicefile is a parser for PostgreSQL service files (e.g. `.pg_service.conf`). 7 | -------------------------------------------------------------------------------- /internal/broker/ftx/README.md: -------------------------------------------------------------------------------- 1 | # FTX Broker 2 | 3 | Implement the FTX.com trading API as broker backend. It fetches ticks from FTX.com but `paperwallet` for trading. So no trades are excuted via the FTX.com API right now as they don't offer sandboxes accounts for testing/demo purpose. 4 | 5 | If you want to enable trading with real money feel free to replace the paperwallet method calls by actual API calls. -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_fts5.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build sqlite_fts5 fts5 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -DSQLITE_ENABLE_FTS5 12 | #cgo LDFLAGS: -lm 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/empty.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.12 6 | // +build !go1.12 7 | 8 | // This file is here to allow bodyless functions with go:linkname for Go 1.11 9 | // and earlier (see https://golang.org/issue/23311). 10 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v4/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .envrc 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && go1.9 6 | // +build windows,go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/coarseTime.go: -------------------------------------------------------------------------------- 1 | package fasthttp 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // CoarseTimeNow returns the current time truncated to the nearest second. 8 | // 9 | // Deprecated: This is slower than calling time.Now() directly. 10 | // This is now time.Now().Truncate(time.Second) shortcut. 11 | func CoarseTimeNow() time.Time { 12 | return time.Now().Truncate(time.Second) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | enable: 3 | - cyclop 4 | - exportloopref 5 | - gocritic 6 | - gosec 7 | - ineffassign 8 | - misspell 9 | - prealloc 10 | - unconvert 11 | - unparam 12 | - goimports 13 | - whitespace 14 | 15 | linters-settings: 16 | whitespace: 17 | multi-func: true 18 | goimports: 19 | local-prefixes: gorm.io/gorm 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pprof 2 | *.log 3 | *.db 4 | .DS_Store 5 | .idea/ 6 | *.csv 7 | 8 | # Binaries for programs and plugins 9 | *.exe 10 | *.exe~ 11 | *.dll 12 | *.so 13 | *.dylib 14 | 15 | # Test binary, built with `go test -c` 16 | *.test 17 | 18 | # Output of the go coverage tool, specifically when used with LiteIDE 19 | *.out 20 | 21 | # Dependency directories (remove the comment below to include it) 22 | # vendor/ 23 | -------------------------------------------------------------------------------- /vendor/github.com/falzm/golang-ring/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_math_functions.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build sqlite_math_functions 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -DSQLITE_ENABLE_MATH_FUNCTIONS 12 | #cgo LDFLAGS: -lm 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | // +build amd64,linux,gc 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/github.com/AMekss/assert/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | *.out 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 11 | return ptrace1(request, pid, addr, data) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgpassfile/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgpassfile?status.svg)](https://godoc.org/github.com/jackc/pgpassfile) 2 | [![Build Status](https://travis-ci.org/jackc/pgpassfile.svg)](https://travis-ci.org/jackc/pgpassfile) 3 | 4 | # pgpassfile 5 | 6 | Package pgpassfile is a parser PostgreSQL .pgpass files. 7 | 8 | Extracted and rewritten from original implementation in https://github.com/jackc/pgx. 9 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/raw.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | func RawExec(db *gorm.DB) { 8 | if db.Error == nil && !db.DryRun { 9 | result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 10 | if err != nil { 11 | db.AddError(err) 12 | return 13 | } 14 | 15 | db.RowsAffected, _ = result.RowsAffected() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.10 6 | // +build go1.10 7 | 8 | package bidirule 9 | 10 | func (t *Transformer) isFinal() bool { 11 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 12 | } 13 | -------------------------------------------------------------------------------- /cmd/backtesting/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #INSTRUMENT="BTC-USD" STRATEGY="rsi" CANDLE_DURATION=24h YEAR_FROM=2021 MONTH_FROM=4 YEAR_TO=2021 MONTH_TO=12 PRICE_SOURCE="COINBASE" go run -ldflags="-w -s -X main.GitRev=123" ./cmd/backtesting/main.go 4 | 5 | INSTRUMENT="SPXUSD" STRATEGY="rsi" CANDLE_DURATION=24h YEAR_FROM=2020 MONTH_FROM=1 YEAR_TO=2022 MONTH_TO=12 PRICE_DB_FILE=./data/SPXUSD.db go run -ldflags="-w -s -X main.GitRev=123" ./cmd/backtesting/main.go 6 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_os_trace.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build sqlite_os_trace 7 | // +build sqlite_os_trace 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_FORCE_OS_TRACE=1 13 | #cgo CFLAGS: -DSQLITE_DEBUG_OS_TRACE=1 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.editorconfig: -------------------------------------------------------------------------------- 1 | ; https://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | insert_final_newline = true 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [{Makefile,go.mod,go.sum,*.go,.gitmodules}] 13 | indent_style = tab 14 | indent_size = 4 15 | 16 | [*.md] 17 | indent_size = 4 18 | trim_trailing_whitespace = false 19 | 20 | eclint_indent_style = unset 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_stat4.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_stat4 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_ENABLE_STAT4 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/schema/pool.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | import ( 4 | "reflect" 5 | "sync" 6 | ) 7 | 8 | // sync pools 9 | var ( 10 | normalPool sync.Map 11 | poolInitializer = func(reflectType reflect.Type) FieldNewValuePool { 12 | v, _ := normalPool.LoadOrStore(reflectType, &sync.Pool{ 13 | New: func() interface{} { 14 | return reflect.New(reflectType).Interface() 15 | }, 16 | }) 17 | return v.(FieldNewValuePool) 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/tls_handshake.go: -------------------------------------------------------------------------------- 1 | package websocket 2 | 3 | import ( 4 | "context" 5 | "crypto/tls" 6 | ) 7 | 8 | func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error { 9 | if err := tlsConn.HandshakeContext(ctx); err != nil { 10 | return err 11 | } 12 | if !cfg.InsecureSkipVerify { 13 | if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil { 14 | return err 15 | } 16 | } 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build generate 6 | // +build generate 7 | 8 | package windows 9 | 10 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 11 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/chunkreader/v2/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/chunkreader?status.svg)](https://godoc.org/github.com/jackc/chunkreader) 2 | [![Build Status](https://travis-ci.org/jackc/chunkreader.svg)](https://travis-ci.org/jackc/chunkreader) 3 | 4 | # chunkreader 5 | 6 | Package chunkreader provides an io.Reader wrapper that minimizes IO reads and memory allocations. 7 | 8 | Extracted from original implementation in https://github.com/jackc/pgx. 9 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | 5 | if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then 6 | mkdir -p /tmp/build-golang/src/github.com/json-iterator 7 | ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go 8 | fi 9 | export GOPATH=/tmp/build-golang 10 | go get -u github.com/golang/dep/cmd/dep 11 | cd /tmp/build-golang/src/github.com/json-iterator/go 12 | exec $GOPATH/bin/dep ensure -update 13 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask_safe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | //go:build appengine 6 | // +build appengine 7 | 8 | package websocket 9 | 10 | func maskBytes(key [4]byte, pos int, b []byte) int { 11 | for i := range b { 12 | b[i] ^= key[pos&3] 13 | pos++ 14 | } 15 | return pos & 3 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/markcheno/go-talib/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | .DS_Store 27 | .vscode 28 | .python-version 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_introspect.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_introspect 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_INTROSPECTION_PRAGMAS 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_secure_delete.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_secure_delete 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_SECURE_DELETE=1 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/buger/jsonparser/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.6 2 | 3 | RUN go get github.com/Jeffail/gabs 4 | RUN go get github.com/bitly/go-simplejson 5 | RUN go get github.com/pquerna/ffjson 6 | RUN go get github.com/antonholmquist/jason 7 | RUN go get github.com/mreiferson/go-ujson 8 | RUN go get -tags=unsafe -u github.com/ugorji/go/codec 9 | RUN go get github.com/mailru/easyjson 10 | 11 | WORKDIR /go/src/github.com/buger/jsonparser 12 | ADD . /go/src/github.com/buger/jsonparser -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_foreign_keys.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_foreign_keys 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_DEFAULT_FOREIGN_KEYS=1 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vacuum_full.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_vacuum_full 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_DEFAULT_AUTOVACUUM=1 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vacuum_incr.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_vacuum_incr 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_DEFAULT_AUTOVACUUM=2 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/nocopy.go: -------------------------------------------------------------------------------- 1 | package fasthttp 2 | 3 | // Embed this type into a struct, which mustn't be copied, 4 | // so `go vet` gives a warning if this struct is copied. 5 | // 6 | // See https://github.com/golang/go/issues/8005#issuecomment-190753527 for details. 7 | // and also: https://stackoverflow.com/questions/52494458/nocopy-minimal-example 8 | type noCopy struct{} //nolint:unused 9 | 10 | func (*noCopy) Lock() {} 11 | func (*noCopy) Unlock() {} 12 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/fees.go: -------------------------------------------------------------------------------- 1 | package coinbasepro 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Fees struct { 8 | MakerFeeRate string `json:"maker_fee_rate"` 9 | TakerFeeRate string `json:"taker_fee_rate"` 10 | USDVolume string `json:"usd_volume"` 11 | } 12 | 13 | func (c *Client) GetFees() (Fees, error) { 14 | var fees Fees 15 | 16 | url := fmt.Sprintf("/fees") 17 | _, err := c.Request("GET", url, nil, &fees) 18 | return fees, err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | const ( 11 | R_OK = 0x4 12 | W_OK = 0x2 13 | X_OK = 0x1 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package uuid generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_secure_delete_fast.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_secure_delete_fast 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_SECURE_DELETE=FAST 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd openbsd solaris 7 | 8 | package unix 9 | 10 | var mapper = &mmapper{ 11 | active: make(map[*byte][]byte), 12 | mmap: mmap, 13 | munmap: munmap, 14 | } 15 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/model.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "time" 4 | 5 | // Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt 6 | // It may be embedded into your model or you may build your own model without it 7 | // 8 | // type User struct { 9 | // gorm.Model 10 | // } 11 | type Model struct { 12 | ID uint `gorm:"primarykey"` 13 | CreatedAt time.Time 14 | UpdatedAt time.Time 15 | DeletedAt DeletedAt `gorm:"index"` 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_allow_uri_authority.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build sqlite_allow_uri_authority 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_ALLOW_URI_AUTHORITY 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_app_armor.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build !windows 8 | // +build sqlite_app_armor 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_ENABLE_API_ARMOR 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_other.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !windows 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -I. 12 | #cgo linux LDFLAGS: -ldl 13 | #cgo linux,ppc LDFLAGS: -lpthread 14 | #cgo linux,ppc64 LDFLAGS: -lpthread 15 | #cgo linux,ppc64le LDFLAGS: -lpthread 16 | */ 17 | import "C" 18 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/currency.go: -------------------------------------------------------------------------------- 1 | package coinbasepro 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Currency struct { 8 | ID string `json:"id"` 9 | Name string `json:"name"` 10 | MinSize string `json:"min_size"` 11 | } 12 | 13 | func (c *Client) GetCurrencies() ([]Currency, error) { 14 | var currencies []Currency 15 | 16 | url := fmt.Sprintf("/currencies") 17 | _, err := c.Request("GET", url, nil, ¤cies) 18 | return currencies, err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.10 6 | // +build !go1.10 7 | 8 | package bidirule 9 | 10 | func (t *Transformer) isFinal() bool { 11 | if !t.isRTL() { 12 | return true 13 | } 14 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 15 | } 16 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/delete.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Delete struct { 4 | Modifier string 5 | } 6 | 7 | func (d Delete) Name() string { 8 | return "DELETE" 9 | } 10 | 11 | func (d Delete) Build(builder Builder) { 12 | builder.WriteString("DELETE") 13 | 14 | if d.Modifier != "" { 15 | builder.WriteByte(' ') 16 | builder.WriteString(d.Modifier) 17 | } 18 | } 19 | 20 | func (d Delete) MergeClause(clause *Clause) { 21 | clause.Name = "" 22 | clause.Expression = d 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/inflection/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | 3 | build: 4 | steps: 5 | - setup-go-workspace 6 | 7 | # Gets the dependencies 8 | - script: 9 | name: go get 10 | code: | 11 | go get 12 | 13 | # Build the project 14 | - script: 15 | name: go build 16 | code: | 17 | go build ./... 18 | 19 | # Test the project 20 | - script: 21 | name: go test 22 | code: | 23 | go test ./... 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 7 | 8 | package unix 9 | 10 | const isBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -I. 12 | #cgo CFLAGS: -fno-stack-check 13 | #cgo CFLAGS: -fno-stack-protector 14 | #cgo CFLAGS: -mno-stack-arg-probe 15 | #cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T 16 | */ 17 | import "C" 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | // SysvShmCtl performs control operations on the shared memory segment 11 | // specified by id. 12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 13 | return shmctl(id, cmd, desc) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/AMekss/assert/boolean.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // True - asserts that passed expression is evaluated to true 4 | func True(reporter interface{}, expression bool) { 5 | if !expression { 6 | reportError(reporter, &failedBoolCompMsg{want: true, got: false}) 7 | } 8 | } 9 | 10 | // False - asserts that passed expression is evaluated to false 11 | func False(reporter interface{}, expression bool) { 12 | if expression { 13 | reportError(reporter, &failedBoolCompMsg{want: false, got: true}) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ordinals.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import "strconv" 4 | 5 | // Ordinal gives you the input number in a rank/ordinal format. 6 | // 7 | // Ordinal(3) -> 3rd 8 | func Ordinal(x int) string { 9 | suffix := "th" 10 | switch x % 10 { 11 | case 1: 12 | if x%100 != 11 { 13 | suffix = "st" 14 | } 15 | case 2: 16 | if x%100 != 12 { 17 | suffix = "nd" 18 | } 19 | case 3: 20 | if x%100 != 13 { 21 | suffix = "rd" 22 | } 23 | } 24 | return strconv.Itoa(x) + suffix 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgio/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgio?status.svg)](https://godoc.org/github.com/jackc/pgio) 2 | [![Build Status](https://travis-ci.org/jackc/pgio.svg)](https://travis-ci.org/jackc/pgio) 3 | 4 | # pgio 5 | 6 | Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. 7 | 8 | pgio provides functions for appending integers to a []byte while doing byte 9 | order conversion. 10 | 11 | Extracted from original implementation in https://github.com/jackc/pgx. 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 12 | // 13 | 14 | TEXT ·syscall6(SB),NOSPLIT,$0-88 15 | JMP syscall·syscall6(SB) 16 | 17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSyscall6(SB) 19 | -------------------------------------------------------------------------------- /internal/broker/order_test.go: -------------------------------------------------------------------------------- 1 | package broker 2 | 3 | import ( 4 | "github.com/AMekss/assert" 5 | "github.com/shopspring/decimal" 6 | "testing" 7 | ) 8 | 9 | func TestMergeOrders(t *testing.T) { 10 | order1 := NewMarketOrder(BuyDirectionShort, 1.00, "", decimal.Zero, decimal.Zero) 11 | order2 := NewMarketOrder(BuyDirectionShort, 1.00, "", decimal.Zero, decimal.Zero) 12 | orders1 := []Order{order1} 13 | orders2 := []Order{order2} 14 | 15 | orders := MergeOrders(orders1, orders2) 16 | assert.EqualInt(t, 2, len(orders)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | // +build arm,gc,linux 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/brotli/find_match_length.go: -------------------------------------------------------------------------------- 1 | package brotli 2 | 3 | /* Copyright 2010 Google Inc. All Rights Reserved. 4 | 5 | Distributed under MIT license. 6 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 7 | */ 8 | 9 | /* Function to find maximal matching prefixes of strings. */ 10 | func findMatchLengthWithLimit(s1 []byte, s2 []byte, limit uint) uint { 11 | var matched uint = 0 12 | for matched < limit && s1[matched] == s2[matched] { 13 | matched++ 14 | } 15 | return matched 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v4/messages.go: -------------------------------------------------------------------------------- 1 | package pgx 2 | 3 | import ( 4 | "database/sql/driver" 5 | 6 | "github.com/jackc/pgtype" 7 | ) 8 | 9 | func convertDriverValuers(args []interface{}) ([]interface{}, error) { 10 | for i, arg := range args { 11 | switch arg := arg.(type) { 12 | case pgtype.BinaryEncoder: 13 | case pgtype.TextEncoder: 14 | case driver.Valuer: 15 | v, err := callValuerValue(arg) 16 | if err != nil { 17 | return nil, err 18 | } 19 | args[i] = v 20 | } 21 | } 22 | return args, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [solve-meta] 11 | analyzer-name = "dep" 12 | analyzer-version = 1 13 | inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7" 14 | solver-name = "gps-cdcl" 15 | solver-version = 1 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | // +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh 7 | 8 | package unix 9 | 10 | const isBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgtype/typed_range_gen.sh: -------------------------------------------------------------------------------- 1 | erb range_type=Int4range element_type=Int4 typed_range.go.erb > int4range.go 2 | erb range_type=Int8range element_type=Int8 typed_range.go.erb > int8range.go 3 | erb range_type=Tsrange element_type=Timestamp typed_range.go.erb > tsrange.go 4 | erb range_type=Tstzrange element_type=Timestamptz typed_range.go.erb > tstzrange.go 5 | erb range_type=Daterange element_type=Date typed_range.go.erb > daterange.go 6 | erb range_type=Numrange element_type=Numeric typed_range.go.erb > numrange.go 7 | goimports -w *range.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build aix dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | // ReadDirent reads directory entries from fd and writes them into buf. 11 | func ReadDirent(fd int, buf []byte) (n int, err error) { 12 | return Getdents(fd, buf) 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gomod" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgtype/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgtype?status.svg)](https://godoc.org/github.com/jackc/pgtype) 2 | ![CI](https://github.com/jackc/pgtype/workflows/CI/badge.svg) 3 | 4 | # pgtype 5 | 6 | pgtype implements Go types for over 70 PostgreSQL types. pgtype is the type system underlying the 7 | https://github.com/jackc/pgx PostgreSQL driver. These types support the binary format for enhanced performance with pgx. 8 | They also support the database/sql `Scan` and `Value` interfaces and can be used with https://github.com/lib/pq. 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | // For Unix, get the pagesize from the runtime. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getpagesize() int { 15 | return syscall.Getpagesize() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.3.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - 1.9.x 10 | - master 11 | matrix: 12 | allow_failures: 13 | - go: master 14 | fast_finish: true 15 | install: 16 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 17 | script: 18 | - go get -t -v ./... 19 | - diff -u <(echo -n) <(gofmt -d -s .) 20 | - go tool vet . 21 | - go test -v -race ./... 22 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/transfer.go: -------------------------------------------------------------------------------- 1 | package coinbasepro 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Transfer struct { 8 | Type string `json:"type"` 9 | Amount string `json:"amount"` 10 | CoinbaseAccountID string `json:"coinbase_account_id,string"` 11 | } 12 | 13 | func (c *Client) CreateTransfer(newTransfer *Transfer) (Transfer, error) { 14 | var savedTransfer Transfer 15 | 16 | url := fmt.Sprintf("/transfers") 17 | _, err := c.Request("POST", url, newTransfer, &savedTransfer) 18 | return savedTransfer, err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/methods.go: -------------------------------------------------------------------------------- 1 | package fasthttp 2 | 3 | // HTTP methods were copied from net/http. 4 | const ( 5 | MethodGet = "GET" // RFC 7231, 4.3.1 6 | MethodHead = "HEAD" // RFC 7231, 4.3.2 7 | MethodPost = "POST" // RFC 7231, 4.3.3 8 | MethodPut = "PUT" // RFC 7231, 4.3.4 9 | MethodPatch = "PATCH" // RFC 5789 10 | MethodDelete = "DELETE" // RFC 7231, 4.3.5 11 | MethodConnect = "CONNECT" // RFC 7231, 4.3.6 12 | MethodOptions = "OPTIONS" // RFC 7231, 4.3.7 13 | MethodTrace = "TRACE" // RFC 7231, 4.3.8 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/my-quotes.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForMyOpQuotes struct { 8 | } 9 | 10 | type ResponseForMyOpQuotes []Quote 11 | 12 | func (req *RequestForMyOpQuotes) Path() string { 13 | return "/options/my_quotes" 14 | } 15 | 16 | func (req *RequestForMyOpQuotes) Method() string { 17 | return http.MethodGet 18 | } 19 | 20 | func (req *RequestForMyOpQuotes) Query() string { 21 | return "" 22 | } 23 | 24 | func (req *RequestForMyOpQuotes) Payload() []byte { 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This removes the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | // +build go1.9 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | type Signal = syscall.Signal 14 | type Errno = syscall.Errno 15 | type SysProcAttr = syscall.SysProcAttr 16 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | testAndLint: 7 | runs-on: ubuntu-latest 8 | name: Tests and Lint 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Setup go 12 | uses: actions/setup-go@v1 13 | with: 14 | go-version: 1.16.2 15 | - run: go test -race -cover ./... 16 | 17 | # - name: lint 18 | # uses: golangci/golangci-lint-action@v2.5.2 19 | # with: 20 | # version: latest 21 | # skip-build-cache: true 22 | # skip-pkg-cache: true -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/wallet/balances-all.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForBalancesAll struct { 8 | } 9 | 10 | type ResponseForBalancesAll map[string][]Balance 11 | 12 | func (req *RequestForBalancesAll) Path() string { 13 | return "/wallet/all_balances" 14 | } 15 | 16 | func (req *RequestForBalancesAll) Method() string { 17 | return http.MethodGet 18 | } 19 | 20 | func (req *RequestForBalancesAll) Query() string { 21 | return "" 22 | } 23 | 24 | func (req *RequestForBalancesAll) Payload() []byte { 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc 7 | 8 | package unix 9 | 10 | func init() { 11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 13 | fcntl64Syscall = SYS_FCNTL64 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | // +build gccgo,linux,amd64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //extern gettimeofday 13 | func realGettimeofday(*Timeval, *byte) int32 14 | 15 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 16 | r := realGettimeofday(tv, nil) 17 | if r < 0 { 18 | return syscall.GetErrno() 19 | } 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/AMekss/assert/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | env: 5 | global: 6 | - CC_TEST_REPORTER_ID=952737a4a21c105e83ab3951dc1e88ee44cdc3ba9ea10fbd40f730b91813de5e 7 | 8 | go: 9 | - "1.9" 10 | - "1.10" 11 | 12 | before_script: 13 | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter 14 | - chmod +x ./cc-test-reporter 15 | - ./cc-test-reporter before-build 16 | 17 | script: go test -v -coverprofile c.out ./... 18 | 19 | after_script: 20 | - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT 21 | -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/brotli/symbol_list.go: -------------------------------------------------------------------------------- 1 | package brotli 2 | 3 | /* Copyright 2013 Google Inc. All Rights Reserved. 4 | 5 | Distributed under MIT license. 6 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 7 | */ 8 | 9 | /* Utilities for building Huffman decoding tables. */ 10 | 11 | type symbolList struct { 12 | storage []uint16 13 | offset int 14 | } 15 | 16 | func symbolListGet(sl symbolList, i int) uint16 { 17 | return sl.storage[i+sl.offset] 18 | } 19 | 20 | func symbolListPut(sl symbolList, i int, val uint16) { 21 | sl.storage[i+sl.offset] = val 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/leveraged/token.go: -------------------------------------------------------------------------------- 1 | package leveraged 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForLvToken struct { 9 | ProductCode string 10 | } 11 | 12 | type ResponseForLvToken LvToken 13 | 14 | func (req *RequestForLvToken) Path() string { 15 | return fmt.Sprintf("/lt/%s", req.ProductCode) 16 | } 17 | 18 | func (req *RequestForLvToken) Method() string { 19 | return http.MethodGet 20 | } 21 | 22 | func (req *RequestForLvToken) Query() string { 23 | return "" 24 | } 25 | 26 | func (req *RequestForLvToken) Payload() []byte { 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | // +build linux,gc 7 | 8 | package unix 9 | 10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 12 | 13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 14 | // fail. 15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 16 | -------------------------------------------------------------------------------- /vendor/github.com/buger/jsonparser/bytes_safe.go: -------------------------------------------------------------------------------- 1 | // +build appengine appenginevm 2 | 3 | package jsonparser 4 | 5 | import ( 6 | "strconv" 7 | ) 8 | 9 | // See fastbytes_unsafe.go for explanation on why *[]byte is used (signatures must be consistent with those in that file) 10 | 11 | func equalStr(b *[]byte, s string) bool { 12 | return string(*b) == s 13 | } 14 | 15 | func parseFloat(b *[]byte) (float64, error) { 16 | return strconv.ParseFloat(string(*b), 64) 17 | } 18 | 19 | func bytesToString(b *[]byte) string { 20 | return string(*b) 21 | } 22 | 23 | func StringToBytes(s string) []byte { 24 | return []byte(s) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && !race 6 | // +build windows,!race 7 | 8 | package windows 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | // +build linux 7 | // +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64 8 | 9 | package unix 10 | 11 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 12 | // values. 13 | 14 | //sys Alarm(seconds uint) (remaining uint, err error) 15 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasthttp/fasthttputil/ecdsa.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBbTCCAROgAwIBAgIQPo718S+K+G7hc1SgTEU4QDAKBggqhkjOPQQDAjASMRAw 3 | DgYDVQQKEwdBY21lIENvMB4XDTE3MDQyMDIxMDExNFoXDTE4MDQyMDIxMDExNFow 4 | EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCkA 5 | mVoBNiAYW+O6LfDCLNQ+CkorB2JWeNSFsnrraY29H48MCIYpoaZdUJXdf3do92d7 6 | 1cn2ucg/p3Fe6ghWbkqjSzBJMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggr 7 | BgEFBQcDATAMBgNVHRMBAf8EAjAAMBQGA1UdEQQNMAuCCWxvY2FsaG9zdDAKBggq 8 | hkjOPQQDAgNIADBFAiEAoLAIQkvSuIcHUqyWroA6yWYw2fznlRH/uO9/hMCxUCEC 9 | IClRYb/5O9eD/Eq/ozPnwNpsQHOeYefEhadJ/P82y0lG 10 | -----END CERTIFICATE----- 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | // +build 386,hurd 7 | 8 | package unix 9 | 10 | const ( 11 | TIOCGETA = 0x62251713 12 | ) 13 | 14 | type Winsize struct { 15 | Row uint16 16 | Col uint16 17 | Xpixel uint16 18 | Ypixel uint16 19 | } 20 | 21 | type Termios struct { 22 | Iflag uint32 23 | Oflag uint32 24 | Cflag uint32 25 | Lflag uint32 26 | Cc [20]uint8 27 | Ispeed int32 28 | Ospeed int32 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/go-test/deep/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | For security patches, the latest release is supported: 6 | 7 | | Version | Supported | 8 | | ------- | ------------------ | 9 | | 1.0.x | :white_check_mark: | 10 | 11 | ## Reporting a Vulnerability 12 | 13 | To report a vulnerability, [create an issue](https://github.com/go-test/deep/issues) with the _security_ label. 14 | 15 | This project is developed and maintained by volunteers during their free time, 16 | so there is no SLA or ETA for fixing vulnerabilities (or any issues). 17 | Please help by submitting a PR to fix an issue. 18 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgproto3?status.svg)](https://godoc.org/github.com/jackc/pgproto3) 2 | [![Build Status](https://travis-ci.org/jackc/pgproto3.svg)](https://travis-ci.org/jackc/pgproto3) 3 | 4 | # pgproto3 5 | 6 | Package pgproto3 is a encoder and decoder of the PostgreSQL wire protocol version 3. 7 | 8 | pgproto3 can be used as a foundation for PostgreSQL drivers, proxies, mock servers, load balancers and more. 9 | 10 | See example/pgfortune for a playful example of a fake PostgreSQL server. 11 | 12 | Extracted from original implementation in https://github.com/jackc/pgx. 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_column_metadata.go: -------------------------------------------------------------------------------- 1 | // +build sqlite_column_metadata 2 | 3 | package sqlite3 4 | 5 | /* 6 | #ifndef USE_LIBSQLITE3 7 | #cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA 8 | #include 9 | #else 10 | #include 11 | #endif 12 | */ 13 | import "C" 14 | 15 | // ColumnTableName returns the table that is the origin of a particular result 16 | // column in a SELECT statement. 17 | // 18 | // See https://www.sqlite.org/c3ref/column_database_name.html 19 | func (s *SQLiteStmt) ColumnTableName(n int) string { 20 | return C.GoString(C.sqlite3_column_table_name(s.s, C.int(n))) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/piquette/finance-go/Makefile: -------------------------------------------------------------------------------- 1 | all: test vet 2 | 3 | bench: 4 | go test -race -bench . -run "Benchmark" ./form 5 | 6 | build: 7 | go build ./... 8 | 9 | test: 10 | go test -v ./... 11 | 12 | vet: 13 | go vet ./... 14 | 15 | coverage: 16 | # go currently cannot create coverage profiles when testing multiple packages, so we test each package 17 | # independently. This issue should be fixed in Go 1.10 (https://github.com/golang/go/issues/6909). 18 | go list ./... | xargs -n1 -I {} -P 4 go test -covermode=count -coverprofile=../../../{}/profile.coverprofile {} 19 | 20 | clean: 21 | find . -name \*.coverprofile -delete 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 G.J.R. Timmer . 2 | // Copyright (C) 2018 segment.com 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build cgo 8 | 9 | package sqlite3 10 | 11 | // SQLitePreUpdateData represents all of the data available during a 12 | // pre-update hook call. 13 | type SQLitePreUpdateData struct { 14 | Conn *SQLiteConn 15 | Op int 16 | DatabaseName string 17 | TableName string 18 | OldRowID int64 19 | NewRowID int64 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | type Map struct { 8 | lock sync.RWMutex 9 | data map[interface{}]interface{} 10 | } 11 | 12 | func NewMap() *Map { 13 | return &Map{ 14 | data: make(map[interface{}]interface{}, 32), 15 | } 16 | } 17 | 18 | func (m *Map) Load(key interface{}) (elem interface{}, found bool) { 19 | m.lock.RLock() 20 | elem, found = m.data[key] 21 | m.lock.RUnlock() 22 | return 23 | } 24 | 25 | func (m *Map) Store(key interface{}, elem interface{}) { 26 | m.lock.Lock() 27 | m.data[key] = elem 28 | m.lock.Unlock() 29 | } 30 | 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/cancel-quote.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForCancelOpQuote struct { 9 | QuoteID int 10 | } 11 | 12 | type ResponseForCancelOpQuote Quote 13 | 14 | func (req *RequestForCancelOpQuote) Path() string { 15 | return fmt.Sprintf("/options/quotes/%d", req.QuoteID) 16 | } 17 | 18 | func (req *RequestForCancelOpQuote) Method() string { 19 | return http.MethodDelete 20 | } 21 | 22 | func (req *RequestForCancelOpQuote) Query() string { 23 | return "" 24 | } 25 | 26 | func (req *RequestForCancelOpQuote) Payload() []byte { 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_serialize_omit.go: -------------------------------------------------------------------------------- 1 | // +build libsqlite3,!sqlite_serialize 2 | 3 | package sqlite3 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_OMIT_DESERIALIZE 11 | */ 12 | import "C" 13 | 14 | func (c *SQLiteConn) Serialize(schema string) ([]byte, error) { 15 | return nil, errors.New("sqlite3: Serialize requires the sqlite_serialize build tag when using the libsqlite3 build tag") 16 | } 17 | 18 | func (c *SQLiteConn) Deserialize(b []byte, schema string) error { 19 | return errors.New("sqlite3: Deserialize requires the sqlite_serialize build tag when using the libsqlite3 build tag") 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | // +build windows 7 | 8 | package windows 9 | 10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 11 | if val < 0 { 12 | return "-" + itoa(-val) 13 | } 14 | var buf [32]byte // big enough for int64 15 | i := len(buf) - 1 16 | for val >= 10 { 17 | buf[i] = byte(val%10 + '0') 18 | i-- 19 | val /= 10 20 | } 21 | buf[i] = byte(val + '0') 22 | return string(buf[i:]) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/accept-quote.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForAcceptOpQuote struct { 9 | QuoteID int 10 | } 11 | 12 | type ResponseForAcceptOpQuote Quote 13 | 14 | func (req *RequestForAcceptOpQuote) Path() string { 15 | return fmt.Sprintf("/options/quotes/%d/accept", req.QuoteID) 16 | } 17 | 18 | func (req *RequestForAcceptOpQuote) Method() string { 19 | return http.MethodPost 20 | } 21 | 22 | func (req *RequestForAcceptOpQuote) Query() string { 23 | return "" 24 | } 25 | 26 | func (req *RequestForAcceptOpQuote) Payload() []byte { 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/sys/windows" 10 | ) 11 | 12 | func checkIfTerminal(w io.Writer) bool { 13 | switch v := w.(type) { 14 | case *os.File: 15 | handle := windows.Handle(v.Fd()) 16 | var mode uint32 17 | if err := windows.GetConsoleMode(handle, &mode); err != nil { 18 | return false 19 | } 20 | mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING 21 | if err := windows.SetConsoleMode(handle, mode); err != nil { 22 | return false 23 | } 24 | return true 25 | } 26 | return false 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | // +build linux 7 | 8 | package unix 9 | 10 | import "runtime" 11 | 12 | // SysvShmCtl performs control operations on the shared memory segment 13 | // specified by id. 14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 15 | if runtime.GOARCH == "arm" || 16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 17 | cmd |= ipc_64 18 | } 19 | 20 | return shmctl(id, cmd, desc) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/client.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/go-numb/go-ftx/auth" 7 | jsoniter "github.com/json-iterator/go" 8 | "github.com/valyala/fasthttp" 9 | ) 10 | 11 | const ENDPOINT = "https://ftx.com/api" 12 | 13 | var json = jsoniter.ConfigCompatibleWithStandardLibrary 14 | 15 | type Client struct { 16 | Auth *auth.Config 17 | 18 | HTTPC *fasthttp.Client 19 | HTTPTimeout time.Duration 20 | } 21 | 22 | func New(auth *auth.Config) *Client { 23 | hc := new(fasthttp.Client) 24 | 25 | return &Client{ 26 | Auth: auth, 27 | HTTPC: hc, 28 | HTTPTimeout: 5 * time.Second, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/chunkreader.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/jackc/chunkreader/v2" 7 | ) 8 | 9 | // ChunkReader is an interface to decouple github.com/jackc/chunkreader from this package. 10 | type ChunkReader interface { 11 | // Next returns buf filled with the next n bytes. If an error (including a partial read) occurs, 12 | // buf must be nil. Next must preserve any partially read data. Next must not reuse buf. 13 | Next(n int) (buf []byte, err error) 14 | } 15 | 16 | // NewChunkReader creates and returns a new default ChunkReader. 17 | func NewChunkReader(r io.Reader) ChunkReader { 18 | return chunkreader.New(r) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_icu.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build sqlite_icu icu 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo LDFLAGS: -licuuc -licui18n 12 | #cgo CFLAGS: -DSQLITE_ENABLE_ICU 13 | #cgo darwin,amd64 CFLAGS: -I/usr/local/opt/icu4c/include 14 | #cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/icu4c/lib 15 | #cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/icu4c/include 16 | #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/icu4c/lib 17 | #cgo openbsd LDFLAGS: -lsqlite3 18 | */ 19 | import "C" 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/my-quote-request.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForMyOpQuoteRequest struct { 9 | RequestID int 10 | } 11 | 12 | type ResponseForMyOpQuoteRequest []Quote 13 | 14 | func (req *RequestForMyOpQuoteRequest) Path() string { 15 | return fmt.Sprintf("/options/requests/%d/quotes", req.RequestID) 16 | } 17 | 18 | func (req *RequestForMyOpQuoteRequest) Method() string { 19 | return http.MethodGet 20 | } 21 | 22 | func (req *RequestForMyOpQuoteRequest) Query() string { 23 | return "" 24 | } 25 | 26 | func (req *RequestForMyOpQuoteRequest) Payload() []byte { 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/types/models.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "math" 5 | "time" 6 | 7 | jsoniter "github.com/json-iterator/go" 8 | ) 9 | 10 | var json = jsoniter.ConfigCompatibleWithStandardLibrary 11 | 12 | const ( 13 | BUY = "buy" 14 | SELL = "sell" 15 | MARKET = "market" 16 | LIMIT = "limit" 17 | STOP = "stop" 18 | ) 19 | 20 | type FtxTime struct { 21 | Time time.Time 22 | } 23 | 24 | func (p *FtxTime) UnmarshalJSON(data []byte) error { 25 | var f float64 26 | if err := json.Unmarshal(data, &f); err != nil { 27 | return err 28 | } 29 | 30 | sec, nsec := math.Modf(f) 31 | p.Time = time.Unix(int64(sec), int64(nsec)) 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/stringnumber.go: -------------------------------------------------------------------------------- 1 | package coinbasepro 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | "fmt" 7 | "strconv" 8 | ) 9 | 10 | type StringNumber string 11 | 12 | func (s *StringNumber) UnmarshalJSON(data []byte) error { 13 | var v interface{} 14 | 15 | if err := json.Unmarshal(data, &v); err != nil { 16 | return err 17 | } 18 | 19 | switch v := v.(type) { 20 | case float64: 21 | *s = StringNumber(fmt.Sprintf("%f", v)) 22 | case int: 23 | *s = StringNumber(strconv.Itoa(v)) 24 | case string: 25 | *s = StringNumber(v) 26 | default: 27 | return errors.New("Not an int or string") 28 | } 29 | 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgtype/typed_multirange_gen.sh: -------------------------------------------------------------------------------- 1 | erb range_type=Numrange multirange_type=Nummultirange typed_multirange.go.erb > num_multirange.go 2 | erb range_type=Int4range multirange_type=Int4multirange typed_multirange.go.erb > int4_multirange.go 3 | erb range_type=Int8range multirange_type=Int8multirange typed_multirange.go.erb > int8_multirange.go 4 | # TODO 5 | # erb range_type=Tsrange multirange_type=Tsmultirange typed_multirange.go.erb > ts_multirange.go 6 | # erb range_type=Tstzrange multirange_type=Tstzmultirange typed_multirange.go.erb > tstz_multirange.go 7 | # erb range_type=Daterange multirange_type=Datemultirange typed_multirange.go.erb > date_multirange.go 8 | goimports -w *multirange.go -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/leveraged/balances.go: -------------------------------------------------------------------------------- 1 | package leveraged 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForLvBalances struct { 8 | } 9 | 10 | type ResponseForLvBalances []TokenBalance 11 | 12 | type TokenBalance struct { 13 | Token string `json:"token"` 14 | Balance float64 `json:"balance"` 15 | } 16 | 17 | func (req *RequestForLvBalances) Path() string { 18 | return "/lt/balances" 19 | } 20 | 21 | func (req *RequestForLvBalances) Method() string { 22 | return http.MethodGet 23 | } 24 | 25 | func (req *RequestForLvBalances) Query() string { 26 | return "" 27 | } 28 | 29 | func (req *RequestForLvBalances) Payload() []byte { 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/row.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | func RowQuery(db *gorm.DB) { 8 | if db.Error == nil { 9 | BuildQuerySQL(db) 10 | if db.DryRun || db.Error != nil { 11 | return 12 | } 13 | 14 | if isRows, ok := db.Get("rows"); ok && isRows.(bool) { 15 | db.Statement.Settings.Delete("rows") 16 | db.Statement.Dest, db.Error = db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 17 | } else { 18 | db.Statement.Dest = db.Statement.ConnPool.QueryRowContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 19 | } 20 | 21 | db.RowsAffected = -1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [[projects]] 11 | name = "github.com/modern-go/reflect2" 12 | packages = ["."] 13 | revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" 14 | version = "1.0.1" 15 | 16 | [solve-meta] 17 | analyzer-name = "dep" 18 | analyzer-version = 1 19 | inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" 20 | solver-name = "gps-cdcl" 21 | solver-version = 1 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | // +build linux,gc,386 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | 16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 18 | -------------------------------------------------------------------------------- /pkg/tick/tick_test.go: -------------------------------------------------------------------------------- 1 | package tick 2 | 3 | import ( 4 | "github.com/AMekss/assert" 5 | "github.com/shopspring/decimal" 6 | "testing" 7 | "time" 8 | ) 9 | 10 | func TestTick_Spread(t *testing.T) { 11 | var bid = decimal.NewFromFloat(1.00) 12 | var ask = decimal.NewFromFloat(1.50) 13 | var tick = New("EURUSD", time.Now(), bid, ask) 14 | var spread, _ = tick.Spread().Float64() 15 | assert.EqualFloat64(t, 0.50, spread) 16 | } 17 | 18 | func TestTick_SpreadInPercent(t *testing.T) { 19 | var bid = decimal.NewFromFloat(0.80) 20 | var ask = decimal.NewFromFloat(1.50) 21 | var tick = New("EURUSD", time.Now(), bid, ask) 22 | var spread, _ = tick.SpreadInPercent().Float64() 23 | assert.EqualFloat64(t, 87.50, spread) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/subaccount/delete.go: -------------------------------------------------------------------------------- 1 | package subaccount 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForDeleteSubAccount struct { 8 | NickName string `json:"nickname"` 9 | } 10 | 11 | type ResponseForDeleteSubAccount string 12 | 13 | func (req *RequestForDeleteSubAccount) Path() string { 14 | return "/subaccounts" 15 | } 16 | 17 | func (req *RequestForDeleteSubAccount) Method() string { 18 | return http.MethodDelete 19 | } 20 | 21 | func (req *RequestForDeleteSubAccount) Query() string { 22 | return "" 23 | } 24 | 25 | func (req *RequestForDeleteSubAccount) Payload() []byte { 26 | b, err := json.Marshal(req) 27 | if err != nil { 28 | return nil 29 | } 30 | return b 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/README.md: -------------------------------------------------------------------------------- 1 | # GORM Sqlite Driver 2 | 3 | ![CI](https://github.com/go-gorm/sqlite/workflows/CI/badge.svg) 4 | 5 | ## USAGE 6 | 7 | ```go 8 | import ( 9 | "gorm.io/driver/sqlite" 10 | "gorm.io/gorm" 11 | ) 12 | 13 | // github.com/mattn/go-sqlite3 14 | db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{}) 15 | ``` 16 | 17 | Checkout [https://gorm.io](https://gorm.io) for details. 18 | 19 | ### Pure go Sqlite Driver 20 | 21 | checkout [https://github.com/glebarez/sqlite](https://github.com/glebarez/sqlite) for details 22 | 23 | ```go 24 | import ( 25 | "github.com/glebarez/sqlite" 26 | "gorm.io/gorm" 27 | ) 28 | 29 | db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{}) 30 | ``` 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/subaccount/all.go: -------------------------------------------------------------------------------- 1 | package subaccount 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForSubAccounts struct { 8 | } 9 | 10 | type ResponseForSubAccounts []SubAccount 11 | 12 | type SubAccount struct { 13 | Nickname string `json:"nickname"` 14 | Deletable bool `json:"deletable"` 15 | Editable bool `json:"editable"` 16 | } 17 | 18 | func (req *RequestForSubAccounts) Path() string { 19 | return "/subaccounts" 20 | } 21 | 22 | func (req *RequestForSubAccounts) Method() string { 23 | return http.MethodGet 24 | } 25 | 26 | func (req *RequestForSubAccounts) Query() string { 27 | return "" 28 | } 29 | 30 | func (req *RequestForSubAccounts) Payload() []byte { 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_load_extension_omit.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build sqlite_omit_load_extension 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -DSQLITE_OMIT_LOAD_EXTENSION 12 | */ 13 | import "C" 14 | import ( 15 | "errors" 16 | ) 17 | 18 | func (c *SQLiteConn) loadExtensions(extensions []string) error { 19 | return errors.New("Extensions have been disabled for static builds") 20 | } 21 | 22 | func (c *SQLiteConn) LoadExtension(lib string, entry string) error { 23 | return errors.New("Extensions have been disabled for static builds") 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | // +build linux,gccgo,arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/brotli/encoder_dict.go: -------------------------------------------------------------------------------- 1 | package brotli 2 | 3 | /* Dictionary data (words and transforms) for 1 possible context */ 4 | type encoderDictionary struct { 5 | words *dictionary 6 | cutoffTransformsCount uint32 7 | cutoffTransforms uint64 8 | hash_table []uint16 9 | buckets []uint16 10 | dict_words []dictWord 11 | } 12 | 13 | func initEncoderDictionary(dict *encoderDictionary) { 14 | dict.words = getDictionary() 15 | 16 | dict.hash_table = kStaticDictionaryHash[:] 17 | dict.buckets = kStaticDictionaryBuckets[:] 18 | dict.dict_words = kStaticDictionaryWords[:] 19 | 20 | dict.cutoffTransformsCount = kCutoffTransformsCount 21 | dict.cutoffTransforms = kCutoffTransforms 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/spotmargin/get-borrow-rates.go: -------------------------------------------------------------------------------- 1 | package spotmargin 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type ResponseForBorrowRates []BorrowRates 8 | 9 | type BorrowRates struct { 10 | Coin string `json:"coin"` 11 | Estimate float64 `json:"estimate"` 12 | Previous float64 `json:"previous"` 13 | } 14 | 15 | type RequestForBorrowRates struct { 16 | } 17 | 18 | func (req *RequestForBorrowRates) Path() string { 19 | return "/spot_margin/borrow_rates" 20 | } 21 | 22 | func (req *RequestForBorrowRates) Method() string { 23 | return http.MethodGet 24 | } 25 | 26 | func (req *RequestForBorrowRates) Query() string { 27 | return "" 28 | } 29 | 30 | func (req *RequestForBorrowRates) Payload() []byte { 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/spotmargin/get-lending-rates.go: -------------------------------------------------------------------------------- 1 | package spotmargin 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForLendingRates struct{} 8 | 9 | type ResponseForLendingRates []LendingRates 10 | 11 | type LendingRates struct { 12 | Coin string `json:"coin"` 13 | Estimate float64 `json:"estimate"` 14 | Previous float64 `json:"previous"` 15 | } 16 | 17 | func (req *RequestForLendingRates) Path() string { 18 | return "/spot_margin/lending_rates" 19 | } 20 | 21 | func (req *RequestForLendingRates) Method() string { 22 | return http.MethodGet 23 | } 24 | 25 | func (req *RequestForLendingRates) Query() string { 26 | return "" 27 | } 28 | 29 | func (req *RequestForLendingRates) Payload() []byte { 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_libsqlite3.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build libsqlite3 7 | 8 | package sqlite3 9 | 10 | /* 11 | #cgo CFLAGS: -DUSE_LIBSQLITE3 12 | #cgo linux LDFLAGS: -lsqlite3 13 | #cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/sqlite/lib -lsqlite3 14 | #cgo darwin,amd64 CFLAGS: -I/usr/local/opt/sqlite/include 15 | #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/sqlite/lib -lsqlite3 16 | #cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/sqlite/include 17 | #cgo openbsd LDFLAGS: -lsqlite3 18 | #cgo solaris LDFLAGS: -lsqlite3 19 | #cgo windows LDFLAGS: -lsqlite3 20 | */ 21 | import "C" 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/precis/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package precis contains types and functions for the preparation, 6 | // enforcement, and comparison of internationalized strings ("PRECIS") as 7 | // defined in RFC 8264. It also contains several pre-defined profiles for 8 | // passwords, nicknames, and usernames as defined in RFC 8265 and RFC 8266. 9 | // 10 | // BE ADVISED: This package is under construction and the API may change in 11 | // backwards incompatible ways and without notice. 12 | package precis // import "golang.org/x/text/secure/precis" 13 | 14 | //go:generate go run gen.go gen_trieval.go 15 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/notice_response.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | type NoticeResponse ErrorResponse 4 | 5 | // Backend identifies this message as sendable by the PostgreSQL backend. 6 | func (*NoticeResponse) Backend() {} 7 | 8 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 9 | // type identifier and 4 byte message length. 10 | func (dst *NoticeResponse) Decode(src []byte) error { 11 | return (*ErrorResponse)(dst).Decode(src) 12 | } 13 | 14 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 15 | func (src *NoticeResponse) Encode(dst []byte) []byte { 16 | return append(dst, (*ErrorResponse)(src).marshalBinary('N')...) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/big.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "math/big" 5 | ) 6 | 7 | // order of magnitude (to a max order) 8 | func oomm(n, b *big.Int, maxmag int) (float64, int) { 9 | mag := 0 10 | m := &big.Int{} 11 | for n.Cmp(b) >= 0 { 12 | n.DivMod(n, b, m) 13 | mag++ 14 | if mag == maxmag && maxmag >= 0 { 15 | break 16 | } 17 | } 18 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 19 | } 20 | 21 | // total order of magnitude 22 | // (same as above, but with no upper limit) 23 | func oom(n, b *big.Int) (float64, int) { 24 | mag := 0 25 | m := &big.Int{} 26 | for n.Cmp(b) >= 0 { 27 | n.DivMod(n, b, m) 28 | mag++ 29 | } 30 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | // +build amd64,solaris 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func (iov *Iovec) SetLen(length int) { 19 | iov.Len = uint64(length) 20 | } 21 | 22 | func (msghdr *Msghdr) SetIovlen(length int) { 23 | msghdr.Iovlen = int32(length) 24 | } 25 | 26 | func (cmsg *Cmsghdr) SetLen(length int) { 27 | cmsg.Len = uint32(length) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && race 6 | // +build windows,race 7 | 8 | package windows 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/subaccount/change.go: -------------------------------------------------------------------------------- 1 | package subaccount 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForChangeSubAccount struct { 8 | NickName string `json:"nickname"` 9 | NewNickname string `json:"newNickname"` 10 | } 11 | 12 | type ResponseForChangeSubAccount string 13 | 14 | func (req *RequestForChangeSubAccount) Path() string { 15 | return "/subaccounts/update_name" 16 | } 17 | 18 | func (req *RequestForChangeSubAccount) Method() string { 19 | return http.MethodPost 20 | } 21 | 22 | func (req *RequestForChangeSubAccount) Query() string { 23 | return "" 24 | } 25 | 26 | func (req *RequestForChangeSubAccount) Payload() []byte { 27 | b, err := json.Marshal(req) 28 | if err != nil { 29 | return nil 30 | } 31 | return b 32 | } 33 | -------------------------------------------------------------------------------- /pkg/indicator/sma/sma.go: -------------------------------------------------------------------------------- 1 | package sma 2 | 3 | import ( 4 | "github.com/sklinkert/at/pkg/ohlc" 5 | "github.com/sklinkert/circularbuffer" 6 | ) 7 | 8 | const Value = "SMA_VALUE" 9 | 10 | type SMA struct { 11 | cb *circularbuffer.CircularBuffer 12 | } 13 | 14 | func New(size int) *SMA { 15 | return &SMA{ 16 | cb: circularbuffer.New(size, size), 17 | } 18 | } 19 | 20 | func (v *SMA) Insert(o *ohlc.OHLC) { 21 | if !o.Closed() { 22 | return 23 | } 24 | 25 | close, _ := o.Close.Float64() 26 | v.cb.Insert(close) 27 | } 28 | 29 | func (v *SMA) Value() (map[string]float64, error) { 30 | var err error 31 | var m = map[string]float64{} 32 | 33 | m[Value], err = v.cb.Average() 34 | return m, err 35 | } 36 | 37 | func (v *SMA) ValueResultKeys() []string { 38 | return []string{Value} 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/account/leverage.go: -------------------------------------------------------------------------------- 1 | package account 2 | 3 | import ( 4 | "net/http" 5 | 6 | jsoniter "github.com/json-iterator/go" 7 | ) 8 | 9 | var json = jsoniter.ConfigCompatibleWithStandardLibrary 10 | 11 | type RequestForLeverage struct { 12 | Leverage int `json:"leverage"` 13 | } 14 | 15 | type ResponseForLeverage interface{} 16 | 17 | func (req *RequestForLeverage) Path() string { 18 | return "/account/leverage" 19 | } 20 | 21 | func (req *RequestForLeverage) Method() string { 22 | return http.MethodPost 23 | } 24 | 25 | func (req *RequestForLeverage) Query() string { 26 | return "" 27 | } 28 | 29 | func (req *RequestForLeverage) Payload() []byte { 30 | b, err := json.Marshal(req) 31 | if err != nil { 32 | return nil 33 | } 34 | return b 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/spotmargin/submit-lending-offer.go: -------------------------------------------------------------------------------- 1 | package spotmargin 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | ) 7 | 8 | type ResponseForLendingOffer struct{} 9 | 10 | type RequestForLendingOffer struct { 11 | Coin string `json:"coin"` 12 | Size float64 `json:"size"` 13 | Rate float64 `json:"rate"` 14 | } 15 | 16 | func (req *RequestForLendingOffer) Path() string { 17 | return "/spot_margin/offers" 18 | } 19 | 20 | func (req *RequestForLendingOffer) Method() string { 21 | return http.MethodPost 22 | } 23 | 24 | func (req *RequestForLendingOffer) Query() string { 25 | return "" 26 | } 27 | 28 | func (req *RequestForLendingOffer) Payload() []byte { 29 | b, err := json.Marshal(req) 30 | if err != nil { 31 | return nil 32 | } 33 | return b 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/common.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import "time" 4 | 5 | type Quote struct { 6 | ID int `json:"id"` 7 | RequestID int `json:"requestId"` 8 | Status string `json:"status"` 9 | QuoterSide string `json:"quoterSide"` 10 | RequestSide string `json:"requestSide"` 11 | Price float64 `json:"price"` 12 | Size float64 `json:"size"` 13 | Collateral float64 `json:"collateral"` 14 | 15 | Option Option `json:"option"` 16 | 17 | QuoteExpiry time.Time `json:"quoteExpiry"` 18 | Time time.Time `json:"time"` 19 | } 20 | 21 | type Option struct { 22 | Underlying string `json:"underlying"` 23 | Type string `json:"type"` 24 | Strike float64 `json:"strike"` 25 | Expiry time.Time `json:"expiry"` 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | // +build hurd 7 | 8 | package unix 9 | 10 | /* 11 | #include 12 | int ioctl(int, unsigned long int, uintptr_t); 13 | */ 14 | import "C" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/from.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | // From from clause 4 | type From struct { 5 | Tables []Table 6 | Joins []Join 7 | } 8 | 9 | // Name from clause name 10 | func (from From) Name() string { 11 | return "FROM" 12 | } 13 | 14 | // Build build from clause 15 | func (from From) Build(builder Builder) { 16 | if len(from.Tables) > 0 { 17 | for idx, table := range from.Tables { 18 | if idx > 0 { 19 | builder.WriteByte(',') 20 | } 21 | 22 | builder.WriteQuoted(table) 23 | } 24 | } else { 25 | builder.WriteQuoted(currentTable) 26 | } 27 | 28 | for _, join := range from.Joins { 29 | builder.WriteByte(' ') 30 | join.Build(builder) 31 | } 32 | } 33 | 34 | // MergeClause merge from clause 35 | func (from From) MergeClause(clause *Clause) { 36 | clause.Expression = from 37 | } 38 | -------------------------------------------------------------------------------- /pkg/volatility/volatility.go: -------------------------------------------------------------------------------- 1 | package volatility 2 | 3 | import ( 4 | "github.com/sklinkert/at/pkg/ohlc" 5 | "github.com/sklinkert/circularbuffer" 6 | ) 7 | 8 | type Volatility struct { 9 | cb *circularbuffer.CircularBuffer 10 | } 11 | 12 | func New(minSize, maxSize int) *Volatility { 13 | return &Volatility{ 14 | cb: circularbuffer.New(minSize, maxSize), 15 | } 16 | } 17 | 18 | func (v *Volatility) AddOHLC(o *ohlc.OHLC) { 19 | if !o.Closed() { 20 | return 21 | } 22 | 23 | volaFloat, _ := o.VolatilityInPercentage().Float64() 24 | v.cb.Insert(volaFloat) 25 | } 26 | 27 | func (v *Volatility) MedianVolatilityInPercentage() (float64, error) { 28 | return v.cb.Median() 29 | } 30 | 31 | func (v *Volatility) VolatilityInPercentageQuantile(quantile float64) (float64, error) { 32 | return v.cb.Quantile(quantile) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/subaccount/balance.go: -------------------------------------------------------------------------------- 1 | package subaccount 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForBalanceSubAccount struct { 9 | NickName string 10 | } 11 | 12 | type ResponseForBalanceSubAccount []Balance 13 | 14 | type Balance struct { 15 | Coin string `json:"coin"` 16 | Free float64 `json:"free"` 17 | Total float64 `json:"total"` 18 | } 19 | 20 | func (req *RequestForBalanceSubAccount) Path() string { 21 | return fmt.Sprintf("/subaccounts/%s/balances", req.NickName) 22 | } 23 | 24 | func (req *RequestForBalanceSubAccount) Method() string { 25 | return http.MethodGet 26 | } 27 | 28 | func (req *RequestForBalanceSubAccount) Query() string { 29 | return "" 30 | } 31 | 32 | func (req *RequestForBalanceSubAccount) Payload() []byte { 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /pkg/indicator/sma/sma_test.go: -------------------------------------------------------------------------------- 1 | package sma 2 | 3 | import ( 4 | "github.com/AMekss/assert" 5 | "github.com/shopspring/decimal" 6 | "github.com/sklinkert/at/pkg/ohlc" 7 | "testing" 8 | "time" 9 | ) 10 | 11 | func TestSMA_Value(t *testing.T) { 12 | var sma20 = New(21) 13 | 14 | total := 0 15 | prices := 0 16 | now := time.Now() 17 | for i := 1; i < 22; i++ { 18 | o := ohlc.New("test", now, time.Minute, false) 19 | total += i 20 | prices++ 21 | o.NewPrice(decimal.NewFromFloat(float64(i)), o.Start) 22 | o.ForceClose() 23 | sma20.Insert(o) 24 | if i < 20 { 25 | _, err := sma20.Value() 26 | assert.ErrorIncludesMessage(t, "not enough", err) 27 | } 28 | } 29 | 30 | sma20Value, err := sma20.Value() 31 | assert.NoError(t.Fatalf, err) 32 | assert.EqualFloat64(t, float64(total/prices), sma20Value[Value]) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/AMekss/assert/inclusion.go: -------------------------------------------------------------------------------- 1 | // Package assert - makes sure that one thing includes other 2 | package assert 3 | 4 | import ( 5 | "strings" 6 | ) 7 | 8 | // ErrorIncludesMessage - asserts that received error includes particular string in the message 9 | func ErrorIncludesMessage(reporter interface{}, expectedPhrase string, got error) { 10 | if expectedPhrase == "" || got == nil || !strings.Contains(got.Error(), expectedPhrase) { 11 | reportError(reporter, &failedErrorIncludeMsg{expectedPhrase, got}) 12 | } 13 | } 14 | 15 | // IncludesString - asserts that string includes substring 16 | func IncludesString(reporter interface{}, expectedPhrase, got string) { 17 | if expectedPhrase == "" || !strings.Contains(got, expectedPhrase) { 18 | reportError(reporter, &failedStrIncludeMsg{expectedPhrase, got}) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/positons.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForOpPositions struct { 8 | } 9 | 10 | type ResponseForOpPositions []OpPosition 11 | 12 | type OpPosition struct { 13 | Side string `json:"side"` 14 | EntryPrice float64 `json:"entryPrice"` 15 | Size float64 `json:"size"` 16 | NetSize float64 `json:"netSize"` 17 | Option Option `json:"option"` 18 | } 19 | 20 | func (req *RequestForOpPositions) Path() string { 21 | return "/options/positions" 22 | } 23 | 24 | func (req *RequestForOpPositions) Method() string { 25 | return http.MethodGet 26 | } 27 | 28 | func (req *RequestForOpPositions) Query() string { 29 | return "" 30 | } 31 | 32 | func (req *RequestForOpPositions) Payload() []byte { 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | // +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris 7 | // +build gc 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /pkg/performance/performance.go: -------------------------------------------------------------------------------- 1 | package performance 2 | 3 | import ( 4 | "github.com/sklinkert/at/pkg/ohlc" 5 | "github.com/sklinkert/circularbuffer" 6 | ) 7 | 8 | type Performance struct { 9 | cb *circularbuffer.CircularBuffer 10 | } 11 | 12 | func New(minSize, maxSize int) *Performance { 13 | return &Performance{ 14 | cb: circularbuffer.New(minSize, maxSize), 15 | } 16 | } 17 | 18 | func (v *Performance) AddOHLC(o *ohlc.OHLC) { 19 | if !o.Closed() { 20 | return 21 | } 22 | 23 | volaFloat, _ := o.PerformanceInPercentage().Float64() 24 | v.cb.Insert(volaFloat) 25 | } 26 | 27 | func (v *Performance) MedianPerformanceInPercentage() (float64, error) { 28 | return v.cb.Median() 29 | } 30 | 31 | func (v *Performance) PerformanceInPercentageQuantile(quantile float64) (float64, error) { 32 | return v.cb.Quantile(quantile) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/falzm/golang-ring/README.md: -------------------------------------------------------------------------------- 1 | # ring 2 | 3 | [![GoDoc](https://godoc.org/github.com/falzm/golang-ring?status.svg)](https://godoc.org/github.com/falzm/golang-ring) 4 | 5 | Package ring provides a simple implementation of a ring buffer. 6 | 7 | This is a fork from original package [zfjagann/golang-ring](https://github.com/zfjagann/golang-ring) modified to store buffer values typed as `float64` numbers instead of `interface{}`. 8 | 9 | ## Usage 10 | 11 | ```go 12 | package main 13 | 14 | import ( 15 | "fmt" 16 | 17 | "github.com/falzm/golang-ring" 18 | ) 19 | 20 | func main() { 21 | r := ring.Ring{} 22 | r.SetCapacity(10) 23 | 24 | for i := 0.0; i <= 100.0; i++ { 25 | r.Enqueue(i) 26 | } 27 | 28 | fmt.Println(r.Values()) 29 | } 30 | ``` 31 | 32 | Output: 33 | 34 | ``` 35 | [91 92 93 94 95 96 97 98 99 100] 36 | ``` -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/spotmargin/get-lending-info.go: -------------------------------------------------------------------------------- 1 | package spotmargin 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForLendingInfo struct{} 8 | 9 | type ResponseForLendingInfo []LendingInfo 10 | 11 | type LendingInfo struct { 12 | Coin string `json:"coin"` 13 | Lendable float64 `json:"lendable"` 14 | Locked float64 `json:"locked"` 15 | MinRate float64 `json:"minRate"` 16 | Offered float64 `json:"offered"` 17 | } 18 | 19 | func (req *RequestForLendingInfo) Path() string { 20 | return "/spot_margin/lending_info" 21 | } 22 | 23 | func (req *RequestForLendingInfo) Method() string { 24 | return http.MethodGet 25 | } 26 | 27 | func (req *RequestForLendingInfo) Query() string { 28 | return "" 29 | } 30 | 31 | func (req *RequestForLendingInfo) Payload() []byte { 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | // +build darwin,race linux,race freebsd,race 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/sklinkert/circularbuffer/README.md: -------------------------------------------------------------------------------- 1 | # circularbuffer 2 | Circular Buffer in Go/Golang with some math methods. 3 | 4 | Returns an error until `minSize` elements are reached. Overrides old values when `maxSize` is reached. 5 | 6 | - Dynamic size (min, max) 7 | - Average 8 | - Median 9 | - Quantile 10 | - Min/Max 11 | 12 | ### Example 13 | 14 | ```go 15 | package main 16 | 17 | import "github.com/sklinkert/circularbuffer" 18 | 19 | func main { 20 | minSize := 5 21 | maxSize := 10 22 | cb := circularbuffer(minSize, maxSize) 23 | for i := 1; i < 12; i++ { 24 | cb.Insert(float64(i)) 25 | } 26 | 27 | value, err := cb.Median() 28 | value, err = cb.Min() 29 | value, err = cb.Max() 30 | value, err = cb.Percentile(0.8) 31 | } 32 | ``` 33 | 34 | Feel free to add further methods if you think they could be helpful. 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | // +build darwin 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // ReadDirent reads directory entries from fd and writes them into buf. 13 | func ReadDirent(fd int, buf []byte) (n int, err error) { 14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 16 | // actual system call is getdirentries64, 64 is a good guess. 17 | // TODO(rsc): Can we use a single global basep for all calls? 18 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 19 | return Getdirentries(fd, buf, base) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/subaccount/create.go: -------------------------------------------------------------------------------- 1 | package subaccount 2 | 3 | import ( 4 | "net/http" 5 | 6 | jsoniter "github.com/json-iterator/go" 7 | ) 8 | 9 | var json = jsoniter.ConfigCompatibleWithStandardLibrary 10 | 11 | type RequestForCreateSubAccount struct { 12 | NickName string `json:"nickname"` 13 | } 14 | 15 | type ResponseForCreateSubAccount SubAccount 16 | 17 | func (req *RequestForCreateSubAccount) Path() string { 18 | return "/subaccounts" 19 | } 20 | 21 | func (req *RequestForCreateSubAccount) Method() string { 22 | return http.MethodPost 23 | } 24 | 25 | func (req *RequestForCreateSubAccount) Query() string { 26 | return "" 27 | } 28 | 29 | func (req *RequestForCreateSubAccount) Payload() []byte { 30 | b, err := json.Marshal(req) 31 | if err != nil { 32 | return nil 33 | } 34 | return b 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for mips64, OpenBSD 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | JMP syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | JMP syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | JMP syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/transaction.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | func BeginTransaction(db *gorm.DB) { 8 | if !db.Config.SkipDefaultTransaction && db.Error == nil { 9 | if tx := db.Begin(); tx.Error == nil { 10 | db.Statement.ConnPool = tx.Statement.ConnPool 11 | db.InstanceSet("gorm:started_transaction", true) 12 | } else if tx.Error == gorm.ErrInvalidTransaction { 13 | tx.Error = nil 14 | } else { 15 | db.Error = tx.Error 16 | } 17 | } 18 | } 19 | 20 | func CommitOrRollbackTransaction(db *gorm.DB) { 21 | if !db.Config.SkipDefaultTransaction { 22 | if _, ok := db.InstanceGet("gorm:started_transaction"); ok { 23 | if db.Error != nil { 24 | db.Rollback() 25 | } else { 26 | db.Commit() 27 | } 28 | 29 | db.Statement.ConnPool = db.ConnPool 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | 22 | ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"] 23 | 24 | [[constraint]] 25 | name = "github.com/modern-go/reflect2" 26 | version = "1.0.1" 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/trieval.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package width 4 | 5 | // elem is an entry of the width trie. The high byte is used to encode the type 6 | // of the rune. The low byte is used to store the index to a mapping entry in 7 | // the inverseData array. 8 | type elem uint16 9 | 10 | const ( 11 | tagNeutral elem = iota << typeShift 12 | tagAmbiguous 13 | tagWide 14 | tagNarrow 15 | tagFullwidth 16 | tagHalfwidth 17 | ) 18 | 19 | const ( 20 | numTypeBits = 3 21 | typeShift = 16 - numTypeBits 22 | 23 | // tagNeedsFold is true for all fullwidth and halfwidth runes except for 24 | // the Won sign U+20A9. 25 | tagNeedsFold = 0x1000 26 | 27 | // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide 28 | // variant. 29 | wonSign rune = 0x20A9 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/returning.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Returning struct { 4 | Columns []Column 5 | } 6 | 7 | // Name where clause name 8 | func (returning Returning) Name() string { 9 | return "RETURNING" 10 | } 11 | 12 | // Build build where clause 13 | func (returning Returning) Build(builder Builder) { 14 | if len(returning.Columns) > 0 { 15 | for idx, column := range returning.Columns { 16 | if idx > 0 { 17 | builder.WriteByte(',') 18 | } 19 | 20 | builder.WriteQuoted(column) 21 | } 22 | } else { 23 | builder.WriteByte('*') 24 | } 25 | } 26 | 27 | // MergeClause merge order by clauses 28 | func (returning Returning) MergeClause(clause *Clause) { 29 | if v, ok := clause.Expression.(Returning); ok { 30 | returning.Columns = append(v.Columns, returning.Columns...) 31 | } 32 | 33 | clause.Expression = returning 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/big_endian.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/binary" 5 | ) 6 | 7 | type BigEndianBuf [8]byte 8 | 9 | func (b BigEndianBuf) Int16(n int16) []byte { 10 | buf := b[0:2] 11 | binary.BigEndian.PutUint16(buf, uint16(n)) 12 | return buf 13 | } 14 | 15 | func (b BigEndianBuf) Uint16(n uint16) []byte { 16 | buf := b[0:2] 17 | binary.BigEndian.PutUint16(buf, n) 18 | return buf 19 | } 20 | 21 | func (b BigEndianBuf) Int32(n int32) []byte { 22 | buf := b[0:4] 23 | binary.BigEndian.PutUint32(buf, uint32(n)) 24 | return buf 25 | } 26 | 27 | func (b BigEndianBuf) Uint32(n uint32) []byte { 28 | buf := b[0:4] 29 | binary.BigEndian.PutUint32(buf, n) 30 | return buf 31 | } 32 | 33 | func (b BigEndianBuf) Int64(n int64) []byte { 34 | buf := b[0:8] 35 | binary.BigEndian.PutUint64(buf, uint64(n)) 36 | return buf 37 | } 38 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/migrator/table_type.go: -------------------------------------------------------------------------------- 1 | package migrator 2 | 3 | import ( 4 | "database/sql" 5 | ) 6 | 7 | // TableType table type implements TableType interface 8 | type TableType struct { 9 | SchemaValue string 10 | NameValue string 11 | TypeValue string 12 | CommentValue sql.NullString 13 | } 14 | 15 | // Schema returns the schema of the table. 16 | func (ct TableType) Schema() string { 17 | return ct.SchemaValue 18 | } 19 | 20 | // Name returns the name of the table. 21 | func (ct TableType) Name() string { 22 | return ct.NameValue 23 | } 24 | 25 | // Type returns the type of the table. 26 | func (ct TableType) Type() string { 27 | return ct.TypeValue 28 | } 29 | 30 | // Comment returns the comment of current table. 31 | func (ct TableType) Comment() (comment string, ok bool) { 32 | return ct.CommentValue.String, ct.CommentValue.Valid 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/wallet/coins.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import ( 4 | "net/http" 5 | 6 | jsoniter "github.com/json-iterator/go" 7 | ) 8 | 9 | var json = jsoniter.ConfigCompatibleWithStandardLibrary 10 | 11 | type RequestForCoins struct { 12 | } 13 | 14 | type ResponseForCoins []Coin 15 | 16 | type Coin struct { 17 | ID string `json:"id"` 18 | Name string `json:"name"` 19 | 20 | CanDeposit bool `json:"canDeposit"` 21 | CanWithdraw bool `json:"canWithdraw"` 22 | HasTag bool `json:"hasTag"` 23 | } 24 | 25 | func (req *RequestForCoins) Path() string { 26 | return "/wallet/coins" 27 | } 28 | 29 | func (req *RequestForCoins) Method() string { 30 | return http.MethodGet 31 | } 32 | 33 | func (req *RequestForCoins) Query() string { 34 | return "" 35 | } 36 | 37 | func (req *RequestForCoins) Payload() []byte { 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgtype/cidr.go: -------------------------------------------------------------------------------- 1 | package pgtype 2 | 3 | type CIDR Inet 4 | 5 | func (dst *CIDR) Set(src interface{}) error { 6 | return (*Inet)(dst).Set(src) 7 | } 8 | 9 | func (dst CIDR) Get() interface{} { 10 | return (Inet)(dst).Get() 11 | } 12 | 13 | func (src *CIDR) AssignTo(dst interface{}) error { 14 | return (*Inet)(src).AssignTo(dst) 15 | } 16 | 17 | func (dst *CIDR) DecodeText(ci *ConnInfo, src []byte) error { 18 | return (*Inet)(dst).DecodeText(ci, src) 19 | } 20 | 21 | func (dst *CIDR) DecodeBinary(ci *ConnInfo, src []byte) error { 22 | return (*Inet)(dst).DecodeBinary(ci, src) 23 | } 24 | 25 | func (src CIDR) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error) { 26 | return (Inet)(src).EncodeText(ci, buf) 27 | } 28 | 29 | func (src CIDR) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error) { 30 | return (Inet)(src).EncodeBinary(ci, buf) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/interfaces.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import "gorm.io/gorm" 4 | 5 | type BeforeCreateInterface interface { 6 | BeforeCreate(*gorm.DB) error 7 | } 8 | 9 | type AfterCreateInterface interface { 10 | AfterCreate(*gorm.DB) error 11 | } 12 | 13 | type BeforeUpdateInterface interface { 14 | BeforeUpdate(*gorm.DB) error 15 | } 16 | 17 | type AfterUpdateInterface interface { 18 | AfterUpdate(*gorm.DB) error 19 | } 20 | 21 | type BeforeSaveInterface interface { 22 | BeforeSave(*gorm.DB) error 23 | } 24 | 25 | type AfterSaveInterface interface { 26 | AfterSave(*gorm.DB) error 27 | } 28 | 29 | type BeforeDeleteInterface interface { 30 | BeforeDelete(*gorm.DB) error 31 | } 32 | 33 | type AfterDeleteInterface interface { 34 | AfterDelete(*gorm.DB) error 35 | } 36 | 37 | type AfterFindInterface interface { 38 | AfterFind(*gorm.DB) error 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | // Unix environment variables. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | func Unsetenv(key string) error { 31 | return syscall.Unsetenv(key) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/modify-quote-request.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | // Document記載はCreate quoteだが、modify request 9 | type RequestForModifyOpQuoteRequest struct { 10 | RequestID int `json:"-"` 11 | Price float64 `json:"price"` 12 | } 13 | 14 | type ResponseForModifyOpQuoteRequest Quote 15 | 16 | func (req *RequestForModifyOpQuoteRequest) Path() string { 17 | return fmt.Sprintf("/options/requests/%s/quotes", req.RequestID) 18 | } 19 | 20 | func (req *RequestForModifyOpQuoteRequest) Method() string { 21 | return http.MethodPost 22 | } 23 | 24 | func (req *RequestForModifyOpQuoteRequest) Query() string { 25 | return "" 26 | } 27 | 28 | func (req *RequestForModifyOpQuoteRequest) Payload() []byte { 29 | b, err := json.Marshal(req) 30 | if err != nil { 31 | return nil 32 | } 33 | return b 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for 386 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/orders/cancel.go: -------------------------------------------------------------------------------- 1 | package orders 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForCancelByID struct { 9 | ClientID string 10 | OrderID int 11 | TriggerOrderID string 12 | } 13 | 14 | type ResponseForCancelByID string 15 | 16 | func (req *RequestForCancelByID) Path() string { 17 | if req.TriggerOrderID != "" { 18 | return fmt.Sprintf("/conditional_orders/%s", req.TriggerOrderID) 19 | } else if req.ClientID != "" { 20 | return fmt.Sprintf("/orders/by_client_id/%s", req.ClientID) 21 | } 22 | return fmt.Sprintf("/orders/%d", req.OrderID) 23 | } 24 | 25 | func (req *RequestForCancelByID) Method() string { 26 | return http.MethodDelete 27 | } 28 | 29 | func (req *RequestForCancelByID) Query() string { 30 | return "" 31 | } 32 | 33 | func (req *RequestForCancelByID) Payload() []byte { 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/buffer_pool.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bytes" 5 | "sync" 6 | ) 7 | 8 | var ( 9 | bufferPool BufferPool 10 | ) 11 | 12 | type BufferPool interface { 13 | Put(*bytes.Buffer) 14 | Get() *bytes.Buffer 15 | } 16 | 17 | type defaultPool struct { 18 | pool *sync.Pool 19 | } 20 | 21 | func (p *defaultPool) Put(buf *bytes.Buffer) { 22 | p.pool.Put(buf) 23 | } 24 | 25 | func (p *defaultPool) Get() *bytes.Buffer { 26 | return p.pool.Get().(*bytes.Buffer) 27 | } 28 | 29 | // SetBufferPool allows to replace the default logrus buffer pool 30 | // to better meets the specific needs of an application. 31 | func SetBufferPool(bp BufferPool) { 32 | bufferPool = bp 33 | } 34 | 35 | func init() { 36 | SetBufferPool(&defaultPool{ 37 | pool: &sync.Pool{ 38 | New: func() interface{} { 39 | return new(bytes.Buffer) 40 | }, 41 | }, 42 | }) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/orders/cancel-all.go: -------------------------------------------------------------------------------- 1 | package orders 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForCancelAll struct { 8 | ProductCode string `json:"market,omitempty"` 9 | Side string `json:"side,omitempty"` 10 | ConditionalOrdersOnly bool `json:"conditionalOrdersOnly,omitempty"` 11 | LimitOrdersOnly bool `json:"limitOrdersOnly,omitempty"` 12 | } 13 | 14 | type ResponseForCancelAll string 15 | 16 | func (req *RequestForCancelAll) Path() string { 17 | return "/orders" 18 | } 19 | 20 | func (req *RequestForCancelAll) Method() string { 21 | return http.MethodDelete 22 | } 23 | 24 | func (req *RequestForCancelAll) Query() string { 25 | return "" 26 | } 27 | 28 | func (req *RequestForCancelAll) Payload() []byte { 29 | b, err := json.Marshal(req) 30 | if err != nil { 31 | return nil 32 | } 33 | return b 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/wallet/deposit-address.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type RequestForDepositAddress struct { 9 | Coin string `json:"-"` 10 | Methods string `json:"-"` 11 | } 12 | 13 | type ResponseForDepositAddress struct { 14 | Address string `json:"address"` 15 | Tag string `json:"tag"` 16 | } 17 | 18 | func (req *RequestForDepositAddress) Path() string { 19 | path := fmt.Sprintf("/wallet/deposit_address/%s", req.Coin) 20 | if req.Methods != "" { 21 | path = fmt.Sprintf("%s?method=%s", path, req.Methods) 22 | } 23 | return path 24 | } 25 | 26 | func (req *RequestForDepositAddress) Method() string { 27 | return http.MethodGet 28 | } 29 | 30 | func (req *RequestForDepositAddress) Query() string { 31 | return "" 32 | } 33 | 34 | func (req *RequestForDepositAddress) Payload() []byte { 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate_omit.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 G.J.R. Timmer . 2 | // Copyright (C) 2018 segment.com 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build !sqlite_preupdate_hook,cgo 8 | 9 | package sqlite3 10 | 11 | // RegisterPreUpdateHook sets the pre-update hook for a connection. 12 | // 13 | // The callback is passed a SQLitePreUpdateData struct with the data for 14 | // the update, as well as methods for fetching copies of impacted data. 15 | // 16 | // If there is an existing preupdate hook for this connection, it will be 17 | // removed. If callback is nil the existing hook (if any) will be removed 18 | // without creating a new one. 19 | func (c *SQLiteConn) RegisterPreUpdateHook(callback func(SQLitePreUpdateData)) { 20 | // NOOP 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for RISCV64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/wallet/balances.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForBalances struct { 8 | } 9 | 10 | type ResponseForBalances []Balance 11 | 12 | type Balance struct { 13 | Coin string `json:"coin"` 14 | Free float64 `json:"free"` 15 | Total float64 `json:"total"` 16 | USDValue float64 `json:"usdvalue"` 17 | StopBorrow float64 `json:"spotBorrow"` 18 | AvailableWithoutBorrow float64 `json:"availableWithoutBorrow"` 19 | } 20 | 21 | func (req *RequestForBalances) Path() string { 22 | return "/wallet/balances" 23 | } 24 | 25 | func (req *RequestForBalances) Method() string { 26 | return http.MethodGet 27 | } 28 | 29 | func (req *RequestForBalances) Query() string { 30 | return "" 31 | } 32 | 33 | func (req *RequestForBalances) Payload() []byte { 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System call support for ppc64, BSD 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /internal/trader/performance_tracking_test.go: -------------------------------------------------------------------------------- 1 | package trader 2 | 3 | import ( 4 | "github.com/AMekss/assert" 5 | "github.com/shopspring/decimal" 6 | "github.com/sklinkert/at/internal/broker" 7 | "testing" 8 | ) 9 | 10 | var lossPosition = broker.Position{ 11 | BuyPrice: decimal.NewFromFloat(2), 12 | SellPrice: decimal.NewFromFloat(1), 13 | BuyDirection: broker.BuyDirectionLong, 14 | } 15 | 16 | var winPosition = broker.Position{ 17 | BuyPrice: decimal.NewFromFloat(1), 18 | SellPrice: decimal.NewFromFloat(2), 19 | BuyDirection: broker.BuyDirectionLong, 20 | } 21 | 22 | func TestTrader_getMaxConsecutiveLossTrades(t *testing.T) { 23 | var tr = Trader{} 24 | var closedPositions = []broker.Position{ 25 | winPosition, 26 | lossPosition, 27 | lossPosition, 28 | winPosition, 29 | winPosition, 30 | lossPosition, 31 | } 32 | assert.EqualInt(t, 2, int(tr.getMaxConsecutiveLossTrades(closedPositions))) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for AMD64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/update.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Update struct { 4 | Modifier string 5 | Table Table 6 | } 7 | 8 | // Name update clause name 9 | func (update Update) Name() string { 10 | return "UPDATE" 11 | } 12 | 13 | // Build build update clause 14 | func (update Update) Build(builder Builder) { 15 | if update.Modifier != "" { 16 | builder.WriteString(update.Modifier) 17 | builder.WriteByte(' ') 18 | } 19 | 20 | if update.Table.Name == "" { 21 | builder.WriteQuoted(currentTable) 22 | } else { 23 | builder.WriteQuoted(update.Table) 24 | } 25 | } 26 | 27 | // MergeClause merge update clause 28 | func (update Update) MergeClause(clause *Clause) { 29 | if v, ok := clause.Expression.(Update); ok { 30 | if update.Modifier == "" { 31 | update.Modifier = v.Modifier 32 | } 33 | if update.Table.Name == "" { 34 | update.Table = v.Table 35 | } 36 | } 37 | clause.Expression = update 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/orders/get-open-trigger-order.go: -------------------------------------------------------------------------------- 1 | package orders 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "time" 7 | ) 8 | 9 | type RequestForOrderTriggers struct { 10 | CID string `url:"-"` 11 | } 12 | 13 | type ResponseForOrderTriggers []Trigger 14 | 15 | type Trigger struct { 16 | FilledSize float64 `json:"filledSize"` 17 | OrderSize float64 `json:"orderSize"` 18 | Error string `json:"error"` 19 | 20 | OrderID int `json:"orderId"` 21 | Time time.Time `json:"time"` 22 | } 23 | 24 | func (req *RequestForOrderTriggers) Path() string { 25 | return fmt.Sprintf("/conditional_orders/%s/triggers", req.CID) 26 | } 27 | 28 | func (req *RequestForOrderTriggers) Method() string { 29 | return http.MethodGet 30 | } 31 | 32 | func (req *RequestForOrderTriggers) Query() string { 33 | return "" 34 | } 35 | 36 | func (req *RequestForOrderTriggers) Payload() []byte { 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | ignored = [] 28 | 29 | [[constraint]] 30 | name = "github.com/modern-go/concurrent" 31 | version = "1.0.0" 32 | 33 | [prune] 34 | go-tests = true 35 | unused-packages = true 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/kind_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Kind"; DO NOT EDIT. 2 | 3 | package width 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[Neutral-0] 12 | _ = x[EastAsianAmbiguous-1] 13 | _ = x[EastAsianWide-2] 14 | _ = x[EastAsianNarrow-3] 15 | _ = x[EastAsianFullwidth-4] 16 | _ = x[EastAsianHalfwidth-5] 17 | } 18 | 19 | const _Kind_name = "NeutralEastAsianAmbiguousEastAsianWideEastAsianNarrowEastAsianFullwidthEastAsianHalfwidth" 20 | 21 | var _Kind_index = [...]uint8{0, 7, 25, 38, 53, 71, 89} 22 | 23 | func (i Kind) String() string { 24 | if i < 0 || i >= Kind(len(_Kind_index)-1) { 25 | return "Kind(" + strconv.FormatInt(int64(i), 10) + ")" 26 | } 27 | return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/safe_struct.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | type safeStructType struct { 4 | safeType 5 | } 6 | 7 | func (type2 *safeStructType) FieldByName(name string) StructField { 8 | field, found := type2.Type.FieldByName(name) 9 | if !found { 10 | panic("field " + name + " not found") 11 | } 12 | return &safeField{StructField: field} 13 | } 14 | 15 | func (type2 *safeStructType) Field(i int) StructField { 16 | return &safeField{StructField: type2.Type.Field(i)} 17 | } 18 | 19 | func (type2 *safeStructType) FieldByIndex(index []int) StructField { 20 | return &safeField{StructField: type2.Type.FieldByIndex(index)} 21 | } 22 | 23 | func (type2 *safeStructType) FieldByNameFunc(match func(string) bool) StructField { 24 | field, found := type2.Type.FieldByNameFunc(match) 25 | if !found { 26 | panic("field match condition not found in " + type2.Type.String()) 27 | } 28 | return &safeField{StructField: field} 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid 2 | The uuid package generates and inspects UUIDs based on 3 | [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) 4 | and DCE 1.1: Authentication and Security Services. 5 | 6 | This package is based on the github.com/pborman/uuid package (previously named 7 | code.google.com/p/go-uuid). It differs from these earlier packages in that 8 | a UUID is a 16 byte array rather than a byte slice. One loss due to this 9 | change is the ability to represent an invalid UUID (vs a NIL UUID). 10 | 11 | ###### Install 12 | ```sh 13 | go get github.com/google/uuid 14 | ``` 15 | 16 | ###### Documentation 17 | [![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) 18 | 19 | Full `go doc` style documentation for the package can be viewed online without 20 | installing this package by using the GoDoc site here: 21 | http://pkg.go.dev/github.com/google/uuid 22 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/commaf.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package humanize 4 | 5 | import ( 6 | "bytes" 7 | "math/big" 8 | "strings" 9 | ) 10 | 11 | // BigCommaf produces a string form of the given big.Float in base 10 12 | // with commas after every three orders of magnitude. 13 | func BigCommaf(v *big.Float) string { 14 | buf := &bytes.Buffer{} 15 | if v.Sign() < 0 { 16 | buf.Write([]byte{'-'}) 17 | v.Abs(v) 18 | } 19 | 20 | comma := []byte{','} 21 | 22 | parts := strings.Split(v.Text('f', -1), ".") 23 | pos := 0 24 | if len(parts[0])%3 != 0 { 25 | pos += len(parts[0]) % 3 26 | buf.WriteString(parts[0][:pos]) 27 | buf.Write(comma) 28 | } 29 | for ; pos < len(parts[0]); pos += 3 { 30 | buf.WriteString(parts[0][pos : pos+3]) 31 | buf.Write(comma) 32 | } 33 | buf.Truncate(buf.Len() - 1) 34 | 35 | if len(parts) > 1 { 36 | buf.Write([]byte{'.'}) 37 | buf.WriteString(parts[1]) 38 | } 39 | return buf.String() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | // +build windows 7 | 8 | package windows 9 | 10 | const ( 11 | EVENTLOG_SUCCESS = 0 12 | EVENTLOG_ERROR_TYPE = 1 13 | EVENTLOG_WARNING_TYPE = 2 14 | EVENTLOG_INFORMATION_TYPE = 4 15 | EVENTLOG_AUDIT_SUCCESS = 8 16 | EVENTLOG_AUDIT_FAILURE = 16 17 | ) 18 | 19 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 20 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 21 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/wallet/withdraw.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | type RequestForWithdraw struct { 8 | Coin string `json:"coin"` 9 | Size float64 `json:"size"` 10 | Address string `json:"address"` 11 | // Optionals 12 | Tag string `json:"tag,omitempty"` 13 | Methods string `json:"method,omitempty"` 14 | Password string `json:"password,omitempty"` 15 | Code string `json:"code,omitempty"` 16 | } 17 | 18 | type ResponseForWithdraw struct { 19 | } 20 | 21 | func (req *RequestForWithdraw) Path() string { 22 | return "/wallet/withdrawals" 23 | } 24 | 25 | func (req *RequestForWithdraw) Method() string { 26 | return http.MethodPost 27 | } 28 | 29 | func (req *RequestForWithdraw) Query() string { 30 | return "" 31 | } 32 | 33 | func (req *RequestForWithdraw) Payload() []byte { 34 | b, err := json.Marshal(req) 35 | if err != nil { 36 | return nil 37 | } 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/insert.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Insert struct { 4 | Table Table 5 | Modifier string 6 | } 7 | 8 | // Name insert clause name 9 | func (insert Insert) Name() string { 10 | return "INSERT" 11 | } 12 | 13 | // Build build insert clause 14 | func (insert Insert) Build(builder Builder) { 15 | if insert.Modifier != "" { 16 | builder.WriteString(insert.Modifier) 17 | builder.WriteByte(' ') 18 | } 19 | 20 | builder.WriteString("INTO ") 21 | if insert.Table.Name == "" { 22 | builder.WriteQuoted(currentTable) 23 | } else { 24 | builder.WriteQuoted(insert.Table) 25 | } 26 | } 27 | 28 | // MergeClause merge insert clause 29 | func (insert Insert) MergeClause(clause *Clause) { 30 | if v, ok := clause.Expression.(Insert); ok { 31 | if insert.Modifier == "" { 32 | insert.Modifier = v.Modifier 33 | } 34 | if insert.Table.Name == "" { 35 | insert.Table = v.Table 36 | } 37 | } 38 | clause.Expression = insert 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/locking.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | const ( 4 | LockingStrengthUpdate = "UPDATE" 5 | LockingStrengthShare = "SHARE" 6 | LockingOptionsSkipLocked = "SKIP LOCKED" 7 | LockingOptionsNoWait = "NOWAIT" 8 | ) 9 | 10 | type Locking struct { 11 | Strength string 12 | Table Table 13 | Options string 14 | } 15 | 16 | // Name where clause name 17 | func (locking Locking) Name() string { 18 | return "FOR" 19 | } 20 | 21 | // Build build where clause 22 | func (locking Locking) Build(builder Builder) { 23 | builder.WriteString(locking.Strength) 24 | if locking.Table.Name != "" { 25 | builder.WriteString(" OF ") 26 | builder.WriteQuoted(locking.Table) 27 | } 28 | 29 | if locking.Options != "" { 30 | builder.WriteByte(' ') 31 | builder.WriteString(locking.Options) 32 | } 33 | } 34 | 35 | // MergeClause merge order by clauses 36 | func (locking Locking) MergeClause(clause *Clause) { 37 | clause.Expression = locking 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md: -------------------------------------------------------------------------------- 1 | | json type \ dest type | bool | int | uint | float |string| 2 | | --- | --- | --- | --- |--|--| 3 | | number | positive => true
negative => true
zero => false| 23.2 => 23
-32.1 => -32| 12.1 => 12
-12.1 => 0|as normal|same as origin| 4 | | string | empty string => false
string "0" => false
other strings => true | "123.32" => 123
"-123.4" => -123
"123.23xxxw" => 123
"abcde12" => 0
"-32.1" => -32| 13.2 => 13
-1.1 => 0 |12.1 => 12.1
-12.3 => -12.3
12.4xxa => 12.4
+1.1e2 =>110 |same as origin| 5 | | bool | true => true
false => false| true => 1
false => 0 | true => 1
false => 0 |true => 1
false => 0|true => "true"
false => "false"| 6 | | object | true | 0 | 0 |0|originnal json| 7 | | array | empty array => false
nonempty array => true| [] => 0
[1,2] => 1 | [] => 0
[1,2] => 1 |[] => 0
[1,2] => 1|original json| -------------------------------------------------------------------------------- /vendor/gorm.io/driver/postgres/README.md: -------------------------------------------------------------------------------- 1 | # GORM PostgreSQL Driver 2 | 3 | ## Quick Start 4 | 5 | ```go 6 | import ( 7 | "gorm.io/driver/postgres" 8 | "gorm.io/gorm" 9 | ) 10 | 11 | // https://github.com/jackc/pgx 12 | dsn := "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai" 13 | db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) 14 | ``` 15 | 16 | ## Configuration 17 | 18 | ```go 19 | import ( 20 | "gorm.io/driver/postgres" 21 | "gorm.io/gorm" 22 | ) 23 | 24 | db, err := gorm.Open(postgres.New(postgres.Config{ 25 | DSN: "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai", // data source name, refer https://github.com/jackc/pgx 26 | PreferSimpleProtocol: true, // disables implicit prepared statement usage. By default pgx automatically uses the extended protocol 27 | }), &gorm.Config{}) 28 | ``` 29 | 30 | 31 | Checkout [https://gorm.io](https://gorm.io) for details. 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/funding/funding.go: -------------------------------------------------------------------------------- 1 | package funding 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | 7 | "github.com/google/go-querystring/query" 8 | ) 9 | 10 | type Request struct { 11 | ProductCode string `url:"future,omitempty"` 12 | Start int64 `url:"start_time,omitempty"` 13 | End int64 `url:"end_time,omitempty"` 14 | } 15 | 16 | type Response []Funding 17 | 18 | type Funding struct { 19 | Future string `json:"future"` 20 | 21 | Payment float64 `json:"payment"` 22 | Rate float64 `json:"rate"` 23 | 24 | Time time.Time `json:"time"` 25 | ID int `json:"id"` 26 | } 27 | 28 | func (req *Request) Path() string { 29 | return "/funding_payments" 30 | } 31 | 32 | func (req *Request) Method() string { 33 | return http.MethodGet 34 | } 35 | 36 | func (req *Request) Query() string { 37 | value, _ := query.Values(req) 38 | return value.Encode() 39 | } 40 | 41 | func (req *Request) Payload() []byte { 42 | return nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/jsoniter.go: -------------------------------------------------------------------------------- 1 | // Package jsoniter implements encoding and decoding of JSON as defined in 2 | // RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json. 3 | // Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter 4 | // and variable type declarations (if any). 5 | // jsoniter interfaces gives 100% compatibility with code using standard lib. 6 | // 7 | // "JSON and Go" 8 | // (https://golang.org/doc/articles/json_and_go.html) 9 | // gives a description of how Marshal/Unmarshal operate 10 | // between arbitrary or predefined json objects and bytes, 11 | // and it applies to jsoniter.Marshal/Unmarshal as well. 12 | // 13 | // Besides, jsoniter.Iterator provides a different set of interfaces 14 | // iterating given bytes/string/reader 15 | // and yielding parsed elements one by one. 16 | // This set of interfaces reads input as required and gives 17 | // better performance. 18 | package jsoniter 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | // +build linux 7 | // +build ppc64le ppc64 8 | // +build gc 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall(trap, a1, a2, a3) 16 | } 17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 19 | } 20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall(trap, a1, a2, a3) 22 | } 23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | ) 11 | 12 | type direct struct{} 13 | 14 | // Direct implements Dialer by making network connections directly using net.Dial or net.DialContext. 15 | var Direct = direct{} 16 | 17 | var ( 18 | _ Dialer = Direct 19 | _ ContextDialer = Direct 20 | ) 21 | 22 | // Dial directly invokes net.Dial with the supplied parameters. 23 | func (direct) Dial(network, addr string) (net.Conn, error) { 24 | return net.Dial(network, addr) 25 | } 26 | 27 | // DialContext instantiates a net.Dialer and invokes its DialContext receiver with the supplied parameters. 28 | func (direct) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { 29 | var d net.Dialer 30 | return d.DialContext(ctx, network, addr) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/AMekss/assert/formatters.go: -------------------------------------------------------------------------------- 1 | // Package assert - private utility functions to convert stuff to string 2 | package assert 3 | 4 | import ( 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | func formatBool(in bool) string { 10 | return fmt.Sprintf("%v", in) 11 | } 12 | 13 | func formatPanic(in string) string { 14 | if in == "" { 15 | return "no panic" 16 | } 17 | return fmt.Sprintf("panic with message '%s'", in) 18 | } 19 | 20 | func formatErr(in error) string { 21 | if in == nil { 22 | return "no error" 23 | } 24 | return fmt.Sprintf("error '%s'", in) 25 | } 26 | 27 | func formatInt(in int) string { 28 | return fmt.Sprint(in) 29 | } 30 | 31 | func formatFloat(in float64) string { 32 | return fmt.Sprint(in) 33 | } 34 | 35 | func formatStr(in string) string { 36 | return fmt.Sprintf("'%s'", in) 37 | } 38 | 39 | func formatTime(in time.Time) string { 40 | return fmt.Sprint(in) 41 | } 42 | 43 | func formatInterface(in interface{}) string { 44 | return fmt.Sprintf("%#v", in) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/andybalholm/brotli/cluster.go: -------------------------------------------------------------------------------- 1 | package brotli 2 | 3 | /* Copyright 2013 Google Inc. All Rights Reserved. 4 | 5 | Distributed under MIT license. 6 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 7 | */ 8 | 9 | /* Functions for clustering similar histograms together. */ 10 | 11 | type histogramPair struct { 12 | idx1 uint32 13 | idx2 uint32 14 | cost_combo float64 15 | cost_diff float64 16 | } 17 | 18 | func histogramPairIsLess(p1 *histogramPair, p2 *histogramPair) bool { 19 | if p1.cost_diff != p2.cost_diff { 20 | return p1.cost_diff > p2.cost_diff 21 | } 22 | 23 | return (p1.idx2 - p1.idx1) > (p2.idx2 - p2.idx1) 24 | } 25 | 26 | /* Returns entropy reduction of the context map when we combine two clusters. */ 27 | func clusterCostDiff(size_a uint, size_b uint) float64 { 28 | var size_c uint = size_a + size_b 29 | return float64(size_a)*fastLog2(size_a) + float64(size_b)*fastLog2(size_b) - float64(size_c)*fastLog2(size_c) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/wallet/withdraw-histories.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | ) 7 | 8 | type RequestForWithdrawHistories struct { 9 | } 10 | 11 | type ResponseForWithdrawHistories []Withdraw 12 | 13 | type Withdraw struct { 14 | Coin string `json:"coin"` 15 | Address string `json:"address"` 16 | Tag string `json:"tag"` 17 | Status string `json:"status"` 18 | Txid string `json:"txid"` 19 | 20 | Fee float64 `json:"fee"` 21 | Size float64 `json:"size,string"` 22 | 23 | Time time.Time `json:"time"` 24 | 25 | ID int `json:"id"` 26 | } 27 | 28 | func (req *RequestForWithdrawHistories) Path() string { 29 | return "/wallet/withdrawals" 30 | } 31 | 32 | func (req *RequestForWithdrawHistories) Method() string { 33 | return http.MethodGet 34 | } 35 | 36 | func (req *RequestForWithdrawHistories) Query() string { 37 | return "" 38 | } 39 | 40 | func (req *RequestForWithdrawHistories) Payload() []byte { 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | // +build zos,s390x 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by z/OS. 10 | // 11 | // The information below is extracted and adapted from macros. 12 | 13 | package unix 14 | 15 | // Major returns the major component of a z/OS device number. 16 | func Major(dev uint64) uint32 { 17 | return uint32((dev >> 16) & 0x0000FFFF) 18 | } 19 | 20 | // Minor returns the minor component of a z/OS device number. 21 | func Minor(dev uint64) uint32 { 22 | return uint32(dev & 0x0000FFFF) 23 | } 24 | 25 | // Mkdev returns a z/OS device number generated from the given major and minor 26 | // components. 27 | func Mkdev(major, minor uint32) uint64 { 28 | return (uint64(major) << 16) | uint64(minor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | // Set adds fd to the set fds. 11 | func (fds *FdSet) Set(fd int) { 12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 13 | } 14 | 15 | // Clear removes fd from the set fds. 16 | func (fds *FdSet) Clear(fd int) { 17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 18 | } 19 | 20 | // IsSet returns whether fd is in the set fds. 21 | func (fds *FdSet) IsSet(fd int) bool { 22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 23 | } 24 | 25 | // Zero clears the set fds. 26 | func (fds *FdSet) Zero() { 27 | for i := range fds.Bits { 28 | fds.Bits[i] = 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /pkg/chart/plotly/assets/chart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | at - Chart 11 | 12 | 13 | 17 | 18 | 33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/public/markets/orderbook.go: -------------------------------------------------------------------------------- 1 | package markets 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | // query 10 | // ?depth={depth} 11 | type RequestForOrderbook struct { 12 | ProductCode string `json:"-"` 13 | Depth int `json:"depth,omitempty"` 14 | } 15 | 16 | type ResponseForOrderbook Orderbook 17 | 18 | type Orderbook struct { 19 | Asks [][]float64 `json:"asks"` 20 | Bids [][]float64 `json:"bids"` 21 | } 22 | 23 | func (req *RequestForOrderbook) Path() string { 24 | return fmt.Sprintf("/markets/%s/orderbook", req.ProductCode) 25 | } 26 | 27 | func (req *RequestForOrderbook) Method() string { 28 | return http.MethodGet 29 | } 30 | 31 | func (req *RequestForOrderbook) Query() string { 32 | // values, _ := query.Values(req) 33 | // return values.Encode() 34 | return "" 35 | } 36 | 37 | func (req *RequestForOrderbook) Payload() []byte { 38 | b, err := json.Marshal(req) 39 | if err != nil { 40 | return nil 41 | } 42 | return b 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/callmethod.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "reflect" 5 | 6 | "gorm.io/gorm" 7 | ) 8 | 9 | func callMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool) { 10 | tx := db.Session(&gorm.Session{NewDB: true}) 11 | if called := fc(db.Statement.ReflectValue.Interface(), tx); !called { 12 | switch db.Statement.ReflectValue.Kind() { 13 | case reflect.Slice, reflect.Array: 14 | db.Statement.CurDestIndex = 0 15 | for i := 0; i < db.Statement.ReflectValue.Len(); i++ { 16 | if value := reflect.Indirect(db.Statement.ReflectValue.Index(i)); value.CanAddr() { 17 | fc(value.Addr().Interface(), tx) 18 | } else { 19 | db.AddError(gorm.ErrInvalidValue) 20 | return 21 | } 22 | db.Statement.CurDestIndex++ 23 | } 24 | case reflect.Struct: 25 | if db.Statement.ReflectValue.CanAddr() { 26 | fc(db.Statement.ReflectValue.Addr().Interface(), tx) 27 | } else { 28 | db.AddError(gorm.ErrInvalidValue) 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/options/trades.go: -------------------------------------------------------------------------------- 1 | package options 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | 7 | "github.com/google/go-querystring/query" 8 | ) 9 | 10 | type RequestForOpTrades struct { 11 | Limit int `url:"limit,omitempty"` 12 | Start int64 `url:"start_time,omitempty"` 13 | End int64 `url:"end_time,omitempty"` 14 | } 15 | 16 | type ResponseForOpTrades []OpTrade 17 | 18 | type OpTrade struct { 19 | ID int `json:"id"` 20 | Price float64 `json:"price"` 21 | Size float64 `json:"size"` 22 | Option Option `json:"option"` 23 | Time time.Time `json:"time"` 24 | } 25 | 26 | func (req *RequestForOpTrades) Path() string { 27 | return "/options/trades" 28 | } 29 | 30 | func (req *RequestForOpTrades) Method() string { 31 | return http.MethodGet 32 | } 33 | 34 | func (req *RequestForOpTrades) Query() string { 35 | value, _ := query.Values(req) 36 | return value.Encode() 37 | } 38 | 39 | func (req *RequestForOpTrades) Payload() []byte { 40 | return nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/piquette/finance-go/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | 28 | [[constraint]] 29 | name = "github.com/shopspring/decimal" 30 | version = "1.0.1" 31 | 32 | [[constraint]] 33 | name = "github.com/stretchr/testify" 34 | version = "1.2.1" 35 | 36 | [prune] 37 | go-tests = true 38 | unused-packages = true 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | // +build aix,ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgtype/database_sql.go: -------------------------------------------------------------------------------- 1 | package pgtype 2 | 3 | import ( 4 | "database/sql/driver" 5 | "errors" 6 | ) 7 | 8 | func DatabaseSQLValue(ci *ConnInfo, src Value) (interface{}, error) { 9 | if valuer, ok := src.(driver.Valuer); ok { 10 | return valuer.Value() 11 | } 12 | 13 | if textEncoder, ok := src.(TextEncoder); ok { 14 | buf, err := textEncoder.EncodeText(ci, nil) 15 | if err != nil { 16 | return nil, err 17 | } 18 | return string(buf), nil 19 | } 20 | 21 | if binaryEncoder, ok := src.(BinaryEncoder); ok { 22 | buf, err := binaryEncoder.EncodeBinary(ci, nil) 23 | if err != nil { 24 | return nil, err 25 | } 26 | return buf, nil 27 | } 28 | 29 | return nil, errors.New("cannot convert to database/sql compatible value") 30 | } 31 | 32 | func EncodeValueText(src TextEncoder) (interface{}, error) { 33 | buf, err := src.EncodeText(nil, make([]byte, 0, 32)) 34 | if err != nil { 35 | return nil, err 36 | } 37 | if buf == nil { 38 | return nil, nil 39 | } 40 | return string(buf), err 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | // +build 386,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | // +build amd64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | // +build arm,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | // +build arm64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /pkg/eo/eo_test.go: -------------------------------------------------------------------------------- 1 | package eo 2 | 3 | import ( 4 | "github.com/AMekss/assert" 5 | "github.com/shopspring/decimal" 6 | "github.com/sklinkert/at/pkg/ohlc" 7 | "testing" 8 | "time" 9 | ) 10 | 11 | func Test_riskLevelHigh(t *testing.T) { 12 | overlay := New() 13 | 14 | for i := 0; i < 100; i++ { 15 | candle := generateCandle(float64(i)) 16 | overlay.AddCandle(candle) 17 | } 18 | level := overlay.riskLevel() 19 | assert.EqualInt(t, int(RExtreme), int(level)) 20 | } 21 | 22 | func Test_riskLevelLow(t *testing.T) { 23 | overlay := New() 24 | 25 | for i := 100; i > 0; i-- { 26 | candle := generateCandle(float64(i)) 27 | overlay.AddCandle(candle) 28 | } 29 | level := overlay.riskLevel() 30 | assert.EqualInt(t, int(RLow), int(level)) 31 | } 32 | 33 | func generateCandle(diff float64) *ohlc.OHLC { 34 | now := time.Now() 35 | candle := ohlc.New("test", now, time.Minute, false) 36 | candle.NewPrice(decimal.NewFromFloat(10), now) 37 | candle.NewPrice(decimal.NewFromFloat(10+diff), now) 38 | candle.ForceClose() 39 | return candle 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/spotmargin/get-borrow-history.go: -------------------------------------------------------------------------------- 1 | package spotmargin 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "time" 7 | ) 8 | 9 | type RequestForBorrowHistory struct { 10 | StartTime int64 `json:"start_time,omitempty"` 11 | EndTime int64 `json:"end_time,omitempty"` 12 | } 13 | 14 | type ResponseForBorrowHistory []BorrowHistory 15 | 16 | type BorrowHistory struct { 17 | Coin string `json:"coin"` 18 | Cost float64 `json:"cost"` 19 | Rate float64 `json:"rate"` 20 | Size float64 `json:"size"` 21 | Time time.Time `json:"time"` 22 | } 23 | 24 | func (req *RequestForBorrowHistory) Path() string { 25 | return "/spot_margin/borrow_history" 26 | } 27 | 28 | func (req *RequestForBorrowHistory) Method() string { 29 | return http.MethodGet 30 | } 31 | 32 | func (req *RequestForBorrowHistory) Query() string { 33 | return "" 34 | } 35 | 36 | func (req *RequestForBorrowHistory) Payload() []byte { 37 | b, err := json.Marshal(req) 38 | if err != nil { 39 | return nil 40 | } 41 | return b 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgio/write.go: -------------------------------------------------------------------------------- 1 | package pgio 2 | 3 | import "encoding/binary" 4 | 5 | func AppendUint16(buf []byte, n uint16) []byte { 6 | wp := len(buf) 7 | buf = append(buf, 0, 0) 8 | binary.BigEndian.PutUint16(buf[wp:], n) 9 | return buf 10 | } 11 | 12 | func AppendUint32(buf []byte, n uint32) []byte { 13 | wp := len(buf) 14 | buf = append(buf, 0, 0, 0, 0) 15 | binary.BigEndian.PutUint32(buf[wp:], n) 16 | return buf 17 | } 18 | 19 | func AppendUint64(buf []byte, n uint64) []byte { 20 | wp := len(buf) 21 | buf = append(buf, 0, 0, 0, 0, 0, 0, 0, 0) 22 | binary.BigEndian.PutUint64(buf[wp:], n) 23 | return buf 24 | } 25 | 26 | func AppendInt16(buf []byte, n int16) []byte { 27 | return AppendUint16(buf, uint16(n)) 28 | } 29 | 30 | func AppendInt32(buf []byte, n int32) []byte { 31 | return AppendUint32(buf, uint32(n)) 32 | } 33 | 34 | func AppendInt64(buf []byte, n int64) []byte { 35 | return AppendUint64(buf, uint64(n)) 36 | } 37 | 38 | func SetInt32(buf []byte, n int32) { 39 | binary.BigEndian.PutUint32(buf, uint32(n)) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/valyala/bytebufferpool.svg)](https://travis-ci.org/valyala/bytebufferpool) 2 | [![GoDoc](https://godoc.org/github.com/valyala/bytebufferpool?status.svg)](http://godoc.org/github.com/valyala/bytebufferpool) 3 | [![Go Report](http://goreportcard.com/badge/valyala/bytebufferpool)](http://goreportcard.com/report/valyala/bytebufferpool) 4 | 5 | # bytebufferpool 6 | 7 | An implementation of a pool of byte buffers with anti-memory-waste protection. 8 | 9 | The pool may waste limited amount of memory due to fragmentation. 10 | This amount equals to the maximum total size of the byte buffers 11 | in concurrent use. 12 | 13 | # Benchmark results 14 | Currently bytebufferpool is fastest and most effective buffer pool written in Go. 15 | 16 | You can find results [here](https://omgnull.github.io/go-benchmark/buffer/). 17 | 18 | # bytebufferpool users 19 | 20 | * [fasthttp](https://github.com/valyala/fasthttp) 21 | * [quicktemplate](https://github.com/valyala/quicktemplate) 22 | -------------------------------------------------------------------------------- /internal/broker/broker.go: -------------------------------------------------------------------------------- 1 | package broker 2 | 3 | import ( 4 | "errors" 5 | "github.com/sklinkert/at/pkg/tick" 6 | ) 7 | 8 | type BuyDirection int 9 | type OrderType int 10 | 11 | const ( 12 | BuyDirectionLong BuyDirection = iota 13 | BuyDirectionShort 14 | 15 | OrderTypeMarket OrderType = iota 16 | OrderTypeLimit 17 | ) 18 | 19 | var ( 20 | ErrPositionNotFound = errors.New("position not found") 21 | ErrUnknownBuyDirection = errors.New("unknown buy direction") 22 | ) 23 | 24 | func (bd BuyDirection) String() string { 25 | return [...]string{"Long", "Short"}[bd] 26 | } 27 | 28 | type Broker interface { 29 | Buy(order Order) (orderID string, err error) 30 | CancelOrder(orderID string) error 31 | Sell(position Position) error 32 | GetOpenPosition(positionRef string) (position Position, err error) 33 | GetOpenPositions() ([]Position, error) 34 | GetOpenOrders() ([]Order, error) 35 | GetOpenPositionsByInstrument(instrument string) ([]Position, error) 36 | GetClosedPositions() ([]Position, error) 37 | ListenToPriceFeed(chan tick.Tick) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/sync.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Sync struct{} 8 | 9 | // Frontend identifies this message as sendable by a PostgreSQL frontend. 10 | func (*Sync) Frontend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *Sync) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "Sync", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *Sync) Encode(dst []byte) []byte { 24 | return append(dst, 'S', 0, 0, 0, 4) 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src Sync) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "Sync", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-numb/go-ftx/rest/private/spotmargin/get-lending-history.go: -------------------------------------------------------------------------------- 1 | package spotmargin 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "time" 7 | ) 8 | 9 | type RequestForLendingHistory struct { 10 | StartTime int64 `json:"start_time,omitempty"` 11 | EndTime int64 `json:"end_time,omitempty"` 12 | } 13 | 14 | type ResponseForLendingHistory []LendingHistory 15 | 16 | type LendingHistory struct { 17 | Coin string `json:"coin"` 18 | Cost float64 `json:"cost"` 19 | Rate float64 `json:"rate"` 20 | Size float64 `json:"size"` 21 | Time time.Time `json:"time"` 22 | } 23 | 24 | func (req *RequestForLendingHistory) Path() string { 25 | return "/spot_margin/lending_history" 26 | } 27 | 28 | func (req *RequestForLendingHistory) Method() string { 29 | return http.MethodGet 30 | } 31 | 32 | func (req *RequestForLendingHistory) Query() string { 33 | return "" 34 | } 35 | 36 | func (req *RequestForLendingHistory) Payload() []byte { 37 | b, err := json.Marshal(req) 38 | if err != nil { 39 | return nil 40 | } 41 | return b 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/flush.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Flush struct{} 8 | 9 | // Frontend identifies this message as sendable by a PostgreSQL frontend. 10 | func (*Flush) Frontend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *Flush) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "Flush", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *Flush) Encode(dst []byte) []byte { 24 | return append(dst, 'H', 0, 0, 0, 4) 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src Flush) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "Flush", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/preichenberger/go-coinbasepro/v2/fill.go: -------------------------------------------------------------------------------- 1 | package coinbasepro 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Fill struct { 8 | TradeID int `json:"trade_id,int"` 9 | ProductID string `json:"product_id"` 10 | Price string `json:"price"` 11 | Size string `json:"size"` 12 | FillID string `json:"order_id"` 13 | CreatedAt Time `json:"created_at,string"` 14 | Fee string `json:"fee"` 15 | Settled bool `json:"settled"` 16 | Side string `json:"side"` 17 | Liquidity string `json:"liquidity"` 18 | } 19 | 20 | type ListFillsParams struct { 21 | OrderID string 22 | ProductID string 23 | Pagination PaginationParams 24 | } 25 | 26 | func (c *Client) ListFills(p ListFillsParams) *Cursor { 27 | paginationParams := p.Pagination 28 | if p.OrderID != "" { 29 | paginationParams.AddExtraParam("order_id", p.OrderID) 30 | } 31 | if p.ProductID != "" { 32 | paginationParams.AddExtraParam("product_id", p.ProductID) 33 | } 34 | 35 | return NewCursor(c, "GET", fmt.Sprintf("/fills"), 36 | &paginationParams) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgproto3/v2/no_data.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type NoData struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*NoData) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *NoData) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "NoData", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *NoData) Encode(dst []byte) []byte { 24 | return append(dst, 'n', 0, 0, 0, 4) 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src NoData) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "NoData", 33 | }) 34 | } 35 | --------------------------------------------------------------------------------