mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* initial consolidation of rate limiting code to request package to reduce bespoke code implementation * continued * finish abstraction * lint * exchanges: fix tests * linter: fix * poloniex: fix auth rate limit not being set * ratelimiter: convert from token to weight * glorious: nits addressed with fire * linter: rip * change func name set -> get * fix test * derbit: impl --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
26 lines
740 B
Go
26 lines
740 B
Go
package poloniex
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/request"
|
|
)
|
|
|
|
const (
|
|
poloniexRateInterval = time.Second
|
|
poloniexAuthRate = 6
|
|
poloniexUnauthRate = 6
|
|
)
|
|
|
|
// GetRateLimit returns the rate limit for the exchange
|
|
// If your account's volume is over $5 million in 30 day volume,
|
|
// you may be eligible for an API rate limit increase.
|
|
// Please email poloniex@circle.com.
|
|
// As per https://docs.poloniex.com/#http-api
|
|
func GetRateLimit() request.RateLimitDefinitions {
|
|
return request.RateLimitDefinitions{
|
|
request.Auth: request.NewRateLimitWithWeight(poloniexRateInterval, poloniexAuthRate, 1),
|
|
request.UnAuth: request.NewRateLimitWithWeight(poloniexRateInterval, poloniexUnauthRate, 1),
|
|
}
|
|
}
|