mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +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>
23 lines
548 B
Go
23 lines
548 B
Go
package gemini
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/request"
|
|
)
|
|
|
|
const (
|
|
// gemini limit rates
|
|
geminiRateInterval = time.Minute
|
|
geminiAuthRate = 600
|
|
geminiUnauthRate = 120
|
|
)
|
|
|
|
// GetRateLimit returns the rate limit for the exchange
|
|
func GetRateLimit() request.RateLimitDefinitions {
|
|
return request.RateLimitDefinitions{
|
|
request.Auth: request.NewRateLimitWithWeight(geminiRateInterval, geminiAuthRate, 1),
|
|
request.UnAuth: request.NewRateLimitWithWeight(geminiRateInterval, geminiUnauthRate, 1),
|
|
}
|
|
}
|