mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 07:26:46 +00:00
futures: Implement GetLatestFundingRates across exchanges (#1339)
* adds funding rate implementations and improvements * merge fixes x1 * lint * kucoin funding rates func make * migrate sync-manager to keys * some kucoin work * adds some kucoin wrapper funcs * ehhh, todo * kucoin position * start of orders * adds the kucoin tests yay * multiplier * nits, EWS includes order limits * NotYetImplemented, IsPerp improvements, cleaning * lint, test fix, huobi time * fixes issues, improves testing * fixes linters I WRECKED * local lint but remote lint, lint, lint, lint * fixes err * skip CI * lint * Supported rates, binance endpoints * fixes weird mocktest problems * no, CZ is invalid * fixes some new EWS test errors
This commit is contained in:
@@ -70,7 +70,7 @@ func (f fExchange) GetFuturesPositionSummary(context.Context, *futures.PositionS
|
||||
MarkPrice: leet,
|
||||
CurrentSize: leet,
|
||||
AverageOpenPrice: leet,
|
||||
PositionPNL: leet,
|
||||
UnrealisedPNL: leet,
|
||||
MaintenanceMarginFraction: leet,
|
||||
FreeCollateral: leet,
|
||||
TotalCollateral: leet,
|
||||
@@ -141,29 +141,31 @@ func (f fExchange) GetFuturesPositionOrders(_ context.Context, req *futures.Posi
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (f fExchange) GetLatestFundingRate(_ context.Context, request *fundingrate.LatestRateRequest) (*fundingrate.LatestRateResponse, error) {
|
||||
func (f fExchange) GetLatestFundingRates(_ context.Context, request *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error) {
|
||||
leet := decimal.NewFromInt(1337)
|
||||
return &fundingrate.LatestRateResponse{
|
||||
Exchange: f.GetName(),
|
||||
Asset: request.Asset,
|
||||
Pair: request.Pair,
|
||||
LatestRate: fundingrate.Rate{
|
||||
Time: time.Now(),
|
||||
Rate: leet,
|
||||
Payment: leet,
|
||||
return []fundingrate.LatestRateResponse{
|
||||
{
|
||||
Exchange: f.GetName(),
|
||||
Asset: request.Asset,
|
||||
Pair: request.Pair,
|
||||
LatestRate: fundingrate.Rate{
|
||||
Time: time.Now(),
|
||||
Rate: leet,
|
||||
Payment: leet,
|
||||
},
|
||||
PredictedUpcomingRate: fundingrate.Rate{
|
||||
Time: time.Now(),
|
||||
Rate: leet,
|
||||
Payment: leet,
|
||||
},
|
||||
TimeOfNextRate: time.Now(),
|
||||
},
|
||||
PredictedUpcomingRate: fundingrate.Rate{
|
||||
Time: time.Now(),
|
||||
Rate: leet,
|
||||
Payment: leet,
|
||||
},
|
||||
TimeOfNextRate: time.Now(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f fExchange) GetFundingRates(_ context.Context, request *fundingrate.RatesRequest) (*fundingrate.Rates, error) {
|
||||
func (f fExchange) GetHistoricalFundingRates(_ context.Context, request *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error) {
|
||||
leet := decimal.NewFromInt(1337)
|
||||
return &fundingrate.Rates{
|
||||
return &fundingrate.HistoricalRates{
|
||||
Exchange: f.GetName(),
|
||||
Asset: request.Asset,
|
||||
Pair: request.Pair,
|
||||
|
||||
Reference in New Issue
Block a user