Documentation
¶
Overview ¶
Package okx is a Go SDK for the OKX v5 API.
OKX v5 is a single unified-account API: spot, margin, perpetual swaps, futures, options, funding, sub-accounts, earn and copy-trading are all served from one domain (https://www.okx.com) under the /api/v5/* path namespace and signed with one HMAC-SHA256 scheme. This package exposes every REST endpoint (and, in the ws_*.go files, the v5 WebSocket streams) through a fluent, per-endpoint Service API.
Install: go get github.com/UnipayFI/go-okx Import: import "github.com/UnipayFI/go-okx"
Authentication uses the OK-ACCESS-KEY / OK-ACCESS-SIGN / OK-ACCESS-TIMESTAMP / OK-ACCESS-PASSPHRASE headers; the sign is base64(HMAC-SHA256(secret, prehash)) over timestamp + method + requestPath + body, with an ISO-8601 millisecond UTC timestamp.
Quick start:
c := okx.NewClient(client.WithAuth(apiKey, apiSecret, passphrase))
if err := c.SyncServerTime(ctx); err != nil { /* ... */ }
// Public market data (no auth).
tickers, err := c.NewGetTickersService(okx.InstTypeSpot).Do(ctx)
// Private account data.
bal, err := c.NewGetBalanceService().Do(ctx)
Index ¶
- Constants
- func ValidateClOrdID(clOrdId string) error
- type AccountConfig
- type AccountLevelSetting
- type AccountPositionRisk
- type AccountPositionRiskBalance
- type AccountPositionRiskPos
- type AccountPositionTier
- type AccountRateLimit
- type ActivateOption
- type ActivateOptionService
- type AdjustFlexLoanCollateralService
- type AdjustGridInvestmentService
- type AdjustGridMarginBalanceService
- func (s *AdjustGridMarginBalanceService) Do(ctx context.Context) (*GridMarginBalanceResult, error)
- func (s *AdjustGridMarginBalanceService) SetAmt(amt decimal.Decimal) *AdjustGridMarginBalanceService
- func (s *AdjustGridMarginBalanceService) SetPercent(percent decimal.Decimal) *AdjustGridMarginBalanceService
- type AdjustLeverageInfo
- type AdvChaseParam
- type AffiliateInviteeDetail
- type AlgoAttachOrd
- type AlgoAttachOrdInfo
- type AlgoCancelArg
- type AlgoLinkedOrd
- type AlgoOrdType
- type AlgoOrder
- type AlgoResult
- type AlgoState
- type AmendAlgoOrderService
- func (s *AmendAlgoOrderService) Do(ctx context.Context) (*AlgoResult, error)
- func (s *AmendAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetAlgoId(algoId string) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetAttachAlgoOrds(ords []AlgoAttachOrd) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetCxlOnFail(cxl bool) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewOrdPx(px decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewSlOrdPx(px decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewSlTriggerPx(px decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewSlTriggerPxType(pxType string) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewSz(sz decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewTpOrdKind(kind string) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewTpOrdPx(px decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewTpTriggerPx(px decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewTpTriggerPxType(pxType string) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewTriggerPx(px decimal.Decimal) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetNewTriggerPxType(pxType string) *AmendAlgoOrderService
- func (s *AmendAlgoOrderService) SetReqId(reqId string) *AmendAlgoOrderService
- type AmendBatchOrdersService
- type AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) Do(ctx context.Context) (*CopyResult, error)
- func (s *AmendCopyCopySettingsService) SetCopyAmt(copyAmt decimal.Decimal) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetCopyRatio(copyRatio decimal.Decimal) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetCopyTotalAmt(copyTotalAmt decimal.Decimal) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetInstId(instId string) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetInstType(instType InstType) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetSlRatio(slRatio decimal.Decimal) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetSlTotalAmt(slTotalAmt decimal.Decimal) *AmendCopyCopySettingsService
- func (s *AmendCopyCopySettingsService) SetTpRatio(tpRatio decimal.Decimal) *AmendCopyCopySettingsService
- type AmendCopyLeadingInstrumentsService
- type AmendCopyProfitSharingRatioService
- type AmendFixedLoanLendingOrderService
- func (s *AmendFixedLoanLendingOrderService) Do(ctx context.Context) (*FixedLoanAmendLendingOrderAck, error)
- func (s *AmendFixedLoanLendingOrderService) SetAutoRenewal(autoRenewal bool) *AmendFixedLoanLendingOrderService
- func (s *AmendFixedLoanLendingOrderService) SetChangeAmt(changeAmt decimal.Decimal) *AmendFixedLoanLendingOrderService
- func (s *AmendFixedLoanLendingOrderService) SetRate(rate decimal.Decimal) *AmendFixedLoanLendingOrderService
- type AmendGridAlgoOrderService
- func (s *AmendGridAlgoOrderService) Do(ctx context.Context) (*GridResult, error)
- func (s *AmendGridAlgoOrderService) SetSlRatio(ratio decimal.Decimal) *AmendGridAlgoOrderService
- func (s *AmendGridAlgoOrderService) SetSlTriggerPx(px decimal.Decimal) *AmendGridAlgoOrderService
- func (s *AmendGridAlgoOrderService) SetTpRatio(ratio decimal.Decimal) *AmendGridAlgoOrderService
- func (s *AmendGridAlgoOrderService) SetTpTriggerPx(px decimal.Decimal) *AmendGridAlgoOrderService
- func (s *AmendGridAlgoOrderService) SetTriggerParams(params []GridTriggerParam) *AmendGridAlgoOrderService
- type AmendOrderArg
- type AmendOrderService
- func (s *AmendOrderService) Do(ctx context.Context) (*AmendResult, error)
- func (s *AmendOrderService) SetAttachAlgoOrds(orders []AttachAlgoOrd) *AmendOrderService
- func (s *AmendOrderService) SetClOrdId(clOrdId string) *AmendOrderService
- func (s *AmendOrderService) SetCxlOnFail(cxlOnFail bool) *AmendOrderService
- func (s *AmendOrderService) SetNewPx(newPx decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewPxUsd(newPxUsd decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewPxVol(newPxVol decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewSlOrdPx(px decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewSlTriggerPx(px decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewSlTriggerPxType(pxType string) *AmendOrderService
- func (s *AmendOrderService) SetNewSz(newSz decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewTpOrdPx(px decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewTpTriggerPx(px decimal.Decimal) *AmendOrderService
- func (s *AmendOrderService) SetNewTpTriggerPxType(pxType string) *AmendOrderService
- func (s *AmendOrderService) SetOrdId(ordId string) *AmendOrderService
- func (s *AmendOrderService) SetReqId(reqId string) *AmendOrderService
- type AmendRecurringOrderService
- type AmendResult
- type AmendSprdOrderService
- func (s *AmendSprdOrderService) Do(ctx context.Context) (*SprdAmendAck, error)
- func (s *AmendSprdOrderService) SetClOrdId(clOrdId string) *AmendSprdOrderService
- func (s *AmendSprdOrderService) SetNewPx(newPx string) *AmendSprdOrderService
- func (s *AmendSprdOrderService) SetNewSz(newSz string) *AmendSprdOrderService
- func (s *AmendSprdOrderService) SetOrdId(ordId string) *AmendSprdOrderService
- func (s *AmendSprdOrderService) SetReqId(reqId string) *AmendSprdOrderService
- type AnnouncementItem
- type AnnouncementType
- type Announcements
- type ApplyBillsHistoryArchiveService
- type ApplyCopyLeadTradingService
- type ApplyMonthlyStatementService
- type AssetAcctType
- type AssetBill
- type AssetTransferType
- type AssetValuation
- type AssetValuationDetails
- type AttachAlgoOrd
- type AutoLoanSetting
- type AutoRepay
- type Balance
- type BalanceDetail
- type BatchOrdersService
- type Bill
- type BillsHistoryArchive
- type BillsHistoryArchiveQuarter
- type BlockTicker
- type BorrowRepay
- type BorrowRepayHistory
- type BorrowRepayType
- type CancelAdvanceAlgoOrdersService
- type CancelAlgoOrdersService
- type CancelAllAfterResult
- type CancelAllAfterRfqService
- type CancelAllAfterService
- type CancelAllRfqQuotesService
- type CancelAllRfqsService
- type CancelAllSprdOrdersService
- type CancelBatchOrdersService
- type CancelBatchRfqQuotesService
- type CancelBatchRfqsService
- type CancelGridCloseOrderService
- type CancelOrderArg
- type CancelOrderService
- type CancelRfqQuoteService
- func (s *CancelRfqQuoteService) Do(ctx context.Context) (*RfqQuoteCancelAck, error)
- func (s *CancelRfqQuoteService) SetClQuoteId(clQuoteId string) *CancelRfqQuoteService
- func (s *CancelRfqQuoteService) SetClRfqId(clRfqId string) *CancelRfqQuoteService
- func (s *CancelRfqQuoteService) SetQuoteId(quoteId string) *CancelRfqQuoteService
- func (s *CancelRfqQuoteService) SetRfqId(rfqId string) *CancelRfqQuoteService
- type CancelRfqService
- type CancelSprdOrderAlgoService
- type CancelSprdOrderService
- type CancelStakingService
- type CancelWithdrawal
- type CancelWithdrawalService
- type Candle
- type Client
- func (c *Client) NewActivateOptionService() *ActivateOptionService
- func (c *Client) NewAdjustFlexLoanCollateralService(typ FlexLoanAdjustType, collateralCcy string, collateralAmt decimal.Decimal) *AdjustFlexLoanCollateralService
- func (c *Client) NewAdjustGridInvestmentService(algoId string, amt decimal.Decimal) *AdjustGridInvestmentService
- func (c *Client) NewAdjustGridMarginBalanceService(algoId, typ string) *AdjustGridMarginBalanceService
- func (c *Client) NewAmendAlgoOrderService(instId string) *AmendAlgoOrderService
- func (c *Client) NewAmendBatchOrdersService(orders []AmendOrderArg) *AmendBatchOrdersService
- func (c *Client) NewAmendCopyCopySettingsService(uniqueCode, copyMgnMode, copyInstIdType, copyMode, subPosCloseType string) *AmendCopyCopySettingsService
- func (c *Client) NewAmendCopyLeadingInstrumentsService(instId string) *AmendCopyLeadingInstrumentsService
- func (c *Client) NewAmendCopyProfitSharingRatioService(profitSharingRatio decimal.Decimal) *AmendCopyProfitSharingRatioService
- func (c *Client) NewAmendFixedLoanLendingOrderService(ordId string) *AmendFixedLoanLendingOrderService
- func (c *Client) NewAmendGridAlgoOrderService(algoId, instId string) *AmendGridAlgoOrderService
- func (c *Client) NewAmendOrderService(instId string) *AmendOrderService
- func (c *Client) NewAmendRecurringOrderService(algoId string) *AmendRecurringOrderService
- func (c *Client) NewAmendSprdOrderService() *AmendSprdOrderService
- func (c *Client) NewApplyBillsHistoryArchiveService(year string, quarter BillsHistoryArchiveQuarter) *ApplyBillsHistoryArchiveService
- func (c *Client) NewApplyCopyLeadTradingService(instId string) *ApplyCopyLeadTradingService
- func (c *Client) NewApplyMonthlyStatementService() *ApplyMonthlyStatementService
- func (c *Client) NewBatchOrdersService(orders []OrderArg) *BatchOrdersService
- func (c *Client) NewCancelAdvanceAlgoOrdersService(items []AlgoCancelArg) *CancelAdvanceAlgoOrdersService
- func (c *Client) NewCancelAlgoOrdersService(items []AlgoCancelArg) *CancelAlgoOrdersService
- func (c *Client) NewCancelAllAfterRfqService(timeOut int) *CancelAllAfterRfqService
- func (c *Client) NewCancelAllAfterService(timeOut int) *CancelAllAfterService
- func (c *Client) NewCancelAllRfqQuotesService() *CancelAllRfqQuotesService
- func (c *Client) NewCancelAllRfqsService() *CancelAllRfqsService
- func (c *Client) NewCancelAllSprdOrdersService() *CancelAllSprdOrdersService
- func (c *Client) NewCancelBatchOrdersService(orders []CancelOrderArg) *CancelBatchOrdersService
- func (c *Client) NewCancelBatchRfqQuotesService() *CancelBatchRfqQuotesService
- func (c *Client) NewCancelBatchRfqsService() *CancelBatchRfqsService
- func (c *Client) NewCancelGridCloseOrderService(algoId, ordId string) *CancelGridCloseOrderService
- func (c *Client) NewCancelOrderService(instId string) *CancelOrderService
- func (c *Client) NewCancelRfqQuoteService() *CancelRfqQuoteService
- func (c *Client) NewCancelRfqService() *CancelRfqService
- func (c *Client) NewCancelSprdOrderAlgoService() *CancelSprdOrderAlgoService
- func (c *Client) NewCancelSprdOrderService() *CancelSprdOrderService
- func (c *Client) NewCancelStakingService(ordId string, protocolType StakingProtocolType) *CancelStakingService
- func (c *Client) NewCancelWithdrawalService(wdId string) *CancelWithdrawalService
- func (c *Client) NewCloseCopySubpositionService(subPosId string) *CloseCopySubpositionService
- func (c *Client) NewCloseGridPositionService(algoId string, mktClose bool) *CloseGridPositionService
- func (c *Client) NewClosePositionService(instId string, mgnMode MgnMode) *ClosePositionService
- func (c *Client) NewComputeGridMarginBalanceService(algoId, typ string) *ComputeGridMarginBalanceService
- func (c *Client) NewConvertEstimateQuoteService(baseCcy, quoteCcy string, side Side, rfqSz decimal.Decimal, rfqSzCcy string) *ConvertEstimateQuoteService
- func (c *Client) NewConvertTradeService(quoteId, baseCcy, quoteCcy string, side Side, sz decimal.Decimal, szCcy string) *ConvertTradeService
- func (c *Client) NewCreateRfqQuoteService(rfqId string, quoteSide RfqQuoteSide, legs []RfqQuoteCreateLeg) *CreateRfqQuoteService
- func (c *Client) NewCreateRfqService(counterparties []string, legs []RfqCreateLeg) *CreateRfqService
- func (c *Client) NewCreateSubAccountApiKeyService(subAcct, label, passphrase string) *CreateSubAccountApiKeyService
- func (c *Client) NewDeleteSubAccountApiKeyService(subAcct, apiKey string) *DeleteSubAccountApiKeyService
- func (c *Client) NewExecuteQuoteService(rfqId, quoteId string) *ExecuteQuoteService
- func (c *Client) NewFirstCopyCopySettingsService(uniqueCode, copyMgnMode, copyInstIdType, copyMode, subPosCloseType string) *FirstCopyCopySettingsService
- func (c *Client) NewFundsTransferService(ccy string, amt decimal.Decimal, from, to AssetAcctType) *FundsTransferService
- func (c *Client) NewGetAccountConfigService() *GetAccountConfigService
- func (c *Client) NewGetAccountInstrumentsService(instType InstType) *GetAccountInstrumentsService
- func (c *Client) NewGetAccountPositionRiskService() *GetAccountPositionRiskService
- func (c *Client) NewGetAccountPositionTiersService(instType InstType) *GetAccountPositionTiersService
- func (c *Client) NewGetAccountRateLimitService() *GetAccountRateLimitService
- func (c *Client) NewGetAdjustLeverageInfoService(instType InstType, mgnMode MgnMode, lever decimal.Decimal) *GetAdjustLeverageInfoService
- func (c *Client) NewGetAffiliateInviteeDetailService(uid string) *GetAffiliateInviteeDetailService
- func (c *Client) NewGetAlgoOrderService() *GetAlgoOrderService
- func (c *Client) NewGetAlgoOrdersHistoryService(ordType AlgoOrdType) *GetAlgoOrdersHistoryService
- func (c *Client) NewGetAlgoOrdersPendingService(ordType AlgoOrdType) *GetAlgoOrdersPendingService
- func (c *Client) NewGetAnnouncementTypesService() *GetAnnouncementTypesService
- func (c *Client) NewGetAnnouncementsService() *GetAnnouncementsService
- func (c *Client) NewGetAssetBillsService() *GetAssetBillsService
- func (c *Client) NewGetAssetValuationService() *GetAssetValuationService
- func (c *Client) NewGetBalanceService() *GetBalanceService
- func (c *Client) NewGetBillsArchiveService() *GetBillsArchiveService
- func (c *Client) NewGetBillsHistoryArchiveService(year string, quarter BillsHistoryArchiveQuarter) *GetBillsHistoryArchiveService
- func (c *Client) NewGetBillsService() *GetBillsService
- func (c *Client) NewGetBlockTickersService(instType InstType) *GetBlockTickersService
- func (c *Client) NewGetBooksFullService(instId string) *GetBooksFullService
- func (c *Client) NewGetBooksService(instId string) *GetBooksService
- func (c *Client) NewGetBorrowRepayHistoryService() *GetBorrowRepayHistoryService
- func (c *Client) NewGetCandlesService(instId string) *GetCandlesService
- func (c *Client) NewGetCollateralAssetsService() *GetCollateralAssetsService
- func (c *Client) NewGetContractsOpenInterestVolumeService(ccy string) *GetContractsOpenInterestVolumeService
- func (c *Client) NewGetConvertContractCoinService(typ, instId, sz string) *GetConvertContractCoinService
- func (c *Client) NewGetConvertCurrenciesService() *GetConvertCurrenciesService
- func (c *Client) NewGetConvertCurrencyPairService(fromCcy, toCcy string) *GetConvertCurrencyPairService
- func (c *Client) NewGetConvertHistoryService() *GetConvertHistoryService
- func (c *Client) NewGetCopyBatchLeverageInfoService(mgnMode MgnMode, uniqueCode string) *GetCopyBatchLeverageInfoService
- func (c *Client) NewGetCopyConfigService() *GetCopyConfigService
- func (c *Client) NewGetCopyCurrentSubpositionsService() *GetCopyCurrentSubpositionsService
- func (c *Client) NewGetCopyInstrumentsService() *GetCopyInstrumentsService
- func (c *Client) NewGetCopyLeadTradersService() *GetCopyLeadTradersService
- func (c *Client) NewGetCopyProfitSharingDetailsService() *GetCopyProfitSharingDetailsService
- func (c *Client) NewGetCopyPublicConfigService() *GetCopyPublicConfigService
- func (c *Client) NewGetCopyPublicLeadTradersService() *GetCopyPublicLeadTradersService
- func (c *Client) NewGetCopySettingsService(instType InstType, uniqueCode string) *GetCopySettingsService
- func (c *Client) NewGetCopySubpositionsHistoryService() *GetCopySubpositionsHistoryService
- func (c *Client) NewGetCopyTotalProfitSharingService() *GetCopyTotalProfitSharingService
- func (c *Client) NewGetCopyTotalUnrealizedProfitSharingService() *GetCopyTotalUnrealizedProfitSharingService
- func (c *Client) NewGetCopyTradersService(uniqueCode string) *GetCopyTradersService
- func (c *Client) NewGetCopyUnrealizedProfitSharingDetailsService() *GetCopyUnrealizedProfitSharingDetailsService
- func (c *Client) NewGetCurrenciesService() *GetCurrenciesService
- func (c *Client) NewGetDeliveryExerciseHistoryService(instType InstType) *GetDeliveryExerciseHistoryService
- func (c *Client) NewGetDepositAddressService(ccy string) *GetDepositAddressService
- func (c *Client) NewGetDepositHistoryService() *GetDepositHistoryService
- func (c *Client) NewGetDepositWithdrawStatusService() *GetDepositWithdrawStatusService
- func (c *Client) NewGetDiscountRateInterestFreeQuotaService() *GetDiscountRateInterestFreeQuotaService
- func (c *Client) NewGetEasyConvertCurrencyListService() *GetEasyConvertCurrencyListService
- func (c *Client) NewGetEasyConvertHistoryService() *GetEasyConvertHistoryService
- func (c *Client) NewGetEconomicCalendarService() *GetEconomicCalendarService
- func (c *Client) NewGetEntrustSubAccountListService() *GetEntrustSubAccountListService
- func (c *Client) NewGetEstimatedPriceService(instId string) *GetEstimatedPriceService
- func (c *Client) NewGetEthStakingApyHistoryService(days int) *GetEthStakingApyHistoryService
- func (c *Client) NewGetEthStakingBalanceService() *GetEthStakingBalanceService
- func (c *Client) NewGetEthStakingHistoryService() *GetEthStakingHistoryService
- func (c *Client) NewGetEthStakingProductInfoService() *GetEthStakingProductInfoService
- func (c *Client) NewGetExchangeListService() *GetExchangeListService
- func (c *Client) NewGetExchangeRateService() *GetExchangeRateService
- func (c *Client) NewGetFillsHistoryService(instType InstType) *GetFillsHistoryService
- func (c *Client) NewGetFillsService() *GetFillsService
- func (c *Client) NewGetFixedLoanLendingApyHistoryService(ccy, term string) *GetFixedLoanLendingApyHistoryService
- func (c *Client) NewGetFixedLoanLendingOffersService() *GetFixedLoanLendingOffersService
- func (c *Client) NewGetFixedLoanLendingOrdersListService() *GetFixedLoanLendingOrdersListService
- func (c *Client) NewGetFixedLoanLendingSubOrdersService(ordId string) *GetFixedLoanLendingSubOrdersService
- func (c *Client) NewGetFixedLoanPendingLendingVolumeService(ccy, term string) *GetFixedLoanPendingLendingVolumeService
- func (c *Client) NewGetFlexLoanBorrowCurrenciesService() *GetFlexLoanBorrowCurrenciesService
- func (c *Client) NewGetFlexLoanCollateralAssetsService() *GetFlexLoanCollateralAssetsService
- func (c *Client) NewGetFlexLoanInterestAccruedService() *GetFlexLoanInterestAccruedService
- func (c *Client) NewGetFlexLoanLoanHistoryService() *GetFlexLoanLoanHistoryService
- func (c *Client) NewGetFlexLoanLoanInfoService() *GetFlexLoanLoanInfoService
- func (c *Client) NewGetFlexLoanMaxLoanService(borrowCcy string) *GetFlexLoanMaxLoanService
- func (c *Client) NewGetFundingBalanceService() *GetFundingBalanceService
- func (c *Client) NewGetFundingRateHistoryService(instId string) *GetFundingRateHistoryService
- func (c *Client) NewGetFundingRateService(instId string) *GetFundingRateService
- func (c *Client) NewGetGLPHistoricalPerformanceService(program GLPProgram) *GetGLPHistoricalPerformanceService
- func (c *Client) NewGetGLPTodayPerformanceService() *GetGLPTodayPerformanceService
- func (c *Client) NewGetGreeksService() *GetGreeksService
- func (c *Client) NewGetGridAIParamService(algoOrdType GridAlgoOrdType, instId string) *GetGridAIParamService
- func (c *Client) NewGetGridAlgoDetailsService(algoOrdType GridAlgoOrdType, algoId string) *GetGridAlgoDetailsService
- func (c *Client) NewGetGridAlgoHistoryService(algoOrdType GridAlgoOrdType) *GetGridAlgoHistoryService
- func (c *Client) NewGetGridAlgoPendingService(algoOrdType GridAlgoOrdType) *GetGridAlgoPendingService
- func (c *Client) NewGetGridMinInvestmentService(instId string, algoOrdType GridAlgoOrdType, maxPx, minPx decimal.Decimal, ...) *GetGridMinInvestmentService
- func (c *Client) NewGetGridPositionsService(algoOrdType GridAlgoOrdType, algoId string) *GetGridPositionsService
- func (c *Client) NewGetGridRSIBackTestingService(instId, timeframe, thold string, timePeriod int, triggerCond, duration string) *GetGridRSIBackTestingService
- func (c *Client) NewGetGridSubOrdersService(algoId string, algoOrdType GridAlgoOrdType, typ GridSubOrderType) *GetGridSubOrdersService
- func (c *Client) NewGetHistoryCandlesService(instId string) *GetHistoryCandlesService
- func (c *Client) NewGetHistoryIndexCandlesService(instId string) *GetHistoryIndexCandlesService
- func (c *Client) NewGetHistoryMarkPriceCandlesService(instId string) *GetHistoryMarkPriceCandlesService
- func (c *Client) NewGetHistoryTradesService(instId string) *GetHistoryTradesService
- func (c *Client) NewGetIndexCandlesService(instId string) *GetIndexCandlesService
- func (c *Client) NewGetIndexComponentsService(index string) *GetIndexComponentsService
- func (c *Client) NewGetIndexTickersService() *GetIndexTickersService
- func (c *Client) NewGetInstrumentTickBandsService(instType InstType) *GetInstrumentTickBandsService
- func (c *Client) NewGetInstrumentsService(instType InstType) *GetInstrumentsService
- func (c *Client) NewGetInsuranceFundService(instType InstType) *GetInsuranceFundService
- func (c *Client) NewGetInterestAccruedService() *GetInterestAccruedService
- func (c *Client) NewGetInterestLimitsService() *GetInterestLimitsService
- func (c *Client) NewGetInterestRateLoanQuotaService() *GetInterestRateLoanQuotaService
- func (c *Client) NewGetInterestRateService() *GetInterestRateService
- func (c *Client) NewGetLeverageInfoService(instId string, mgnMode MgnMode) *GetLeverageInfoService
- func (c *Client) NewGetLoanRatioService(ccy string) *GetLoanRatioService
- func (c *Client) NewGetLongShortAccountRatioContractService(instId string) *GetLongShortAccountRatioContractService
- func (c *Client) NewGetLongShortAccountRatioContractTopTraderService(instId string) *GetLongShortAccountRatioContractTopTraderService
- func (c *Client) NewGetLongShortAccountRatioService(ccy string) *GetLongShortAccountRatioService
- func (c *Client) NewGetLongShortPositionRatioContractTopTraderService(instId string) *GetLongShortPositionRatioContractTopTraderService
- func (c *Client) NewGetMMInstrumentTypesService() *GetMMInstrumentTypesService
- func (c *Client) NewGetMMPConfigService(instFamily string) *GetMMPConfigService
- func (c *Client) NewGetManagedSubAccountBillsService() *GetManagedSubAccountBillsService
- func (c *Client) NewGetMarkPriceCandlesService(instId string) *GetMarkPriceCandlesService
- func (c *Client) NewGetMarkPriceService(instType InstType) *GetMarkPriceService
- func (c *Client) NewGetMaxAvailSizeService(instId string, tdMode TdMode) *GetMaxAvailSizeService
- func (c *Client) NewGetMaxLoanService(mgnMode MgnMode) *GetMaxLoanService
- func (c *Client) NewGetMaxSizeService(instId string, tdMode TdMode) *GetMaxSizeService
- func (c *Client) NewGetMaxWithdrawalService() *GetMaxWithdrawalService
- func (c *Client) NewGetMonthlyStatementService(month string) *GetMonthlyStatementService
- func (c *Client) NewGetMovePositionsHistoryService() *GetMovePositionsHistoryService
- func (c *Client) NewGetNonTradableAssetsService() *GetNonTradableAssetsService
- func (c *Client) NewGetOKUSDLimitsService() *GetOKUSDLimitsService
- func (c *Client) NewGetOneClickRepayCurrencyListService() *GetOneClickRepayCurrencyListService
- func (c *Client) NewGetOneClickRepayCurrencyListV2Service() *GetOneClickRepayCurrencyListV2Service
- func (c *Client) NewGetOneClickRepayHistoryService() *GetOneClickRepayHistoryService
- func (c *Client) NewGetOneClickRepayHistoryV2Service() *GetOneClickRepayHistoryV2Service
- func (c *Client) NewGetOpenInterestHistoryService(instId string) *GetOpenInterestHistoryService
- func (c *Client) NewGetOpenInterestService(instType InstType) *GetOpenInterestService
- func (c *Client) NewGetOptSummaryService() *GetOptSummaryService
- func (c *Client) NewGetOptionInstrumentFamilyTradesService(instFamily string) *GetOptionInstrumentFamilyTradesService
- func (c *Client) NewGetOptionOpenInterestVolumeExpiryService(ccy string) *GetOptionOpenInterestVolumeExpiryService
- func (c *Client) NewGetOptionOpenInterestVolumeService(ccy string) *GetOptionOpenInterestVolumeService
- func (c *Client) NewGetOptionOpenInterestVolumeStrikeService(ccy, expTime string) *GetOptionOpenInterestVolumeStrikeService
- func (c *Client) NewGetOptionTakerBlockVolumeService(ccy string) *GetOptionTakerBlockVolumeService
- func (c *Client) NewGetOrderService(instId string) *GetOrderService
- func (c *Client) NewGetOrdersHistoryArchiveService(instType InstType) *GetOrdersHistoryArchiveService
- func (c *Client) NewGetOrdersHistoryService(instType InstType) *GetOrdersHistoryService
- func (c *Client) NewGetOrdersPendingService() *GetOrdersPendingService
- func (c *Client) NewGetPlatform24VolumeService() *GetPlatform24VolumeService
- func (c *Client) NewGetPositionTiersService(instType InstType, tdMode TdMode) *GetPositionTiersService
- func (c *Client) NewGetPositionsHistoryService() *GetPositionsHistoryService
- func (c *Client) NewGetPositionsService() *GetPositionsService
- func (c *Client) NewGetPremiumHistoryService(instId string) *GetPremiumHistoryService
- func (c *Client) NewGetPriceLimitService(instId string) *GetPriceLimitService
- func (c *Client) NewGetRecurringOrderDetailsService(algoId string) *GetRecurringOrderDetailsService
- func (c *Client) NewGetRecurringOrdersHistoryService() *GetRecurringOrdersHistoryService
- func (c *Client) NewGetRecurringOrdersPendingService() *GetRecurringOrdersPendingService
- func (c *Client) NewGetRecurringSubOrdersService(algoId string) *GetRecurringSubOrdersService
- func (c *Client) NewGetRfqBlockTickerService(instId string) *GetRfqBlockTickerService
- func (c *Client) NewGetRfqBlockTickersService(instType InstType) *GetRfqBlockTickersService
- func (c *Client) NewGetRfqCounterpartiesService() *GetRfqCounterpartiesService
- func (c *Client) NewGetRfqMakerInstrumentSettingsService() *GetRfqMakerInstrumentSettingsService
- func (c *Client) NewGetRfqMmpConfigService() *GetRfqMmpConfigService
- func (c *Client) NewGetRfqPublicTradesService() *GetRfqPublicTradesService
- func (c *Client) NewGetRfqQuoteProductsService() *GetRfqQuoteProductsService
- func (c *Client) NewGetRfqQuotesService() *GetRfqQuotesService
- func (c *Client) NewGetRfqTradesService() *GetRfqTradesService
- func (c *Client) NewGetRfqsService() *GetRfqsService
- func (c *Client) NewGetRiskStateService() *GetRiskStateService
- func (c *Client) NewGetSavingsBalanceService() *GetSavingsBalanceService
- func (c *Client) NewGetSavingsLendingHistoryService() *GetSavingsLendingHistoryService
- func (c *Client) NewGetSavingsLendingRateHistoryService() *GetSavingsLendingRateHistoryService
- func (c *Client) NewGetSavingsLendingRateSummaryService() *GetSavingsLendingRateSummaryService
- func (c *Client) NewGetSettlementHistoryService(instType InstType, instFamily string) *GetSettlementHistoryService
- func (c *Client) NewGetSolStakingApyHistoryService(days int) *GetSolStakingApyHistoryService
- func (c *Client) NewGetSolStakingBalanceService() *GetSolStakingBalanceService
- func (c *Client) NewGetSolStakingHistoryService() *GetSolStakingHistoryService
- func (c *Client) NewGetSolStakingProductInfoService() *GetSolStakingProductInfoService
- func (c *Client) NewGetSpotBorrowRepayHistoryService() *GetSpotBorrowRepayHistoryService
- func (c *Client) NewGetSprdBooksService(sprdId string) *GetSprdBooksService
- func (c *Client) NewGetSprdCandlesService(sprdId string) *GetSprdCandlesService
- func (c *Client) NewGetSprdHistoryCandlesService(sprdId string) *GetSprdHistoryCandlesService
- func (c *Client) NewGetSprdOrderAlgoService() *GetSprdOrderAlgoService
- func (c *Client) NewGetSprdOrderService() *GetSprdOrderService
- func (c *Client) NewGetSprdOrdersAlgoHistoryService() *GetSprdOrdersAlgoHistoryService
- func (c *Client) NewGetSprdOrdersAlgoPendingService() *GetSprdOrdersAlgoPendingService
- func (c *Client) NewGetSprdOrdersHistoryArchiveService() *GetSprdOrdersHistoryArchiveService
- func (c *Client) NewGetSprdOrdersHistoryService() *GetSprdOrdersHistoryService
- func (c *Client) NewGetSprdOrdersPendingService() *GetSprdOrdersPendingService
- func (c *Client) NewGetSprdPublicTradesService() *GetSprdPublicTradesService
- func (c *Client) NewGetSprdSpreadsService() *GetSprdSpreadsService
- func (c *Client) NewGetSprdTickerService(sprdId string) *GetSprdTickerService
- func (c *Client) NewGetSprdTradesService() *GetSprdTradesService
- func (c *Client) NewGetStakingActiveOrdersService() *GetStakingActiveOrdersService
- func (c *Client) NewGetStakingOffersService() *GetStakingOffersService
- func (c *Client) NewGetStakingOrdersHistoryService() *GetStakingOrdersHistoryService
- func (c *Client) NewGetSubAccountApiKeyService(subAcct string) *GetSubAccountApiKeyService
- func (c *Client) NewGetSubAccountBillsService() *GetSubAccountBillsService
- func (c *Client) NewGetSubAccountFundingBalancesService(subAcct string) *GetSubAccountFundingBalancesService
- func (c *Client) NewGetSubAccountListService() *GetSubAccountListService
- func (c *Client) NewGetSubAccountMaxWithdrawalService(subAcct string) *GetSubAccountMaxWithdrawalService
- func (c *Client) NewGetSubAccountTradingBalancesService(subAcct string) *GetSubAccountTradingBalancesService
- func (c *Client) NewGetSupportCoinService() *GetSupportCoinService
- func (c *Client) NewGetSystemStatusService() *GetSystemStatusService
- func (c *Client) NewGetSystemTimeService() *GetSystemTimeService
- func (c *Client) NewGetTakerVolumeService(ccy string, instType InstType) *GetTakerVolumeService
- func (c *Client) NewGetTickerService(instId string) *GetTickerService
- func (c *Client) NewGetTickersService(instType InstType) *GetTickersService
- func (c *Client) NewGetTradeFeeService(instType InstType) *GetTradeFeeService
- func (c *Client) NewGetTradesService(instId string) *GetTradesService
- func (c *Client) NewGetTransferStateService() *GetTransferStateService
- func (c *Client) NewGetUnderlyingService(instType InstType) *GetUnderlyingService
- func (c *Client) NewGetVipInterestAccruedService() *GetVipInterestAccruedService
- func (c *Client) NewGetVipInterestDeductedService() *GetVipInterestDeductedService
- func (c *Client) NewGetVipLoanOrderDetailService(ordId string) *GetVipLoanOrderDetailService
- func (c *Client) NewGetVipLoanOrderListService() *GetVipLoanOrderListService
- func (c *Client) NewGetWithdrawalHistoryService() *GetWithdrawalHistoryService
- func (c *Client) NewInstantTriggerGridService(algoId string, algoOrdType GridAlgoOrdType) *InstantTriggerGridService
- func (c *Client) NewMassCancelService(instType InstType, instFamily string) *MassCancelService
- func (c *Client) NewModifySubAccountApiKeyService(subAcct, apiKey string) *ModifySubAccountApiKeyService
- func (c *Client) NewMovePositionsService(fromAcct, toAcct, clientId string, legs []MovePositionLeg) *MovePositionsService
- func (c *Client) NewOrderPrecheckService(instId string, tdMode TdMode, side Side, ordType OrdType, sz decimal.Decimal) *OrderPrecheckService
- func (c *Client) NewPlaceAlgoOrderService(instId string, tdMode TdMode, side Side, ordType AlgoOrdType, ...) *PlaceAlgoOrderService
- func (c *Client) NewPlaceCopyLeadStopOrderService(subPosId string) *PlaceCopyLeadStopOrderService
- func (c *Client) NewPlaceEasyConvertService(fromCcy []string, toCcy string) *PlaceEasyConvertService
- func (c *Client) NewPlaceFixedLoanLendingOrderService(ccy string, amt, rate decimal.Decimal, term string) *PlaceFixedLoanLendingOrderService
- func (c *Client) NewPlaceGridAlgoOrderService(instId string, algoOrdType GridAlgoOrdType, maxPx, minPx decimal.Decimal, ...) *PlaceGridAlgoOrderService
- func (c *Client) NewPlaceOrderService(instId string, tdMode TdMode, side Side, ordType OrdType, sz decimal.Decimal) *PlaceOrderService
- func (c *Client) NewPlaceRecurringOrderService(stgyName string, recurringList []RecurringItem, period RecurringPeriod, ...) *PlaceRecurringOrderService
- func (c *Client) NewPlaceSprdOrderAlgoService(sprdId string, side Side, ordType, sz string) *PlaceSprdOrderAlgoService
- func (c *Client) NewPlaceSprdOrderService(sprdId string, side Side, ordType SprdOrdType, sz string) *PlaceSprdOrderService
- func (c *Client) NewPositionBuilderService() *PositionBuilderService
- func (c *Client) NewPurchaseEthStakingService(amt decimal.Decimal) *PurchaseEthStakingService
- func (c *Client) NewPurchaseSolStakingService(amt decimal.Decimal) *PurchaseSolStakingService
- func (c *Client) NewPurchaseStakingService(productId string, investData []StakingPurchaseInvest) *PurchaseStakingService
- func (c *Client) NewRedeemEthStakingService(amt decimal.Decimal) *RedeemEthStakingService
- func (c *Client) NewRedeemSolStakingService(amt decimal.Decimal) *RedeemSolStakingService
- func (c *Client) NewRedeemStakingService(ordId string, protocolType StakingProtocolType) *RedeemStakingService
- func (c *Client) NewResetMMPService(instFamily string) *ResetMMPService
- func (c *Client) NewResetRfqMmpService() *ResetRfqMmpService
- func (c *Client) NewSetAccountLevelService(acctLv string) *SetAccountLevelService
- func (c *Client) NewSetAutoLoanService(autoLoan bool) *SetAutoLoanService
- func (c *Client) NewSetAutoRepayService(autoRepay bool) *SetAutoRepayService
- func (c *Client) NewSetBorrowRepayService(ccy string, side BorrowRepayType, amt decimal.Decimal) *SetBorrowRepayService
- func (c *Client) NewSetCollateralAssetsService(typ CollateralAssetType, collateralEnabled bool) *SetCollateralAssetsService
- func (c *Client) NewSetCopyLeverageService(mgnMode MgnMode, lever decimal.Decimal) *SetCopyLeverageService
- func (c *Client) NewSetGreeksService(greeksType GreeksType) *SetGreeksService
- func (c *Client) NewSetIsolatedModeService(isoMode IsoMode, typ IsoModeType) *SetIsolatedModeService
- func (c *Client) NewSetLeverageService(lever string, mgnMode MgnMode) *SetLeverageService
- func (c *Client) NewSetMMPConfigService(instFamily, timeInterval, frozenInterval, qtyLimit string) *SetMMPConfigService
- func (c *Client) NewSetMarginBalanceService(instId string, posSide PosSide, typ MarginBalanceType, amt string) *SetMarginBalanceService
- func (c *Client) NewSetOKUSDRedeemService(amt decimal.Decimal, redeemType OKUSDRedeemType) *SetOKUSDRedeemService
- func (c *Client) NewSetOKUSDSubscribeService(amt decimal.Decimal) *SetOKUSDSubscribeService
- func (c *Client) NewSetPositionModeService(posMode PosMode) *SetPositionModeService
- func (c *Client) NewSetRfqMakerInstrumentSettingsService(settings []RfqMakerInstrumentSetting) *SetRfqMakerInstrumentSettingsService
- func (c *Client) NewSetRfqMmpService(timeInterval, frozenInterval, countLimit int) *SetRfqMmpService
- func (c *Client) NewSetRfqQuoteProductsService(products []RfqQuoteProduct) *SetRfqQuoteProductsService
- func (c *Client) NewSetSavingsLendingRateService(ccy string, rate decimal.Decimal) *SetSavingsLendingRateService
- func (c *Client) NewSetSavingsPurchaseRedemptionService(ccy string, amt decimal.Decimal, side SavingsSide) *SetSavingsPurchaseRedemptionService
- func (c *Client) NewSetSpotManualBorrowRepayService(ccy string, side BorrowRepayType, amt decimal.Decimal) *SetSpotManualBorrowRepayService
- func (c *Client) NewSetSubAccountTransferOutService(subAcct string, canTransOut bool) *SetSubAccountTransferOutService
- func (c *Client) NewSprdCancelAllAfterService(timeOut int) *SprdCancelAllAfterService
- func (c *Client) NewSprdMassCancelOrdersService() *SprdMassCancelOrdersService
- func (c *Client) NewStopCopyCopyTradingService(uniqueCode, subPosCloseType string) *StopCopyCopyTradingService
- func (c *Client) NewStopCopyLeadTradingService() *StopCopyLeadTradingService
- func (c *Client) NewStopGridAlgoOrderService(items []GridStopArg) *StopGridAlgoOrderService
- func (c *Client) NewStopRecurringOrderService(algoIds []string) *StopRecurringOrderService
- func (c *Client) NewSubAccountTransferService(ccy string, amt decimal.Decimal, ...) *SubAccountTransferService
- func (c *Client) NewTradeOneClickRepayService(debtCcy []string, repayCcy string) *TradeOneClickRepayService
- func (c *Client) NewTradeOneClickRepayV2Service(debtCcy string, repayCcyList []string) *TradeOneClickRepayV2Service
- func (c *Client) NewWithdrawGridIncomeService(algoId string) *WithdrawGridIncomeService
- func (c *Client) NewWithdrawalService(ccy string, amt decimal.Decimal, dest, toAddr string) *WithdrawalService
- func (c *Client) SyncServerTime(ctx context.Context) error
- type CloseCopySubpositionService
- type CloseGridPositionService
- type ClosePositionResult
- type ClosePositionService
- func (s *ClosePositionService) Do(ctx context.Context) (*ClosePositionResult, error)
- func (s *ClosePositionService) SetAutoCxl(autoCxl bool) *ClosePositionService
- func (s *ClosePositionService) SetCcy(ccy string) *ClosePositionService
- func (s *ClosePositionService) SetClOrdId(clOrdId string) *ClosePositionService
- func (s *ClosePositionService) SetPosSide(posSide PosSide) *ClosePositionService
- func (s *ClosePositionService) SetTag(tag string) *ClosePositionService
- type CollateralAsset
- type CollateralAssetType
- type CollateralAssetsSetting
- type ComputeGridMarginBalanceService
- type ConvertContractCoin
- type ConvertCurrency
- type ConvertCurrencyPair
- type ConvertEstimateQuote
- type ConvertEstimateQuoteService
- type ConvertHistory
- type ConvertSource
- type ConvertStatus
- type ConvertTrade
- type ConvertTradeService
- type CopyBatchLeverageInfo
- type CopyConfig
- type CopyInstrument
- type CopyLeadTrader
- type CopyLeadTraderPnlRatio
- type CopyLeadTradersPage
- type CopyProfitSharingDetail
- type CopyPublicConfig
- type CopyResult
- type CopySettings
- type CopySortType
- type CopyState
- type CopySubPosAck
- type CopySubPosType
- type CopySubPosition
- type CopySubPositionHistory
- type CopyTotalProfitSharing
- type CopyTotalUnrealizedProfitSharing
- type CopyTrader
- type CopyTradersPage
- type CopyUnrealizedProfitSharingDetail
- type CreateRfqQuoteService
- func (s *CreateRfqQuoteService) Do(ctx context.Context) (*RfqQuote, error)
- func (s *CreateRfqQuoteService) SetAnonymous(anonymous bool) *CreateRfqQuoteService
- func (s *CreateRfqQuoteService) SetClQuoteId(clQuoteId string) *CreateRfqQuoteService
- func (s *CreateRfqQuoteService) SetExpiresIn(seconds int) *CreateRfqQuoteService
- func (s *CreateRfqQuoteService) SetTag(tag string) *CreateRfqQuoteService
- type CreateRfqService
- type CreateSubAccountApiKeyService
- type CtType
- type Currency
- type DebtType
- type DeleteSubAccountApiKeyService
- type DeliveryExerciseHistory
- type DeliveryExerciseHistoryDetail
- type DepositAddress
- type DepositHistory
- type DepositWithdrawStatus
- type DiscountRateInterestFreeQuota
- type DiscountRateTier
- type EasyConvertCurrencyList
- type EasyConvertFromCcy
- type EasyConvertHistory
- type EasyConvertResult
- type EconomicCalendar
- type EconomicCalendarImportance
- type EntrustSubAccount
- type EstimatedPrice
- type EthStakingAck
- type EthStakingBalance
- type EthStakingHistory
- type EthStakingProductInfo
- type Exchange
- type ExchangeRate
- type ExecType
- type ExecuteQuoteService
- type Fill
- type FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) Do(ctx context.Context) (*CopyResult, error)
- func (s *FirstCopyCopySettingsService) SetCopyAmt(copyAmt decimal.Decimal) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetCopyRatio(copyRatio decimal.Decimal) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetCopyTotalAmt(copyTotalAmt decimal.Decimal) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetInstId(instId string) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetInstType(instType InstType) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetSlRatio(slRatio decimal.Decimal) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetSlTotalAmt(slTotalAmt decimal.Decimal) *FirstCopyCopySettingsService
- func (s *FirstCopyCopySettingsService) SetTpRatio(tpRatio decimal.Decimal) *FirstCopyCopySettingsService
- type FixedLoanAmendLendingOrderAck
- type FixedLoanLendingApyHistory
- type FixedLoanLendingOffer
- type FixedLoanLendingOfferDetail
- type FixedLoanLendingOrder
- type FixedLoanLendingOrderAck
- type FixedLoanLendingSubOrder
- type FixedLoanOfferEarning
- type FixedLoanPendingLendingVolume
- type FlexLoanAdjustCollateral
- type FlexLoanAdjustType
- type FlexLoanBorrowCurrency
- type FlexLoanCollateralAsset
- type FlexLoanCollateralAssets
- type FlexLoanHistory
- type FlexLoanInfo
- type FlexLoanInfoCollateral
- type FlexLoanInfoLoan
- type FlexLoanInterestAccrued
- type FlexLoanMaxLoan
- type FlexLoanSupCollateral
- type FundingBalance
- type FundingRate
- type FundingRateHistory
- type FundsTransfer
- type FundsTransferService
- func (s *FundsTransferService) Do(ctx context.Context) (*FundsTransfer, error)
- func (s *FundsTransferService) SetClientId(clientId string) *FundsTransferService
- func (s *FundsTransferService) SetLoanTrans(loanTrans bool) *FundsTransferService
- func (s *FundsTransferService) SetOmitPosRisk(omitPosRisk string) *FundsTransferService
- func (s *FundsTransferService) SetSubAcct(subAcct string) *FundsTransferService
- func (s *FundsTransferService) SetType(typ AssetTransferType) *FundsTransferService
- type GLPAccount
- type GLPCategoryBreakdown
- type GLPHistoricalPerformance
- type GLPMakerTaker
- type GLPPeriodPerf
- type GLPProgram
- type GLPProgramPerf
- type GLPQualifyingRow
- type GLPTodayPerformance
- type GetAccountConfigService
- type GetAccountInstrumentsService
- func (s *GetAccountInstrumentsService) Do(ctx context.Context) ([]Instrument, error)
- func (s *GetAccountInstrumentsService) SetInstFamily(instFamily string) *GetAccountInstrumentsService
- func (s *GetAccountInstrumentsService) SetInstId(instId string) *GetAccountInstrumentsService
- func (s *GetAccountInstrumentsService) SetUly(uly string) *GetAccountInstrumentsService
- type GetAccountPositionRiskService
- type GetAccountPositionTiersService
- type GetAccountRateLimitService
- type GetAdjustLeverageInfoService
- func (s *GetAdjustLeverageInfoService) Do(ctx context.Context) (*AdjustLeverageInfo, error)
- func (s *GetAdjustLeverageInfoService) SetCcy(ccy string) *GetAdjustLeverageInfoService
- func (s *GetAdjustLeverageInfoService) SetInstId(instId string) *GetAdjustLeverageInfoService
- func (s *GetAdjustLeverageInfoService) SetPosSide(posSide PosSide) *GetAdjustLeverageInfoService
- type GetAffiliateInviteeDetailService
- type GetAlgoOrderService
- type GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) Do(ctx context.Context) ([]AlgoOrder, error)
- func (s *GetAlgoOrdersHistoryService) SetAfter(algoId string) *GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) SetAlgoId(algoId string) *GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) SetBefore(algoId string) *GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) SetInstId(instId string) *GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) SetInstType(instType InstType) *GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) SetLimit(limit int) *GetAlgoOrdersHistoryService
- func (s *GetAlgoOrdersHistoryService) SetState(state AlgoState) *GetAlgoOrdersHistoryService
- type GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) Do(ctx context.Context) ([]AlgoOrder, error)
- func (s *GetAlgoOrdersPendingService) SetAfter(algoId string) *GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) SetAlgoClOrdId(algoClOrdId string) *GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) SetAlgoId(algoId string) *GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) SetBefore(algoId string) *GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) SetInstId(instId string) *GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) SetInstType(instType InstType) *GetAlgoOrdersPendingService
- func (s *GetAlgoOrdersPendingService) SetLimit(limit int) *GetAlgoOrdersPendingService
- type GetAnnouncementTypesService
- type GetAnnouncementsService
- type GetAssetBillsService
- func (s *GetAssetBillsService) Do(ctx context.Context) ([]AssetBill, error)
- func (s *GetAssetBillsService) SetAfter(t time.Time) *GetAssetBillsService
- func (s *GetAssetBillsService) SetBefore(t time.Time) *GetAssetBillsService
- func (s *GetAssetBillsService) SetCcy(ccy string) *GetAssetBillsService
- func (s *GetAssetBillsService) SetClientId(clientId string) *GetAssetBillsService
- func (s *GetAssetBillsService) SetLimit(limit int) *GetAssetBillsService
- func (s *GetAssetBillsService) SetType(typ string) *GetAssetBillsService
- type GetAssetValuationService
- type GetBalanceService
- type GetBillsArchiveService
- func (s *GetBillsArchiveService) Do(ctx context.Context) ([]Bill, error)
- func (s *GetBillsArchiveService) SetAfter(billId string) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetBefore(billId string) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetBegin(t time.Time) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetCcy(ccy string) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetCtType(ctType CtType) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetEnd(t time.Time) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetInstId(instId string) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetInstType(instType InstType) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetLimit(limit int) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetMgnMode(mgnMode MgnMode) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetSubType(subType string) *GetBillsArchiveService
- func (s *GetBillsArchiveService) SetType(typ string) *GetBillsArchiveService
- type GetBillsHistoryArchiveService
- type GetBillsService
- func (s *GetBillsService) Do(ctx context.Context) ([]Bill, error)
- func (s *GetBillsService) SetAfter(billId string) *GetBillsService
- func (s *GetBillsService) SetBefore(billId string) *GetBillsService
- func (s *GetBillsService) SetBegin(t time.Time) *GetBillsService
- func (s *GetBillsService) SetCcy(ccy string) *GetBillsService
- func (s *GetBillsService) SetCtType(ctType CtType) *GetBillsService
- func (s *GetBillsService) SetEnd(t time.Time) *GetBillsService
- func (s *GetBillsService) SetInstId(instId string) *GetBillsService
- func (s *GetBillsService) SetInstType(instType InstType) *GetBillsService
- func (s *GetBillsService) SetLimit(limit int) *GetBillsService
- func (s *GetBillsService) SetMgnMode(mgnMode MgnMode) *GetBillsService
- func (s *GetBillsService) SetSubType(subType string) *GetBillsService
- func (s *GetBillsService) SetType(typ string) *GetBillsService
- type GetBlockTickersService
- type GetBooksFullService
- type GetBooksService
- type GetBorrowRepayHistoryService
- func (s *GetBorrowRepayHistoryService) Do(ctx context.Context) ([]BorrowRepayHistory, error)
- func (s *GetBorrowRepayHistoryService) SetAfter(t time.Time) *GetBorrowRepayHistoryService
- func (s *GetBorrowRepayHistoryService) SetBefore(t time.Time) *GetBorrowRepayHistoryService
- func (s *GetBorrowRepayHistoryService) SetCcy(ccy string) *GetBorrowRepayHistoryService
- func (s *GetBorrowRepayHistoryService) SetLimit(limit int) *GetBorrowRepayHistoryService
- type GetCandlesService
- func (s *GetCandlesService) Do(ctx context.Context) ([]Candle, error)
- func (s *GetCandlesService) SetAfter(after time.Time) *GetCandlesService
- func (s *GetCandlesService) SetBar(bar MarketBar) *GetCandlesService
- func (s *GetCandlesService) SetBefore(before time.Time) *GetCandlesService
- func (s *GetCandlesService) SetLimit(limit int) *GetCandlesService
- type GetCollateralAssetsService
- type GetContractsOpenInterestVolumeService
- func (s *GetContractsOpenInterestVolumeService) Do(ctx context.Context) ([]RubikOpenInterestVolume, error)
- func (s *GetContractsOpenInterestVolumeService) SetBegin(t time.Time) *GetContractsOpenInterestVolumeService
- func (s *GetContractsOpenInterestVolumeService) SetEnd(t time.Time) *GetContractsOpenInterestVolumeService
- func (s *GetContractsOpenInterestVolumeService) SetPeriod(p RubikStatPeriod) *GetContractsOpenInterestVolumeService
- type GetConvertContractCoinService
- type GetConvertCurrenciesService
- type GetConvertCurrencyPairService
- type GetConvertHistoryService
- func (s *GetConvertHistoryService) Do(ctx context.Context) ([]ConvertHistory, error)
- func (s *GetConvertHistoryService) SetAfter(t time.Time) *GetConvertHistoryService
- func (s *GetConvertHistoryService) SetBefore(t time.Time) *GetConvertHistoryService
- func (s *GetConvertHistoryService) SetLimit(limit int) *GetConvertHistoryService
- func (s *GetConvertHistoryService) SetTag(tag string) *GetConvertHistoryService
- type GetCopyBatchLeverageInfoService
- type GetCopyConfigService
- type GetCopyCurrentSubpositionsService
- func (s *GetCopyCurrentSubpositionsService) Do(ctx context.Context) ([]CopySubPosition, error)
- func (s *GetCopyCurrentSubpositionsService) SetAfter(after string) *GetCopyCurrentSubpositionsService
- func (s *GetCopyCurrentSubpositionsService) SetBefore(before string) *GetCopyCurrentSubpositionsService
- func (s *GetCopyCurrentSubpositionsService) SetInstId(instId string) *GetCopyCurrentSubpositionsService
- func (s *GetCopyCurrentSubpositionsService) SetInstType(instType InstType) *GetCopyCurrentSubpositionsService
- func (s *GetCopyCurrentSubpositionsService) SetLimit(limit int) *GetCopyCurrentSubpositionsService
- func (s *GetCopyCurrentSubpositionsService) SetSubPosType(subPosType CopySubPosType) *GetCopyCurrentSubpositionsService
- type GetCopyInstrumentsService
- type GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) Do(ctx context.Context) (*CopyLeadTradersPage, error)
- func (s *GetCopyLeadTradersService) SetDataVer(dataVer string) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetInstType(instType InstType) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetLimit(limit int) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetMaxAssets(maxAssets decimal.Decimal) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetMaxAum(maxAum decimal.Decimal) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetMinAssets(minAssets decimal.Decimal) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetMinAum(minAum decimal.Decimal) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetMinLeadDays(minLeadDays string) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetPage(page int) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetSortType(sortType CopySortType) *GetCopyLeadTradersService
- func (s *GetCopyLeadTradersService) SetState(state CopyState) *GetCopyLeadTradersService
- type GetCopyProfitSharingDetailsService
- func (s *GetCopyProfitSharingDetailsService) Do(ctx context.Context) ([]CopyProfitSharingDetail, error)
- func (s *GetCopyProfitSharingDetailsService) SetAfter(after string) *GetCopyProfitSharingDetailsService
- func (s *GetCopyProfitSharingDetailsService) SetBefore(before string) *GetCopyProfitSharingDetailsService
- func (s *GetCopyProfitSharingDetailsService) SetInstType(instType InstType) *GetCopyProfitSharingDetailsService
- func (s *GetCopyProfitSharingDetailsService) SetLimit(limit int) *GetCopyProfitSharingDetailsService
- type GetCopyPublicConfigService
- type GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) Do(ctx context.Context) (*CopyLeadTradersPage, error)
- func (s *GetCopyPublicLeadTradersService) SetDataVer(dataVer string) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetInstType(instType InstType) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetLimit(limit int) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetMaxAssets(maxAssets decimal.Decimal) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetMaxAum(maxAum decimal.Decimal) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetMinAssets(minAssets decimal.Decimal) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetMinAum(minAum decimal.Decimal) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetMinLeadDays(minLeadDays string) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetPage(page int) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetSortType(sortType CopySortType) *GetCopyPublicLeadTradersService
- func (s *GetCopyPublicLeadTradersService) SetState(state CopyState) *GetCopyPublicLeadTradersService
- type GetCopySettingsService
- type GetCopySubpositionsHistoryService
- func (s *GetCopySubpositionsHistoryService) Do(ctx context.Context) ([]CopySubPositionHistory, error)
- func (s *GetCopySubpositionsHistoryService) SetAfter(after string) *GetCopySubpositionsHistoryService
- func (s *GetCopySubpositionsHistoryService) SetBefore(before string) *GetCopySubpositionsHistoryService
- func (s *GetCopySubpositionsHistoryService) SetInstId(instId string) *GetCopySubpositionsHistoryService
- func (s *GetCopySubpositionsHistoryService) SetInstType(instType InstType) *GetCopySubpositionsHistoryService
- func (s *GetCopySubpositionsHistoryService) SetLimit(limit int) *GetCopySubpositionsHistoryService
- type GetCopyTotalProfitSharingService
- type GetCopyTotalUnrealizedProfitSharingService
- type GetCopyTradersService
- type GetCopyUnrealizedProfitSharingDetailsService
- type GetCurrenciesService
- type GetDeliveryExerciseHistoryService
- func (s *GetDeliveryExerciseHistoryService) Do(ctx context.Context) ([]DeliveryExerciseHistory, error)
- func (s *GetDeliveryExerciseHistoryService) SetAfter(t time.Time) *GetDeliveryExerciseHistoryService
- func (s *GetDeliveryExerciseHistoryService) SetBefore(t time.Time) *GetDeliveryExerciseHistoryService
- func (s *GetDeliveryExerciseHistoryService) SetInstFamily(instFamily string) *GetDeliveryExerciseHistoryService
- func (s *GetDeliveryExerciseHistoryService) SetLimit(limit int) *GetDeliveryExerciseHistoryService
- func (s *GetDeliveryExerciseHistoryService) SetUly(uly string) *GetDeliveryExerciseHistoryService
- type GetDepositAddressService
- type GetDepositHistoryService
- func (s *GetDepositHistoryService) Do(ctx context.Context) ([]DepositHistory, error)
- func (s *GetDepositHistoryService) SetAfter(t time.Time) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetBefore(t time.Time) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetCcy(ccy string) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetDepId(depId string) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetFromWdId(fromWdId string) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetLimit(limit int) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetState(state string) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetTxId(txId string) *GetDepositHistoryService
- func (s *GetDepositHistoryService) SetType(typ string) *GetDepositHistoryService
- type GetDepositWithdrawStatusService
- func (s *GetDepositWithdrawStatusService) Do(ctx context.Context) ([]DepositWithdrawStatus, error)
- func (s *GetDepositWithdrawStatusService) SetCcy(ccy string) *GetDepositWithdrawStatusService
- func (s *GetDepositWithdrawStatusService) SetChain(chain string) *GetDepositWithdrawStatusService
- func (s *GetDepositWithdrawStatusService) SetTo(to string) *GetDepositWithdrawStatusService
- func (s *GetDepositWithdrawStatusService) SetTxId(txId string) *GetDepositWithdrawStatusService
- func (s *GetDepositWithdrawStatusService) SetWdId(wdId string) *GetDepositWithdrawStatusService
- type GetDiscountRateInterestFreeQuotaService
- func (s *GetDiscountRateInterestFreeQuotaService) Do(ctx context.Context) ([]DiscountRateInterestFreeQuota, error)
- func (s *GetDiscountRateInterestFreeQuotaService) SetCcy(ccy string) *GetDiscountRateInterestFreeQuotaService
- func (s *GetDiscountRateInterestFreeQuotaService) SetDiscountLv(discountLv string) *GetDiscountRateInterestFreeQuotaService
- type GetEasyConvertCurrencyListService
- type GetEasyConvertHistoryService
- func (s *GetEasyConvertHistoryService) Do(ctx context.Context) ([]EasyConvertHistory, error)
- func (s *GetEasyConvertHistoryService) SetAfter(t time.Time) *GetEasyConvertHistoryService
- func (s *GetEasyConvertHistoryService) SetBefore(t time.Time) *GetEasyConvertHistoryService
- func (s *GetEasyConvertHistoryService) SetLimit(limit int) *GetEasyConvertHistoryService
- type GetEconomicCalendarService
- func (s *GetEconomicCalendarService) Do(ctx context.Context) ([]EconomicCalendar, error)
- func (s *GetEconomicCalendarService) SetAfter(after time.Time) *GetEconomicCalendarService
- func (s *GetEconomicCalendarService) SetBefore(before time.Time) *GetEconomicCalendarService
- func (s *GetEconomicCalendarService) SetImportance(importance EconomicCalendarImportance) *GetEconomicCalendarService
- func (s *GetEconomicCalendarService) SetLimit(limit int) *GetEconomicCalendarService
- func (s *GetEconomicCalendarService) SetRegion(region string) *GetEconomicCalendarService
- type GetEntrustSubAccountListService
- type GetEstimatedPriceService
- type GetEthStakingApyHistoryService
- type GetEthStakingBalanceService
- type GetEthStakingHistoryService
- func (s *GetEthStakingHistoryService) Do(ctx context.Context) ([]EthStakingHistory, error)
- func (s *GetEthStakingHistoryService) SetAfter(t time.Time) *GetEthStakingHistoryService
- func (s *GetEthStakingHistoryService) SetBefore(t time.Time) *GetEthStakingHistoryService
- func (s *GetEthStakingHistoryService) SetLimit(limit int) *GetEthStakingHistoryService
- func (s *GetEthStakingHistoryService) SetStatus(status string) *GetEthStakingHistoryService
- func (s *GetEthStakingHistoryService) SetType(typ string) *GetEthStakingHistoryService
- type GetEthStakingProductInfoService
- type GetExchangeListService
- type GetExchangeRateService
- type GetFillsHistoryService
- func (s *GetFillsHistoryService) Do(ctx context.Context) ([]Fill, error)
- func (s *GetFillsHistoryService) SetAfter(after string) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetBefore(before string) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetBegin(t time.Time) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetEnd(t time.Time) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetInstFamily(instFamily string) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetInstId(instId string) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetLimit(limit int) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetOrdId(ordId string) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetSubType(subType string) *GetFillsHistoryService
- func (s *GetFillsHistoryService) SetUly(uly string) *GetFillsHistoryService
- type GetFillsService
- func (s *GetFillsService) Do(ctx context.Context) ([]Fill, error)
- func (s *GetFillsService) SetAfter(after string) *GetFillsService
- func (s *GetFillsService) SetBefore(before string) *GetFillsService
- func (s *GetFillsService) SetBegin(t time.Time) *GetFillsService
- func (s *GetFillsService) SetEnd(t time.Time) *GetFillsService
- func (s *GetFillsService) SetInstFamily(instFamily string) *GetFillsService
- func (s *GetFillsService) SetInstId(instId string) *GetFillsService
- func (s *GetFillsService) SetInstType(instType InstType) *GetFillsService
- func (s *GetFillsService) SetLimit(limit int) *GetFillsService
- func (s *GetFillsService) SetOrdId(ordId string) *GetFillsService
- func (s *GetFillsService) SetSubType(subType string) *GetFillsService
- func (s *GetFillsService) SetUly(uly string) *GetFillsService
- type GetFixedLoanLendingApyHistoryService
- type GetFixedLoanLendingOffersService
- type GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) Do(ctx context.Context) ([]FixedLoanLendingOrder, error)
- func (s *GetFixedLoanLendingOrdersListService) SetAfter(t time.Time) *GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) SetBefore(t time.Time) *GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) SetCcy(ccy string) *GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) SetLimit(limit int) *GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) SetOrdId(ordId string) *GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) SetState(state string) *GetFixedLoanLendingOrdersListService
- func (s *GetFixedLoanLendingOrdersListService) SetTerm(term string) *GetFixedLoanLendingOrdersListService
- type GetFixedLoanLendingSubOrdersService
- type GetFixedLoanPendingLendingVolumeService
- type GetFlexLoanBorrowCurrenciesService
- type GetFlexLoanCollateralAssetsService
- type GetFlexLoanInterestAccruedService
- func (s *GetFlexLoanInterestAccruedService) Do(ctx context.Context) ([]FlexLoanInterestAccrued, error)
- func (s *GetFlexLoanInterestAccruedService) SetAfter(t time.Time) *GetFlexLoanInterestAccruedService
- func (s *GetFlexLoanInterestAccruedService) SetBefore(t time.Time) *GetFlexLoanInterestAccruedService
- func (s *GetFlexLoanInterestAccruedService) SetCcy(ccy string) *GetFlexLoanInterestAccruedService
- func (s *GetFlexLoanInterestAccruedService) SetLimit(limit int) *GetFlexLoanInterestAccruedService
- type GetFlexLoanLoanHistoryService
- func (s *GetFlexLoanLoanHistoryService) Do(ctx context.Context) ([]FlexLoanHistory, error)
- func (s *GetFlexLoanLoanHistoryService) SetAfter(t time.Time) *GetFlexLoanLoanHistoryService
- func (s *GetFlexLoanLoanHistoryService) SetBefore(t time.Time) *GetFlexLoanLoanHistoryService
- func (s *GetFlexLoanLoanHistoryService) SetLimit(limit int) *GetFlexLoanLoanHistoryService
- func (s *GetFlexLoanLoanHistoryService) SetType(typ string) *GetFlexLoanLoanHistoryService
- type GetFlexLoanLoanInfoService
- type GetFlexLoanMaxLoanService
- type GetFundingBalanceService
- type GetFundingRateHistoryService
- func (s *GetFundingRateHistoryService) Do(ctx context.Context) ([]FundingRateHistory, error)
- func (s *GetFundingRateHistoryService) SetAfter(t time.Time) *GetFundingRateHistoryService
- func (s *GetFundingRateHistoryService) SetBefore(t time.Time) *GetFundingRateHistoryService
- func (s *GetFundingRateHistoryService) SetLimit(limit int) *GetFundingRateHistoryService
- type GetFundingRateService
- type GetGLPHistoricalPerformanceService
- func (s *GetGLPHistoricalPerformanceService) Do(ctx context.Context) ([]GLPHistoricalPerformance, error)
- func (s *GetGLPHistoricalPerformanceService) SetBegin(ms int64) *GetGLPHistoricalPerformanceService
- func (s *GetGLPHistoricalPerformanceService) SetEnd(ms int64) *GetGLPHistoricalPerformanceService
- func (s *GetGLPHistoricalPerformanceService) SetLimit(limit int) *GetGLPHistoricalPerformanceService
- type GetGLPTodayPerformanceService
- type GetGreeksService
- type GetGridAIParamService
- type GetGridAlgoDetailsService
- type GetGridAlgoHistoryService
- func (s *GetGridAlgoHistoryService) Do(ctx context.Context) ([]GridAlgoOrder, error)
- func (s *GetGridAlgoHistoryService) SetAfter(algoId string) *GetGridAlgoHistoryService
- func (s *GetGridAlgoHistoryService) SetAlgoId(algoId string) *GetGridAlgoHistoryService
- func (s *GetGridAlgoHistoryService) SetBefore(algoId string) *GetGridAlgoHistoryService
- func (s *GetGridAlgoHistoryService) SetInstId(instId string) *GetGridAlgoHistoryService
- func (s *GetGridAlgoHistoryService) SetInstType(instType InstType) *GetGridAlgoHistoryService
- func (s *GetGridAlgoHistoryService) SetLimit(limit int) *GetGridAlgoHistoryService
- type GetGridAlgoPendingService
- func (s *GetGridAlgoPendingService) Do(ctx context.Context) ([]GridAlgoOrder, error)
- func (s *GetGridAlgoPendingService) SetAfter(algoId string) *GetGridAlgoPendingService
- func (s *GetGridAlgoPendingService) SetAlgoId(algoId string) *GetGridAlgoPendingService
- func (s *GetGridAlgoPendingService) SetBefore(algoId string) *GetGridAlgoPendingService
- func (s *GetGridAlgoPendingService) SetInstId(instId string) *GetGridAlgoPendingService
- func (s *GetGridAlgoPendingService) SetInstType(instType InstType) *GetGridAlgoPendingService
- func (s *GetGridAlgoPendingService) SetLimit(limit int) *GetGridAlgoPendingService
- type GetGridMinInvestmentService
- func (s *GetGridMinInvestmentService) Do(ctx context.Context) (*GridMinInvestment, error)
- func (s *GetGridMinInvestmentService) SetAmt(amt decimal.Decimal) *GetGridMinInvestmentService
- func (s *GetGridMinInvestmentService) SetBasePos(basePos bool) *GetGridMinInvestmentService
- func (s *GetGridMinInvestmentService) SetDirection(direction GridDirection) *GetGridMinInvestmentService
- func (s *GetGridMinInvestmentService) SetInvestmentData(data []GridInvestmentDataInput) *GetGridMinInvestmentService
- func (s *GetGridMinInvestmentService) SetInvestmentType(investmentType string) *GetGridMinInvestmentService
- func (s *GetGridMinInvestmentService) SetLever(lever decimal.Decimal) *GetGridMinInvestmentService
- type GetGridPositionsService
- type GetGridRSIBackTestingService
- type GetGridSubOrdersService
- func (s *GetGridSubOrdersService) Do(ctx context.Context) ([]GridSubOrder, error)
- func (s *GetGridSubOrdersService) SetAfter(ordId string) *GetGridSubOrdersService
- func (s *GetGridSubOrdersService) SetBefore(ordId string) *GetGridSubOrdersService
- func (s *GetGridSubOrdersService) SetGroupId(groupId string) *GetGridSubOrdersService
- func (s *GetGridSubOrdersService) SetInstType(instType InstType) *GetGridSubOrdersService
- func (s *GetGridSubOrdersService) SetLimit(limit int) *GetGridSubOrdersService
- type GetHistoryCandlesService
- func (s *GetHistoryCandlesService) Do(ctx context.Context) ([]Candle, error)
- func (s *GetHistoryCandlesService) SetAfter(after time.Time) *GetHistoryCandlesService
- func (s *GetHistoryCandlesService) SetBar(bar MarketBar) *GetHistoryCandlesService
- func (s *GetHistoryCandlesService) SetBefore(before time.Time) *GetHistoryCandlesService
- func (s *GetHistoryCandlesService) SetLimit(limit int) *GetHistoryCandlesService
- type GetHistoryIndexCandlesService
- func (s *GetHistoryIndexCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
- func (s *GetHistoryIndexCandlesService) SetAfter(v time.Time) *GetHistoryIndexCandlesService
- func (s *GetHistoryIndexCandlesService) SetBar(v string) *GetHistoryIndexCandlesService
- func (s *GetHistoryIndexCandlesService) SetBefore(v time.Time) *GetHistoryIndexCandlesService
- func (s *GetHistoryIndexCandlesService) SetLimit(v int) *GetHistoryIndexCandlesService
- type GetHistoryMarkPriceCandlesService
- func (s *GetHistoryMarkPriceCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
- func (s *GetHistoryMarkPriceCandlesService) SetAfter(v time.Time) *GetHistoryMarkPriceCandlesService
- func (s *GetHistoryMarkPriceCandlesService) SetBar(v string) *GetHistoryMarkPriceCandlesService
- func (s *GetHistoryMarkPriceCandlesService) SetBefore(v time.Time) *GetHistoryMarkPriceCandlesService
- func (s *GetHistoryMarkPriceCandlesService) SetLimit(v int) *GetHistoryMarkPriceCandlesService
- type GetHistoryTradesService
- func (s *GetHistoryTradesService) Do(ctx context.Context) ([]Trade, error)
- func (s *GetHistoryTradesService) SetAfter(after string) *GetHistoryTradesService
- func (s *GetHistoryTradesService) SetBefore(before string) *GetHistoryTradesService
- func (s *GetHistoryTradesService) SetLimit(limit int) *GetHistoryTradesService
- func (s *GetHistoryTradesService) SetType(typ MarketHistoryTradeType) *GetHistoryTradesService
- type GetIndexCandlesService
- func (s *GetIndexCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
- func (s *GetIndexCandlesService) SetAfter(v time.Time) *GetIndexCandlesService
- func (s *GetIndexCandlesService) SetBar(v string) *GetIndexCandlesService
- func (s *GetIndexCandlesService) SetBefore(v time.Time) *GetIndexCandlesService
- func (s *GetIndexCandlesService) SetLimit(v int) *GetIndexCandlesService
- type GetIndexComponentsService
- type GetIndexTickersService
- type GetInstrumentTickBandsService
- type GetInstrumentsService
- func (s *GetInstrumentsService) Do(ctx context.Context) ([]Instrument, error)
- func (s *GetInstrumentsService) SetInstFamily(instFamily string) *GetInstrumentsService
- func (s *GetInstrumentsService) SetInstId(instId string) *GetInstrumentsService
- func (s *GetInstrumentsService) SetSeriesID(seriesId string) *GetInstrumentsService
- func (s *GetInstrumentsService) SetUly(uly string) *GetInstrumentsService
- type GetInsuranceFundService
- func (s *GetInsuranceFundService) Do(ctx context.Context) (*InsuranceFund, error)
- func (s *GetInsuranceFundService) SetAfter(t time.Time) *GetInsuranceFundService
- func (s *GetInsuranceFundService) SetBefore(t time.Time) *GetInsuranceFundService
- func (s *GetInsuranceFundService) SetCcy(ccy string) *GetInsuranceFundService
- func (s *GetInsuranceFundService) SetInstFamily(instFamily string) *GetInsuranceFundService
- func (s *GetInsuranceFundService) SetLimit(limit int) *GetInsuranceFundService
- func (s *GetInsuranceFundService) SetType(typ string) *GetInsuranceFundService
- func (s *GetInsuranceFundService) SetUly(uly string) *GetInsuranceFundService
- type GetInterestAccruedService
- func (s *GetInterestAccruedService) Do(ctx context.Context) ([]InterestAccrued, error)
- func (s *GetInterestAccruedService) SetAfter(t time.Time) *GetInterestAccruedService
- func (s *GetInterestAccruedService) SetBefore(t time.Time) *GetInterestAccruedService
- func (s *GetInterestAccruedService) SetCcy(ccy string) *GetInterestAccruedService
- func (s *GetInterestAccruedService) SetInstId(instId string) *GetInterestAccruedService
- func (s *GetInterestAccruedService) SetLimit(limit int) *GetInterestAccruedService
- func (s *GetInterestAccruedService) SetMgnMode(mgnMode MgnMode) *GetInterestAccruedService
- func (s *GetInterestAccruedService) SetType(typ string) *GetInterestAccruedService
- type GetInterestLimitsService
- type GetInterestRateLoanQuotaService
- type GetInterestRateService
- type GetLeverageInfoService
- type GetLoanRatioService
- type GetLongShortAccountRatioContractService
- func (s *GetLongShortAccountRatioContractService) Do(ctx context.Context) ([]RubikRatio, error)
- func (s *GetLongShortAccountRatioContractService) SetBegin(t time.Time) *GetLongShortAccountRatioContractService
- func (s *GetLongShortAccountRatioContractService) SetEnd(t time.Time) *GetLongShortAccountRatioContractService
- func (s *GetLongShortAccountRatioContractService) SetPeriod(p RubikStatPeriod) *GetLongShortAccountRatioContractService
- type GetLongShortAccountRatioContractTopTraderService
- func (s *GetLongShortAccountRatioContractTopTraderService) Do(ctx context.Context) ([]RubikRatio, error)
- func (s *GetLongShortAccountRatioContractTopTraderService) SetBegin(t time.Time) *GetLongShortAccountRatioContractTopTraderService
- func (s *GetLongShortAccountRatioContractTopTraderService) SetEnd(t time.Time) *GetLongShortAccountRatioContractTopTraderService
- func (s *GetLongShortAccountRatioContractTopTraderService) SetPeriod(p RubikStatPeriod) *GetLongShortAccountRatioContractTopTraderService
- type GetLongShortAccountRatioService
- func (s *GetLongShortAccountRatioService) Do(ctx context.Context) ([]RubikRatio, error)
- func (s *GetLongShortAccountRatioService) SetBegin(t time.Time) *GetLongShortAccountRatioService
- func (s *GetLongShortAccountRatioService) SetEnd(t time.Time) *GetLongShortAccountRatioService
- func (s *GetLongShortAccountRatioService) SetPeriod(p RubikStatPeriod) *GetLongShortAccountRatioService
- type GetLongShortPositionRatioContractTopTraderService
- func (s *GetLongShortPositionRatioContractTopTraderService) Do(ctx context.Context) ([]RubikRatio, error)
- func (s *GetLongShortPositionRatioContractTopTraderService) SetBegin(t time.Time) *GetLongShortPositionRatioContractTopTraderService
- func (s *GetLongShortPositionRatioContractTopTraderService) SetEnd(t time.Time) *GetLongShortPositionRatioContractTopTraderService
- func (s *GetLongShortPositionRatioContractTopTraderService) SetPeriod(p RubikStatPeriod) *GetLongShortPositionRatioContractTopTraderService
- type GetMMInstrumentTypesService
- func (s *GetMMInstrumentTypesService) Do(ctx context.Context) ([]MMInstrumentType, error)
- func (s *GetMMInstrumentTypesService) SetInstFamily(instFamily string) *GetMMInstrumentTypesService
- func (s *GetMMInstrumentTypesService) SetInstId(instId string) *GetMMInstrumentTypesService
- func (s *GetMMInstrumentTypesService) SetInstType(instType InstType) *GetMMInstrumentTypesService
- type GetMMPConfigService
- type GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) Do(ctx context.Context) ([]ManagedSubAccountBill, error)
- func (s *GetManagedSubAccountBillsService) SetAfter(t time.Time) *GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) SetBefore(t time.Time) *GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) SetCcy(ccy string) *GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) SetLimit(limit int) *GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) SetSubAcct(subAcct string) *GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) SetSubUid(subUid string) *GetManagedSubAccountBillsService
- func (s *GetManagedSubAccountBillsService) SetType(typ string) *GetManagedSubAccountBillsService
- type GetMarkPriceCandlesService
- func (s *GetMarkPriceCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
- func (s *GetMarkPriceCandlesService) SetAfter(v time.Time) *GetMarkPriceCandlesService
- func (s *GetMarkPriceCandlesService) SetBar(v string) *GetMarkPriceCandlesService
- func (s *GetMarkPriceCandlesService) SetBefore(v time.Time) *GetMarkPriceCandlesService
- func (s *GetMarkPriceCandlesService) SetLimit(v int) *GetMarkPriceCandlesService
- type GetMarkPriceService
- func (s *GetMarkPriceService) Do(ctx context.Context) ([]MarkPrice, error)
- func (s *GetMarkPriceService) SetInstFamily(instFamily string) *GetMarkPriceService
- func (s *GetMarkPriceService) SetInstId(instId string) *GetMarkPriceService
- func (s *GetMarkPriceService) SetUly(uly string) *GetMarkPriceService
- type GetMaxAvailSizeService
- func (s *GetMaxAvailSizeService) Do(ctx context.Context) ([]MaxAvailSize, error)
- func (s *GetMaxAvailSizeService) SetCcy(ccy string) *GetMaxAvailSizeService
- func (s *GetMaxAvailSizeService) SetPx(px decimal.Decimal) *GetMaxAvailSizeService
- func (s *GetMaxAvailSizeService) SetQuickMgnType(quickMgnType string) *GetMaxAvailSizeService
- func (s *GetMaxAvailSizeService) SetReduceOnly(reduceOnly bool) *GetMaxAvailSizeService
- func (s *GetMaxAvailSizeService) SetUnSpotOffset(unSpotOffset bool) *GetMaxAvailSizeService
- type GetMaxLoanService
- type GetMaxSizeService
- func (s *GetMaxSizeService) Do(ctx context.Context) ([]MaxSize, error)
- func (s *GetMaxSizeService) SetCcy(ccy string) *GetMaxSizeService
- func (s *GetMaxSizeService) SetLeverage(leverage decimal.Decimal) *GetMaxSizeService
- func (s *GetMaxSizeService) SetPx(px decimal.Decimal) *GetMaxSizeService
- func (s *GetMaxSizeService) SetUnSpotOffset(unSpotOffset bool) *GetMaxSizeService
- type GetMaxWithdrawalService
- type GetMonthlyStatementService
- type GetMovePositionsHistoryService
- func (s *GetMovePositionsHistoryService) Do(ctx context.Context) ([]MovePositionsHistory, error)
- func (s *GetMovePositionsHistoryService) SetBeginTs(t time.Time) *GetMovePositionsHistoryService
- func (s *GetMovePositionsHistoryService) SetBlockTdId(blockTdId string) *GetMovePositionsHistoryService
- func (s *GetMovePositionsHistoryService) SetClientId(clientId string) *GetMovePositionsHistoryService
- func (s *GetMovePositionsHistoryService) SetEndTs(t time.Time) *GetMovePositionsHistoryService
- func (s *GetMovePositionsHistoryService) SetLimit(limit int) *GetMovePositionsHistoryService
- func (s *GetMovePositionsHistoryService) SetState(state string) *GetMovePositionsHistoryService
- type GetNonTradableAssetsService
- type GetOKUSDLimitsService
- type GetOneClickRepayCurrencyListService
- type GetOneClickRepayCurrencyListV2Service
- type GetOneClickRepayHistoryService
- func (s *GetOneClickRepayHistoryService) Do(ctx context.Context) ([]OneClickRepayHistory, error)
- func (s *GetOneClickRepayHistoryService) SetAfter(t time.Time) *GetOneClickRepayHistoryService
- func (s *GetOneClickRepayHistoryService) SetBefore(t time.Time) *GetOneClickRepayHistoryService
- func (s *GetOneClickRepayHistoryService) SetLimit(limit int) *GetOneClickRepayHistoryService
- type GetOneClickRepayHistoryV2Service
- func (s *GetOneClickRepayHistoryV2Service) Do(ctx context.Context) ([]OneClickRepayHistoryV2, error)
- func (s *GetOneClickRepayHistoryV2Service) SetAfter(t time.Time) *GetOneClickRepayHistoryV2Service
- func (s *GetOneClickRepayHistoryV2Service) SetBefore(t time.Time) *GetOneClickRepayHistoryV2Service
- func (s *GetOneClickRepayHistoryV2Service) SetLimit(limit int) *GetOneClickRepayHistoryV2Service
- type GetOpenInterestHistoryService
- func (s *GetOpenInterestHistoryService) Do(ctx context.Context) ([]RubikOpenInterestHistory, error)
- func (s *GetOpenInterestHistoryService) SetBegin(t time.Time) *GetOpenInterestHistoryService
- func (s *GetOpenInterestHistoryService) SetEnd(t time.Time) *GetOpenInterestHistoryService
- func (s *GetOpenInterestHistoryService) SetLimit(limit int) *GetOpenInterestHistoryService
- func (s *GetOpenInterestHistoryService) SetPeriod(p RubikStatPeriod) *GetOpenInterestHistoryService
- type GetOpenInterestService
- func (s *GetOpenInterestService) Do(ctx context.Context) ([]OpenInterest, error)
- func (s *GetOpenInterestService) SetInstFamily(instFamily string) *GetOpenInterestService
- func (s *GetOpenInterestService) SetInstId(instId string) *GetOpenInterestService
- func (s *GetOpenInterestService) SetUly(uly string) *GetOpenInterestService
- type GetOptSummaryService
- func (s *GetOptSummaryService) Do(ctx context.Context) ([]OptSummary, error)
- func (s *GetOptSummaryService) SetExpTime(expTime string) *GetOptSummaryService
- func (s *GetOptSummaryService) SetInstFamily(instFamily string) *GetOptSummaryService
- func (s *GetOptSummaryService) SetUly(uly string) *GetOptSummaryService
- type GetOptionInstrumentFamilyTradesService
- type GetOptionOpenInterestVolumeExpiryService
- type GetOptionOpenInterestVolumeService
- type GetOptionOpenInterestVolumeStrikeService
- type GetOptionTakerBlockVolumeService
- type GetOrderService
- type GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) Do(ctx context.Context) ([]Order, error)
- func (s *GetOrdersHistoryArchiveService) SetAfter(ordId string) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetBefore(ordId string) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetBegin(t time.Time) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetCategory(category string) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetEnd(t time.Time) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetInstFamily(instFamily string) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetInstId(instId string) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetLimit(limit int) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetOrdType(ordType OrdType) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetState(state OrdState) *GetOrdersHistoryArchiveService
- func (s *GetOrdersHistoryArchiveService) SetUly(uly string) *GetOrdersHistoryArchiveService
- type GetOrdersHistoryService
- func (s *GetOrdersHistoryService) Do(ctx context.Context) ([]Order, error)
- func (s *GetOrdersHistoryService) SetAfter(ordId string) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetBefore(ordId string) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetBegin(t time.Time) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetCategory(category string) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetEnd(t time.Time) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetInstFamily(instFamily string) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetInstId(instId string) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetLimit(limit int) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetOrdType(ordType OrdType) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetState(state OrdState) *GetOrdersHistoryService
- func (s *GetOrdersHistoryService) SetUly(uly string) *GetOrdersHistoryService
- type GetOrdersPendingService
- func (s *GetOrdersPendingService) Do(ctx context.Context) ([]Order, error)
- func (s *GetOrdersPendingService) SetAfter(ordId string) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetBefore(ordId string) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetInstFamily(instFamily string) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetInstId(instId string) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetInstType(instType InstType) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetLimit(limit int) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetOrdType(ordType OrdType) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetState(state OrdState) *GetOrdersPendingService
- func (s *GetOrdersPendingService) SetUly(uly string) *GetOrdersPendingService
- type GetPlatform24VolumeService
- type GetPositionTiersService
- func (s *GetPositionTiersService) Do(ctx context.Context) ([]PositionTier, error)
- func (s *GetPositionTiersService) SetCcy(ccy string) *GetPositionTiersService
- func (s *GetPositionTiersService) SetInstFamily(instFamily string) *GetPositionTiersService
- func (s *GetPositionTiersService) SetInstId(instId string) *GetPositionTiersService
- func (s *GetPositionTiersService) SetTier(tier string) *GetPositionTiersService
- func (s *GetPositionTiersService) SetUly(uly string) *GetPositionTiersService
- type GetPositionsHistoryService
- func (s *GetPositionsHistoryService) Do(ctx context.Context) ([]PositionHistory, error)
- func (s *GetPositionsHistoryService) SetAfter(t time.Time) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetBefore(t time.Time) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetInstId(instId string) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetInstType(instType InstType) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetLimit(limit int) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetMgnMode(mgnMode MgnMode) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetPosId(posId string) *GetPositionsHistoryService
- func (s *GetPositionsHistoryService) SetType(typ string) *GetPositionsHistoryService
- type GetPositionsService
- func (s *GetPositionsService) Do(ctx context.Context) ([]Position, error)
- func (s *GetPositionsService) SetInstId(instId string) *GetPositionsService
- func (s *GetPositionsService) SetInstType(instType InstType) *GetPositionsService
- func (s *GetPositionsService) SetPosId(posId string) *GetPositionsService
- type GetPremiumHistoryService
- func (s *GetPremiumHistoryService) Do(ctx context.Context) ([]PremiumHistory, error)
- func (s *GetPremiumHistoryService) SetAfter(t time.Time) *GetPremiumHistoryService
- func (s *GetPremiumHistoryService) SetBefore(t time.Time) *GetPremiumHistoryService
- func (s *GetPremiumHistoryService) SetLimit(limit int) *GetPremiumHistoryService
- type GetPriceLimitService
- type GetRecurringOrderDetailsService
- type GetRecurringOrdersHistoryService
- func (s *GetRecurringOrdersHistoryService) Do(ctx context.Context) ([]RecurringOrder, error)
- func (s *GetRecurringOrdersHistoryService) SetAfter(after string) *GetRecurringOrdersHistoryService
- func (s *GetRecurringOrdersHistoryService) SetAlgoId(algoId string) *GetRecurringOrdersHistoryService
- func (s *GetRecurringOrdersHistoryService) SetBefore(before string) *GetRecurringOrdersHistoryService
- func (s *GetRecurringOrdersHistoryService) SetLimit(limit int) *GetRecurringOrdersHistoryService
- type GetRecurringOrdersPendingService
- func (s *GetRecurringOrdersPendingService) Do(ctx context.Context) ([]RecurringOrder, error)
- func (s *GetRecurringOrdersPendingService) SetAfter(after string) *GetRecurringOrdersPendingService
- func (s *GetRecurringOrdersPendingService) SetAlgoId(algoId string) *GetRecurringOrdersPendingService
- func (s *GetRecurringOrdersPendingService) SetBefore(before string) *GetRecurringOrdersPendingService
- func (s *GetRecurringOrdersPendingService) SetLimit(limit int) *GetRecurringOrdersPendingService
- type GetRecurringSubOrdersService
- func (s *GetRecurringSubOrdersService) Do(ctx context.Context) ([]RecurringSubOrder, error)
- func (s *GetRecurringSubOrdersService) SetAfter(after string) *GetRecurringSubOrdersService
- func (s *GetRecurringSubOrdersService) SetBefore(before string) *GetRecurringSubOrdersService
- func (s *GetRecurringSubOrdersService) SetLimit(limit int) *GetRecurringSubOrdersService
- func (s *GetRecurringSubOrdersService) SetOrdId(ordId string) *GetRecurringSubOrdersService
- type GetRfqBlockTickerService
- type GetRfqBlockTickersService
- type GetRfqCounterpartiesService
- type GetRfqMakerInstrumentSettingsService
- type GetRfqMmpConfigService
- type GetRfqPublicTradesService
- func (s *GetRfqPublicTradesService) Do(ctx context.Context) ([]RfqPublicTrade, error)
- func (s *GetRfqPublicTradesService) SetBeginId(beginId string) *GetRfqPublicTradesService
- func (s *GetRfqPublicTradesService) SetEndId(endId string) *GetRfqPublicTradesService
- func (s *GetRfqPublicTradesService) SetLimit(limit int) *GetRfqPublicTradesService
- type GetRfqQuoteProductsService
- type GetRfqQuotesService
- func (s *GetRfqQuotesService) Do(ctx context.Context) ([]RfqQuote, error)
- func (s *GetRfqQuotesService) SetBeginId(beginId string) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetClQuoteId(clQuoteId string) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetClRfqId(clRfqId string) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetEndId(endId string) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetLimit(limit int) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetQuoteId(quoteId string) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetRfqId(rfqId string) *GetRfqQuotesService
- func (s *GetRfqQuotesService) SetState(state RfqQuoteState) *GetRfqQuotesService
- type GetRfqTradesService
- func (s *GetRfqTradesService) Do(ctx context.Context) ([]RfqTrade, error)
- func (s *GetRfqTradesService) SetBeginId(beginId string) *GetRfqTradesService
- func (s *GetRfqTradesService) SetBeginTs(t time.Time) *GetRfqTradesService
- func (s *GetRfqTradesService) SetClQuoteId(clQuoteId string) *GetRfqTradesService
- func (s *GetRfqTradesService) SetClRfqId(clRfqId string) *GetRfqTradesService
- func (s *GetRfqTradesService) SetEndId(endId string) *GetRfqTradesService
- func (s *GetRfqTradesService) SetEndTs(t time.Time) *GetRfqTradesService
- func (s *GetRfqTradesService) SetLimit(limit int) *GetRfqTradesService
- func (s *GetRfqTradesService) SetQuoteId(quoteId string) *GetRfqTradesService
- func (s *GetRfqTradesService) SetRfqId(rfqId string) *GetRfqTradesService
- func (s *GetRfqTradesService) SetState(state string) *GetRfqTradesService
- type GetRfqsService
- func (s *GetRfqsService) Do(ctx context.Context) ([]Rfq, error)
- func (s *GetRfqsService) SetBeginId(beginId string) *GetRfqsService
- func (s *GetRfqsService) SetClRfqId(clRfqId string) *GetRfqsService
- func (s *GetRfqsService) SetEndId(endId string) *GetRfqsService
- func (s *GetRfqsService) SetLimit(limit int) *GetRfqsService
- func (s *GetRfqsService) SetRfqId(rfqId string) *GetRfqsService
- func (s *GetRfqsService) SetState(state RfqState) *GetRfqsService
- type GetRiskStateService
- type GetSavingsBalanceService
- type GetSavingsLendingHistoryService
- func (s *GetSavingsLendingHistoryService) Do(ctx context.Context) ([]SavingsLendingHistory, error)
- func (s *GetSavingsLendingHistoryService) SetAfter(t time.Time) *GetSavingsLendingHistoryService
- func (s *GetSavingsLendingHistoryService) SetBefore(t time.Time) *GetSavingsLendingHistoryService
- func (s *GetSavingsLendingHistoryService) SetCcy(ccy string) *GetSavingsLendingHistoryService
- func (s *GetSavingsLendingHistoryService) SetLimit(limit int) *GetSavingsLendingHistoryService
- type GetSavingsLendingRateHistoryService
- func (s *GetSavingsLendingRateHistoryService) Do(ctx context.Context) ([]SavingsLendingRateHistory, error)
- func (s *GetSavingsLendingRateHistoryService) SetAfter(t time.Time) *GetSavingsLendingRateHistoryService
- func (s *GetSavingsLendingRateHistoryService) SetBefore(t time.Time) *GetSavingsLendingRateHistoryService
- func (s *GetSavingsLendingRateHistoryService) SetCcy(ccy string) *GetSavingsLendingRateHistoryService
- func (s *GetSavingsLendingRateHistoryService) SetLimit(limit int) *GetSavingsLendingRateHistoryService
- type GetSavingsLendingRateSummaryService
- type GetSettlementHistoryService
- func (s *GetSettlementHistoryService) Do(ctx context.Context) ([]SettlementHistory, error)
- func (s *GetSettlementHistoryService) SetAfter(t time.Time) *GetSettlementHistoryService
- func (s *GetSettlementHistoryService) SetBefore(t time.Time) *GetSettlementHistoryService
- func (s *GetSettlementHistoryService) SetLimit(limit int) *GetSettlementHistoryService
- type GetSolStakingApyHistoryService
- type GetSolStakingBalanceService
- type GetSolStakingHistoryService
- func (s *GetSolStakingHistoryService) Do(ctx context.Context) ([]SolStakingHistory, error)
- func (s *GetSolStakingHistoryService) SetAfter(t time.Time) *GetSolStakingHistoryService
- func (s *GetSolStakingHistoryService) SetBefore(t time.Time) *GetSolStakingHistoryService
- func (s *GetSolStakingHistoryService) SetLimit(limit int) *GetSolStakingHistoryService
- func (s *GetSolStakingHistoryService) SetStatus(status string) *GetSolStakingHistoryService
- func (s *GetSolStakingHistoryService) SetType(typ string) *GetSolStakingHistoryService
- type GetSolStakingProductInfoService
- type GetSpotBorrowRepayHistoryService
- func (s *GetSpotBorrowRepayHistoryService) Do(ctx context.Context) ([]SpotBorrowRepayHistory, error)
- func (s *GetSpotBorrowRepayHistoryService) SetAfter(t time.Time) *GetSpotBorrowRepayHistoryService
- func (s *GetSpotBorrowRepayHistoryService) SetBefore(t time.Time) *GetSpotBorrowRepayHistoryService
- func (s *GetSpotBorrowRepayHistoryService) SetCcy(ccy string) *GetSpotBorrowRepayHistoryService
- func (s *GetSpotBorrowRepayHistoryService) SetLimit(limit int) *GetSpotBorrowRepayHistoryService
- func (s *GetSpotBorrowRepayHistoryService) SetType(typ string) *GetSpotBorrowRepayHistoryService
- type GetSprdBooksService
- type GetSprdCandlesService
- func (s *GetSprdCandlesService) Do(ctx context.Context) ([]SprdCandle, error)
- func (s *GetSprdCandlesService) SetAfter(after time.Time) *GetSprdCandlesService
- func (s *GetSprdCandlesService) SetBar(bar MarketBar) *GetSprdCandlesService
- func (s *GetSprdCandlesService) SetBefore(before time.Time) *GetSprdCandlesService
- func (s *GetSprdCandlesService) SetLimit(limit int) *GetSprdCandlesService
- type GetSprdHistoryCandlesService
- func (s *GetSprdHistoryCandlesService) Do(ctx context.Context) ([]SprdCandle, error)
- func (s *GetSprdHistoryCandlesService) SetAfter(after time.Time) *GetSprdHistoryCandlesService
- func (s *GetSprdHistoryCandlesService) SetBar(bar MarketBar) *GetSprdHistoryCandlesService
- func (s *GetSprdHistoryCandlesService) SetBefore(before time.Time) *GetSprdHistoryCandlesService
- func (s *GetSprdHistoryCandlesService) SetLimit(limit int) *GetSprdHistoryCandlesService
- type GetSprdOrderAlgoService
- type GetSprdOrderService
- type GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) Do(ctx context.Context) ([]SprdAlgoOrder, error)
- func (s *GetSprdOrdersAlgoHistoryService) SetAlgoId(algoId string) *GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) SetBegin(t time.Time) *GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) SetEnd(t time.Time) *GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) SetLimit(limit int) *GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) SetOrdType(ordType string) *GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) SetSprdId(sprdId string) *GetSprdOrdersAlgoHistoryService
- func (s *GetSprdOrdersAlgoHistoryService) SetState(state string) *GetSprdOrdersAlgoHistoryService
- type GetSprdOrdersAlgoPendingService
- func (s *GetSprdOrdersAlgoPendingService) Do(ctx context.Context) ([]SprdAlgoOrder, error)
- func (s *GetSprdOrdersAlgoPendingService) SetAlgoId(algoId string) *GetSprdOrdersAlgoPendingService
- func (s *GetSprdOrdersAlgoPendingService) SetOrdType(ordType string) *GetSprdOrdersAlgoPendingService
- func (s *GetSprdOrdersAlgoPendingService) SetSprdId(sprdId string) *GetSprdOrdersAlgoPendingService
- func (s *GetSprdOrdersAlgoPendingService) SetState(state string) *GetSprdOrdersAlgoPendingService
- type GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) Do(ctx context.Context) ([]SprdOrder, error)
- func (s *GetSprdOrdersHistoryArchiveService) SetBegin(t time.Time) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetBeginId(beginId string) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetEnd(t time.Time) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetEndId(endId string) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetLimit(limit int) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetOrdType(ordType SprdOrdType) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetSprdId(sprdId string) *GetSprdOrdersHistoryArchiveService
- func (s *GetSprdOrdersHistoryArchiveService) SetState(state SprdOrdState) *GetSprdOrdersHistoryArchiveService
- type GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) Do(ctx context.Context) ([]SprdOrder, error)
- func (s *GetSprdOrdersHistoryService) SetBegin(t time.Time) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetBeginId(beginId string) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetEnd(t time.Time) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetEndId(endId string) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetLimit(limit int) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetOrdType(ordType SprdOrdType) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetSprdId(sprdId string) *GetSprdOrdersHistoryService
- func (s *GetSprdOrdersHistoryService) SetState(state SprdOrdState) *GetSprdOrdersHistoryService
- type GetSprdOrdersPendingService
- func (s *GetSprdOrdersPendingService) Do(ctx context.Context) ([]SprdOrder, error)
- func (s *GetSprdOrdersPendingService) SetBeginId(beginId string) *GetSprdOrdersPendingService
- func (s *GetSprdOrdersPendingService) SetEndId(endId string) *GetSprdOrdersPendingService
- func (s *GetSprdOrdersPendingService) SetLimit(limit int) *GetSprdOrdersPendingService
- func (s *GetSprdOrdersPendingService) SetOrdType(ordType SprdOrdType) *GetSprdOrdersPendingService
- func (s *GetSprdOrdersPendingService) SetSprdId(sprdId string) *GetSprdOrdersPendingService
- func (s *GetSprdOrdersPendingService) SetState(state SprdOrdState) *GetSprdOrdersPendingService
- type GetSprdPublicTradesService
- type GetSprdSpreadsService
- func (s *GetSprdSpreadsService) Do(ctx context.Context) ([]SprdSpread, error)
- func (s *GetSprdSpreadsService) SetBaseCcy(baseCcy string) *GetSprdSpreadsService
- func (s *GetSprdSpreadsService) SetInstId(instId string) *GetSprdSpreadsService
- func (s *GetSprdSpreadsService) SetSprdId(sprdId string) *GetSprdSpreadsService
- func (s *GetSprdSpreadsService) SetState(state SprdState) *GetSprdSpreadsService
- type GetSprdTickerService
- type GetSprdTradesService
- func (s *GetSprdTradesService) Do(ctx context.Context) ([]SprdTrade, error)
- func (s *GetSprdTradesService) SetBegin(t time.Time) *GetSprdTradesService
- func (s *GetSprdTradesService) SetBeginId(beginId string) *GetSprdTradesService
- func (s *GetSprdTradesService) SetEnd(t time.Time) *GetSprdTradesService
- func (s *GetSprdTradesService) SetEndId(endId string) *GetSprdTradesService
- func (s *GetSprdTradesService) SetLimit(limit int) *GetSprdTradesService
- func (s *GetSprdTradesService) SetOrdId(ordId string) *GetSprdTradesService
- func (s *GetSprdTradesService) SetSprdId(sprdId string) *GetSprdTradesService
- func (s *GetSprdTradesService) SetTradeId(tradeId string) *GetSprdTradesService
- type GetStakingActiveOrdersService
- func (s *GetStakingActiveOrdersService) Do(ctx context.Context) ([]StakingActiveOrder, error)
- func (s *GetStakingActiveOrdersService) SetCcy(ccy string) *GetStakingActiveOrdersService
- func (s *GetStakingActiveOrdersService) SetProductId(productId string) *GetStakingActiveOrdersService
- func (s *GetStakingActiveOrdersService) SetProtocolType(protocolType StakingProtocolType) *GetStakingActiveOrdersService
- func (s *GetStakingActiveOrdersService) SetState(state StakingOrderState) *GetStakingActiveOrdersService
- type GetStakingOffersService
- func (s *GetStakingOffersService) Do(ctx context.Context) ([]StakingOffer, error)
- func (s *GetStakingOffersService) SetCcy(ccy string) *GetStakingOffersService
- func (s *GetStakingOffersService) SetProductId(productId string) *GetStakingOffersService
- func (s *GetStakingOffersService) SetProtocolType(protocolType StakingProtocolType) *GetStakingOffersService
- type GetStakingOrdersHistoryService
- func (s *GetStakingOrdersHistoryService) Do(ctx context.Context) ([]StakingHistoryOrder, error)
- func (s *GetStakingOrdersHistoryService) SetAfter(t time.Time) *GetStakingOrdersHistoryService
- func (s *GetStakingOrdersHistoryService) SetBefore(t time.Time) *GetStakingOrdersHistoryService
- func (s *GetStakingOrdersHistoryService) SetCcy(ccy string) *GetStakingOrdersHistoryService
- func (s *GetStakingOrdersHistoryService) SetLimit(limit int) *GetStakingOrdersHistoryService
- func (s *GetStakingOrdersHistoryService) SetProductId(productId string) *GetStakingOrdersHistoryService
- func (s *GetStakingOrdersHistoryService) SetProtocolType(protocolType StakingProtocolType) *GetStakingOrdersHistoryService
- type GetSubAccountApiKeyService
- type GetSubAccountBillsService
- func (s *GetSubAccountBillsService) Do(ctx context.Context) ([]SubAccountBill, error)
- func (s *GetSubAccountBillsService) SetAfter(t time.Time) *GetSubAccountBillsService
- func (s *GetSubAccountBillsService) SetBefore(t time.Time) *GetSubAccountBillsService
- func (s *GetSubAccountBillsService) SetCcy(ccy string) *GetSubAccountBillsService
- func (s *GetSubAccountBillsService) SetLimit(limit int) *GetSubAccountBillsService
- func (s *GetSubAccountBillsService) SetSubAcct(subAcct string) *GetSubAccountBillsService
- func (s *GetSubAccountBillsService) SetType(typ string) *GetSubAccountBillsService
- type GetSubAccountFundingBalancesService
- type GetSubAccountListService
- func (s *GetSubAccountListService) Do(ctx context.Context) ([]SubAccount, error)
- func (s *GetSubAccountListService) SetAfter(t time.Time) *GetSubAccountListService
- func (s *GetSubAccountListService) SetBefore(t time.Time) *GetSubAccountListService
- func (s *GetSubAccountListService) SetEnable(enable bool) *GetSubAccountListService
- func (s *GetSubAccountListService) SetLimit(limit int) *GetSubAccountListService
- func (s *GetSubAccountListService) SetSubAcct(subAcct string) *GetSubAccountListService
- type GetSubAccountMaxWithdrawalService
- type GetSubAccountTradingBalancesService
- type GetSupportCoinService
- type GetSystemStatusService
- type GetSystemTimeService
- type GetTakerVolumeService
- func (s *GetTakerVolumeService) Do(ctx context.Context) ([]RubikTakerVolume, error)
- func (s *GetTakerVolumeService) SetBegin(t time.Time) *GetTakerVolumeService
- func (s *GetTakerVolumeService) SetEnd(t time.Time) *GetTakerVolumeService
- func (s *GetTakerVolumeService) SetPeriod(p RubikStatPeriod) *GetTakerVolumeService
- type GetTickerService
- type GetTickersService
- type GetTradeFeeService
- func (s *GetTradeFeeService) Do(ctx context.Context) (*TradeFee, error)
- func (s *GetTradeFeeService) SetInstFamily(instFamily string) *GetTradeFeeService
- func (s *GetTradeFeeService) SetInstId(instId string) *GetTradeFeeService
- func (s *GetTradeFeeService) SetRuleType(ruleType string) *GetTradeFeeService
- func (s *GetTradeFeeService) SetUly(uly string) *GetTradeFeeService
- type GetTradesService
- type GetTransferStateService
- func (s *GetTransferStateService) Do(ctx context.Context) ([]TransferState, error)
- func (s *GetTransferStateService) SetClientId(clientId string) *GetTransferStateService
- func (s *GetTransferStateService) SetTransId(transId string) *GetTransferStateService
- func (s *GetTransferStateService) SetType(typ AssetTransferType) *GetTransferStateService
- type GetUnderlyingService
- type GetVipInterestAccruedService
- func (s *GetVipInterestAccruedService) Do(ctx context.Context) ([]VipInterestAccrued, error)
- func (s *GetVipInterestAccruedService) SetAfter(t time.Time) *GetVipInterestAccruedService
- func (s *GetVipInterestAccruedService) SetBefore(t time.Time) *GetVipInterestAccruedService
- func (s *GetVipInterestAccruedService) SetCcy(ccy string) *GetVipInterestAccruedService
- func (s *GetVipInterestAccruedService) SetLimit(limit int) *GetVipInterestAccruedService
- func (s *GetVipInterestAccruedService) SetOrdId(ordId string) *GetVipInterestAccruedService
- type GetVipInterestDeductedService
- func (s *GetVipInterestDeductedService) Do(ctx context.Context) ([]VipInterestDeducted, error)
- func (s *GetVipInterestDeductedService) SetAfter(t time.Time) *GetVipInterestDeductedService
- func (s *GetVipInterestDeductedService) SetBefore(t time.Time) *GetVipInterestDeductedService
- func (s *GetVipInterestDeductedService) SetCcy(ccy string) *GetVipInterestDeductedService
- func (s *GetVipInterestDeductedService) SetLimit(limit int) *GetVipInterestDeductedService
- func (s *GetVipInterestDeductedService) SetOrdId(ordId string) *GetVipInterestDeductedService
- type GetVipLoanOrderDetailService
- func (s *GetVipLoanOrderDetailService) Do(ctx context.Context) ([]VipLoanOrderDetail, error)
- func (s *GetVipLoanOrderDetailService) SetAfter(t time.Time) *GetVipLoanOrderDetailService
- func (s *GetVipLoanOrderDetailService) SetBefore(t time.Time) *GetVipLoanOrderDetailService
- func (s *GetVipLoanOrderDetailService) SetCcy(ccy string) *GetVipLoanOrderDetailService
- func (s *GetVipLoanOrderDetailService) SetLimit(limit int) *GetVipLoanOrderDetailService
- type GetVipLoanOrderListService
- func (s *GetVipLoanOrderListService) Do(ctx context.Context) ([]VipLoanOrder, error)
- func (s *GetVipLoanOrderListService) SetAfter(t time.Time) *GetVipLoanOrderListService
- func (s *GetVipLoanOrderListService) SetBefore(t time.Time) *GetVipLoanOrderListService
- func (s *GetVipLoanOrderListService) SetCcy(ccy string) *GetVipLoanOrderListService
- func (s *GetVipLoanOrderListService) SetLimit(limit int) *GetVipLoanOrderListService
- func (s *GetVipLoanOrderListService) SetOrdId(ordId string) *GetVipLoanOrderListService
- func (s *GetVipLoanOrderListService) SetState(state VipLoanState) *GetVipLoanOrderListService
- type GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) Do(ctx context.Context) ([]WithdrawalHistory, error)
- func (s *GetWithdrawalHistoryService) SetAfter(t time.Time) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetBefore(t time.Time) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetCcy(ccy string) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetClientId(clientId string) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetLimit(limit int) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetState(state string) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetTxId(txId string) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetType(typ string) *GetWithdrawalHistoryService
- func (s *GetWithdrawalHistoryService) SetWdId(wdId string) *GetWithdrawalHistoryService
- type Greeks
- type GreeksSetting
- type GreeksType
- type GridAIParam
- type GridAdjustInvestmentResult
- type GridAlgoOrdType
- type GridAlgoOrder
- type GridCancelCloseOrderResult
- type GridClosePositionResult
- type GridComputeMarginBalance
- type GridDirection
- type GridInstantTriggerResult
- type GridInvestmentDataInput
- type GridMarginBalanceResult
- type GridMinInvestment
- type GridMinInvestmentData
- type GridPosition
- type GridRSIBackTesting
- type GridRebateTrans
- type GridResult
- type GridRunType
- type GridStopArg
- type GridSubOrder
- type GridSubOrderType
- type GridTriggerParam
- type GridWithdrawIncomeResult
- type IndexCandle
- type IndexComponent
- type IndexComponents
- type IndexTicker
- type InstState
- type InstType
- type InstantTriggerGridService
- type Instrument
- type InstrumentTickBands
- type InstrumentUpcChg
- type InsuranceFund
- type InsuranceFundDetail
- type InterestAccrued
- type InterestLimits
- type InterestLimitsRecord
- type InterestRate
- type InterestRateBasic
- type InterestRateCcy
- type InterestRateConfig
- type InterestRateLevel
- type InterestRateLoanQuota
- type IsoMode
- type IsoModeType
- type IsolatedModeSetting
- type LeverageInfo
- type LeverageSetting
- type MMInstrumentType
- type MMPConfig
- type MMPConfigSetting
- type MMPReset
- type ManagedSubAccountBill
- type MarginBalance
- type MarginBalanceType
- type MarkPrice
- type MarketBar
- type MarketHistoryTradeType
- type MassCancelResult
- type MassCancelService
- type MaxAvailSize
- type MaxLoan
- type MaxSize
- type MaxWithdrawal
- type MgnMode
- type ModifySubAccountApiKeyService
- func (s *ModifySubAccountApiKeyService) Do(ctx context.Context) (*SubAccountApiKey, error)
- func (s *ModifySubAccountApiKeyService) SetIP(ip string) *ModifySubAccountApiKeyService
- func (s *ModifySubAccountApiKeyService) SetLabel(label string) *ModifySubAccountApiKeyService
- func (s *ModifySubAccountApiKeyService) SetPerm(perm string) *ModifySubAccountApiKeyService
- type MonthlyStatement
- type MonthlyStatementApply
- type MovePositionLeg
- type MovePositionLegFromReq
- type MovePositionLegToReq
- type MovePositions
- type MovePositionsHistory
- type MovePositionsHistoryLeg
- type MovePositionsHistoryLegFrom
- type MovePositionsHistoryLegTo
- type MovePositionsLeg
- type MovePositionsLegFrom
- type MovePositionsLegTo
- type MovePositionsService
- type NonTradableAsset
- type OKUSDLimits
- type OKUSDRedeemLimit
- type OKUSDRedeemType
- type OKUSDRedemption
- type OKUSDSubLimit
- type OKUSDSubscription
- type OneClickRepayCurrencyList
- type OneClickRepayCurrencyListV2
- type OneClickRepayDebt
- type OneClickRepayHistory
- type OneClickRepayHistoryV2
- type OneClickRepayOrderRef
- type OneClickRepayRepay
- type OneClickRepayResult
- type OneClickRepayResultV2
- type OpenInterest
- type OptSummary
- type OptType
- type OptionFamilyInfo
- type OptionFamilyTrades
- type OrdState
- type OrdType
- type Order
- type OrderArg
- type OrderBook
- type OrderLinkedAlgo
- type OrderPrecheck
- type OrderPrecheckService
- func (s *OrderPrecheckService) Do(ctx context.Context) (*OrderPrecheck, error)
- func (s *OrderPrecheckService) SetAttachAlgoOrds(orders []AttachAlgoOrd) *OrderPrecheckService
- func (s *OrderPrecheckService) SetPosSide(posSide PosSide) *OrderPrecheckService
- func (s *OrderPrecheckService) SetPx(px decimal.Decimal) *OrderPrecheckService
- func (s *OrderPrecheckService) SetReduceOnly(reduceOnly bool) *OrderPrecheckService
- func (s *OrderPrecheckService) SetTgtCcy(tgtCcy TgtCcy) *OrderPrecheckService
- type OrderResult
- type PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) Do(ctx context.Context) (*AlgoResult, error)
- func (s *PlaceAlgoOrderService) SetActivePx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetAdvChaseParams(params []AdvChaseParam) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetAdvanceOrdType(advanceOrdType string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetAttachAlgoOrds(ords []AlgoAttachOrd) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetCallbackRatio(ratio decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetCallbackSpread(spread decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetCcy(ccy string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetChaseType(chaseType string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetChaseVal(val decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetClOrdId(clOrdId string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetCxlOnClosePos(cxl bool) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetMaxChaseType(maxChaseType string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetMaxChaseVal(val decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetOrdPx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetPosSide(posSide PosSide) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetPxLimit(pxLimit decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetPxSpread(pxSpread decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetPxVar(pxVar decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetQuickMgnType(quickMgnType string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetReduceOnly(reduceOnly bool) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetSlOrdPx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetSlTriggerPxType(pxType string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetSzLimit(szLimit decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTag(tag string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTgtCcy(tgtCcy TgtCcy) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTimeInterval(seconds int) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTpOrdKind(kind string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTpOrdPx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTpTriggerPxType(pxType string) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTriggerPx(px decimal.Decimal) *PlaceAlgoOrderService
- func (s *PlaceAlgoOrderService) SetTriggerPxType(pxType string) *PlaceAlgoOrderService
- type PlaceCopyLeadStopOrderService
- func (s *PlaceCopyLeadStopOrderService) Do(ctx context.Context) (*CopySubPosAck, error)
- func (s *PlaceCopyLeadStopOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceCopyLeadStopOrderService
- func (s *PlaceCopyLeadStopOrderService) SetSlTriggerPxType(pxType string) *PlaceCopyLeadStopOrderService
- func (s *PlaceCopyLeadStopOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceCopyLeadStopOrderService
- func (s *PlaceCopyLeadStopOrderService) SetTpTriggerPxType(pxType string) *PlaceCopyLeadStopOrderService
- type PlaceEasyConvertService
- type PlaceFixedLoanLendingOrderService
- type PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) Do(ctx context.Context) (*GridResult, error)
- func (s *PlaceGridAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetBasePos(basePos bool) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetBaseSz(sz decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetCcy(ccy string) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetDirection(direction GridDirection) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetLever(lever decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetProfitSharingRatio(ratio decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetQuoteSz(sz decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetRunType(runType GridRunType) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetSlRatio(ratio decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetSz(sz decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetTag(tag string) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetTdMode(tdMode TdMode) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetTpRatio(ratio decimal.Decimal) *PlaceGridAlgoOrderService
- func (s *PlaceGridAlgoOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceGridAlgoOrderService
- type PlaceOrderService
- func (s *PlaceOrderService) Do(ctx context.Context) (*OrderResult, error)
- func (s *PlaceOrderService) SetAttachAlgoOrds(orders []AttachAlgoOrd) *PlaceOrderService
- func (s *PlaceOrderService) SetBanAmend(banAmend bool) *PlaceOrderService
- func (s *PlaceOrderService) SetCcy(ccy string) *PlaceOrderService
- func (s *PlaceOrderService) SetClOrdId(clOrdId string) *PlaceOrderService
- func (s *PlaceOrderService) SetPosSide(posSide PosSide) *PlaceOrderService
- func (s *PlaceOrderService) SetPx(px decimal.Decimal) *PlaceOrderService
- func (s *PlaceOrderService) SetQuickMgnType(quickMgnType string) *PlaceOrderService
- func (s *PlaceOrderService) SetReduceOnly(reduceOnly bool) *PlaceOrderService
- func (s *PlaceOrderService) SetSlOrdPx(px decimal.Decimal) *PlaceOrderService
- func (s *PlaceOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceOrderService
- func (s *PlaceOrderService) SetSlTriggerPxType(pxType string) *PlaceOrderService
- func (s *PlaceOrderService) SetStpId(stpId string) *PlaceOrderService
- func (s *PlaceOrderService) SetStpMode(stpMode string) *PlaceOrderService
- func (s *PlaceOrderService) SetTag(tag string) *PlaceOrderService
- func (s *PlaceOrderService) SetTgtCcy(tgtCcy TgtCcy) *PlaceOrderService
- func (s *PlaceOrderService) SetTpOrdPx(px decimal.Decimal) *PlaceOrderService
- func (s *PlaceOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceOrderService
- func (s *PlaceOrderService) SetTpTriggerPxType(pxType string) *PlaceOrderService
- type PlaceRecurringOrderService
- func (s *PlaceRecurringOrderService) Do(ctx context.Context) (*RecurringResult, error)
- func (s *PlaceRecurringOrderService) SetAlgoClOrdId(algoClOrdId string) *PlaceRecurringOrderService
- func (s *PlaceRecurringOrderService) SetRecurringDay(recurringDay string) *PlaceRecurringOrderService
- func (s *PlaceRecurringOrderService) SetRecurringHour(recurringHour string) *PlaceRecurringOrderService
- func (s *PlaceRecurringOrderService) SetTag(tag string) *PlaceRecurringOrderService
- type PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) Do(ctx context.Context) (*SprdAlgoAck, error)
- func (s *PlaceSprdOrderAlgoService) SetAlgoClOrdId(algoClOrdId string) *PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) SetPxLimit(pxLimit string) *PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) SetPxSpread(pxSpread string) *PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) SetPxVar(pxVar string) *PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) SetSzLimit(szLimit string) *PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) SetTag(tag string) *PlaceSprdOrderAlgoService
- func (s *PlaceSprdOrderAlgoService) SetTimeInterval(timeInterval string) *PlaceSprdOrderAlgoService
- type PlaceSprdOrderService
- func (s *PlaceSprdOrderService) Do(ctx context.Context) (*SprdOrderAck, error)
- func (s *PlaceSprdOrderService) SetClOrdId(clOrdId string) *PlaceSprdOrderService
- func (s *PlaceSprdOrderService) SetPx(px string) *PlaceSprdOrderService
- func (s *PlaceSprdOrderService) SetTag(tag string) *PlaceSprdOrderService
- type Platform24Volume
- type PosMode
- type PosSide
- type Position
- type PositionBuilder
- type PositionBuilderAsset
- type PositionBuilderMr1Scenarios
- type PositionBuilderMr6FinalResult
- type PositionBuilderMrFinalResult
- type PositionBuilderPortfolio
- type PositionBuilderPosition
- type PositionBuilderRiskUnit
- type PositionBuilderService
- func (s *PositionBuilderService) Do(ctx context.Context) (*PositionBuilder, error)
- func (s *PositionBuilderService) SetAcctLv(acctLv string) *PositionBuilderService
- func (s *PositionBuilderService) SetGreeksType(greeksType GreeksType) *PositionBuilderService
- func (s *PositionBuilderService) SetIdxVol(idxVol string) *PositionBuilderService
- func (s *PositionBuilderService) SetInclRealPosAndEq(incl bool) *PositionBuilderService
- func (s *PositionBuilderService) SetLever(lever string) *PositionBuilderService
- func (s *PositionBuilderService) SetSimAsset(simAsset []PositionBuilderSimAsset) *PositionBuilderService
- func (s *PositionBuilderService) SetSimPos(simPos []PositionBuilderSimPos) *PositionBuilderService
- type PositionBuilderSimAsset
- type PositionBuilderSimPos
- type PositionCloseOrderAlgo
- type PositionHistory
- type PositionMode
- type PositionTier
- type PremiumHistory
- type PriceLimit
- type PurchaseEthStakingService
- type PurchaseSolStakingService
- type PurchaseStakingService
- type RecurringItem
- type RecurringOrder
- type RecurringPeriod
- type RecurringResult
- type RecurringState
- type RecurringSubOrder
- type RedeemEthStakingService
- type RedeemSolStakingService
- type RedeemStakingService
- type ResetMMPService
- type ResetRfqMmpService
- type Rfq
- type RfqBlockTicker
- type RfqCancelAck
- type RfqCancelAllAfter
- type RfqCounterparty
- type RfqCreateLeg
- type RfqExecuteLeg
- type RfqLeg
- type RfqMakerInstrumentSetting
- type RfqMakerInstrumentSettingData
- type RfqMmpConfig
- type RfqMmpReset
- type RfqPublicTrade
- type RfqPublicTradeLeg
- type RfqQuote
- type RfqQuoteCancelAck
- type RfqQuoteCreateLeg
- type RfqQuoteLeg
- type RfqQuoteProduct
- type RfqQuoteProductData
- type RfqQuoteSide
- type RfqQuoteState
- type RfqState
- type RfqTimestampAck
- type RfqTrade
- type RfqTradeLeg
- type RiskState
- type RubikOpenInterestHistory
- type RubikOpenInterestVolume
- type RubikOpenInterestVolumeExpiry
- type RubikOpenInterestVolumeStrike
- type RubikOptionTakerBlockVolume
- type RubikRatio
- type RubikStatPeriod
- type RubikSupportCoin
- type RubikTakerVolume
- type SavingsBalance
- type SavingsLendingHistory
- type SavingsLendingRate
- type SavingsLendingRateHistory
- type SavingsLendingRateSummary
- type SavingsPurchaseRedemption
- type SavingsSide
- type SetAccountLevelService
- type SetAutoLoanService
- type SetAutoRepayService
- type SetBorrowRepayService
- type SetCollateralAssetsService
- type SetCopyLeverageService
- type SetGreeksService
- type SetIsolatedModeService
- type SetLeverageService
- type SetMMPConfigService
- type SetMarginBalanceService
- type SetOKUSDRedeemService
- type SetOKUSDSubscribeService
- type SetPositionModeService
- type SetRfqMakerInstrumentSettingsService
- type SetRfqMmpService
- type SetRfqQuoteProductsService
- type SetSavingsLendingRateService
- type SetSavingsPurchaseRedemptionService
- type SetSpotManualBorrowRepayService
- type SetSubAccountTransferOutService
- type SettlementHistory
- type SettlementHistoryDetail
- type Side
- type SolStakingAck
- type SolStakingBalance
- type SolStakingHistory
- type SolStakingProductInfo
- type SpotBorrowRepayHistory
- type SpotManualBorrowRepay
- type SprdAlgoAck
- type SprdAlgoOrder
- type SprdAmendAck
- type SprdCancelAllAck
- type SprdCancelAllAfterAck
- type SprdCancelAllAfterService
- type SprdCandle
- type SprdLeg
- type SprdMassCancelAck
- type SprdMassCancelOrdersService
- type SprdOrdState
- type SprdOrdType
- type SprdOrder
- type SprdOrderAck
- type SprdOrderBook
- type SprdPublicTrade
- type SprdSpread
- type SprdState
- type SprdTicker
- type SprdTrade
- type SprdTradeLeg
- type SprdType
- type StakingActiveOrder
- type StakingApyHistory
- type StakingEarningData
- type StakingFastRedemption
- type StakingHistoryOrder
- type StakingInvestData
- type StakingOffer
- type StakingOfferState
- type StakingOrderAck
- type StakingOrderEarn
- type StakingOrderInvest
- type StakingOrderState
- type StakingProtocolType
- type StakingPurchaseInvest
- type StopCopyCopyTradingService
- type StopCopyLeadTradingService
- type StopGridAlgoOrderService
- type StopRecurringOrderService
- type SubAccount
- type SubAccountApiKey
- type SubAccountBill
- type SubAccountFundingBalance
- type SubAccountMaxWithdrawal
- type SubAccountTradingBalance
- type SubAccountTradingBalanceCcy
- type SubAccountTransfer
- type SubAccountTransferOut
- type SubAccountTransferService
- type SubscribeAccountGreeksService
- type SubscribeAccountService
- type SubscribeAlgoAdvanceService
- type SubscribeBalanceAndPositionService
- type SubscribeBboTbtService
- type SubscribeBooks5Service
- type SubscribeBooks50L2TbtService
- type SubscribeBooksL2TbtService
- type SubscribeBooksService
- type SubscribeCandleService
- type SubscribeEconomicCalendarService
- type SubscribeFundingRateService
- type SubscribeGridOrdersContractService
- type SubscribeGridOrdersMoonService
- type SubscribeGridOrdersSpotService
- type SubscribeGridPositionsService
- type SubscribeGridSubOrdersService
- type SubscribeIndexCandleService
- type SubscribeIndexTickersService
- type SubscribeInstrumentsService
- type SubscribeLiquidationOrdersService
- type SubscribeLiquidationWarningService
- func (s *SubscribeLiquidationWarningService) Do(ctx context.Context, cb WsHandler[WsLiquidationWarning]) (chan<- struct{}, <-chan struct{}, error)
- func (s *SubscribeLiquidationWarningService) SetInstFamily(instFamily string) *SubscribeLiquidationWarningService
- func (s *SubscribeLiquidationWarningService) SetInstId(instId string) *SubscribeLiquidationWarningService
- type SubscribeMarkPriceCandleService
- type SubscribeMarkPriceService
- type SubscribeOpenInterestService
- type SubscribeOrdersAlgoService
- func (s *SubscribeOrdersAlgoService) Do(ctx context.Context, cb WsHandler[WsAlgoOrder]) (chan<- struct{}, <-chan struct{}, error)
- func (s *SubscribeOrdersAlgoService) SetInstFamily(instFamily string) *SubscribeOrdersAlgoService
- func (s *SubscribeOrdersAlgoService) SetInstId(instId string) *SubscribeOrdersAlgoService
- type SubscribeOrdersService
- type SubscribePositionsService
- func (s *SubscribePositionsService) Do(ctx context.Context, cb WsHandler[WsPosition]) (chan<- struct{}, <-chan struct{}, error)
- func (s *SubscribePositionsService) SetInstFamily(instFamily string) *SubscribePositionsService
- func (s *SubscribePositionsService) SetInstId(instId string) *SubscribePositionsService
- type SubscribePriceLimitService
- type SubscribeSprdBooks5Service
- type SubscribeSprdCandleService
- type SubscribeSprdPublicTradesService
- type SubscribeSprdTickersService
- type SubscribeStatusService
- type SubscribeTickersService
- type SubscribeTradesService
- type SurplusLmtDetails
- type SystemStatus
- type SystemStatusState
- type SystemTime
- type TdMode
- type TgtCcy
- type TickBand
- type Ticker
- type Trade
- type TradeFee
- type TradeFeeFiat
- type TradeFeeGroup
- type TradeOneClickRepayService
- type TradeOneClickRepayV2Service
- type TransferState
- type VipInterestAccrued
- type VipInterestDeducted
- type VipLoanOrder
- type VipLoanOrderDetail
- type VipLoanOrderDetailEvent
- type VipLoanState
- type WebSocketClient
- func (c *WebSocketClient) DialTrade(ctx context.Context) (*WsTradeConn, error)
- func (c *WebSocketClient) NewSubscribeAccountGreeksService() *SubscribeAccountGreeksService
- func (c *WebSocketClient) NewSubscribeAccountService() *SubscribeAccountService
- func (c *WebSocketClient) NewSubscribeAlgoAdvanceService(instType InstType) *SubscribeAlgoAdvanceService
- func (c *WebSocketClient) NewSubscribeBalanceAndPositionService() *SubscribeBalanceAndPositionService
- func (c *WebSocketClient) NewSubscribeBboTbtService(instId string) *SubscribeBboTbtService
- func (c *WebSocketClient) NewSubscribeBooks5Service(instId string) *SubscribeBooks5Service
- func (c *WebSocketClient) NewSubscribeBooks50L2TbtService(instId string) *SubscribeBooks50L2TbtService
- func (c *WebSocketClient) NewSubscribeBooksL2TbtService(instId string) *SubscribeBooksL2TbtService
- func (c *WebSocketClient) NewSubscribeBooksService(instId string) *SubscribeBooksService
- func (c *WebSocketClient) NewSubscribeCandleService(instId, bar string) *SubscribeCandleService
- func (c *WebSocketClient) NewSubscribeEconomicCalendarService() *SubscribeEconomicCalendarService
- func (c *WebSocketClient) NewSubscribeFundingRateService(instId string) *SubscribeFundingRateService
- func (c *WebSocketClient) NewSubscribeGridOrdersContractService(instType InstType) *SubscribeGridOrdersContractService
- func (c *WebSocketClient) NewSubscribeGridOrdersMoonService(instType InstType) *SubscribeGridOrdersMoonService
- func (c *WebSocketClient) NewSubscribeGridOrdersSpotService(instType InstType) *SubscribeGridOrdersSpotService
- func (c *WebSocketClient) NewSubscribeGridPositionsService(algoId string) *SubscribeGridPositionsService
- func (c *WebSocketClient) NewSubscribeGridSubOrdersService(algoId string) *SubscribeGridSubOrdersService
- func (c *WebSocketClient) NewSubscribeIndexCandleService(instId, bar string) *SubscribeIndexCandleService
- func (c *WebSocketClient) NewSubscribeIndexTickersService(instId string) *SubscribeIndexTickersService
- func (c *WebSocketClient) NewSubscribeInstrumentsService(instType InstType) *SubscribeInstrumentsService
- func (c *WebSocketClient) NewSubscribeLiquidationOrdersService(instType InstType) *SubscribeLiquidationOrdersService
- func (c *WebSocketClient) NewSubscribeLiquidationWarningService(instType InstType) *SubscribeLiquidationWarningService
- func (c *WebSocketClient) NewSubscribeMarkPriceCandleService(instId, bar string) *SubscribeMarkPriceCandleService
- func (c *WebSocketClient) NewSubscribeMarkPriceService(instId string) *SubscribeMarkPriceService
- func (c *WebSocketClient) NewSubscribeOpenInterestService(instId string) *SubscribeOpenInterestService
- func (c *WebSocketClient) NewSubscribeOrdersAlgoService(instType InstType) *SubscribeOrdersAlgoService
- func (c *WebSocketClient) NewSubscribeOrdersService(instType InstType) *SubscribeOrdersService
- func (c *WebSocketClient) NewSubscribePositionsService(instType InstType) *SubscribePositionsService
- func (c *WebSocketClient) NewSubscribePriceLimitService(instId string) *SubscribePriceLimitService
- func (c *WebSocketClient) NewSubscribeSprdBooks5Service(sprdId string) *SubscribeSprdBooks5Service
- func (c *WebSocketClient) NewSubscribeSprdCandleService(sprdId, bar string) *SubscribeSprdCandleService
- func (c *WebSocketClient) NewSubscribeSprdPublicTradesService(sprdId string) *SubscribeSprdPublicTradesService
- func (c *WebSocketClient) NewSubscribeSprdTickersService(sprdId string) *SubscribeSprdTickersService
- func (c *WebSocketClient) NewSubscribeStatusService() *SubscribeStatusService
- func (c *WebSocketClient) NewSubscribeTickersService(instId string) *SubscribeTickersService
- func (c *WebSocketClient) NewSubscribeTradesService(instId string) *SubscribeTradesService
- func (c *WebSocketClient) Subscribe(ctx context.Context, gateway request.Gateway, private bool, arg request.WsArg, ...) (chan<- struct{}, <-chan struct{}, error)
- type WithdrawGridIncomeService
- type Withdrawal
- type WithdrawalHistory
- type WithdrawalService
- func (s *WithdrawalService) Do(ctx context.Context) (*Withdrawal, error)
- func (s *WithdrawalService) SetAreaCode(areaCode string) *WithdrawalService
- func (s *WithdrawalService) SetChain(chain string) *WithdrawalService
- func (s *WithdrawalService) SetClientId(clientId string) *WithdrawalService
- func (s *WithdrawalService) SetFee(fee decimal.Decimal) *WithdrawalService
- func (s *WithdrawalService) SetRcvrInfo(rcvrInfo any) *WithdrawalService
- type WsAccount
- type WsAccountDetail
- type WsAccountGreeks
- type WsAdvanceAlgoOrder
- type WsAlgoOrder
- type WsBalData
- type WsBalPosTrade
- type WsBalanceAndPosition
- type WsCandle
- type WsCandleHandler
- type WsEconomicCalendar
- type WsFundingRate
- type WsGridOrder
- type WsGridPosition
- type WsGridSubOrder
- type WsHandler
- type WsIndexCandle
- type WsIndexCandleHandler
- type WsIndexTicker
- type WsInstrument
- type WsLiquidationOrder
- type WsLiquidationOrderDetail
- type WsLiquidationWarning
- type WsMarkPrice
- type WsOpenInterest
- type WsOrder
- type WsOrderBook
- type WsPosition
- type WsPriceLimit
- type WsSprdBooks
- type WsSprdCandle
- type WsSprdCandleHandler
- type WsSprdPublicTrade
- type WsSprdTicker
- type WsStatus
- type WsTicker
- type WsTrade
- type WsTradeConn
- func (tc *WsTradeConn) AmendOrder(ctx context.Context, arg AmendOrderArg) (*AmendResult, error)
- func (tc *WsTradeConn) BatchAmendOrders(ctx context.Context, args []AmendOrderArg) ([]AmendResult, error)
- func (tc *WsTradeConn) BatchCancelOrders(ctx context.Context, args []CancelOrderArg) ([]OrderResult, error)
- func (tc *WsTradeConn) BatchPlaceOrders(ctx context.Context, args []OrderArg) ([]OrderResult, error)
- func (tc *WsTradeConn) CancelOrder(ctx context.Context, arg CancelOrderArg) (*OrderResult, error)
- func (tc *WsTradeConn) Close() error
- func (tc *WsTradeConn) MassCancel(ctx context.Context, instType InstType, instFamily string) (*MassCancelResult, error)
- func (tc *WsTradeConn) PlaceOrder(ctx context.Context, arg OrderArg) (*OrderResult, error)
Constants ¶
const MaxBatchOrders = 20
MaxBatchOrders is the maximum number of orders OKX accepts in a single batch-orders / cancel-batch-orders / amend-batch-orders request (REST) and in the WS batch-* ops. Larger batches are rejected; callers should chunk by this.
const MaxClOrdIDLen = 32
MaxClOrdIDLen is the maximum length OKX accepts for a client order id (clOrdId). Longer ids are rejected with code 51000 ("Parameter clOrdId error"). OKX also requires the id to be alphanumeric (letters and digits only); see ValidateClOrdID.
Variables ¶
This section is empty.
Functions ¶
func ValidateClOrdID ¶ added in v0.20260623.1
ValidateClOrdID reports whether clOrdId satisfies OKX's client-order-id rule: at most MaxClOrdIDLen characters, letters and digits only (case-sensitive). It lets callers fail fast instead of round-tripping to a 51000 rejection. An empty clOrdId is allowed (the field is optional) and reported valid.
Types ¶
type AccountConfig ¶
type AccountConfig struct {
UID string `json:"uid"`
MainUID string `json:"mainUid"`
AccountLevel string `json:"acctLv"`
AccountSTPMode string `json:"acctStpMode"`
PositionMode string `json:"posMode"`
AutoLoan bool `json:"autoLoan"`
GreeksType string `json:"greeksType"`
Level string `json:"level"`
LevelTemporary string `json:"levelTmp"`
ContractIsolatedMode string `json:"ctIsoMode"`
MarginIsolatedMode string `json:"mgnIsoMode"`
SpotOffsetType string `json:"spotOffsetType"`
RoleType string `json:"roleType"`
TraderInstruments []string `json:"traderInsts"`
SpotTraderInstruments []string `json:"spotTraderInsts"`
OpAuth string `json:"opAuth"`
KYCLevel string `json:"kycLv"`
Label string `json:"label"`
IP string `json:"ip"`
Perm string `json:"perm"`
LiquidationGear string `json:"liquidationGear"`
EnableSpotBorrow bool `json:"enableSpotBorrow"`
SpotBorrowAutoRepay bool `json:"spotBorrowAutoRepay"`
Type string `json:"type"`
SpotRoleType string `json:"spotRoleType"`
StrategyType string `json:"stgyType"`
SettleCurrency string `json:"settleCcy"`
SettleCurrencyList []string `json:"settleCcyList"`
FeeType string `json:"feeType"`
}
AccountConfig is the account's configuration.
type AccountLevelSetting ¶
type AccountLevelSetting struct {
AccountLevel string `json:"acctLv"`
}
AccountLevelSetting is the set-account-level acknowledgement.
type AccountPositionRisk ¶
type AccountPositionRisk struct {
Timestamp time.Time `json:"ts"`
AdjustedEquity decimal.Decimal `json:"adjEq"`
BalanceData []AccountPositionRiskBalance `json:"balData"`
PositionData []AccountPositionRiskPos `json:"posData"`
}
AccountPositionRisk is the account/position risk snapshot.
type AccountPositionRiskBalance ¶
type AccountPositionRiskBalance struct {
Currency string `json:"ccy"`
Equity decimal.Decimal `json:"eq"`
DiscountEquity decimal.Decimal `json:"disEq"`
}
AccountPositionRiskBalance is one currency's equity within the risk snapshot.
type AccountPositionRiskPos ¶
type AccountPositionRiskPos struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
MarginMode MgnMode `json:"mgnMode"`
PositionID string `json:"posId"`
PositionSide PosSide `json:"posSide"`
Position decimal.Decimal `json:"pos"`
BaseBalance decimal.Decimal `json:"baseBal"`
QuoteBalance decimal.Decimal `json:"quoteBal"`
PositionCurrency string `json:"posCcy"`
Currency string `json:"ccy"`
NotionalCurrency decimal.Decimal `json:"notionalCcy"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
}
AccountPositionRiskPos is one position's risk data within the snapshot. The account used to validate this SDK had no open positions, so this field set is modeled from the OKX doc field table.
type AccountPositionTier ¶
type AccountPositionTier struct {
Underlying string `json:"uly"`
InstrumentFamily string `json:"instFamily"`
MaxSize decimal.Decimal `json:"maxSz"`
PositionType string `json:"posType"`
}
AccountPositionTier is the account's maximum position size for an underlying or instrument family.
type AccountRateLimit ¶
type AccountRateLimit struct {
AccountRateLimit decimal.Decimal `json:"accRateLimit"`
FillRatio decimal.Decimal `json:"fillRatio"`
MainFillRatio decimal.Decimal `json:"mainFillRatio"`
NextAccountRateLimit decimal.Decimal `json:"nextAccRateLimit"`
Timestamp time.Time `json:"ts"`
}
AccountRateLimit is the account's order rate-limit snapshot.
type ActivateOption ¶
ActivateOption is the activate-option acknowledgement. Some account states also return a "result" boolean.
type ActivateOptionService ¶
type ActivateOptionService struct {
// contains filtered or unexported fields
}
ActivateOptionService -- POST /api/v5/account/activate-option (Trade)
Activates option trading for the account. Returns the activation timestamp.
func (*ActivateOptionService) Do ¶
func (s *ActivateOptionService) Do(ctx context.Context) (*ActivateOption, error)
type AdjustFlexLoanCollateralService ¶
type AdjustFlexLoanCollateralService struct {
// contains filtered or unexported fields
}
AdjustFlexLoanCollateralService -- POST /api/v5/finance/flexible-loan/adjust-collateral (Trade)
Adds or reduces collateral on a flexible-loan position. State-changing: implemented but never executed by the test suite. The acknowledgement shape is modeled from the OKX doc field table.
func (*AdjustFlexLoanCollateralService) Do ¶
func (s *AdjustFlexLoanCollateralService) Do(ctx context.Context) (*FlexLoanAdjustCollateral, error)
type AdjustGridInvestmentService ¶
type AdjustGridInvestmentService struct {
// contains filtered or unexported fields
}
AdjustGridInvestmentService -- POST /api/v5/tradingBot/grid/adjust-investment (Trade)
Adds investment to a running spot grid. IMPLEMENT-ONLY.
func (*AdjustGridInvestmentService) Do ¶
func (s *AdjustGridInvestmentService) Do(ctx context.Context) (*GridAdjustInvestmentResult, error)
type AdjustGridMarginBalanceService ¶
type AdjustGridMarginBalanceService struct {
// contains filtered or unexported fields
}
AdjustGridMarginBalanceService -- POST /api/v5/tradingBot/grid/margin-balance (Trade)
Adds or reduces the margin of a running contract grid. IMPLEMENT-ONLY.
func (*AdjustGridMarginBalanceService) Do ¶
func (s *AdjustGridMarginBalanceService) Do(ctx context.Context) (*GridMarginBalanceResult, error)
func (*AdjustGridMarginBalanceService) SetAmt ¶
func (s *AdjustGridMarginBalanceService) SetAmt(amt decimal.Decimal) *AdjustGridMarginBalanceService
SetAmt sets the margin amount to add/reduce (mutually exclusive with percent).
func (*AdjustGridMarginBalanceService) SetPercent ¶
func (s *AdjustGridMarginBalanceService) SetPercent(percent decimal.Decimal) *AdjustGridMarginBalanceService
SetPercent sets the percentage of margin to add/reduce.
type AdjustLeverageInfo ¶
type AdjustLeverageInfo struct {
EstimatedAvailableQuoteTransfer decimal.Decimal `json:"estAvailQuoteTrans"`
EstimatedAvailableTransfer decimal.Decimal `json:"estAvailTrans"`
EstimatedLiquidationPrice decimal.Decimal `json:"estLiqPx"`
EstimatedMargin decimal.Decimal `json:"estMgn"`
EstimatedQuoteMargin decimal.Decimal `json:"estQuoteMgn"`
EstimatedMaxAmount decimal.Decimal `json:"estMaxAmt"`
EstimatedQuoteMaxAmount decimal.Decimal `json:"estQuoteMaxAmt"`
ExistOrder bool `json:"existOrd"`
MaxLeverage decimal.Decimal `json:"maxLever"`
MinLeverage decimal.Decimal `json:"minLever"`
}
AdjustLeverageInfo is the estimated impact of adjusting leverage.
type AdvChaseParam ¶ added in v0.20260723.0
type AdvChaseParam struct {
ChaseType string `json:"chaseType,omitempty"`
ChaseValue decimal.Decimal `json:"chaseVal,omitzero"`
MaxChaseType string `json:"maxChaseType,omitempty"`
MaxChaseValue decimal.Decimal `json:"maxChaseVal,omitzero"`
}
AdvChaseParam carries the chase execution parameters of a FUTURES/SWAP trigger order whose advanceOrdType is "chase": when the trigger fires the spawned order chases the order book. Mirrors the standalone chase order fields.
type AffiliateInviteeDetail ¶
type AffiliateInviteeDetail struct {
InviteeLevel string `json:"inviteeLv"`
JoinTime time.Time `json:"joinTime"`
InviteeRebateRate decimal.Decimal `json:"inviteeRebateRate"`
TotalCommission decimal.Decimal `json:"totalCommission"`
FirstTradeTime time.Time `json:"firstTradeTime"`
Level string `json:"level"`
DepositAmount decimal.Decimal `json:"depAmt"`
Volume decimal.Decimal `json:"vol"`
KYCTime time.Time `json:"kycTime"`
Region string `json:"region"`
AffiliateCode string `json:"affiliateCode"`
InvitedTradeVolumeThirtyDay decimal.Decimal `json:"invitedTradeVolThirtyD"`
}
AffiliateInviteeDetail is one invitee's affiliate-relationship detail. The validating account does not have the affiliate role (the endpoint returns code 51620), so the field set is modeled from the OKX affiliate doc field table.
type AlgoAttachOrd ¶
type AlgoAttachOrd struct {
AttachAlgoClientOrderID string `json:"attachAlgoClOrdId,omitempty"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx,omitzero"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType,omitempty"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx,omitzero"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx,omitzero"`
StopLossTriggerPriceType string `json:"slTriggerPxType,omitempty"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx,omitzero"`
Size decimal.Decimal `json:"sz,omitzero"`
AmendPriceOnTriggerType string `json:"amendPxOnTriggerType,omitempty"`
}
AlgoAttachOrd is a take-profit / stop-loss order attached to a trigger order.
type AlgoAttachOrdInfo ¶
type AlgoAttachOrdInfo struct {
AttachAlgoID string `json:"attachAlgoId"`
AttachAlgoClientOrderID string `json:"attachAlgoClOrdId"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
StopLossTriggerPriceType string `json:"slTriggerPxType"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx"`
Size decimal.Decimal `json:"sz"`
AmendPriceOnTriggerType string `json:"amendPxOnTriggerType"`
FailCode string `json:"failCode"`
FailReason string `json:"failReason"`
}
AlgoAttachOrdInfo is a take-profit / stop-loss order attached to a trigger order as returned by the read endpoints.
type AlgoCancelArg ¶
AlgoCancelArg identifies one algo order to cancel.
type AlgoLinkedOrd ¶
type AlgoLinkedOrd struct {
OrderID string `json:"ordId"`
}
AlgoLinkedOrd is the order linked to an algo order (OCO/conditional).
type AlgoOrdType ¶
type AlgoOrdType string
AlgoOrdType is the type of an algo (trigger / advanced) order.
const ( AlgoOrdTypeConditional AlgoOrdType = "conditional" AlgoOrdTypeOCO AlgoOrdType = "oco" AlgoOrdTypeTrigger AlgoOrdType = "trigger" AlgoOrdTypeMoveOrderStop AlgoOrdType = "move_order_stop" AlgoOrdTypeTwap AlgoOrdType = "twap" AlgoOrdTypeIceberg AlgoOrdType = "iceberg" AlgoOrdTypeChase AlgoOrdType = "chase" )
type AlgoOrder ¶
type AlgoOrder struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
OrderID string `json:"ordId"`
OrderIDList []string `json:"ordIdList"`
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
ClientOrderID string `json:"clOrdId"`
Size decimal.Decimal `json:"sz"`
CloseFraction decimal.Decimal `json:"closeFraction"`
OrderType AlgoOrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
TargetCurrency TgtCcy `json:"tgtCcy"`
State AlgoState `json:"state"`
Leverage decimal.Decimal `json:"lever"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx"`
TakeProfitOrderKind string `json:"tpOrdKind"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
StopLossTriggerPriceType string `json:"slTriggerPxType"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
TriggerPriceType string `json:"triggerPxType"`
OrderPrice decimal.Decimal `json:"ordPx"`
ActualSize decimal.Decimal `json:"actualSz"`
ActualPrice decimal.Decimal `json:"actualPx"`
ActualSide string `json:"actualSide"`
TriggerTime time.Time `json:"triggerTime"`
PriceVariation decimal.Decimal `json:"pxVar"`
PriceSpread decimal.Decimal `json:"pxSpread"`
SizeLimit decimal.Decimal `json:"szLimit"`
PriceLimit decimal.Decimal `json:"pxLimit"`
TimeInterval string `json:"timeInterval"`
CallbackRatio decimal.Decimal `json:"callbackRatio"`
CallbackSpread decimal.Decimal `json:"callbackSpread"`
ActivePrice decimal.Decimal `json:"activePx"`
MoveTriggerPrice decimal.Decimal `json:"moveTriggerPx"`
ChaseType string `json:"chaseType"`
ChaseValue decimal.Decimal `json:"chaseVal"`
MaxChaseType string `json:"maxChaseType"`
MaxChaseValue decimal.Decimal `json:"maxChaseVal"`
// SubAlgoIDList holds the algoId(s) of the chase order(s) spawned when a
// trigger order with advanceOrdType "chase" fires (FUTURES/SWAP).
SubAlgoIDList []string `json:"subAlgoIdList"`
ReduceOnly string `json:"reduceOnly"`
QuickMarginType string `json:"quickMgnType"`
Last decimal.Decimal `json:"last"`
FailCode string `json:"failCode"`
AlgoClientOrderIDParent string `json:"algoClOrdIdParent"`
AmendPriceOnTriggerType string `json:"amendPxOnTriggerType"`
LinkedOrder *AlgoLinkedOrd `json:"linkedOrd"`
AttachAlgoOrders []AlgoAttachOrdInfo `json:"attachAlgoOrds"`
Tag string `json:"tag"`
CancelOnClosePosition string `json:"cxlOnClosePos"`
IsTradeBorrowMode string `json:"isTradeBorrowMode"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
AlgoOrder is a single algo (trigger / advanced) order. The validating account had no algo orders, so the field set is modeled from the OKX doc field tables for order-algo / orders-algo-pending / orders-algo-history (a union covering all algo order types).
type AlgoResult ¶
type AlgoResult struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
RequestID string `json:"reqId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
AlgoResult is the per-item ack returned by the algo place / amend / cancel endpoints. On a top-level code of "1" the real reason is in sCode/sMsg.
func (AlgoResult) Err ¶ added in v0.20260623.1
func (r AlgoResult) Err() error
type AlgoState ¶
type AlgoState string
AlgoState is the lifecycle state of an algo order. "live"/"pause" appear on the pending endpoint; "effective"/"canceled"/"order_failed"/"partially_failed" appear on the history endpoint.
const ( AlgoStateLive AlgoState = "live" AlgoStatePause AlgoState = "pause" AlgoStatePartiallyEff AlgoState = "partially_effective" AlgoStateEffective AlgoState = "effective" AlgoStateCanceled AlgoState = "canceled" AlgoStateOrderFailed AlgoState = "order_failed" AlgoStatePartiallyFailed AlgoState = "partially_failed" )
type AmendAlgoOrderService ¶
type AmendAlgoOrderService struct {
// contains filtered or unexported fields
}
AmendAlgoOrderService -- POST /api/v5/trade/amend-algos (Trade)
Amends a single pending algo order. One of algoId / algoClOrdId is required.
func (*AmendAlgoOrderService) Do ¶
func (s *AmendAlgoOrderService) Do(ctx context.Context) (*AlgoResult, error)
func (*AmendAlgoOrderService) SetAlgoClOrdId ¶
func (s *AmendAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *AmendAlgoOrderService
SetAlgoClOrdId targets the algo order by client-supplied id.
func (*AmendAlgoOrderService) SetAlgoId ¶
func (s *AmendAlgoOrderService) SetAlgoId(algoId string) *AmendAlgoOrderService
SetAlgoId targets the algo order by id (one of algoId / algoClOrdId required).
func (*AmendAlgoOrderService) SetAttachAlgoOrds ¶
func (s *AmendAlgoOrderService) SetAttachAlgoOrds(ords []AlgoAttachOrd) *AmendAlgoOrderService
SetAttachAlgoOrds amends the attached TP/SL orders.
func (*AmendAlgoOrderService) SetCxlOnFail ¶
func (s *AmendAlgoOrderService) SetCxlOnFail(cxl bool) *AmendAlgoOrderService
SetCxlOnFail cancels the order if amendment fails.
func (*AmendAlgoOrderService) SetNewOrdPx ¶
func (s *AmendAlgoOrderService) SetNewOrdPx(px decimal.Decimal) *AmendAlgoOrderService
SetNewOrdPx sets the new order price ("-1" for market).
func (*AmendAlgoOrderService) SetNewSlOrdPx ¶
func (s *AmendAlgoOrderService) SetNewSlOrdPx(px decimal.Decimal) *AmendAlgoOrderService
SetNewSlOrdPx sets the new stop-loss order price ("-1" for market).
func (*AmendAlgoOrderService) SetNewSlTriggerPx ¶
func (s *AmendAlgoOrderService) SetNewSlTriggerPx(px decimal.Decimal) *AmendAlgoOrderService
SetNewSlTriggerPx sets the new stop-loss trigger price.
func (*AmendAlgoOrderService) SetNewSlTriggerPxType ¶
func (s *AmendAlgoOrderService) SetNewSlTriggerPxType(pxType string) *AmendAlgoOrderService
SetNewSlTriggerPxType sets the new stop-loss trigger price type.
func (*AmendAlgoOrderService) SetNewSz ¶
func (s *AmendAlgoOrderService) SetNewSz(sz decimal.Decimal) *AmendAlgoOrderService
SetNewSz sets the new size.
func (*AmendAlgoOrderService) SetNewTpOrdKind ¶
func (s *AmendAlgoOrderService) SetNewTpOrdKind(kind string) *AmendAlgoOrderService
SetNewTpOrdKind sets the new take-profit order kind (condition / limit).
func (*AmendAlgoOrderService) SetNewTpOrdPx ¶
func (s *AmendAlgoOrderService) SetNewTpOrdPx(px decimal.Decimal) *AmendAlgoOrderService
SetNewTpOrdPx sets the new take-profit order price ("-1" for market).
func (*AmendAlgoOrderService) SetNewTpTriggerPx ¶
func (s *AmendAlgoOrderService) SetNewTpTriggerPx(px decimal.Decimal) *AmendAlgoOrderService
SetNewTpTriggerPx sets the new take-profit trigger price.
func (*AmendAlgoOrderService) SetNewTpTriggerPxType ¶
func (s *AmendAlgoOrderService) SetNewTpTriggerPxType(pxType string) *AmendAlgoOrderService
SetNewTpTriggerPxType sets the new take-profit trigger price type.
func (*AmendAlgoOrderService) SetNewTriggerPx ¶
func (s *AmendAlgoOrderService) SetNewTriggerPx(px decimal.Decimal) *AmendAlgoOrderService
SetNewTriggerPx sets the new trigger price.
func (*AmendAlgoOrderService) SetNewTriggerPxType ¶
func (s *AmendAlgoOrderService) SetNewTriggerPxType(pxType string) *AmendAlgoOrderService
SetNewTriggerPxType sets the new trigger price type.
func (*AmendAlgoOrderService) SetReqId ¶
func (s *AmendAlgoOrderService) SetReqId(reqId string) *AmendAlgoOrderService
SetReqId sets a client-supplied request id for the amendment.
type AmendBatchOrdersService ¶
type AmendBatchOrdersService struct {
// contains filtered or unexported fields
}
AmendBatchOrdersService -- POST /api/v5/trade/amend-batch-orders (Trade)
Amends up to 20 pending orders in a single request (array body).
func (*AmendBatchOrdersService) Do ¶
func (s *AmendBatchOrdersService) Do(ctx context.Context) ([]AmendResult, error)
type AmendCopyCopySettingsService ¶
type AmendCopyCopySettingsService struct {
// contains filtered or unexported fields
}
AmendCopyCopySettingsService -- POST /api/v5/copytrading/amend-copy-settings (Trade)
Updates the copy configuration for a lead trader already being copied.
func (*AmendCopyCopySettingsService) Do ¶
func (s *AmendCopyCopySettingsService) Do(ctx context.Context) (*CopyResult, error)
func (*AmendCopyCopySettingsService) SetCopyAmt ¶
func (s *AmendCopyCopySettingsService) SetCopyAmt(copyAmt decimal.Decimal) *AmendCopyCopySettingsService
SetCopyAmt sets the fixed copy amount per order (copyMode=fixed_amount).
func (*AmendCopyCopySettingsService) SetCopyRatio ¶
func (s *AmendCopyCopySettingsService) SetCopyRatio(copyRatio decimal.Decimal) *AmendCopyCopySettingsService
SetCopyRatio sets the copy ratio (copyMode=ratio_copy).
func (*AmendCopyCopySettingsService) SetCopyTotalAmt ¶
func (s *AmendCopyCopySettingsService) SetCopyTotalAmt(copyTotalAmt decimal.Decimal) *AmendCopyCopySettingsService
SetCopyTotalAmt sets the total amount budgeted for copying.
func (*AmendCopyCopySettingsService) SetInstId ¶
func (s *AmendCopyCopySettingsService) SetInstId(instId string) *AmendCopyCopySettingsService
SetInstId sets the comma-separated instruments to copy (copyInstIdType=custom).
func (*AmendCopyCopySettingsService) SetInstType ¶
func (s *AmendCopyCopySettingsService) SetInstType(instType InstType) *AmendCopyCopySettingsService
SetInstType sets the product line (SWAP).
func (*AmendCopyCopySettingsService) SetSlRatio ¶
func (s *AmendCopyCopySettingsService) SetSlRatio(slRatio decimal.Decimal) *AmendCopyCopySettingsService
SetSlRatio sets the stop-loss ratio.
func (*AmendCopyCopySettingsService) SetSlTotalAmt ¶
func (s *AmendCopyCopySettingsService) SetSlTotalAmt(slTotalAmt decimal.Decimal) *AmendCopyCopySettingsService
SetSlTotalAmt sets the total stop-loss amount.
func (*AmendCopyCopySettingsService) SetTpRatio ¶
func (s *AmendCopyCopySettingsService) SetTpRatio(tpRatio decimal.Decimal) *AmendCopyCopySettingsService
SetTpRatio sets the take-profit ratio.
type AmendCopyLeadingInstrumentsService ¶
type AmendCopyLeadingInstrumentsService struct {
// contains filtered or unexported fields
}
AmendCopyLeadingInstrumentsService -- POST /api/v5/copytrading/amend-leading-instruments (Trade)
Updates the set of instruments the current lead trader leads on.
func (*AmendCopyLeadingInstrumentsService) Do ¶
func (s *AmendCopyLeadingInstrumentsService) Do(ctx context.Context) ([]CopyInstrument, error)
func (*AmendCopyLeadingInstrumentsService) SetInstType ¶
func (s *AmendCopyLeadingInstrumentsService) SetInstType(instType InstType) *AmendCopyLeadingInstrumentsService
SetInstType sets the product line (SWAP).
type AmendCopyProfitSharingRatioService ¶
type AmendCopyProfitSharingRatioService struct {
// contains filtered or unexported fields
}
AmendCopyProfitSharingRatioService -- POST /api/v5/copytrading/amend-profit-sharing-ratio (Trade)
Updates the lead trader's profit-sharing ratio.
func (*AmendCopyProfitSharingRatioService) Do ¶
func (s *AmendCopyProfitSharingRatioService) Do(ctx context.Context) (*CopyResult, error)
func (*AmendCopyProfitSharingRatioService) SetInstType ¶
func (s *AmendCopyProfitSharingRatioService) SetInstType(instType InstType) *AmendCopyProfitSharingRatioService
SetInstType sets the product line (SWAP).
type AmendFixedLoanLendingOrderService ¶
type AmendFixedLoanLendingOrderService struct {
// contains filtered or unexported fields
}
AmendFixedLoanLendingOrderService -- POST /api/v5/finance/fixed-loan/amend-lending-order (Trade)
Amends an existing fixed-loan lending order. State-changing: implemented but never executed by the test suite. The acknowledgement shape is modeled from the OKX doc field table.
func (*AmendFixedLoanLendingOrderService) Do ¶
func (s *AmendFixedLoanLendingOrderService) Do(ctx context.Context) (*FixedLoanAmendLendingOrderAck, error)
func (*AmendFixedLoanLendingOrderService) SetAutoRenewal ¶
func (s *AmendFixedLoanLendingOrderService) SetAutoRenewal(autoRenewal bool) *AmendFixedLoanLendingOrderService
SetAutoRenewal toggles auto-renewal of the order.
func (*AmendFixedLoanLendingOrderService) SetChangeAmt ¶
func (s *AmendFixedLoanLendingOrderService) SetChangeAmt(changeAmt decimal.Decimal) *AmendFixedLoanLendingOrderService
SetChangeAmt sets the amount to add to (or reduce from) the order.
func (*AmendFixedLoanLendingOrderService) SetRate ¶
func (s *AmendFixedLoanLendingOrderService) SetRate(rate decimal.Decimal) *AmendFixedLoanLendingOrderService
SetRate sets a new lending rate for the order.
type AmendGridAlgoOrderService ¶
type AmendGridAlgoOrderService struct {
// contains filtered or unexported fields
}
AmendGridAlgoOrderService -- POST /api/v5/tradingBot/grid/amend-order-algo (Trade)
Amends the take-profit / stop-loss settings of a running grid algo order. IMPLEMENT-ONLY.
func (*AmendGridAlgoOrderService) Do ¶
func (s *AmendGridAlgoOrderService) Do(ctx context.Context) (*GridResult, error)
func (*AmendGridAlgoOrderService) SetSlRatio ¶
func (s *AmendGridAlgoOrderService) SetSlRatio(ratio decimal.Decimal) *AmendGridAlgoOrderService
SetSlRatio sets the stop-loss ratio (contract grid).
func (*AmendGridAlgoOrderService) SetSlTriggerPx ¶
func (s *AmendGridAlgoOrderService) SetSlTriggerPx(px decimal.Decimal) *AmendGridAlgoOrderService
SetSlTriggerPx sets the stop-loss trigger price.
func (*AmendGridAlgoOrderService) SetTpRatio ¶
func (s *AmendGridAlgoOrderService) SetTpRatio(ratio decimal.Decimal) *AmendGridAlgoOrderService
SetTpRatio sets the take-profit ratio (contract grid).
func (*AmendGridAlgoOrderService) SetTpTriggerPx ¶
func (s *AmendGridAlgoOrderService) SetTpTriggerPx(px decimal.Decimal) *AmendGridAlgoOrderService
SetTpTriggerPx sets the take-profit trigger price.
func (*AmendGridAlgoOrderService) SetTriggerParams ¶
func (s *AmendGridAlgoOrderService) SetTriggerParams(params []GridTriggerParam) *AmendGridAlgoOrderService
SetTriggerParams sets the trigger-parameter list (advanced trigger config).
type AmendOrderArg ¶
type AmendOrderArg struct {
InstrumentID string `json:"instId"`
OrderID string `json:"ordId,omitempty"`
ClientOrderID string `json:"clOrdId,omitempty"`
CancelOnFail bool `json:"cxlOnFail,omitempty"`
RequestID string `json:"reqId,omitempty"`
NewSize decimal.Decimal `json:"newSz,omitzero"`
NewPrice decimal.Decimal `json:"newPx,omitzero"`
NewPriceUSD decimal.Decimal `json:"newPxUsd,omitzero"`
NewPriceVolatility decimal.Decimal `json:"newPxVol,omitzero"`
NewTakeProfitTriggerPrice decimal.Decimal `json:"newTpTriggerPx,omitzero"`
NewTakeProfitOrderPrice decimal.Decimal `json:"newTpOrdPx,omitzero"`
NewStopLossTriggerPrice decimal.Decimal `json:"newSlTriggerPx,omitzero"`
NewStopLossOrderPrice decimal.Decimal `json:"newSlOrdPx,omitzero"`
NewTakeProfitTriggerPriceType string `json:"newTpTriggerPxType,omitempty"`
NewStopLossTriggerPriceType string `json:"newSlTriggerPxType,omitempty"`
AttachAlgoOrders []AttachAlgoOrd `json:"attachAlgoOrds,omitempty"`
}
AmendOrderArg is one leg of an amend-batch-orders request body.
type AmendOrderService ¶
type AmendOrderService struct {
// contains filtered or unexported fields
}
AmendOrderService -- POST /api/v5/trade/amend-order (Trade)
Amends a single pending order's size and/or price by ordId or clOrdId.
func (*AmendOrderService) Do ¶
func (s *AmendOrderService) Do(ctx context.Context) (*AmendResult, error)
func (*AmendOrderService) SetAttachAlgoOrds ¶
func (s *AmendOrderService) SetAttachAlgoOrds(orders []AttachAlgoOrd) *AmendOrderService
SetAttachAlgoOrds amends the attached take-profit / stop-loss algo orders.
func (*AmendOrderService) SetClOrdId ¶
func (s *AmendOrderService) SetClOrdId(clOrdId string) *AmendOrderService
SetClOrdId sets the client-supplied order id (either ordId or clOrdId is required).
func (*AmendOrderService) SetCxlOnFail ¶
func (s *AmendOrderService) SetCxlOnFail(cxlOnFail bool) *AmendOrderService
SetCxlOnFail cancels the order if the amendment fails.
func (*AmendOrderService) SetNewPx ¶
func (s *AmendOrderService) SetNewPx(newPx decimal.Decimal) *AmendOrderService
SetNewPx sets the new order price.
func (*AmendOrderService) SetNewPxUsd ¶
func (s *AmendOrderService) SetNewPxUsd(newPxUsd decimal.Decimal) *AmendOrderService
SetNewPxUsd sets the new options price in USD (OPTION only).
func (*AmendOrderService) SetNewPxVol ¶
func (s *AmendOrderService) SetNewPxVol(newPxVol decimal.Decimal) *AmendOrderService
SetNewPxVol sets the new implied volatility (OPTION only).
func (*AmendOrderService) SetNewSlOrdPx ¶
func (s *AmendOrderService) SetNewSlOrdPx(px decimal.Decimal) *AmendOrderService
SetNewSlOrdPx sets the new stop-loss order price.
func (*AmendOrderService) SetNewSlTriggerPx ¶
func (s *AmendOrderService) SetNewSlTriggerPx(px decimal.Decimal) *AmendOrderService
SetNewSlTriggerPx sets the new stop-loss trigger price.
func (*AmendOrderService) SetNewSlTriggerPxType ¶
func (s *AmendOrderService) SetNewSlTriggerPxType(pxType string) *AmendOrderService
SetNewSlTriggerPxType sets the new stop-loss trigger price type.
func (*AmendOrderService) SetNewSz ¶
func (s *AmendOrderService) SetNewSz(newSz decimal.Decimal) *AmendOrderService
SetNewSz sets the new order size.
func (*AmendOrderService) SetNewTpOrdPx ¶
func (s *AmendOrderService) SetNewTpOrdPx(px decimal.Decimal) *AmendOrderService
SetNewTpOrdPx sets the new take-profit order price.
func (*AmendOrderService) SetNewTpTriggerPx ¶
func (s *AmendOrderService) SetNewTpTriggerPx(px decimal.Decimal) *AmendOrderService
SetNewTpTriggerPx sets the new take-profit trigger price.
func (*AmendOrderService) SetNewTpTriggerPxType ¶
func (s *AmendOrderService) SetNewTpTriggerPxType(pxType string) *AmendOrderService
SetNewTpTriggerPxType sets the new take-profit trigger price type.
func (*AmendOrderService) SetOrdId ¶
func (s *AmendOrderService) SetOrdId(ordId string) *AmendOrderService
SetOrdId sets the order id (either ordId or clOrdId is required).
func (*AmendOrderService) SetReqId ¶
func (s *AmendOrderService) SetReqId(reqId string) *AmendOrderService
SetReqId sets the client-supplied request id for the amendment.
type AmendRecurringOrderService ¶
type AmendRecurringOrderService struct {
// contains filtered or unexported fields
}
AmendRecurringOrderService -- POST /api/v5/tradingBot/recurring/amend-order-algo (Trade)
Amends the display name of a running recurring-buy strategy. Implement-only; not exercised against the live account.
func (*AmendRecurringOrderService) Do ¶
func (s *AmendRecurringOrderService) Do(ctx context.Context) (*RecurringResult, error)
func (*AmendRecurringOrderService) SetStgyName ¶
func (s *AmendRecurringOrderService) SetStgyName(stgyName string) *AmendRecurringOrderService
SetStgyName sets the new display name for the strategy.
type AmendResult ¶
type AmendResult struct {
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Timestamp time.Time `json:"ts"`
RequestID string `json:"reqId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
AmendResult is the ack returned by the amend / batch-amend order endpoints.
func (AmendResult) Err ¶ added in v0.20260623.1
func (r AmendResult) Err() error
type AmendSprdOrderService ¶
type AmendSprdOrderService struct {
// contains filtered or unexported fields
}
AmendSprdOrderService -- POST /api/v5/sprd/amend-order (Trade)
Amends an existing spread order's price and/or size. Either ordId or clOrdId is required, plus at least one of newSz / newPx.
func (*AmendSprdOrderService) Do ¶
func (s *AmendSprdOrderService) Do(ctx context.Context) (*SprdAmendAck, error)
func (*AmendSprdOrderService) SetClOrdId ¶
func (s *AmendSprdOrderService) SetClOrdId(clOrdId string) *AmendSprdOrderService
SetClOrdId identifies the order to amend by its client-supplied id.
func (*AmendSprdOrderService) SetNewPx ¶
func (s *AmendSprdOrderService) SetNewPx(newPx string) *AmendSprdOrderService
SetNewPx sets the new order price.
func (*AmendSprdOrderService) SetNewSz ¶
func (s *AmendSprdOrderService) SetNewSz(newSz string) *AmendSprdOrderService
SetNewSz sets the new order size.
func (*AmendSprdOrderService) SetOrdId ¶
func (s *AmendSprdOrderService) SetOrdId(ordId string) *AmendSprdOrderService
SetOrdId identifies the order to amend by its OKX order id.
func (*AmendSprdOrderService) SetReqId ¶
func (s *AmendSprdOrderService) SetReqId(reqId string) *AmendSprdOrderService
SetReqId sets a client request id echoed back in the response.
type AnnouncementItem ¶
type AnnouncementItem struct {
AnnouncementType string `json:"annType"`
Title string `json:"title"`
URL string `json:"url"`
PushTime time.Time `json:"pTime"`
BusinessPTime time.Time `json:"businessPTime"`
}
AnnouncementItem is a single announcement entry.
type AnnouncementType ¶
type AnnouncementType struct {
AnnouncementType string `json:"annType"`
AnnouncementTypeDescription string `json:"annTypeDesc"`
}
AnnouncementType is a selectable announcement category.
type Announcements ¶
type Announcements struct {
TotalPage string `json:"totalPage"`
Details []AnnouncementItem `json:"details"`
}
Announcements is one page of OKX support announcements.
type ApplyBillsHistoryArchiveService ¶
type ApplyBillsHistoryArchiveService struct {
// contains filtered or unexported fields
}
ApplyBillsHistoryArchiveService -- POST /api/v5/account/bills-history-archive (Trade)
Applies for a downloadable archive of one quarter's bill records. After the request is processed the download link is fetched via GetBillsHistoryArchiveService.
func (*ApplyBillsHistoryArchiveService) Do ¶
func (s *ApplyBillsHistoryArchiveService) Do(ctx context.Context) (*BillsHistoryArchive, error)
type ApplyCopyLeadTradingService ¶
type ApplyCopyLeadTradingService struct {
// contains filtered or unexported fields
}
ApplyCopyLeadTradingService -- POST /api/v5/copytrading/apply-lead-trading (Trade)
Applies to become a lead trader on the given instruments.
func (*ApplyCopyLeadTradingService) Do ¶
func (s *ApplyCopyLeadTradingService) Do(ctx context.Context) ([]CopyInstrument, error)
func (*ApplyCopyLeadTradingService) SetInstType ¶
func (s *ApplyCopyLeadTradingService) SetInstType(instType InstType) *ApplyCopyLeadTradingService
SetInstType sets the product line (SWAP).
type ApplyMonthlyStatementService ¶
type ApplyMonthlyStatementService struct {
// contains filtered or unexported fields
}
ApplyMonthlyStatementService -- POST /api/v5/asset/monthly-statement (private)
Applies for a downloadable monthly transaction statement. IMPLEMENT-ONLY: this creates an export job on a real account and is not executed by the test suite.
func (*ApplyMonthlyStatementService) Do ¶
func (s *ApplyMonthlyStatementService) Do(ctx context.Context) (*MonthlyStatementApply, error)
func (*ApplyMonthlyStatementService) SetMonth ¶
func (s *ApplyMonthlyStatementService) SetMonth(month string) *ApplyMonthlyStatementService
SetMonth sets the statement month (e.g. "Jan"); defaults to the previous month.
type AssetAcctType ¶
type AssetAcctType string
AssetAcctType is a funding/transfer account-type code used by the asset (funding) endpoints. 6 is the funding account, 18 the unified trading account.
const ( AssetAcctTypeFunding AssetAcctType = "6" AssetAcctTypeTrading AssetAcctType = "18" )
type AssetBill ¶
type AssetBill struct {
BillID string `json:"billId"`
Currency string `json:"ccy"`
ClientID string `json:"clientId"`
BalanceChange decimal.Decimal `json:"balChg"`
Balance decimal.Decimal `json:"bal"`
Type string `json:"type"`
Notes string `json:"notes"`
Timestamp time.Time `json:"ts"`
}
AssetBill is one funding-account balance-change record.
type AssetTransferType ¶
type AssetTransferType string
AssetTransferType selects the kind of transfer for /asset/transfer and /asset/transfer-state: "0" within own account (default), "1" master->sub, "2" sub->master (via master key), "3" sub->master (via sub key), "4" sub->sub.
const ( AssetTransferTypeWithinAccount AssetTransferType = "0" AssetTransferTypeMasterToSub AssetTransferType = "1" AssetTransferTypeSubToMaster AssetTransferType = "2" AssetTransferTypeSubToMasterBySubKey AssetTransferType = "3" AssetTransferTypeSubToSub AssetTransferType = "4" )
type AssetValuation ¶
type AssetValuation struct {
TotalBalance decimal.Decimal `json:"totalBal"`
Timestamp time.Time `json:"ts"`
Details AssetValuationDetails `json:"details"`
}
AssetValuation is the account-wide asset valuation and its per-account-type breakdown.
type AssetValuationDetails ¶
type AssetValuationDetails struct {
Funding decimal.Decimal `json:"funding"`
Trading decimal.Decimal `json:"trading"`
Classic decimal.Decimal `json:"classic"`
Earn decimal.Decimal `json:"earn"`
}
AssetValuationDetails breaks the valuation down by account type.
type AttachAlgoOrd ¶
type AttachAlgoOrd struct {
AttachAlgoID string `json:"attachAlgoId,omitempty"`
AttachAlgoClientOrderID string `json:"attachAlgoClOrdId,omitempty"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx,omitzero"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType,omitempty"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx,omitzero"`
TakeProfitOrderKind string `json:"tpOrdKind,omitempty"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx,omitzero"`
StopLossTriggerPriceType string `json:"slTriggerPxType,omitempty"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx,omitzero"`
Size decimal.Decimal `json:"sz,omitzero"`
AmendPriceOnTriggerType string `json:"amendPxOnTriggerType,omitempty"`
}
AttachAlgoOrd is an attached take-profit / stop-loss algo order that can be supplied when placing or amending an order. It is used both in the request body (attachAlgoOrds) and as a sub-object of Order in responses.
type AutoLoanSetting ¶
type AutoLoanSetting struct {
AutoLoan bool `json:"autoLoan"`
}
AutoLoanSetting is the set-auto-loan acknowledgement.
type AutoRepay ¶
type AutoRepay struct {
AutoRepay bool `json:"autoRepay"`
}
AutoRepay is the ack of a set-auto-repay action.
type Balance ¶
type Balance struct {
UpdateTime time.Time `json:"uTime"`
TotalEquity decimal.Decimal `json:"totalEq"`
IsolatedEquity decimal.Decimal `json:"isoEq"`
AdjustedEquity decimal.Decimal `json:"adjEq"`
AvailableEquity decimal.Decimal `json:"availEq"`
OrderFrozen decimal.Decimal `json:"ordFroz"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
BorrowFrozen decimal.Decimal `json:"borrowFroz"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
NotionalUSDForBorrow decimal.Decimal `json:"notionalUsdForBorrow"`
NotionalUSDForSwap decimal.Decimal `json:"notionalUsdForSwap"`
NotionalUSDForFutures decimal.Decimal `json:"notionalUsdForFutures"`
NotionalUSDForOption decimal.Decimal `json:"notionalUsdForOption"`
UPL decimal.Decimal `json:"upl"`
Delta decimal.Decimal `json:"delta"`
DeltaLeverage decimal.Decimal `json:"deltaLever"`
DeltaNeutralStatus string `json:"deltaNeutralStatus"`
Details []BalanceDetail `json:"details"`
}
Balance is the account-level balance summary plus per-currency details.
type BalanceDetail ¶
type BalanceDetail struct {
Currency string `json:"ccy"`
Equity decimal.Decimal `json:"eq"`
CashBalance decimal.Decimal `json:"cashBal"`
UpdateTime time.Time `json:"uTime"`
IsolatedEquity decimal.Decimal `json:"isoEq"`
AvailableEquity decimal.Decimal `json:"availEq"`
DiscountEquity decimal.Decimal `json:"disEq"`
FixedBalance decimal.Decimal `json:"fixedBal"`
AvailableBalance decimal.Decimal `json:"availBal"`
FrozenBalance decimal.Decimal `json:"frozenBal"`
OrderFrozen decimal.Decimal `json:"ordFrozen"`
Liability decimal.Decimal `json:"liab"`
UPL decimal.Decimal `json:"upl"`
UPLLiability decimal.Decimal `json:"uplLiab"`
CrossLiability decimal.Decimal `json:"crossLiab"`
IsolatedLiability decimal.Decimal `json:"isoLiab"`
RewardBalance decimal.Decimal `json:"rewardBal"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
Interest decimal.Decimal `json:"interest"`
TWAP decimal.Decimal `json:"twap"`
MaxLoan decimal.Decimal `json:"maxLoan"`
EquityUSD decimal.Decimal `json:"eqUsd"`
BorrowFrozen decimal.Decimal `json:"borrowFroz"`
NotionalLeverage decimal.Decimal `json:"notionalLever"`
StrategyEquity decimal.Decimal `json:"stgyEq"`
IsolatedUPL decimal.Decimal `json:"isoUpl"`
SpotInUseAmount decimal.Decimal `json:"spotInUseAmt"`
ClientSpotInUseAmount decimal.Decimal `json:"clSpotInUseAmt"`
MaxSpotInUse decimal.Decimal `json:"maxSpotInUse"`
SpotIsolatedBalance decimal.Decimal `json:"spotIsoBal"`
SmtSyncEquity decimal.Decimal `json:"smtSyncEq"`
SpotCopyTradingEquity decimal.Decimal `json:"spotCopyTradingEq"`
SpotBalance decimal.Decimal `json:"spotBal"`
OpenAveragePrice decimal.Decimal `json:"openAvgPx"`
AccumulatedAveragePrice decimal.Decimal `json:"accAvgPx"`
SpotUPL decimal.Decimal `json:"spotUpl"`
SpotUPLRatio decimal.Decimal `json:"spotUplRatio"`
TotalPnl decimal.Decimal `json:"totalPnl"`
TotalPnlRatio decimal.Decimal `json:"totalPnlRatio"`
CollateralEnabled bool `json:"collateralEnabled"`
CollateralRestrict bool `json:"collateralRestrict"`
CollateralBorrowAutoConversion decimal.Decimal `json:"colBorrAutoConversion"`
ColRes string `json:"colRes"`
AutoLendStatus string `json:"autoLendStatus"`
AutoLendAmount decimal.Decimal `json:"autoLendAmt"`
AutoLendMatchedAmount decimal.Decimal `json:"autoLendMtAmt"`
AutoStakingStatus string `json:"autoStakingStatus"`
FrpType string `json:"frpType"`
}
BalanceDetail is a single currency's balance within the trading account.
type BatchOrdersService ¶
type BatchOrdersService struct {
// contains filtered or unexported fields
}
BatchOrdersService -- POST /api/v5/trade/batch-orders (Trade)
Places up to 20 orders in a single request (array body). Each result carries its own sCode/sMsg.
func (*BatchOrdersService) Do ¶
func (s *BatchOrdersService) Do(ctx context.Context) ([]OrderResult, error)
type Bill ¶
type Bill struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
BillID string `json:"billId"`
Type string `json:"type"`
SubType string `json:"subType"`
Timestamp time.Time `json:"ts"`
BalanceChange decimal.Decimal `json:"balChg"`
PositionBalanceChange decimal.Decimal `json:"posBalChg"`
Balance decimal.Decimal `json:"bal"`
PositionBalance decimal.Decimal `json:"posBal"`
Size decimal.Decimal `json:"sz"`
Price decimal.Decimal `json:"px"`
Pnl decimal.Decimal `json:"pnl"`
Fee decimal.Decimal `json:"fee"`
Currency string `json:"ccy"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
TradeID string `json:"tradeId"`
ExecutionType ExecType `json:"execType"`
MarginMode MgnMode `json:"mgnMode"`
ContractType CtType `json:"ctType"`
From string `json:"from"`
To string `json:"to"`
Notes string `json:"notes"`
Interest decimal.Decimal `json:"interest"`
Tag string `json:"tag"`
EarnAmount decimal.Decimal `json:"earnAmt"`
EarnAPR decimal.Decimal `json:"earnApr"`
FillTime time.Time `json:"fillTime"`
FillForwardPrice decimal.Decimal `json:"fillFwdPx"`
FillIndexPrice decimal.Decimal `json:"fillIdxPx"`
FillMarkPrice decimal.Decimal `json:"fillMarkPx"`
FillMarkVolatility decimal.Decimal `json:"fillMarkVol"`
FillPriceVolatility decimal.Decimal `json:"fillPxVol"`
FillPriceUSD decimal.Decimal `json:"fillPxUsd"`
}
Bill is a single account balance-change record, shared by /account/bills and /account/bills-archive.
type BillsHistoryArchive ¶
type BillsHistoryArchive struct {
Timestamp time.Time `json:"ts"`
FileHref string `json:"fileHref"`
State string `json:"state"`
}
BillsHistoryArchive is the state and download link of a quarterly bills archive request.
type BillsHistoryArchiveQuarter ¶
type BillsHistoryArchiveQuarter string
BillsHistoryArchiveQuarter selects the quarter of a yearly bills-history archive request.
const ( BillsHistoryArchiveQuarterQ1 BillsHistoryArchiveQuarter = "Q1" BillsHistoryArchiveQuarterQ2 BillsHistoryArchiveQuarter = "Q2" BillsHistoryArchiveQuarterQ3 BillsHistoryArchiveQuarter = "Q3" BillsHistoryArchiveQuarterQ4 BillsHistoryArchiveQuarter = "Q4" )
type BlockTicker ¶
type BlockTicker struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
VolumeCurrency24h decimal.Decimal `json:"volCcy24h"`
Volume24h decimal.Decimal `json:"vol24h"`
Timestamp time.Time `json:"ts"`
}
BlockTicker is the 24h block-trade volume snapshot for an instrument.
type BorrowRepay ¶
type BorrowRepay struct {
Currency string `json:"ccy"`
Side BorrowRepayType `json:"side"`
Amount decimal.Decimal `json:"amt"`
OrderID string `json:"ordId"`
State VipLoanState `json:"state"`
}
BorrowRepay is the ack of a VIP-loan borrow/repay action.
type BorrowRepayHistory ¶
type BorrowRepayHistory struct {
Currency string `json:"ccy"`
Type BorrowRepayType `json:"type"`
Amount decimal.Decimal `json:"amt"`
AccumulatedBorrowed decimal.Decimal `json:"accBorrowed"`
Timestamp time.Time `json:"ts"`
}
BorrowRepayHistory is one VIP-loan borrow/repay event.
type BorrowRepayType ¶
type BorrowRepayType string
BorrowRepayType selects whether a borrow/repay record (or action) is a borrow or a repayment.
const ( BorrowRepayTypeBorrow BorrowRepayType = "borrow" BorrowRepayTypeRepay BorrowRepayType = "repay" )
type CancelAdvanceAlgoOrdersService ¶
type CancelAdvanceAlgoOrdersService struct {
// contains filtered or unexported fields
}
CancelAdvanceAlgoOrdersService -- POST /api/v5/trade/cancel-advance-algos (Trade)
Cancels up to 10 pending advanced algo orders (iceberg / twap / move_order_stop) in one request. The body is a JSON ARRAY of {algoId, instId} items.
func (*CancelAdvanceAlgoOrdersService) Do ¶
func (s *CancelAdvanceAlgoOrdersService) Do(ctx context.Context) ([]AlgoResult, error)
type CancelAlgoOrdersService ¶
type CancelAlgoOrdersService struct {
// contains filtered or unexported fields
}
CancelAlgoOrdersService -- POST /api/v5/trade/cancel-algos (Trade)
Cancels up to 10 pending algo orders in one request. The body is a JSON ARRAY of {algoId, instId} items.
func (*CancelAlgoOrdersService) Do ¶
func (s *CancelAlgoOrdersService) Do(ctx context.Context) ([]AlgoResult, error)
type CancelAllAfterResult ¶
type CancelAllAfterResult struct {
TriggerTime time.Time `json:"triggerTime"`
Tag string `json:"tag"`
Timestamp time.Time `json:"ts"`
}
CancelAllAfterResult is the ack returned by the cancel-all-after endpoint.
type CancelAllAfterRfqService ¶
type CancelAllAfterRfqService struct {
// contains filtered or unexported fields
}
CancelAllAfterRfqService -- POST /api/v5/rfq/cancel-all-after (Trade)
Arms a dead-man's-switch: cancels all quotes after the given number of seconds unless re-armed (0 disarms).
func (*CancelAllAfterRfqService) Do ¶
func (s *CancelAllAfterRfqService) Do(ctx context.Context) (*RfqCancelAllAfter, error)
type CancelAllAfterService ¶
type CancelAllAfterService struct {
// contains filtered or unexported fields
}
CancelAllAfterService -- POST /api/v5/trade/cancel-all-after (Trade)
Arms (or disarms with timeOut 0) a dead-man's-switch that cancels all pending orders after the given number of seconds if not refreshed.
func (*CancelAllAfterService) Do ¶
func (s *CancelAllAfterService) Do(ctx context.Context) (*CancelAllAfterResult, error)
func (*CancelAllAfterService) SetTag ¶
func (s *CancelAllAfterService) SetTag(tag string) *CancelAllAfterService
SetTag sets the order tag scope for the timer.
type CancelAllRfqQuotesService ¶
type CancelAllRfqQuotesService struct {
// contains filtered or unexported fields
}
CancelAllRfqQuotesService -- POST /api/v5/rfq/cancel-all-quotes (Trade)
Cancels all of the account's active quotes.
func (*CancelAllRfqQuotesService) Do ¶
func (s *CancelAllRfqQuotesService) Do(ctx context.Context) (*RfqTimestampAck, error)
type CancelAllRfqsService ¶
type CancelAllRfqsService struct {
// contains filtered or unexported fields
}
CancelAllRfqsService -- POST /api/v5/rfq/cancel-all-rfqs (Trade)
Cancels all of the account's active RFQs.
func (*CancelAllRfqsService) Do ¶
func (s *CancelAllRfqsService) Do(ctx context.Context) (*RfqTimestampAck, error)
type CancelAllSprdOrdersService ¶
type CancelAllSprdOrdersService struct {
// contains filtered or unexported fields
}
CancelAllSprdOrdersService -- POST /api/v5/sprd/cancel-all-orders (Trade)
Cancels all pending spread orders, optionally scoped to one spread.
func (*CancelAllSprdOrdersService) Do ¶
func (s *CancelAllSprdOrdersService) Do(ctx context.Context) (*SprdCancelAllAck, error)
func (*CancelAllSprdOrdersService) SetSprdId ¶
func (s *CancelAllSprdOrdersService) SetSprdId(sprdId string) *CancelAllSprdOrdersService
SetSprdId scopes the cancellation to a single spread.
type CancelBatchOrdersService ¶
type CancelBatchOrdersService struct {
// contains filtered or unexported fields
}
CancelBatchOrdersService -- POST /api/v5/trade/cancel-batch-orders (Trade)
Cancels up to 20 pending orders in a single request (array body).
func (*CancelBatchOrdersService) Do ¶
func (s *CancelBatchOrdersService) Do(ctx context.Context) ([]OrderResult, error)
type CancelBatchRfqQuotesService ¶
type CancelBatchRfqQuotesService struct {
// contains filtered or unexported fields
}
CancelBatchRfqQuotesService -- POST /api/v5/rfq/cancel-batch-quotes (Trade)
Cancels multiple active quotes in one request.
func (*CancelBatchRfqQuotesService) Do ¶
func (s *CancelBatchRfqQuotesService) Do(ctx context.Context) ([]RfqQuoteCancelAck, error)
func (*CancelBatchRfqQuotesService) SetClQuoteIds ¶
func (s *CancelBatchRfqQuotesService) SetClQuoteIds(clQuoteIds []string) *CancelBatchRfqQuotesService
SetClQuoteIds targets the quotes by client-supplied id.
func (*CancelBatchRfqQuotesService) SetQuoteIds ¶
func (s *CancelBatchRfqQuotesService) SetQuoteIds(quoteIds []string) *CancelBatchRfqQuotesService
SetQuoteIds targets the quotes by id.
type CancelBatchRfqsService ¶
type CancelBatchRfqsService struct {
// contains filtered or unexported fields
}
CancelBatchRfqsService -- POST /api/v5/rfq/cancel-batch-rfqs (Trade)
Cancels multiple active RFQs in one request.
func (*CancelBatchRfqsService) Do ¶
func (s *CancelBatchRfqsService) Do(ctx context.Context) ([]RfqCancelAck, error)
func (*CancelBatchRfqsService) SetClRfqIds ¶
func (s *CancelBatchRfqsService) SetClRfqIds(clRfqIds []string) *CancelBatchRfqsService
SetClRfqIds targets the RFQs by client-supplied id.
func (*CancelBatchRfqsService) SetRfqIds ¶
func (s *CancelBatchRfqsService) SetRfqIds(rfqIds []string) *CancelBatchRfqsService
SetRfqIds targets the RFQs by id.
type CancelGridCloseOrderService ¶
type CancelGridCloseOrderService struct {
// contains filtered or unexported fields
}
CancelGridCloseOrderService -- POST /api/v5/tradingBot/grid/cancel-close-order (Trade)
Cancels an outstanding close-position order of a stopped contract grid. IMPLEMENT-ONLY.
func (*CancelGridCloseOrderService) Do ¶
func (s *CancelGridCloseOrderService) Do(ctx context.Context) (*GridCancelCloseOrderResult, error)
type CancelOrderArg ¶
type CancelOrderArg struct {
InstrumentID string `json:"instId"`
OrderID string `json:"ordId,omitempty"`
ClientOrderID string `json:"clOrdId,omitempty"`
}
CancelOrderArg is one leg of a cancel-batch-orders request body.
type CancelOrderService ¶
type CancelOrderService struct {
// contains filtered or unexported fields
}
CancelOrderService -- POST /api/v5/trade/cancel-order (Trade)
Cancels a single pending order by ordId or clOrdId.
func (*CancelOrderService) Do ¶
func (s *CancelOrderService) Do(ctx context.Context) (*OrderResult, error)
func (*CancelOrderService) SetClOrdId ¶
func (s *CancelOrderService) SetClOrdId(clOrdId string) *CancelOrderService
SetClOrdId sets the client-supplied order id (either ordId or clOrdId is required).
func (*CancelOrderService) SetOrdId ¶
func (s *CancelOrderService) SetOrdId(ordId string) *CancelOrderService
SetOrdId sets the order id (either ordId or clOrdId is required).
type CancelRfqQuoteService ¶
type CancelRfqQuoteService struct {
// contains filtered or unexported fields
}
CancelRfqQuoteService -- POST /api/v5/rfq/cancel-quote (Trade)
Cancels a single active quote.
func (*CancelRfqQuoteService) Do ¶
func (s *CancelRfqQuoteService) Do(ctx context.Context) (*RfqQuoteCancelAck, error)
func (*CancelRfqQuoteService) SetClQuoteId ¶
func (s *CancelRfqQuoteService) SetClQuoteId(clQuoteId string) *CancelRfqQuoteService
SetClQuoteId targets the quote by client-supplied id.
func (*CancelRfqQuoteService) SetClRfqId ¶
func (s *CancelRfqQuoteService) SetClRfqId(clRfqId string) *CancelRfqQuoteService
SetClRfqId restricts cancellation to quotes on the given client RFQ id.
func (*CancelRfqQuoteService) SetQuoteId ¶
func (s *CancelRfqQuoteService) SetQuoteId(quoteId string) *CancelRfqQuoteService
SetQuoteId targets the quote by id (one of quoteId / clQuoteId is required).
func (*CancelRfqQuoteService) SetRfqId ¶
func (s *CancelRfqQuoteService) SetRfqId(rfqId string) *CancelRfqQuoteService
SetRfqId restricts cancellation to quotes on the given RFQ.
type CancelRfqService ¶
type CancelRfqService struct {
// contains filtered or unexported fields
}
CancelRfqService -- POST /api/v5/rfq/cancel-rfq (Trade)
Cancels a single active RFQ.
func (*CancelRfqService) Do ¶
func (s *CancelRfqService) Do(ctx context.Context) (*RfqCancelAck, error)
func (*CancelRfqService) SetClRfqId ¶
func (s *CancelRfqService) SetClRfqId(clRfqId string) *CancelRfqService
SetClRfqId targets the RFQ by client-supplied id.
func (*CancelRfqService) SetRfqId ¶
func (s *CancelRfqService) SetRfqId(rfqId string) *CancelRfqService
SetRfqId targets the RFQ by id (one of rfqId / clRfqId is required).
type CancelSprdOrderAlgoService ¶
type CancelSprdOrderAlgoService struct {
// contains filtered or unexported fields
}
CancelSprdOrderAlgoService -- POST /api/v5/sprd/cancel-order-algo (Trade)
Cancels a single spread algo order by algoId or algoClOrdId.
func (*CancelSprdOrderAlgoService) Do ¶
func (s *CancelSprdOrderAlgoService) Do(ctx context.Context) (*SprdAlgoAck, error)
func (*CancelSprdOrderAlgoService) SetAlgoClOrdId ¶
func (s *CancelSprdOrderAlgoService) SetAlgoClOrdId(algoClOrdId string) *CancelSprdOrderAlgoService
SetAlgoClOrdId cancels by client-supplied algo id.
func (*CancelSprdOrderAlgoService) SetAlgoId ¶
func (s *CancelSprdOrderAlgoService) SetAlgoId(algoId string) *CancelSprdOrderAlgoService
SetAlgoId cancels by OKX algo id.
type CancelSprdOrderService ¶
type CancelSprdOrderService struct {
// contains filtered or unexported fields
}
CancelSprdOrderService -- POST /api/v5/sprd/cancel-order (Trade)
Cancels a single spread order by ordId or clOrdId.
func (*CancelSprdOrderService) Do ¶
func (s *CancelSprdOrderService) Do(ctx context.Context) (*SprdOrderAck, error)
func (*CancelSprdOrderService) SetClOrdId ¶
func (s *CancelSprdOrderService) SetClOrdId(clOrdId string) *CancelSprdOrderService
SetClOrdId cancels by client-supplied order id.
func (*CancelSprdOrderService) SetOrdId ¶
func (s *CancelSprdOrderService) SetOrdId(ordId string) *CancelSprdOrderService
SetOrdId cancels by OKX order id.
type CancelStakingService ¶
type CancelStakingService struct {
// contains filtered or unexported fields
}
CancelStakingService -- POST /api/v5/finance/staking-defi/cancel (Trade)
Cancels a pending purchase/redemption of an on-chain earn order. State-changing: implement-only.
func (*CancelStakingService) Do ¶
func (s *CancelStakingService) Do(ctx context.Context) (*StakingOrderAck, error)
type CancelWithdrawal ¶
type CancelWithdrawal struct {
WithdrawalID string `json:"wdId"`
}
CancelWithdrawal is the acknowledgement of a withdrawal cancellation.
type CancelWithdrawalService ¶
type CancelWithdrawalService struct {
// contains filtered or unexported fields
}
CancelWithdrawalService -- POST /api/v5/asset/cancel-withdrawal (private)
Cancels a pending withdrawal. IMPLEMENT-ONLY: acts on a real withdrawal and is not executed by the test suite.
func (*CancelWithdrawalService) Do ¶
func (s *CancelWithdrawalService) Do(ctx context.Context) (*CancelWithdrawal, error)
type Candle ¶
type Candle struct {
Timestamp time.Time
Open decimal.Decimal
High decimal.Decimal
Low decimal.Decimal
Close decimal.Decimal
Volume decimal.Decimal
VolumeCurrency decimal.Decimal
VolumeCurrencyQuote decimal.Decimal
Confirm string
}
Candle is one OHLCV candlestick from the market candle endpoints. The raw response is an array-of-arrays with 9 columns: [ts, o, h, l, c, vol, volCcy, volCcyQuote, confirm].
type Client ¶
Client is the REST client for OKX's v5 unified-account (/api/v5/*) endpoints. It embeds the shared core client, which holds the signing/transport machinery and the client/server clock offset.
func (*Client) NewActivateOptionService ¶
func (c *Client) NewActivateOptionService() *ActivateOptionService
func (*Client) NewAdjustFlexLoanCollateralService ¶
func (c *Client) NewAdjustFlexLoanCollateralService(typ FlexLoanAdjustType, collateralCcy string, collateralAmt decimal.Decimal) *AdjustFlexLoanCollateralService
func (*Client) NewAdjustGridInvestmentService ¶
func (c *Client) NewAdjustGridInvestmentService(algoId string, amt decimal.Decimal) *AdjustGridInvestmentService
func (*Client) NewAdjustGridMarginBalanceService ¶
func (c *Client) NewAdjustGridMarginBalanceService(algoId, typ string) *AdjustGridMarginBalanceService
NewAdjustGridMarginBalanceService builds the request. typ is "add" or "reduce".
func (*Client) NewAmendAlgoOrderService ¶
func (c *Client) NewAmendAlgoOrderService(instId string) *AmendAlgoOrderService
func (*Client) NewAmendBatchOrdersService ¶
func (c *Client) NewAmendBatchOrdersService(orders []AmendOrderArg) *AmendBatchOrdersService
func (*Client) NewAmendCopyCopySettingsService ¶
func (c *Client) NewAmendCopyCopySettingsService(uniqueCode, copyMgnMode, copyInstIdType, copyMode, subPosCloseType string) *AmendCopyCopySettingsService
func (*Client) NewAmendCopyLeadingInstrumentsService ¶
func (c *Client) NewAmendCopyLeadingInstrumentsService(instId string) *AmendCopyLeadingInstrumentsService
func (*Client) NewAmendCopyProfitSharingRatioService ¶
func (c *Client) NewAmendCopyProfitSharingRatioService(profitSharingRatio decimal.Decimal) *AmendCopyProfitSharingRatioService
func (*Client) NewAmendFixedLoanLendingOrderService ¶
func (c *Client) NewAmendFixedLoanLendingOrderService(ordId string) *AmendFixedLoanLendingOrderService
func (*Client) NewAmendGridAlgoOrderService ¶
func (c *Client) NewAmendGridAlgoOrderService(algoId, instId string) *AmendGridAlgoOrderService
func (*Client) NewAmendOrderService ¶
func (c *Client) NewAmendOrderService(instId string) *AmendOrderService
func (*Client) NewAmendRecurringOrderService ¶
func (c *Client) NewAmendRecurringOrderService(algoId string) *AmendRecurringOrderService
func (*Client) NewAmendSprdOrderService ¶
func (c *Client) NewAmendSprdOrderService() *AmendSprdOrderService
func (*Client) NewApplyBillsHistoryArchiveService ¶
func (c *Client) NewApplyBillsHistoryArchiveService(year string, quarter BillsHistoryArchiveQuarter) *ApplyBillsHistoryArchiveService
NewApplyBillsHistoryArchiveService builds the apply request. year is a 4-digit year (e.g. "2024"); quarter is Q1..Q4.
func (*Client) NewApplyCopyLeadTradingService ¶
func (c *Client) NewApplyCopyLeadTradingService(instId string) *ApplyCopyLeadTradingService
func (*Client) NewApplyMonthlyStatementService ¶
func (c *Client) NewApplyMonthlyStatementService() *ApplyMonthlyStatementService
func (*Client) NewBatchOrdersService ¶
func (c *Client) NewBatchOrdersService(orders []OrderArg) *BatchOrdersService
func (*Client) NewCancelAdvanceAlgoOrdersService ¶
func (c *Client) NewCancelAdvanceAlgoOrdersService(items []AlgoCancelArg) *CancelAdvanceAlgoOrdersService
func (*Client) NewCancelAlgoOrdersService ¶
func (c *Client) NewCancelAlgoOrdersService(items []AlgoCancelArg) *CancelAlgoOrdersService
func (*Client) NewCancelAllAfterRfqService ¶
func (c *Client) NewCancelAllAfterRfqService(timeOut int) *CancelAllAfterRfqService
func (*Client) NewCancelAllAfterService ¶
func (c *Client) NewCancelAllAfterService(timeOut int) *CancelAllAfterService
func (*Client) NewCancelAllRfqQuotesService ¶
func (c *Client) NewCancelAllRfqQuotesService() *CancelAllRfqQuotesService
func (*Client) NewCancelAllRfqsService ¶
func (c *Client) NewCancelAllRfqsService() *CancelAllRfqsService
func (*Client) NewCancelAllSprdOrdersService ¶
func (c *Client) NewCancelAllSprdOrdersService() *CancelAllSprdOrdersService
func (*Client) NewCancelBatchOrdersService ¶
func (c *Client) NewCancelBatchOrdersService(orders []CancelOrderArg) *CancelBatchOrdersService
func (*Client) NewCancelBatchRfqQuotesService ¶
func (c *Client) NewCancelBatchRfqQuotesService() *CancelBatchRfqQuotesService
func (*Client) NewCancelBatchRfqsService ¶
func (c *Client) NewCancelBatchRfqsService() *CancelBatchRfqsService
func (*Client) NewCancelGridCloseOrderService ¶
func (c *Client) NewCancelGridCloseOrderService(algoId, ordId string) *CancelGridCloseOrderService
func (*Client) NewCancelOrderService ¶
func (c *Client) NewCancelOrderService(instId string) *CancelOrderService
func (*Client) NewCancelRfqQuoteService ¶
func (c *Client) NewCancelRfqQuoteService() *CancelRfqQuoteService
func (*Client) NewCancelRfqService ¶
func (c *Client) NewCancelRfqService() *CancelRfqService
func (*Client) NewCancelSprdOrderAlgoService ¶
func (c *Client) NewCancelSprdOrderAlgoService() *CancelSprdOrderAlgoService
func (*Client) NewCancelSprdOrderService ¶
func (c *Client) NewCancelSprdOrderService() *CancelSprdOrderService
func (*Client) NewCancelStakingService ¶
func (c *Client) NewCancelStakingService(ordId string, protocolType StakingProtocolType) *CancelStakingService
func (*Client) NewCancelWithdrawalService ¶
func (c *Client) NewCancelWithdrawalService(wdId string) *CancelWithdrawalService
func (*Client) NewCloseCopySubpositionService ¶
func (c *Client) NewCloseCopySubpositionService(subPosId string) *CloseCopySubpositionService
func (*Client) NewCloseGridPositionService ¶
func (c *Client) NewCloseGridPositionService(algoId string, mktClose bool) *CloseGridPositionService
func (*Client) NewClosePositionService ¶
func (c *Client) NewClosePositionService(instId string, mgnMode MgnMode) *ClosePositionService
func (*Client) NewComputeGridMarginBalanceService ¶
func (c *Client) NewComputeGridMarginBalanceService(algoId, typ string) *ComputeGridMarginBalanceService
NewComputeGridMarginBalanceService builds the estimate. typ is "add" or "reduce".
func (*Client) NewConvertEstimateQuoteService ¶
func (c *Client) NewConvertEstimateQuoteService(baseCcy, quoteCcy string, side Side, rfqSz decimal.Decimal, rfqSzCcy string) *ConvertEstimateQuoteService
NewConvertEstimateQuoteService builds an estimate-quote request. side is the trade direction relative to baseCcy; rfqSz is the requested size denominated in rfqSzCcy (which must be either baseCcy or quoteCcy).
func (*Client) NewConvertTradeService ¶
func (c *Client) NewConvertTradeService(quoteId, baseCcy, quoteCcy string, side Side, sz decimal.Decimal, szCcy string) *ConvertTradeService
NewConvertTradeService builds a convert-trade request. quoteId is the id from estimate-quote; sz is the size denominated in szCcy (which must be either baseCcy or quoteCcy).
func (*Client) NewCreateRfqQuoteService ¶
func (c *Client) NewCreateRfqQuoteService(rfqId string, quoteSide RfqQuoteSide, legs []RfqQuoteCreateLeg) *CreateRfqQuoteService
func (*Client) NewCreateRfqService ¶
func (c *Client) NewCreateRfqService(counterparties []string, legs []RfqCreateLeg) *CreateRfqService
func (*Client) NewCreateSubAccountApiKeyService ¶
func (c *Client) NewCreateSubAccountApiKeyService(subAcct, label, passphrase string) *CreateSubAccountApiKeyService
func (*Client) NewDeleteSubAccountApiKeyService ¶
func (c *Client) NewDeleteSubAccountApiKeyService(subAcct, apiKey string) *DeleteSubAccountApiKeyService
func (*Client) NewExecuteQuoteService ¶
func (c *Client) NewExecuteQuoteService(rfqId, quoteId string) *ExecuteQuoteService
func (*Client) NewFirstCopyCopySettingsService ¶
func (c *Client) NewFirstCopyCopySettingsService(uniqueCode, copyMgnMode, copyInstIdType, copyMode, subPosCloseType string) *FirstCopyCopySettingsService
func (*Client) NewFundsTransferService ¶
func (c *Client) NewFundsTransferService(ccy string, amt decimal.Decimal, from, to AssetAcctType) *FundsTransferService
NewFundsTransferService builds a transfer. ccy is the currency, amt the amount, from/to the source and destination account types.
func (*Client) NewGetAccountConfigService ¶
func (c *Client) NewGetAccountConfigService() *GetAccountConfigService
func (*Client) NewGetAccountInstrumentsService ¶
func (c *Client) NewGetAccountInstrumentsService(instType InstType) *GetAccountInstrumentsService
func (*Client) NewGetAccountPositionRiskService ¶
func (c *Client) NewGetAccountPositionRiskService() *GetAccountPositionRiskService
func (*Client) NewGetAccountPositionTiersService ¶
func (c *Client) NewGetAccountPositionTiersService(instType InstType) *GetAccountPositionTiersService
func (*Client) NewGetAccountRateLimitService ¶
func (c *Client) NewGetAccountRateLimitService() *GetAccountRateLimitService
func (*Client) NewGetAdjustLeverageInfoService ¶
func (*Client) NewGetAffiliateInviteeDetailService ¶
func (c *Client) NewGetAffiliateInviteeDetailService(uid string) *GetAffiliateInviteeDetailService
func (*Client) NewGetAlgoOrderService ¶
func (c *Client) NewGetAlgoOrderService() *GetAlgoOrderService
func (*Client) NewGetAlgoOrdersHistoryService ¶
func (c *Client) NewGetAlgoOrdersHistoryService(ordType AlgoOrdType) *GetAlgoOrdersHistoryService
func (*Client) NewGetAlgoOrdersPendingService ¶
func (c *Client) NewGetAlgoOrdersPendingService(ordType AlgoOrdType) *GetAlgoOrdersPendingService
func (*Client) NewGetAnnouncementTypesService ¶
func (c *Client) NewGetAnnouncementTypesService() *GetAnnouncementTypesService
func (*Client) NewGetAnnouncementsService ¶
func (c *Client) NewGetAnnouncementsService() *GetAnnouncementsService
func (*Client) NewGetAssetBillsService ¶
func (c *Client) NewGetAssetBillsService() *GetAssetBillsService
func (*Client) NewGetAssetValuationService ¶
func (c *Client) NewGetAssetValuationService() *GetAssetValuationService
func (*Client) NewGetBalanceService ¶
func (c *Client) NewGetBalanceService() *GetBalanceService
func (*Client) NewGetBillsArchiveService ¶
func (c *Client) NewGetBillsArchiveService() *GetBillsArchiveService
func (*Client) NewGetBillsHistoryArchiveService ¶
func (c *Client) NewGetBillsHistoryArchiveService(year string, quarter BillsHistoryArchiveQuarter) *GetBillsHistoryArchiveService
NewGetBillsHistoryArchiveService builds the request. year is a 4-digit year (e.g. "2024"); quarter is Q1..Q4.
func (*Client) NewGetBillsService ¶
func (c *Client) NewGetBillsService() *GetBillsService
func (*Client) NewGetBlockTickersService ¶
func (c *Client) NewGetBlockTickersService(instType InstType) *GetBlockTickersService
func (*Client) NewGetBooksFullService ¶
func (c *Client) NewGetBooksFullService(instId string) *GetBooksFullService
func (*Client) NewGetBooksService ¶
func (c *Client) NewGetBooksService(instId string) *GetBooksService
func (*Client) NewGetBorrowRepayHistoryService ¶
func (c *Client) NewGetBorrowRepayHistoryService() *GetBorrowRepayHistoryService
func (*Client) NewGetCandlesService ¶
func (c *Client) NewGetCandlesService(instId string) *GetCandlesService
func (*Client) NewGetCollateralAssetsService ¶
func (c *Client) NewGetCollateralAssetsService() *GetCollateralAssetsService
func (*Client) NewGetContractsOpenInterestVolumeService ¶
func (c *Client) NewGetContractsOpenInterestVolumeService(ccy string) *GetContractsOpenInterestVolumeService
func (*Client) NewGetConvertContractCoinService ¶
func (c *Client) NewGetConvertContractCoinService(typ, instId, sz string) *GetConvertContractCoinService
NewGetConvertContractCoinService builds the conversion. typ is "1" (coin -> to contract) or "2" (contract -> to coin); instId is the derivatives instrument; sz is the quantity to convert.
func (*Client) NewGetConvertCurrenciesService ¶
func (c *Client) NewGetConvertCurrenciesService() *GetConvertCurrenciesService
func (*Client) NewGetConvertCurrencyPairService ¶
func (c *Client) NewGetConvertCurrencyPairService(fromCcy, toCcy string) *GetConvertCurrencyPairService
func (*Client) NewGetConvertHistoryService ¶
func (c *Client) NewGetConvertHistoryService() *GetConvertHistoryService
func (*Client) NewGetCopyBatchLeverageInfoService ¶
func (c *Client) NewGetCopyBatchLeverageInfoService(mgnMode MgnMode, uniqueCode string) *GetCopyBatchLeverageInfoService
func (*Client) NewGetCopyConfigService ¶
func (c *Client) NewGetCopyConfigService() *GetCopyConfigService
func (*Client) NewGetCopyCurrentSubpositionsService ¶
func (c *Client) NewGetCopyCurrentSubpositionsService() *GetCopyCurrentSubpositionsService
func (*Client) NewGetCopyInstrumentsService ¶
func (c *Client) NewGetCopyInstrumentsService() *GetCopyInstrumentsService
func (*Client) NewGetCopyLeadTradersService ¶
func (c *Client) NewGetCopyLeadTradersService() *GetCopyLeadTradersService
func (*Client) NewGetCopyProfitSharingDetailsService ¶
func (c *Client) NewGetCopyProfitSharingDetailsService() *GetCopyProfitSharingDetailsService
func (*Client) NewGetCopyPublicConfigService ¶
func (c *Client) NewGetCopyPublicConfigService() *GetCopyPublicConfigService
func (*Client) NewGetCopyPublicLeadTradersService ¶
func (c *Client) NewGetCopyPublicLeadTradersService() *GetCopyPublicLeadTradersService
func (*Client) NewGetCopySettingsService ¶
func (c *Client) NewGetCopySettingsService(instType InstType, uniqueCode string) *GetCopySettingsService
func (*Client) NewGetCopySubpositionsHistoryService ¶
func (c *Client) NewGetCopySubpositionsHistoryService() *GetCopySubpositionsHistoryService
func (*Client) NewGetCopyTotalProfitSharingService ¶
func (c *Client) NewGetCopyTotalProfitSharingService() *GetCopyTotalProfitSharingService
func (*Client) NewGetCopyTotalUnrealizedProfitSharingService ¶
func (c *Client) NewGetCopyTotalUnrealizedProfitSharingService() *GetCopyTotalUnrealizedProfitSharingService
func (*Client) NewGetCopyTradersService ¶
func (c *Client) NewGetCopyTradersService(uniqueCode string) *GetCopyTradersService
func (*Client) NewGetCopyUnrealizedProfitSharingDetailsService ¶
func (c *Client) NewGetCopyUnrealizedProfitSharingDetailsService() *GetCopyUnrealizedProfitSharingDetailsService
func (*Client) NewGetCurrenciesService ¶
func (c *Client) NewGetCurrenciesService() *GetCurrenciesService
func (*Client) NewGetDeliveryExerciseHistoryService ¶
func (c *Client) NewGetDeliveryExerciseHistoryService(instType InstType) *GetDeliveryExerciseHistoryService
func (*Client) NewGetDepositAddressService ¶
func (c *Client) NewGetDepositAddressService(ccy string) *GetDepositAddressService
func (*Client) NewGetDepositHistoryService ¶
func (c *Client) NewGetDepositHistoryService() *GetDepositHistoryService
func (*Client) NewGetDepositWithdrawStatusService ¶
func (c *Client) NewGetDepositWithdrawStatusService() *GetDepositWithdrawStatusService
func (*Client) NewGetDiscountRateInterestFreeQuotaService ¶
func (c *Client) NewGetDiscountRateInterestFreeQuotaService() *GetDiscountRateInterestFreeQuotaService
func (*Client) NewGetEasyConvertCurrencyListService ¶
func (c *Client) NewGetEasyConvertCurrencyListService() *GetEasyConvertCurrencyListService
func (*Client) NewGetEasyConvertHistoryService ¶
func (c *Client) NewGetEasyConvertHistoryService() *GetEasyConvertHistoryService
func (*Client) NewGetEconomicCalendarService ¶
func (c *Client) NewGetEconomicCalendarService() *GetEconomicCalendarService
func (*Client) NewGetEntrustSubAccountListService ¶
func (c *Client) NewGetEntrustSubAccountListService() *GetEntrustSubAccountListService
func (*Client) NewGetEstimatedPriceService ¶
func (c *Client) NewGetEstimatedPriceService(instId string) *GetEstimatedPriceService
func (*Client) NewGetEthStakingApyHistoryService ¶
func (c *Client) NewGetEthStakingApyHistoryService(days int) *GetEthStakingApyHistoryService
func (*Client) NewGetEthStakingBalanceService ¶
func (c *Client) NewGetEthStakingBalanceService() *GetEthStakingBalanceService
func (*Client) NewGetEthStakingHistoryService ¶
func (c *Client) NewGetEthStakingHistoryService() *GetEthStakingHistoryService
func (*Client) NewGetEthStakingProductInfoService ¶
func (c *Client) NewGetEthStakingProductInfoService() *GetEthStakingProductInfoService
func (*Client) NewGetExchangeListService ¶
func (c *Client) NewGetExchangeListService() *GetExchangeListService
func (*Client) NewGetExchangeRateService ¶
func (c *Client) NewGetExchangeRateService() *GetExchangeRateService
func (*Client) NewGetFillsHistoryService ¶
func (c *Client) NewGetFillsHistoryService(instType InstType) *GetFillsHistoryService
func (*Client) NewGetFillsService ¶
func (c *Client) NewGetFillsService() *GetFillsService
func (*Client) NewGetFixedLoanLendingApyHistoryService ¶
func (c *Client) NewGetFixedLoanLendingApyHistoryService(ccy, term string) *GetFixedLoanLendingApyHistoryService
func (*Client) NewGetFixedLoanLendingOffersService ¶
func (c *Client) NewGetFixedLoanLendingOffersService() *GetFixedLoanLendingOffersService
func (*Client) NewGetFixedLoanLendingOrdersListService ¶
func (c *Client) NewGetFixedLoanLendingOrdersListService() *GetFixedLoanLendingOrdersListService
func (*Client) NewGetFixedLoanLendingSubOrdersService ¶
func (c *Client) NewGetFixedLoanLendingSubOrdersService(ordId string) *GetFixedLoanLendingSubOrdersService
func (*Client) NewGetFixedLoanPendingLendingVolumeService ¶
func (c *Client) NewGetFixedLoanPendingLendingVolumeService(ccy, term string) *GetFixedLoanPendingLendingVolumeService
func (*Client) NewGetFlexLoanBorrowCurrenciesService ¶
func (c *Client) NewGetFlexLoanBorrowCurrenciesService() *GetFlexLoanBorrowCurrenciesService
func (*Client) NewGetFlexLoanCollateralAssetsService ¶
func (c *Client) NewGetFlexLoanCollateralAssetsService() *GetFlexLoanCollateralAssetsService
func (*Client) NewGetFlexLoanInterestAccruedService ¶
func (c *Client) NewGetFlexLoanInterestAccruedService() *GetFlexLoanInterestAccruedService
func (*Client) NewGetFlexLoanLoanHistoryService ¶
func (c *Client) NewGetFlexLoanLoanHistoryService() *GetFlexLoanLoanHistoryService
func (*Client) NewGetFlexLoanLoanInfoService ¶
func (c *Client) NewGetFlexLoanLoanInfoService() *GetFlexLoanLoanInfoService
func (*Client) NewGetFlexLoanMaxLoanService ¶
func (c *Client) NewGetFlexLoanMaxLoanService(borrowCcy string) *GetFlexLoanMaxLoanService
func (*Client) NewGetFundingBalanceService ¶
func (c *Client) NewGetFundingBalanceService() *GetFundingBalanceService
func (*Client) NewGetFundingRateHistoryService ¶
func (c *Client) NewGetFundingRateHistoryService(instId string) *GetFundingRateHistoryService
func (*Client) NewGetFundingRateService ¶
func (c *Client) NewGetFundingRateService(instId string) *GetFundingRateService
func (*Client) NewGetGLPHistoricalPerformanceService ¶ added in v0.20260723.0
func (c *Client) NewGetGLPHistoricalPerformanceService(program GLPProgram) *GetGLPHistoricalPerformanceService
NewGetGLPHistoricalPerformanceService requires the GLP program (SPOT/PERP/FUT_NTO).
func (*Client) NewGetGLPTodayPerformanceService ¶ added in v0.20260723.0
func (c *Client) NewGetGLPTodayPerformanceService() *GetGLPTodayPerformanceService
func (*Client) NewGetGreeksService ¶
func (c *Client) NewGetGreeksService() *GetGreeksService
func (*Client) NewGetGridAIParamService ¶
func (c *Client) NewGetGridAIParamService(algoOrdType GridAlgoOrdType, instId string) *GetGridAIParamService
func (*Client) NewGetGridAlgoDetailsService ¶
func (c *Client) NewGetGridAlgoDetailsService(algoOrdType GridAlgoOrdType, algoId string) *GetGridAlgoDetailsService
func (*Client) NewGetGridAlgoHistoryService ¶
func (c *Client) NewGetGridAlgoHistoryService(algoOrdType GridAlgoOrdType) *GetGridAlgoHistoryService
func (*Client) NewGetGridAlgoPendingService ¶
func (c *Client) NewGetGridAlgoPendingService(algoOrdType GridAlgoOrdType) *GetGridAlgoPendingService
func (*Client) NewGetGridMinInvestmentService ¶
func (c *Client) NewGetGridMinInvestmentService(instId string, algoOrdType GridAlgoOrdType, maxPx, minPx decimal.Decimal, gridNum int, runType GridRunType) *GetGridMinInvestmentService
func (*Client) NewGetGridPositionsService ¶
func (c *Client) NewGetGridPositionsService(algoOrdType GridAlgoOrdType, algoId string) *GetGridPositionsService
func (*Client) NewGetGridRSIBackTestingService ¶
func (c *Client) NewGetGridRSIBackTestingService(instId, timeframe, thold string, timePeriod int, triggerCond, duration string) *GetGridRSIBackTestingService
NewGetGridRSIBackTestingService builds the back-test. triggerCond is e.g. "cross_up"/"cross_down"/"above"/"below"; timeframe is e.g. "3m"/"15m"/"1H".
func (*Client) NewGetGridSubOrdersService ¶
func (c *Client) NewGetGridSubOrdersService(algoId string, algoOrdType GridAlgoOrdType, typ GridSubOrderType) *GetGridSubOrdersService
func (*Client) NewGetHistoryCandlesService ¶
func (c *Client) NewGetHistoryCandlesService(instId string) *GetHistoryCandlesService
func (*Client) NewGetHistoryIndexCandlesService ¶
func (c *Client) NewGetHistoryIndexCandlesService(instId string) *GetHistoryIndexCandlesService
func (*Client) NewGetHistoryMarkPriceCandlesService ¶
func (c *Client) NewGetHistoryMarkPriceCandlesService(instId string) *GetHistoryMarkPriceCandlesService
func (*Client) NewGetHistoryTradesService ¶
func (c *Client) NewGetHistoryTradesService(instId string) *GetHistoryTradesService
func (*Client) NewGetIndexCandlesService ¶
func (c *Client) NewGetIndexCandlesService(instId string) *GetIndexCandlesService
func (*Client) NewGetIndexComponentsService ¶
func (c *Client) NewGetIndexComponentsService(index string) *GetIndexComponentsService
func (*Client) NewGetIndexTickersService ¶
func (c *Client) NewGetIndexTickersService() *GetIndexTickersService
func (*Client) NewGetInstrumentTickBandsService ¶
func (c *Client) NewGetInstrumentTickBandsService(instType InstType) *GetInstrumentTickBandsService
func (*Client) NewGetInstrumentsService ¶
func (c *Client) NewGetInstrumentsService(instType InstType) *GetInstrumentsService
func (*Client) NewGetInsuranceFundService ¶
func (c *Client) NewGetInsuranceFundService(instType InstType) *GetInsuranceFundService
func (*Client) NewGetInterestAccruedService ¶
func (c *Client) NewGetInterestAccruedService() *GetInterestAccruedService
func (*Client) NewGetInterestLimitsService ¶
func (c *Client) NewGetInterestLimitsService() *GetInterestLimitsService
func (*Client) NewGetInterestRateLoanQuotaService ¶
func (c *Client) NewGetInterestRateLoanQuotaService() *GetInterestRateLoanQuotaService
func (*Client) NewGetInterestRateService ¶
func (c *Client) NewGetInterestRateService() *GetInterestRateService
func (*Client) NewGetLeverageInfoService ¶
func (c *Client) NewGetLeverageInfoService(instId string, mgnMode MgnMode) *GetLeverageInfoService
func (*Client) NewGetLoanRatioService ¶
func (c *Client) NewGetLoanRatioService(ccy string) *GetLoanRatioService
func (*Client) NewGetLongShortAccountRatioContractService ¶
func (c *Client) NewGetLongShortAccountRatioContractService(instId string) *GetLongShortAccountRatioContractService
func (*Client) NewGetLongShortAccountRatioContractTopTraderService ¶
func (c *Client) NewGetLongShortAccountRatioContractTopTraderService(instId string) *GetLongShortAccountRatioContractTopTraderService
func (*Client) NewGetLongShortAccountRatioService ¶
func (c *Client) NewGetLongShortAccountRatioService(ccy string) *GetLongShortAccountRatioService
func (*Client) NewGetLongShortPositionRatioContractTopTraderService ¶
func (c *Client) NewGetLongShortPositionRatioContractTopTraderService(instId string) *GetLongShortPositionRatioContractTopTraderService
func (*Client) NewGetMMInstrumentTypesService ¶ added in v0.20260703.0
func (c *Client) NewGetMMInstrumentTypesService() *GetMMInstrumentTypesService
func (*Client) NewGetMMPConfigService ¶
func (c *Client) NewGetMMPConfigService(instFamily string) *GetMMPConfigService
func (*Client) NewGetManagedSubAccountBillsService ¶
func (c *Client) NewGetManagedSubAccountBillsService() *GetManagedSubAccountBillsService
func (*Client) NewGetMarkPriceCandlesService ¶
func (c *Client) NewGetMarkPriceCandlesService(instId string) *GetMarkPriceCandlesService
func (*Client) NewGetMarkPriceService ¶
func (c *Client) NewGetMarkPriceService(instType InstType) *GetMarkPriceService
func (*Client) NewGetMaxAvailSizeService ¶
func (c *Client) NewGetMaxAvailSizeService(instId string, tdMode TdMode) *GetMaxAvailSizeService
func (*Client) NewGetMaxLoanService ¶
func (c *Client) NewGetMaxLoanService(mgnMode MgnMode) *GetMaxLoanService
func (*Client) NewGetMaxSizeService ¶
func (c *Client) NewGetMaxSizeService(instId string, tdMode TdMode) *GetMaxSizeService
func (*Client) NewGetMaxWithdrawalService ¶
func (c *Client) NewGetMaxWithdrawalService() *GetMaxWithdrawalService
func (*Client) NewGetMonthlyStatementService ¶
func (c *Client) NewGetMonthlyStatementService(month string) *GetMonthlyStatementService
func (*Client) NewGetMovePositionsHistoryService ¶
func (c *Client) NewGetMovePositionsHistoryService() *GetMovePositionsHistoryService
func (*Client) NewGetNonTradableAssetsService ¶
func (c *Client) NewGetNonTradableAssetsService() *GetNonTradableAssetsService
func (*Client) NewGetOKUSDLimitsService ¶ added in v0.20260703.0
func (c *Client) NewGetOKUSDLimitsService() *GetOKUSDLimitsService
func (*Client) NewGetOneClickRepayCurrencyListService ¶
func (c *Client) NewGetOneClickRepayCurrencyListService() *GetOneClickRepayCurrencyListService
func (*Client) NewGetOneClickRepayCurrencyListV2Service ¶
func (c *Client) NewGetOneClickRepayCurrencyListV2Service() *GetOneClickRepayCurrencyListV2Service
func (*Client) NewGetOneClickRepayHistoryService ¶
func (c *Client) NewGetOneClickRepayHistoryService() *GetOneClickRepayHistoryService
func (*Client) NewGetOneClickRepayHistoryV2Service ¶
func (c *Client) NewGetOneClickRepayHistoryV2Service() *GetOneClickRepayHistoryV2Service
func (*Client) NewGetOpenInterestHistoryService ¶
func (c *Client) NewGetOpenInterestHistoryService(instId string) *GetOpenInterestHistoryService
func (*Client) NewGetOpenInterestService ¶
func (c *Client) NewGetOpenInterestService(instType InstType) *GetOpenInterestService
func (*Client) NewGetOptSummaryService ¶
func (c *Client) NewGetOptSummaryService() *GetOptSummaryService
func (*Client) NewGetOptionInstrumentFamilyTradesService ¶
func (c *Client) NewGetOptionInstrumentFamilyTradesService(instFamily string) *GetOptionInstrumentFamilyTradesService
func (*Client) NewGetOptionOpenInterestVolumeExpiryService ¶
func (c *Client) NewGetOptionOpenInterestVolumeExpiryService(ccy string) *GetOptionOpenInterestVolumeExpiryService
func (*Client) NewGetOptionOpenInterestVolumeService ¶
func (c *Client) NewGetOptionOpenInterestVolumeService(ccy string) *GetOptionOpenInterestVolumeService
func (*Client) NewGetOptionOpenInterestVolumeStrikeService ¶
func (c *Client) NewGetOptionOpenInterestVolumeStrikeService(ccy, expTime string) *GetOptionOpenInterestVolumeStrikeService
func (*Client) NewGetOptionTakerBlockVolumeService ¶
func (c *Client) NewGetOptionTakerBlockVolumeService(ccy string) *GetOptionTakerBlockVolumeService
func (*Client) NewGetOrderService ¶
func (c *Client) NewGetOrderService(instId string) *GetOrderService
func (*Client) NewGetOrdersHistoryArchiveService ¶
func (c *Client) NewGetOrdersHistoryArchiveService(instType InstType) *GetOrdersHistoryArchiveService
func (*Client) NewGetOrdersHistoryService ¶
func (c *Client) NewGetOrdersHistoryService(instType InstType) *GetOrdersHistoryService
func (*Client) NewGetOrdersPendingService ¶
func (c *Client) NewGetOrdersPendingService() *GetOrdersPendingService
func (*Client) NewGetPlatform24VolumeService ¶
func (c *Client) NewGetPlatform24VolumeService() *GetPlatform24VolumeService
func (*Client) NewGetPositionTiersService ¶
func (c *Client) NewGetPositionTiersService(instType InstType, tdMode TdMode) *GetPositionTiersService
func (*Client) NewGetPositionsHistoryService ¶
func (c *Client) NewGetPositionsHistoryService() *GetPositionsHistoryService
func (*Client) NewGetPositionsService ¶
func (c *Client) NewGetPositionsService() *GetPositionsService
func (*Client) NewGetPremiumHistoryService ¶
func (c *Client) NewGetPremiumHistoryService(instId string) *GetPremiumHistoryService
func (*Client) NewGetPriceLimitService ¶
func (c *Client) NewGetPriceLimitService(instId string) *GetPriceLimitService
func (*Client) NewGetRecurringOrderDetailsService ¶
func (c *Client) NewGetRecurringOrderDetailsService(algoId string) *GetRecurringOrderDetailsService
func (*Client) NewGetRecurringOrdersHistoryService ¶
func (c *Client) NewGetRecurringOrdersHistoryService() *GetRecurringOrdersHistoryService
func (*Client) NewGetRecurringOrdersPendingService ¶
func (c *Client) NewGetRecurringOrdersPendingService() *GetRecurringOrdersPendingService
func (*Client) NewGetRecurringSubOrdersService ¶
func (c *Client) NewGetRecurringSubOrdersService(algoId string) *GetRecurringSubOrdersService
func (*Client) NewGetRfqBlockTickerService ¶
func (c *Client) NewGetRfqBlockTickerService(instId string) *GetRfqBlockTickerService
func (*Client) NewGetRfqBlockTickersService ¶
func (c *Client) NewGetRfqBlockTickersService(instType InstType) *GetRfqBlockTickersService
func (*Client) NewGetRfqCounterpartiesService ¶
func (c *Client) NewGetRfqCounterpartiesService() *GetRfqCounterpartiesService
func (*Client) NewGetRfqMakerInstrumentSettingsService ¶
func (c *Client) NewGetRfqMakerInstrumentSettingsService() *GetRfqMakerInstrumentSettingsService
func (*Client) NewGetRfqMmpConfigService ¶
func (c *Client) NewGetRfqMmpConfigService() *GetRfqMmpConfigService
func (*Client) NewGetRfqPublicTradesService ¶
func (c *Client) NewGetRfqPublicTradesService() *GetRfqPublicTradesService
func (*Client) NewGetRfqQuoteProductsService ¶
func (c *Client) NewGetRfqQuoteProductsService() *GetRfqQuoteProductsService
func (*Client) NewGetRfqQuotesService ¶
func (c *Client) NewGetRfqQuotesService() *GetRfqQuotesService
func (*Client) NewGetRfqTradesService ¶
func (c *Client) NewGetRfqTradesService() *GetRfqTradesService
func (*Client) NewGetRfqsService ¶
func (c *Client) NewGetRfqsService() *GetRfqsService
func (*Client) NewGetRiskStateService ¶
func (c *Client) NewGetRiskStateService() *GetRiskStateService
func (*Client) NewGetSavingsBalanceService ¶
func (c *Client) NewGetSavingsBalanceService() *GetSavingsBalanceService
func (*Client) NewGetSavingsLendingHistoryService ¶
func (c *Client) NewGetSavingsLendingHistoryService() *GetSavingsLendingHistoryService
func (*Client) NewGetSavingsLendingRateHistoryService ¶
func (c *Client) NewGetSavingsLendingRateHistoryService() *GetSavingsLendingRateHistoryService
func (*Client) NewGetSavingsLendingRateSummaryService ¶
func (c *Client) NewGetSavingsLendingRateSummaryService() *GetSavingsLendingRateSummaryService
func (*Client) NewGetSettlementHistoryService ¶
func (c *Client) NewGetSettlementHistoryService(instType InstType, instFamily string) *GetSettlementHistoryService
func (*Client) NewGetSolStakingApyHistoryService ¶
func (c *Client) NewGetSolStakingApyHistoryService(days int) *GetSolStakingApyHistoryService
func (*Client) NewGetSolStakingBalanceService ¶
func (c *Client) NewGetSolStakingBalanceService() *GetSolStakingBalanceService
func (*Client) NewGetSolStakingHistoryService ¶
func (c *Client) NewGetSolStakingHistoryService() *GetSolStakingHistoryService
func (*Client) NewGetSolStakingProductInfoService ¶
func (c *Client) NewGetSolStakingProductInfoService() *GetSolStakingProductInfoService
func (*Client) NewGetSpotBorrowRepayHistoryService ¶
func (c *Client) NewGetSpotBorrowRepayHistoryService() *GetSpotBorrowRepayHistoryService
func (*Client) NewGetSprdBooksService ¶
func (c *Client) NewGetSprdBooksService(sprdId string) *GetSprdBooksService
func (*Client) NewGetSprdCandlesService ¶
func (c *Client) NewGetSprdCandlesService(sprdId string) *GetSprdCandlesService
func (*Client) NewGetSprdHistoryCandlesService ¶
func (c *Client) NewGetSprdHistoryCandlesService(sprdId string) *GetSprdHistoryCandlesService
func (*Client) NewGetSprdOrderAlgoService ¶
func (c *Client) NewGetSprdOrderAlgoService() *GetSprdOrderAlgoService
func (*Client) NewGetSprdOrderService ¶
func (c *Client) NewGetSprdOrderService() *GetSprdOrderService
func (*Client) NewGetSprdOrdersAlgoHistoryService ¶
func (c *Client) NewGetSprdOrdersAlgoHistoryService() *GetSprdOrdersAlgoHistoryService
func (*Client) NewGetSprdOrdersAlgoPendingService ¶
func (c *Client) NewGetSprdOrdersAlgoPendingService() *GetSprdOrdersAlgoPendingService
func (*Client) NewGetSprdOrdersHistoryArchiveService ¶
func (c *Client) NewGetSprdOrdersHistoryArchiveService() *GetSprdOrdersHistoryArchiveService
func (*Client) NewGetSprdOrdersHistoryService ¶
func (c *Client) NewGetSprdOrdersHistoryService() *GetSprdOrdersHistoryService
func (*Client) NewGetSprdOrdersPendingService ¶
func (c *Client) NewGetSprdOrdersPendingService() *GetSprdOrdersPendingService
func (*Client) NewGetSprdPublicTradesService ¶
func (c *Client) NewGetSprdPublicTradesService() *GetSprdPublicTradesService
func (*Client) NewGetSprdSpreadsService ¶
func (c *Client) NewGetSprdSpreadsService() *GetSprdSpreadsService
func (*Client) NewGetSprdTickerService ¶
func (c *Client) NewGetSprdTickerService(sprdId string) *GetSprdTickerService
func (*Client) NewGetSprdTradesService ¶
func (c *Client) NewGetSprdTradesService() *GetSprdTradesService
func (*Client) NewGetStakingActiveOrdersService ¶
func (c *Client) NewGetStakingActiveOrdersService() *GetStakingActiveOrdersService
func (*Client) NewGetStakingOffersService ¶
func (c *Client) NewGetStakingOffersService() *GetStakingOffersService
func (*Client) NewGetStakingOrdersHistoryService ¶
func (c *Client) NewGetStakingOrdersHistoryService() *GetStakingOrdersHistoryService
func (*Client) NewGetSubAccountApiKeyService ¶
func (c *Client) NewGetSubAccountApiKeyService(subAcct string) *GetSubAccountApiKeyService
func (*Client) NewGetSubAccountBillsService ¶
func (c *Client) NewGetSubAccountBillsService() *GetSubAccountBillsService
func (*Client) NewGetSubAccountFundingBalancesService ¶
func (c *Client) NewGetSubAccountFundingBalancesService(subAcct string) *GetSubAccountFundingBalancesService
func (*Client) NewGetSubAccountListService ¶
func (c *Client) NewGetSubAccountListService() *GetSubAccountListService
func (*Client) NewGetSubAccountMaxWithdrawalService ¶
func (c *Client) NewGetSubAccountMaxWithdrawalService(subAcct string) *GetSubAccountMaxWithdrawalService
func (*Client) NewGetSubAccountTradingBalancesService ¶
func (c *Client) NewGetSubAccountTradingBalancesService(subAcct string) *GetSubAccountTradingBalancesService
func (*Client) NewGetSupportCoinService ¶
func (c *Client) NewGetSupportCoinService() *GetSupportCoinService
func (*Client) NewGetSystemStatusService ¶
func (c *Client) NewGetSystemStatusService() *GetSystemStatusService
func (*Client) NewGetSystemTimeService ¶
func (c *Client) NewGetSystemTimeService() *GetSystemTimeService
func (*Client) NewGetTakerVolumeService ¶
func (c *Client) NewGetTakerVolumeService(ccy string, instType InstType) *GetTakerVolumeService
func (*Client) NewGetTickerService ¶
func (c *Client) NewGetTickerService(instId string) *GetTickerService
func (*Client) NewGetTickersService ¶
func (c *Client) NewGetTickersService(instType InstType) *GetTickersService
func (*Client) NewGetTradeFeeService ¶
func (c *Client) NewGetTradeFeeService(instType InstType) *GetTradeFeeService
func (*Client) NewGetTradesService ¶
func (c *Client) NewGetTradesService(instId string) *GetTradesService
func (*Client) NewGetTransferStateService ¶
func (c *Client) NewGetTransferStateService() *GetTransferStateService
func (*Client) NewGetUnderlyingService ¶
func (c *Client) NewGetUnderlyingService(instType InstType) *GetUnderlyingService
func (*Client) NewGetVipInterestAccruedService ¶
func (c *Client) NewGetVipInterestAccruedService() *GetVipInterestAccruedService
func (*Client) NewGetVipInterestDeductedService ¶
func (c *Client) NewGetVipInterestDeductedService() *GetVipInterestDeductedService
func (*Client) NewGetVipLoanOrderDetailService ¶
func (c *Client) NewGetVipLoanOrderDetailService(ordId string) *GetVipLoanOrderDetailService
func (*Client) NewGetVipLoanOrderListService ¶
func (c *Client) NewGetVipLoanOrderListService() *GetVipLoanOrderListService
func (*Client) NewGetWithdrawalHistoryService ¶
func (c *Client) NewGetWithdrawalHistoryService() *GetWithdrawalHistoryService
func (*Client) NewInstantTriggerGridService ¶
func (c *Client) NewInstantTriggerGridService(algoId string, algoOrdType GridAlgoOrdType) *InstantTriggerGridService
func (*Client) NewMassCancelService ¶
func (c *Client) NewMassCancelService(instType InstType, instFamily string) *MassCancelService
func (*Client) NewModifySubAccountApiKeyService ¶
func (c *Client) NewModifySubAccountApiKeyService(subAcct, apiKey string) *ModifySubAccountApiKeyService
func (*Client) NewMovePositionsService ¶
func (c *Client) NewMovePositionsService(fromAcct, toAcct, clientId string, legs []MovePositionLeg) *MovePositionsService
func (*Client) NewOrderPrecheckService ¶
func (*Client) NewPlaceAlgoOrderService ¶
func (c *Client) NewPlaceAlgoOrderService(instId string, tdMode TdMode, side Side, ordType AlgoOrdType, sz decimal.Decimal) *PlaceAlgoOrderService
func (*Client) NewPlaceCopyLeadStopOrderService ¶
func (c *Client) NewPlaceCopyLeadStopOrderService(subPosId string) *PlaceCopyLeadStopOrderService
func (*Client) NewPlaceEasyConvertService ¶
func (c *Client) NewPlaceEasyConvertService(fromCcy []string, toCcy string) *PlaceEasyConvertService
NewPlaceEasyConvertService starts an easy-convert order. fromCcy is the list of dust currencies (max 5); toCcy is the single mainstream currency to receive.
func (*Client) NewPlaceFixedLoanLendingOrderService ¶
func (*Client) NewPlaceGridAlgoOrderService ¶
func (c *Client) NewPlaceGridAlgoOrderService(instId string, algoOrdType GridAlgoOrdType, maxPx, minPx decimal.Decimal, gridNum int) *PlaceGridAlgoOrderService
func (*Client) NewPlaceOrderService ¶
func (*Client) NewPlaceRecurringOrderService ¶
func (c *Client) NewPlaceRecurringOrderService(stgyName string, recurringList []RecurringItem, period RecurringPeriod, recurringTime string, timeZone string, amt decimal.Decimal, investmentCcy string, tdMode TdMode) *PlaceRecurringOrderService
func (*Client) NewPlaceSprdOrderAlgoService ¶
func (c *Client) NewPlaceSprdOrderAlgoService(sprdId string, side Side, ordType, sz string) *PlaceSprdOrderAlgoService
func (*Client) NewPlaceSprdOrderService ¶
func (c *Client) NewPlaceSprdOrderService(sprdId string, side Side, ordType SprdOrdType, sz string) *PlaceSprdOrderService
func (*Client) NewPositionBuilderService ¶
func (c *Client) NewPositionBuilderService() *PositionBuilderService
func (*Client) NewPurchaseEthStakingService ¶
func (c *Client) NewPurchaseEthStakingService(amt decimal.Decimal) *PurchaseEthStakingService
func (*Client) NewPurchaseSolStakingService ¶
func (c *Client) NewPurchaseSolStakingService(amt decimal.Decimal) *PurchaseSolStakingService
func (*Client) NewPurchaseStakingService ¶
func (c *Client) NewPurchaseStakingService(productId string, investData []StakingPurchaseInvest) *PurchaseStakingService
func (*Client) NewRedeemEthStakingService ¶
func (c *Client) NewRedeemEthStakingService(amt decimal.Decimal) *RedeemEthStakingService
func (*Client) NewRedeemSolStakingService ¶
func (c *Client) NewRedeemSolStakingService(amt decimal.Decimal) *RedeemSolStakingService
func (*Client) NewRedeemStakingService ¶
func (c *Client) NewRedeemStakingService(ordId string, protocolType StakingProtocolType) *RedeemStakingService
func (*Client) NewResetMMPService ¶
func (c *Client) NewResetMMPService(instFamily string) *ResetMMPService
func (*Client) NewResetRfqMmpService ¶
func (c *Client) NewResetRfqMmpService() *ResetRfqMmpService
func (*Client) NewSetAccountLevelService ¶
func (c *Client) NewSetAccountLevelService(acctLv string) *SetAccountLevelService
func (*Client) NewSetAutoLoanService ¶
func (c *Client) NewSetAutoLoanService(autoLoan bool) *SetAutoLoanService
func (*Client) NewSetAutoRepayService ¶
func (c *Client) NewSetAutoRepayService(autoRepay bool) *SetAutoRepayService
func (*Client) NewSetBorrowRepayService ¶
func (c *Client) NewSetBorrowRepayService(ccy string, side BorrowRepayType, amt decimal.Decimal) *SetBorrowRepayService
func (*Client) NewSetCollateralAssetsService ¶
func (c *Client) NewSetCollateralAssetsService(typ CollateralAssetType, collateralEnabled bool) *SetCollateralAssetsService
func (*Client) NewSetCopyLeverageService ¶
func (c *Client) NewSetCopyLeverageService(mgnMode MgnMode, lever decimal.Decimal) *SetCopyLeverageService
func (*Client) NewSetGreeksService ¶
func (c *Client) NewSetGreeksService(greeksType GreeksType) *SetGreeksService
func (*Client) NewSetIsolatedModeService ¶
func (c *Client) NewSetIsolatedModeService(isoMode IsoMode, typ IsoModeType) *SetIsolatedModeService
func (*Client) NewSetLeverageService ¶
func (c *Client) NewSetLeverageService(lever string, mgnMode MgnMode) *SetLeverageService
func (*Client) NewSetMMPConfigService ¶
func (c *Client) NewSetMMPConfigService(instFamily, timeInterval, frozenInterval, qtyLimit string) *SetMMPConfigService
func (*Client) NewSetMarginBalanceService ¶
func (c *Client) NewSetMarginBalanceService(instId string, posSide PosSide, typ MarginBalanceType, amt string) *SetMarginBalanceService
func (*Client) NewSetOKUSDRedeemService ¶ added in v0.20260703.0
func (c *Client) NewSetOKUSDRedeemService(amt decimal.Decimal, redeemType OKUSDRedeemType) *SetOKUSDRedeemService
func (*Client) NewSetOKUSDSubscribeService ¶ added in v0.20260703.0
func (c *Client) NewSetOKUSDSubscribeService(amt decimal.Decimal) *SetOKUSDSubscribeService
func (*Client) NewSetPositionModeService ¶
func (c *Client) NewSetPositionModeService(posMode PosMode) *SetPositionModeService
func (*Client) NewSetRfqMakerInstrumentSettingsService ¶
func (c *Client) NewSetRfqMakerInstrumentSettingsService(settings []RfqMakerInstrumentSetting) *SetRfqMakerInstrumentSettingsService
func (*Client) NewSetRfqMmpService ¶
func (c *Client) NewSetRfqMmpService(timeInterval, frozenInterval, countLimit int) *SetRfqMmpService
func (*Client) NewSetRfqQuoteProductsService ¶
func (c *Client) NewSetRfqQuoteProductsService(products []RfqQuoteProduct) *SetRfqQuoteProductsService
func (*Client) NewSetSavingsLendingRateService ¶
func (c *Client) NewSetSavingsLendingRateService(ccy string, rate decimal.Decimal) *SetSavingsLendingRateService
func (*Client) NewSetSavingsPurchaseRedemptionService ¶
func (c *Client) NewSetSavingsPurchaseRedemptionService(ccy string, amt decimal.Decimal, side SavingsSide) *SetSavingsPurchaseRedemptionService
func (*Client) NewSetSpotManualBorrowRepayService ¶
func (c *Client) NewSetSpotManualBorrowRepayService(ccy string, side BorrowRepayType, amt decimal.Decimal) *SetSpotManualBorrowRepayService
func (*Client) NewSetSubAccountTransferOutService ¶
func (c *Client) NewSetSubAccountTransferOutService(subAcct string, canTransOut bool) *SetSubAccountTransferOutService
func (*Client) NewSprdCancelAllAfterService ¶
func (c *Client) NewSprdCancelAllAfterService(timeOut int) *SprdCancelAllAfterService
func (*Client) NewSprdMassCancelOrdersService ¶
func (c *Client) NewSprdMassCancelOrdersService() *SprdMassCancelOrdersService
func (*Client) NewStopCopyCopyTradingService ¶
func (c *Client) NewStopCopyCopyTradingService(uniqueCode, subPosCloseType string) *StopCopyCopyTradingService
func (*Client) NewStopCopyLeadTradingService ¶
func (c *Client) NewStopCopyLeadTradingService() *StopCopyLeadTradingService
func (*Client) NewStopGridAlgoOrderService ¶
func (c *Client) NewStopGridAlgoOrderService(items []GridStopArg) *StopGridAlgoOrderService
func (*Client) NewStopRecurringOrderService ¶
func (c *Client) NewStopRecurringOrderService(algoIds []string) *StopRecurringOrderService
func (*Client) NewSubAccountTransferService ¶
func (c *Client) NewSubAccountTransferService(ccy string, amt decimal.Decimal, froms, to, fromSubAccount, toSubAccount string) *SubAccountTransferService
NewSubAccountTransferService builds the transfer. froms/to are the source/dest account types ("6" funding, "18" trading); fromSubAccount/toSubAccount are the sub-account names.
func (*Client) NewTradeOneClickRepayService ¶
func (c *Client) NewTradeOneClickRepayService(debtCcy []string, repayCcy string) *TradeOneClickRepayService
NewTradeOneClickRepayService starts a one-click repay. debtCcy is the list of debt currencies (max 5); repayCcy is the single currency used to repay.
func (*Client) NewTradeOneClickRepayV2Service ¶
func (c *Client) NewTradeOneClickRepayV2Service(debtCcy string, repayCcyList []string) *TradeOneClickRepayV2Service
NewTradeOneClickRepayV2Service starts a one-click repay (v2). debtCcy is the single debt currency; repayCcyList is the prioritized list of currencies used to repay it.
func (*Client) NewWithdrawGridIncomeService ¶
func (c *Client) NewWithdrawGridIncomeService(algoId string) *WithdrawGridIncomeService
func (*Client) NewWithdrawalService ¶
func (c *Client) NewWithdrawalService(ccy string, amt decimal.Decimal, dest, toAddr string) *WithdrawalService
NewWithdrawalService builds a withdrawal. ccy is the currency, amt the amount, dest the destination ("3" internal, "4" on-chain), toAddr the recipient address (suffix ":tag" / ":memo" when required).
func (*Client) SyncServerTime ¶
SyncServerTime measures the client/server clock offset and stores it so that signed requests carry a timestamp the server accepts. OKX rejects requests whose OK-ACCESS-TIMESTAMP drifts more than 30s from its own clock, so call this once at startup (and periodically for long-lived processes).
type CloseCopySubpositionService ¶
type CloseCopySubpositionService struct {
// contains filtered or unexported fields
}
CloseCopySubpositionService -- POST /api/v5/copytrading/close-subposition (Trade)
Market-closes a lead trader's open sub-position.
func (*CloseCopySubpositionService) Do ¶
func (s *CloseCopySubpositionService) Do(ctx context.Context) (*CopySubPosAck, error)
type CloseGridPositionService ¶
type CloseGridPositionService struct {
// contains filtered or unexported fields
}
CloseGridPositionService -- POST /api/v5/tradingBot/grid/close-position (Trade)
Closes the position of a stopped contract grid (market or limit). IMPLEMENT-ONLY.
func (*CloseGridPositionService) Do ¶
func (s *CloseGridPositionService) Do(ctx context.Context) (*GridClosePositionResult, error)
func (*CloseGridPositionService) SetPx ¶
func (s *CloseGridPositionService) SetPx(px decimal.Decimal) *CloseGridPositionService
SetPx sets the close price (required when mktClose is false).
func (*CloseGridPositionService) SetSz ¶
func (s *CloseGridPositionService) SetSz(sz decimal.Decimal) *CloseGridPositionService
SetSz sets the quantity to close (required when mktClose is false).
type ClosePositionResult ¶
type ClosePositionResult struct {
InstrumentID string `json:"instId"`
PositionSide PosSide `json:"posSide"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
}
ClosePositionResult is the ack returned by the close-position endpoint.
type ClosePositionService ¶
type ClosePositionService struct {
// contains filtered or unexported fields
}
ClosePositionService -- POST /api/v5/trade/close-position (Trade)
Market-closes the position of an instrument under the given margin mode.
func (*ClosePositionService) Do ¶
func (s *ClosePositionService) Do(ctx context.Context) (*ClosePositionResult, error)
func (*ClosePositionService) SetAutoCxl ¶
func (s *ClosePositionService) SetAutoCxl(autoCxl bool) *ClosePositionService
SetAutoCxl cancels pending orders that would prevent the close.
func (*ClosePositionService) SetCcy ¶
func (s *ClosePositionService) SetCcy(ccy string) *ClosePositionService
SetCcy sets the margin currency (single-currency margin cross only).
func (*ClosePositionService) SetClOrdId ¶
func (s *ClosePositionService) SetClOrdId(clOrdId string) *ClosePositionService
SetClOrdId sets the client-supplied order id.
func (*ClosePositionService) SetPosSide ¶
func (s *ClosePositionService) SetPosSide(posSide PosSide) *ClosePositionService
SetPosSide sets the position side (long/short; required in long/short mode).
func (*ClosePositionService) SetTag ¶
func (s *ClosePositionService) SetTag(tag string) *ClosePositionService
SetTag sets the order tag.
type CollateralAsset ¶
type CollateralAsset struct {
Currency string `json:"ccy"`
CollateralEnabled bool `json:"collateralEnabled"`
}
CollateralAsset is a currency's collateral-enabled state.
type CollateralAssetType ¶
type CollateralAssetType string
CollateralAssetType selects whether a set-collateral-assets request applies to all currencies or to a custom currency list.
const ( CollateralAssetTypeAll CollateralAssetType = "all" CollateralAssetTypeCustom CollateralAssetType = "custom" )
type CollateralAssetsSetting ¶
type CollateralAssetsSetting struct {
Type CollateralAssetType `json:"type"`
CollateralEnabled bool `json:"collateralEnabled"`
CurrencyList []string `json:"ccyList"`
}
CollateralAssetsSetting is the set-collateral-assets acknowledgement.
type ComputeGridMarginBalanceService ¶
type ComputeGridMarginBalanceService struct {
// contains filtered or unexported fields
}
ComputeGridMarginBalanceService -- POST /api/v5/tradingBot/grid/compute-margin-balance (Trade)
Estimates the impact of adding/reducing the margin of a contract grid. IMPLEMENT-ONLY.
func (*ComputeGridMarginBalanceService) Do ¶
func (s *ComputeGridMarginBalanceService) Do(ctx context.Context) (*GridComputeMarginBalance, error)
func (*ComputeGridMarginBalanceService) SetAmt ¶
func (s *ComputeGridMarginBalanceService) SetAmt(amt decimal.Decimal) *ComputeGridMarginBalanceService
SetAmt sets the margin amount to add/reduce.
type ConvertContractCoin ¶
type ConvertContractCoin struct {
Type string `json:"type"`
InstrumentID string `json:"instId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
Unit string `json:"unit"`
}
ConvertContractCoin is the result of a contract/coin conversion.
type ConvertCurrency ¶
type ConvertCurrency struct {
Currency string `json:"ccy"`
Min decimal.Decimal `json:"min"`
Max decimal.Decimal `json:"max"`
}
ConvertCurrency is a single convertible currency and its conversion bounds.
type ConvertCurrencyPair ¶
type ConvertCurrencyPair struct {
InstrumentID string `json:"instId"`
BaseCurrency string `json:"baseCcy"`
BaseCurrencyMax decimal.Decimal `json:"baseCcyMax"`
BaseCurrencyMin decimal.Decimal `json:"baseCcyMin"`
QuoteCurrency string `json:"quoteCcy"`
QuoteCurrencyMax decimal.Decimal `json:"quoteCcyMax"`
QuoteCurrencyMin decimal.Decimal `json:"quoteCcyMin"`
}
ConvertCurrencyPair is a convert pair and its base/quote size limits.
type ConvertEstimateQuote ¶
type ConvertEstimateQuote struct {
QuoteID string `json:"quoteId"`
ClientQuoteRequestID string `json:"clQReqId"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
Side Side `json:"side"`
OriginalRFQSize decimal.Decimal `json:"origRfqSz"`
RFQSize decimal.Decimal `json:"rfqSz"`
RFQSizeCurrency string `json:"rfqSzCcy"`
ConvertedPrice decimal.Decimal `json:"cnvtPx"`
BaseSize decimal.Decimal `json:"baseSz"`
QuoteSize decimal.Decimal `json:"quoteSz"`
TTLMilliseconds decimal.Decimal `json:"ttlMs"`
QuoteTime time.Time `json:"quoteTime"`
}
ConvertEstimateQuote is the binding quote returned by estimate-quote.
type ConvertEstimateQuoteService ¶
type ConvertEstimateQuoteService struct {
// contains filtered or unexported fields
}
ConvertEstimateQuoteService -- POST /api/v5/asset/convert/estimate-quote (Trade)
Requests a binding conversion quote (returns a quoteId valid for a short window) for a base/quote currency and side.
State-changing: NOT exercised by the test suite.
func (*ConvertEstimateQuoteService) Do ¶
func (s *ConvertEstimateQuoteService) Do(ctx context.Context) (*ConvertEstimateQuote, error)
func (*ConvertEstimateQuoteService) SetClQReqId ¶
func (s *ConvertEstimateQuoteService) SetClQReqId(clQReqId string) *ConvertEstimateQuoteService
SetClQReqId sets the client-supplied quote-request id (used for idempotency).
func (*ConvertEstimateQuoteService) SetTag ¶
func (s *ConvertEstimateQuoteService) SetTag(tag string) *ConvertEstimateQuoteService
SetTag sets the order tag (broker id).
type ConvertHistory ¶
type ConvertHistory struct {
InstrumentID string `json:"instId"`
Side Side `json:"side"`
FillPrice decimal.Decimal `json:"fillPx"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
FillBaseSize decimal.Decimal `json:"fillBaseSz"`
FillQuoteSize decimal.Decimal `json:"fillQuoteSz"`
State convertState `json:"state"`
TradeID string `json:"tradeId"`
Timestamp time.Time `json:"ts"`
}
ConvertHistory is a single past conversion record.
type ConvertSource ¶
type ConvertSource string
ConvertSource selects the funding source for an easy-convert order: "1" (trading account) or "2" (funding account).
const ( ConvertSourceTrading ConvertSource = "1" ConvertSourceFunding ConvertSource = "2" )
type ConvertStatus ¶
type ConvertStatus string
ConvertStatus is the lifecycle state of an easy-convert / one-click-repay job.
const ( ConvertStatusRunning ConvertStatus = "running" ConvertStatusFilled ConvertStatus = "filled" ConvertStatusFailed ConvertStatus = "failed" )
type ConvertTrade ¶
type ConvertTrade struct {
TradeID string `json:"tradeId"`
QuoteID string `json:"quoteId"`
ClientTradeRequestID string `json:"clTReqId"`
State convertState `json:"state"`
InstrumentID string `json:"instId"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
Side Side `json:"side"`
FillPrice decimal.Decimal `json:"fillPx"`
FillBaseSize decimal.Decimal `json:"fillBaseSz"`
FillQuoteSize decimal.Decimal `json:"fillQuoteSz"`
Timestamp time.Time `json:"ts"`
}
ConvertTrade is the result of an executed conversion.
type ConvertTradeService ¶
type ConvertTradeService struct {
// contains filtered or unexported fields
}
ConvertTradeService -- POST /api/v5/asset/convert/trade (Trade)
Executes a conversion against a quoteId previously obtained from estimate-quote.
State-changing: NOT exercised by the test suite.
func (*ConvertTradeService) Do ¶
func (s *ConvertTradeService) Do(ctx context.Context) (*ConvertTrade, error)
func (*ConvertTradeService) SetClTReqId ¶
func (s *ConvertTradeService) SetClTReqId(clTReqId string) *ConvertTradeService
SetClTReqId sets the client-supplied trade-request id (used for idempotency).
func (*ConvertTradeService) SetTag ¶
func (s *ConvertTradeService) SetTag(tag string) *ConvertTradeService
SetTag sets the order tag (broker id).
type CopyBatchLeverageInfo ¶
type CopyBatchLeverageInfo struct {
InstrumentID string `json:"instId"`
MarginMode MgnMode `json:"mgnMode"`
Leverage decimal.Decimal `json:"lever"`
PositionSide PosSide `json:"posSide"`
}
CopyBatchLeverageInfo is a lead trader's leverage for an instrument. The validating account is not on the copy-trading allowlist (code 59263), so the field set is modeled from the OKX doc field table.
type CopyConfig ¶
type CopyConfig struct {
NickName string `json:"nickName"`
PortLink string `json:"portLink"`
Roles []string `json:"roles"`
CopyState CopyState `json:"copyState"`
LeadState CopyState `json:"leadState"`
UniqueCode string `json:"uniqueCode"`
}
CopyConfig is the account's copy-trading role configuration. The validating account has neither led nor copied any trades (the endpoint returns code 59285), so the field set is modeled from the OKX doc field table.
type CopyInstrument ¶
CopyInstrument is one lead-tradable instrument and its enabled flag.
type CopyLeadTrader ¶
type CopyLeadTrader struct {
UniqueCode string `json:"uniqueCode"`
NickName string `json:"nickName"`
PortLink string `json:"portLink"`
Currency string `json:"ccy"`
ChannelType string `json:"chanType"`
CopyState CopyState `json:"copyState"`
AUM decimal.Decimal `json:"aum"`
Pnl decimal.Decimal `json:"pnl"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
WinRatio decimal.Decimal `json:"winRatio"`
LeadDays decimal.Decimal `json:"leadDays"`
CopyTraderNumber decimal.Decimal `json:"copyTraderNum"`
MaxCopyTraderNumber decimal.Decimal `json:"maxCopyTraderNum"`
AccumulatedCopyTraderNumber decimal.Decimal `json:"accCopyTraderNum"`
TraderInstruments []string `json:"traderInsts"`
PnlRatios []CopyLeadTraderPnlRatio `json:"pnlRatios"`
}
CopyLeadTrader is one lead trader's ranking row. chanType is only present in the signed lead-traders response.
type CopyLeadTraderPnlRatio ¶
type CopyLeadTraderPnlRatio struct {
BeginTimestamp time.Time `json:"beginTs"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
}
CopyLeadTraderPnlRatio is a single dated pnl-ratio point in a lead trader's history curve.
type CopyLeadTradersPage ¶
type CopyLeadTradersPage struct {
DataVersion string `json:"dataVer"`
TotalPage decimal.Decimal `json:"totalPage"`
Ranks []CopyLeadTrader `json:"ranks"`
}
CopyLeadTradersPage is one page of the lead-trader ranking.
type CopyProfitSharingDetail ¶
type CopyProfitSharingDetail struct {
InstrumentType InstType `json:"instType"`
Currency string `json:"ccy"`
NickName string `json:"nickName"`
ProfitSharingAmount decimal.Decimal `json:"profitSharingAmt"`
ProfitSharingID string `json:"profitSharingId"`
Timestamp time.Time `json:"ts"`
}
CopyProfitSharingDetail is one profit-sharing record. The validating account has not led any trades (the endpoint returns an empty array), so the field set is modeled from the OKX doc field table.
type CopyPublicConfig ¶
type CopyPublicConfig struct {
MaxCopyAmount decimal.Decimal `json:"maxCopyAmt"`
MinCopyAmount decimal.Decimal `json:"minCopyAmt"`
MaxCopyTotalAmount decimal.Decimal `json:"maxCopyTotalAmt"`
MaxCopyRatio decimal.Decimal `json:"maxCopyRatio"`
MinCopyRatio decimal.Decimal `json:"minCopyRatio"`
MaxTakeProfitRatio decimal.Decimal `json:"maxTpRatio"`
MaxStopLossRatio decimal.Decimal `json:"maxSlRatio"`
}
CopyPublicConfig is the platform-wide copy-trading configuration.
type CopyResult ¶
type CopyResult struct {
Result bool `json:"result"`
}
CopyResult is the generic ack for the copy/lead settings POST endpoints.
type CopySettings ¶
type CopySettings struct {
Currency string `json:"ccy"`
CopyAmount decimal.Decimal `json:"copyAmt"`
CopyTotalAmount decimal.Decimal `json:"copyTotalAmt"`
CopyInstrumentIDType string `json:"copyInstIdType"`
CopyMarginMode string `json:"copyMgnMode"`
CopyMode string `json:"copyMode"`
CopyRatio decimal.Decimal `json:"copyRatio"`
CopyState CopyState `json:"copyState"`
InstrumentIDs []string `json:"instIds"`
StopLossRatio decimal.Decimal `json:"slRatio"`
StopLossTotalAmount decimal.Decimal `json:"slTotalAmt"`
SubPositionCloseType string `json:"subPosCloseType"`
Tag string `json:"tag"`
TakeProfitRatio decimal.Decimal `json:"tpRatio"`
}
CopySettings is the current account's copy configuration for a lead trader.
type CopySortType ¶
type CopySortType string
CopySortType is the lead-trader ranking sort key (overview/pnl/aum/winRatio/...).
const ( CopySortTypeOverview CopySortType = "overview" CopySortTypePnl CopySortType = "pnl" CopySortTypePnlRatio CopySortType = "pnlRatio" CopySortTypeAum CopySortType = "aum" CopySortTypeWinRatio CopySortType = "winRatio" )
type CopyState ¶
type CopyState string
CopyState is the copy/lead state flag ("0" not copying / "1" copying).
type CopySubPosAck ¶
CopySubPosAck is the acknowledgement for a sub-position lead order/close.
type CopySubPosType ¶
type CopySubPosType string
CopySubPosType is a copy-trading sub-position side selector.
const ( CopySubPosTypeLong CopySubPosType = "long" CopySubPosTypeShort CopySubPosType = "short" )
type CopySubPosition ¶
type CopySubPosition struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
SubPositionID string `json:"subPosId"`
PositionSide PosSide `json:"posSide"`
MarginMode MgnMode `json:"mgnMode"`
Leverage decimal.Decimal `json:"lever"`
OpenOrderID string `json:"openOrdId"`
OpenAveragePrice decimal.Decimal `json:"openAvgPx"`
OpenTime time.Time `json:"openTime"`
SubPosition decimal.Decimal `json:"subPos"`
Currency string `json:"ccy"`
MarkPrice decimal.Decimal `json:"markPx"`
UPL decimal.Decimal `json:"upl"`
UPLRatio decimal.Decimal `json:"uplRatio"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
Margin decimal.Decimal `json:"margin"`
UniqueCode string `json:"uniqueCode"`
AvailableSubPosition decimal.Decimal `json:"availSubPos"`
}
CopySubPosition is a single lead-trader sub-position. The validating account has not led any trades (the endpoint returns an empty array), so the field set is modeled from the OKX doc field table.
type CopySubPositionHistory ¶
type CopySubPositionHistory struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
SubPositionID string `json:"subPosId"`
PositionSide PosSide `json:"posSide"`
MarginMode MgnMode `json:"mgnMode"`
Leverage decimal.Decimal `json:"lever"`
OpenAveragePrice decimal.Decimal `json:"openAvgPx"`
OpenTime time.Time `json:"openTime"`
CloseAveragePrice decimal.Decimal `json:"closeAvgPx"`
CloseTime time.Time `json:"closeTime"`
SubPosition decimal.Decimal `json:"subPos"`
Currency string `json:"ccy"`
Pnl decimal.Decimal `json:"pnl"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
UniqueCode string `json:"uniqueCode"`
Type string `json:"type"`
}
CopySubPositionHistory is a single closed lead-trader sub-position. The validating account has not led any trades (the endpoint returns an empty array), so the field set is modeled from the OKX doc field table.
type CopyTotalProfitSharing ¶
type CopyTotalProfitSharing struct {
InstrumentType InstType `json:"instType"`
Currency string `json:"ccy"`
TotalProfitSharingAmount decimal.Decimal `json:"totalProfitSharingAmt"`
}
CopyTotalProfitSharing is the lead trader's total profit-sharing for a currency.
type CopyTotalUnrealizedProfitSharing ¶
type CopyTotalUnrealizedProfitSharing struct {
InstrumentType InstType `json:"instType"`
Currency string `json:"ccy"`
TotalUnrealizedProfitSharingAmount decimal.Decimal `json:"totalUnrealizedProfitSharingAmt"`
}
CopyTotalUnrealizedProfitSharing is the lead trader's total pending profit-sharing for a currency. The validating account lacks permission for this endpoint (code 50030), so the field set is modeled from the OKX doc field table.
type CopyTrader ¶
type CopyTrader struct {
NickName string `json:"nickName"`
PortLink string `json:"portLink"`
BeginCopyTime time.Time `json:"beginCopyTime"`
Pnl decimal.Decimal `json:"pnl"`
}
CopyTrader is one copier following a lead trader.
type CopyTradersPage ¶
type CopyTradersPage struct {
InstrumentType InstType `json:"instType"`
CopyTotalAmount decimal.Decimal `json:"copyTotalAmt"`
CopyTotalPnl decimal.Decimal `json:"copyTotalPnl"`
Currency string `json:"ccy"`
CopyTraderNumber decimal.Decimal `json:"copyTraderNum"`
CopyTraders []CopyTrader `json:"copyTraders"`
}
CopyTradersPage is the summary plus per-copier list following a lead trader. The validating account is not on the copy-trading allowlist (code 59263), so the field set is modeled from the OKX doc field table.
type CopyUnrealizedProfitSharingDetail ¶
type CopyUnrealizedProfitSharingDetail struct {
InstrumentType InstType `json:"instType"`
Currency string `json:"ccy"`
NickName string `json:"nickName"`
UnrealizedProfitSharingAmount decimal.Decimal `json:"unrealizedProfitSharingAmt"`
}
CopyUnrealizedProfitSharingDetail is one copier's pending profit-sharing. The validating account lacks permission for this endpoint (code 50030), so the field set is modeled from the OKX doc field table.
type CreateRfqQuoteService ¶
type CreateRfqQuoteService struct {
// contains filtered or unexported fields
}
CreateRfqQuoteService -- POST /api/v5/rfq/create-quote (Trade)
Creates a quote against an RFQ as a maker.
func (*CreateRfqQuoteService) Do ¶
func (s *CreateRfqQuoteService) Do(ctx context.Context) (*RfqQuote, error)
func (*CreateRfqQuoteService) SetAnonymous ¶
func (s *CreateRfqQuoteService) SetAnonymous(anonymous bool) *CreateRfqQuoteService
SetAnonymous toggles whether the quote is anonymous.
func (*CreateRfqQuoteService) SetClQuoteId ¶
func (s *CreateRfqQuoteService) SetClQuoteId(clQuoteId string) *CreateRfqQuoteService
SetClQuoteId sets a client-supplied quote id.
func (*CreateRfqQuoteService) SetExpiresIn ¶
func (s *CreateRfqQuoteService) SetExpiresIn(seconds int) *CreateRfqQuoteService
SetExpiresIn sets the quote validity window in seconds.
func (*CreateRfqQuoteService) SetTag ¶
func (s *CreateRfqQuoteService) SetTag(tag string) *CreateRfqQuoteService
SetTag sets an order tag for the quote.
type CreateRfqService ¶
type CreateRfqService struct {
// contains filtered or unexported fields
}
CreateRfqService -- POST /api/v5/rfq/create-rfq (Trade)
Creates an RFQ as a taker and broadcasts it to the chosen counterparties.
func (*CreateRfqService) SetAllowPartialExecution ¶
func (s *CreateRfqService) SetAllowPartialExecution(allow bool) *CreateRfqService
SetAllowPartialExecution toggles whether partial execution is allowed.
func (*CreateRfqService) SetClRfqId ¶
func (s *CreateRfqService) SetClRfqId(clRfqId string) *CreateRfqService
SetClRfqId sets a client-supplied RFQ id.
func (*CreateRfqService) SetTag ¶
func (s *CreateRfqService) SetTag(tag string) *CreateRfqService
SetTag sets an order tag for the RFQ.
type CreateSubAccountApiKeyService ¶
type CreateSubAccountApiKeyService struct {
// contains filtered or unexported fields
}
CreateSubAccountApiKeyService -- POST /api/v5/users/subaccount/apikey (Trade)
Creates an API key for a sub-account (master account). Implement-only: never executed by the live test suite.
func (*CreateSubAccountApiKeyService) Do ¶
func (s *CreateSubAccountApiKeyService) Do(ctx context.Context) (*SubAccountApiKey, error)
func (*CreateSubAccountApiKeyService) SetIP ¶
func (s *CreateSubAccountApiKeyService) SetIP(ip string) *CreateSubAccountApiKeyService
SetIP sets the IP allow-list (comma-separated, up to 20 addresses).
func (*CreateSubAccountApiKeyService) SetPerm ¶
func (s *CreateSubAccountApiKeyService) SetPerm(perm string) *CreateSubAccountApiKeyService
SetPerm sets the API key permissions (comma-separated: read_only, trade).
type Currency ¶
type Currency struct {
Currency string `json:"ccy"`
Name string `json:"name"`
LogoLink string `json:"logoLink"`
Chain string `json:"chain"`
CanDeposit bool `json:"canDep"`
CanWithdrawal bool `json:"canWd"`
CanInternal bool `json:"canInternal"`
MinDeposit decimal.Decimal `json:"minDep"`
MinWithdrawal decimal.Decimal `json:"minWd"`
MaxWithdrawal decimal.Decimal `json:"maxWd"`
WithdrawalTickSize decimal.Decimal `json:"wdTickSz"`
WithdrawalQuota decimal.Decimal `json:"wdQuota"`
UsedWithdrawalQuota decimal.Decimal `json:"usedWdQuota"`
Fee decimal.Decimal `json:"fee"`
MinFee decimal.Decimal `json:"minFee"`
MaxFee decimal.Decimal `json:"maxFee"`
MinFeeForContractAddress decimal.Decimal `json:"minFeeForCtAddr"`
MaxFeeForContractAddress decimal.Decimal `json:"maxFeeForCtAddr"`
BurningFeeRate decimal.Decimal `json:"burningFeeRate"`
MinInternal decimal.Decimal `json:"minInternal"`
MinDepositArrivalConfirm decimal.Decimal `json:"minDepArrivalConfirm"`
MinWithdrawalUnlockConfirm decimal.Decimal `json:"minWdUnlockConfirm"`
MainNet bool `json:"mainNet"`
NeedTag bool `json:"needTag"`
ContractAddress string `json:"ctAddr"`
DepositEstimatedOpenTime time.Time `json:"depEstOpenTime"`
WithdrawalEstimatedOpenTime time.Time `json:"wdEstOpenTime"`
DepositQuotaFixed decimal.Decimal `json:"depQuotaFixed"`
UsedDepositQuotaFixed decimal.Decimal `json:"usedDepQuotaFixed"`
DepositQuoteDailyLayer2 decimal.Decimal `json:"depQuoteDailyLayer2"`
StablecoinDailyQuota decimal.Decimal `json:"stablecoinDailyQuota"`
StablecoinMonthlyQuota decimal.Decimal `json:"stablecoinMonthlyQuota"`
UsedStablecoinDailyQuota decimal.Decimal `json:"usedStablecoinDailyQuota"`
UsedStablecoinMonthlyQuota decimal.Decimal `json:"usedStablecoinMonthlyQuota"`
}
Currency is a single currency-on-chain entry and its deposit/withdrawal rules.
type DebtType ¶
type DebtType string
DebtType selects whether a one-click-repay currency list reports cross or isolated debt.
type DeleteSubAccountApiKeyService ¶
type DeleteSubAccountApiKeyService struct {
// contains filtered or unexported fields
}
DeleteSubAccountApiKeyService -- POST /api/v5/users/subaccount/delete-apikey (Trade)
Deletes a sub-account API key (master account). Implement-only: never executed by the live test suite.
func (*DeleteSubAccountApiKeyService) Do ¶
func (s *DeleteSubAccountApiKeyService) Do(ctx context.Context) (*SubAccountApiKey, error)
type DeliveryExerciseHistory ¶
type DeliveryExerciseHistory struct {
Timestamp time.Time `json:"ts"`
Details []DeliveryExerciseHistoryDetail `json:"details"`
}
DeliveryExerciseHistory is one delivery/exercise event and its per-instrument details.
type DeliveryExerciseHistoryDetail ¶
type DeliveryExerciseHistoryDetail struct {
InstrumentID string `json:"insId"`
Price decimal.Decimal `json:"px"`
Type string `json:"type"`
}
DeliveryExerciseHistoryDetail is a single instrument's delivery/exercise record.
type DepositAddress ¶
type DepositAddress struct {
Address string `json:"addr"`
Tag string `json:"tag"`
Memo string `json:"memo"`
PaymentID string `json:"pmtId"`
AddrEx any `json:"addrEx"`
Currency string `json:"ccy"`
Chain string `json:"chain"`
To AssetAcctType `json:"to"`
Selected bool `json:"selected"`
ContractAddress string `json:"ctAddr"`
VerifiedName string `json:"verifiedName"`
}
DepositAddress is a single deposit address for a currency on a chain.
type DepositHistory ¶
type DepositHistory struct {
Currency string `json:"ccy"`
Chain string `json:"chain"`
Amount decimal.Decimal `json:"amt"`
From string `json:"from"`
AreaCodeFrom string `json:"areaCodeFrom"`
To string `json:"to"`
TransactionID string `json:"txId"`
DepositID string `json:"depId"`
FromWithdrawalID string `json:"fromWdId"`
State string `json:"state"`
ActualDepositBlockConfirm decimal.Decimal `json:"actualDepBlkConfirm"`
Timestamp time.Time `json:"ts"`
}
DepositHistory is one deposit record.
type DepositWithdrawStatus ¶
type DepositWithdrawStatus struct {
WithdrawalID string `json:"wdId"`
TransactionID string `json:"txId"`
State string `json:"state"`
EstimatedCompleteTime time.Time `json:"estCompleteTime"`
}
DepositWithdrawStatus is the on-chain progress of a deposit/withdrawal.
type DiscountRateInterestFreeQuota ¶
type DiscountRateInterestFreeQuota struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
DiscountLevel string `json:"discountLv"`
MinDiscountRate decimal.Decimal `json:"minDiscountRate"`
CollateralRestrict bool `json:"collateralRestrict"`
ColRes string `json:"colRes"`
Details []DiscountRateTier `json:"details"`
}
DiscountRateInterestFreeQuota is a currency's interest-free quota and its tiered discount-rate schedule.
type DiscountRateTier ¶
type DiscountRateTier struct {
DiscountRate decimal.Decimal `json:"discountRate"`
LiquidationPenaltyRate decimal.Decimal `json:"liqPenaltyRate"`
DiscountCurrencyEquity decimal.Decimal `json:"disCcyEq"`
MinAmount decimal.Decimal `json:"minAmt"`
MaxAmount decimal.Decimal `json:"maxAmt"`
Tier string `json:"tier"`
}
DiscountRateTier is one tier of a currency's discount-rate schedule.
type EasyConvertCurrencyList ¶
type EasyConvertCurrencyList struct {
FromData []EasyConvertFromCcy `json:"fromData"`
ToCurrency []string `json:"toCcy"`
}
EasyConvertCurrencyList is the set of convertible dust currencies and the mainstream currencies they can be converted into.
type EasyConvertFromCcy ¶
type EasyConvertFromCcy struct {
FromCurrency string `json:"fromCcy"`
FromAmount decimal.Decimal `json:"fromAmt"`
}
EasyConvertFromCcy is a single dust currency and its convertible balance.
type EasyConvertHistory ¶
type EasyConvertHistory struct {
FromCurrency string `json:"fromCcy"`
FillFromSize decimal.Decimal `json:"fillFromSz"`
ToCurrency string `json:"toCcy"`
FillToSize decimal.Decimal `json:"fillToSz"`
Account string `json:"acct"`
Status ConvertStatus `json:"status"`
UpdateTime time.Time `json:"uTime"`
}
EasyConvertHistory is a single past easy-convert order.
type EasyConvertResult ¶
type EasyConvertResult struct {
Status ConvertStatus `json:"status"`
FromCurrency string `json:"fromCcy"`
ToCurrency string `json:"toCcy"`
FillFromSize decimal.Decimal `json:"fillFromSz"`
FillToSize decimal.Decimal `json:"fillToSz"`
UpdateTime time.Time `json:"uTime"`
}
EasyConvertResult is the acknowledgement for an easy-convert order.
type EconomicCalendar ¶
type EconomicCalendar struct {
CalendarID string `json:"calendarId"`
Date time.Time `json:"date"`
Region string `json:"region"`
Category string `json:"category"`
Event string `json:"event"`
ReferenceDate time.Time `json:"refDate"`
Actual string `json:"actual"`
Previous string `json:"previous"`
Forecast string `json:"forecast"`
DateSpan string `json:"dateSpan"`
Importance EconomicCalendarImportance `json:"importance"`
UpdateTime time.Time `json:"uTime"`
PreviousInitial string `json:"prevInitial"`
Currency string `json:"ccy"`
Unit string `json:"unit"`
}
EconomicCalendar is one macro-economic calendar event. The numeric-looking fields (actual, previous, forecast, prevInitial) are kept as strings because OKX returns them with trailing units/symbols (e.g. "2.4%", "1.2K", "-").
type EconomicCalendarImportance ¶
type EconomicCalendarImportance string
EconomicCalendarImportance is the market-impact rating of a calendar event.
const ( EconomicCalendarImportanceLow EconomicCalendarImportance = "1" EconomicCalendarImportanceMedium EconomicCalendarImportance = "2" EconomicCalendarImportanceHigh EconomicCalendarImportance = "3" )
type EntrustSubAccount ¶
type EntrustSubAccount struct {
SubAccount string `json:"subAcct"`
}
EntrustSubAccount is one custody (entrusted) trading sub-account.
type EstimatedPrice ¶
type EstimatedPrice struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
SettlePrice decimal.Decimal `json:"settlePx"`
Timestamp time.Time `json:"ts"`
}
EstimatedPrice is the estimated delivery/exercise price of an instrument.
type EthStakingAck ¶
type EthStakingAck struct{}
EthStakingAck is the (empty) acknowledgement returned by ETH purchase/redeem.
type EthStakingBalance ¶
type EthStakingBalance struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
LatestInterestAccrual decimal.Decimal `json:"latestInterestAccrual"`
TotalInterestAccrual decimal.Decimal `json:"totalInterestAccrual"`
Timestamp time.Time `json:"ts"`
}
EthStakingBalance is the BETH balance and accrued interest.
type EthStakingHistory ¶
type EthStakingHistory struct {
Type string `json:"type"`
Amount decimal.Decimal `json:"amt"`
Status string `json:"status"`
RequestTime time.Time `json:"requestTime"`
CompletedTime time.Time `json:"completedTime"`
EstimatedCompletedTime time.Time `json:"estCompletedTime"`
}
EthStakingHistory is one ETH staking purchase/redemption record. The validating account has no ETH staking history, so the field set is modeled from the OKX doc field table.
type EthStakingProductInfo ¶
type EthStakingProductInfo struct {
FastRedemptionDailyLimit decimal.Decimal `json:"fastRedemptionDailyLimit"`
MinAmount decimal.Decimal `json:"minAmt"`
Rate decimal.Decimal `json:"rate"`
RedemptionDays decimal.Decimal `json:"redemptDays"`
}
EthStakingProductInfo is the ETH staking product configuration.
type ExchangeRate ¶
ExchangeRate is the USD-CNY reference exchange rate.
type ExecuteQuoteService ¶
type ExecuteQuoteService struct {
// contains filtered or unexported fields
}
ExecuteQuoteService -- POST /api/v5/rfq/execute-quote (Trade)
Executes (accepts) a maker's quote as the taker, producing a block trade.
func (*ExecuteQuoteService) Do ¶
func (s *ExecuteQuoteService) Do(ctx context.Context) (*RfqTrade, error)
func (*ExecuteQuoteService) SetLegs ¶
func (s *ExecuteQuoteService) SetLegs(legs []RfqExecuteLeg) *ExecuteQuoteService
SetLegs restricts execution to a subset of legs (partial execution).
type Fill ¶
type Fill struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
TradeID string `json:"tradeId"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
BillID string `json:"billId"`
SubType string `json:"subType"`
Tag string `json:"tag"`
FillPrice decimal.Decimal `json:"fillPx"`
FillSize decimal.Decimal `json:"fillSz"`
FillIndexPrice decimal.Decimal `json:"fillIdxPx"`
FillPnl decimal.Decimal `json:"fillPnl"`
FillPriceVolatility decimal.Decimal `json:"fillPxVol"`
FillPriceUSD decimal.Decimal `json:"fillPxUsd"`
FillMarkVolatility decimal.Decimal `json:"fillMarkVol"`
FillForwardPrice decimal.Decimal `json:"fillFwdPx"`
FillMarkPrice decimal.Decimal `json:"fillMarkPx"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
ExecutionType ExecType `json:"execType"`
FeeCurrency string `json:"feeCcy"`
Fee decimal.Decimal `json:"fee"`
TradeQuoteCurrency string `json:"tradeQuoteCcy"`
Timestamp time.Time `json:"ts"`
FillTime time.Time `json:"fillTime"`
}
Fill is one transaction (fill) detail, shared by /api/v5/trade/fills and /api/v5/trade/fills-history.
type FirstCopyCopySettingsService ¶
type FirstCopyCopySettingsService struct {
// contains filtered or unexported fields
}
FirstCopyCopySettingsService -- POST /api/v5/copytrading/first-copy-settings (Trade)
Starts copy-trading a lead trader for the first time, with the given copy configuration.
func (*FirstCopyCopySettingsService) Do ¶
func (s *FirstCopyCopySettingsService) Do(ctx context.Context) (*CopyResult, error)
func (*FirstCopyCopySettingsService) SetCopyAmt ¶
func (s *FirstCopyCopySettingsService) SetCopyAmt(copyAmt decimal.Decimal) *FirstCopyCopySettingsService
SetCopyAmt sets the fixed copy amount per order (copyMode=fixed_amount).
func (*FirstCopyCopySettingsService) SetCopyRatio ¶
func (s *FirstCopyCopySettingsService) SetCopyRatio(copyRatio decimal.Decimal) *FirstCopyCopySettingsService
SetCopyRatio sets the copy ratio (copyMode=ratio_copy).
func (*FirstCopyCopySettingsService) SetCopyTotalAmt ¶
func (s *FirstCopyCopySettingsService) SetCopyTotalAmt(copyTotalAmt decimal.Decimal) *FirstCopyCopySettingsService
SetCopyTotalAmt sets the total amount budgeted for copying.
func (*FirstCopyCopySettingsService) SetInstId ¶
func (s *FirstCopyCopySettingsService) SetInstId(instId string) *FirstCopyCopySettingsService
SetInstId sets the comma-separated instruments to copy (copyInstIdType=custom).
func (*FirstCopyCopySettingsService) SetInstType ¶
func (s *FirstCopyCopySettingsService) SetInstType(instType InstType) *FirstCopyCopySettingsService
SetInstType sets the product line (SWAP).
func (*FirstCopyCopySettingsService) SetSlRatio ¶
func (s *FirstCopyCopySettingsService) SetSlRatio(slRatio decimal.Decimal) *FirstCopyCopySettingsService
SetSlRatio sets the stop-loss ratio.
func (*FirstCopyCopySettingsService) SetSlTotalAmt ¶
func (s *FirstCopyCopySettingsService) SetSlTotalAmt(slTotalAmt decimal.Decimal) *FirstCopyCopySettingsService
SetSlTotalAmt sets the total stop-loss amount.
func (*FirstCopyCopySettingsService) SetTpRatio ¶
func (s *FirstCopyCopySettingsService) SetTpRatio(tpRatio decimal.Decimal) *FirstCopyCopySettingsService
SetTpRatio sets the take-profit ratio.
type FixedLoanAmendLendingOrderAck ¶
type FixedLoanAmendLendingOrderAck struct {
OrderID string `json:"ordId"`
}
FixedLoanAmendLendingOrderAck is the acknowledgement of an amended lending order.
type FixedLoanLendingApyHistory ¶
type FixedLoanLendingApyHistory struct {
Rate decimal.Decimal `json:"rate"`
Timestamp time.Time `json:"ts"`
}
FixedLoanLendingApyHistory is one historical APY data point.
type FixedLoanLendingOffer ¶
type FixedLoanLendingOffer struct {
Currency string `json:"ccy"`
Term string `json:"term"`
Lend decimal.Decimal `json:"lend"`
APY decimal.Decimal `json:"apy"`
EarningCurrency []FixedLoanOfferEarning `json:"earningCcy"`
Details []FixedLoanLendingOfferDetail `json:"details"`
}
FixedLoanLendingOffer is one available fixed-loan lending offer.
type FixedLoanLendingOfferDetail ¶
type FixedLoanLendingOfferDetail struct {
MinLend decimal.Decimal `json:"minLend"`
MaxLend decimal.Decimal `json:"maxLend"`
}
FixedLoanLendingOfferDetail is one min/max amount detail of a lending offer.
type FixedLoanLendingOrder ¶
type FixedLoanLendingOrder struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Term string `json:"term"`
Rate decimal.Decimal `json:"rate"`
EarningCurrency string `json:"earningCcy"`
Earnings decimal.Decimal `json:"earnings"`
State string `json:"state"`
AutoRenewal bool `json:"autoRenewal"`
SettledRate decimal.Decimal `json:"settledRate"`
PendingAmount decimal.Decimal `json:"pendingAmt"`
UsedAmount decimal.Decimal `json:"usedAmt"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
FixedLoanLendingOrder is one fixed-loan lending order.
type FixedLoanLendingOrderAck ¶
type FixedLoanLendingOrderAck struct {
OrderID string `json:"ordId"`
}
FixedLoanLendingOrderAck is the acknowledgement of a placed lending order.
type FixedLoanLendingSubOrder ¶
type FixedLoanLendingSubOrder struct {
OrderID string `json:"ordId"`
SubOrderID string `json:"subOrdId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Term string `json:"term"`
Rate decimal.Decimal `json:"rate"`
EarningCurrency string `json:"earningCcy"`
Earnings decimal.Decimal `json:"earnings"`
State string `json:"state"`
SettledRate decimal.Decimal `json:"settledRate"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
EffectiveTimestamp time.Time `json:"effectiveTs"`
ExpiryTimestamp time.Time `json:"expiryTs"`
}
FixedLoanLendingSubOrder is one sub-order of a fixed-loan lending order.
type FixedLoanOfferEarning ¶
type FixedLoanOfferEarning struct {
EarningCurrency string `json:"earningCcy"`
}
FixedLoanOfferEarning is one earning-currency entry of a lending offer.
type FixedLoanPendingLendingVolume ¶
type FixedLoanPendingLendingVolume struct {
Currency string `json:"ccy"`
Term string `json:"term"`
Amount decimal.Decimal `json:"amt"`
MinRate decimal.Decimal `json:"minRate"`
MaxRate decimal.Decimal `json:"maxRate"`
}
FixedLoanPendingLendingVolume is the pending lending volume for a currency/term.
type FlexLoanAdjustCollateral ¶
type FlexLoanAdjustCollateral struct {
Type FlexLoanAdjustType `json:"type"`
CollateralCurrency string `json:"collateralCcy"`
CollateralAmount decimal.Decimal `json:"collateralAmt"`
}
FlexLoanAdjustCollateral is the acknowledgement of a collateral adjustment.
type FlexLoanAdjustType ¶
type FlexLoanAdjustType string
FlexLoanAdjustType selects whether collateral is added or reduced when adjusting a flexible-loan position.
const ( FlexLoanAdjustTypeAdd FlexLoanAdjustType = "add" FlexLoanAdjustTypeReduce FlexLoanAdjustType = "reduce" )
type FlexLoanBorrowCurrency ¶
type FlexLoanBorrowCurrency struct {
BorrowCurrency string `json:"borrowCcy"`
}
FlexLoanBorrowCurrency is a single borrowable flexible-loan currency.
type FlexLoanCollateralAsset ¶
type FlexLoanCollateralAsset struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
}
FlexLoanCollateralAsset is one asset usable as flexible-loan collateral.
type FlexLoanCollateralAssets ¶
type FlexLoanCollateralAssets struct {
Assets []FlexLoanCollateralAsset `json:"assets"`
}
FlexLoanCollateralAssets wraps the list of collateral assets. The validating account had no eligible collateral (assets is []), so FlexLoanCollateralAsset is modeled from the OKX doc field table.
type FlexLoanHistory ¶
type FlexLoanHistory struct {
ReferenceID string `json:"refId"`
Type string `json:"type"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Timestamp time.Time `json:"ts"`
}
FlexLoanHistory is one flexible-loan event record.
type FlexLoanInfo ¶
type FlexLoanInfo struct {
LiquidationLTV decimal.Decimal `json:"liquidationLTV"`
CurrentLTV decimal.Decimal `json:"curLTV"`
RiskWarningLTV decimal.Decimal `json:"riskWarningLTV"`
InitialLTV decimal.Decimal `json:"initLTV"`
TotalBorrowValueUSD decimal.Decimal `json:"totalBorrowValueUsd"`
TotalCollateralValueUSD decimal.Decimal `json:"totalCollateralValueUsd"`
LoanData []FlexLoanInfoLoan `json:"loanData"`
CollateralData []FlexLoanInfoCollateral `json:"collateralData"`
}
FlexLoanInfo is the account's current flexible-loan position.
type FlexLoanInfoCollateral ¶
type FlexLoanInfoCollateral struct {
CollateralCurrency string `json:"collateralCcy"`
Amount decimal.Decimal `json:"amt"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
}
FlexLoanInfoCollateral is one collateral currency within a flexible-loan position.
type FlexLoanInfoLoan ¶
type FlexLoanInfoLoan struct {
BorrowCurrency string `json:"borrowCcy"`
Amount decimal.Decimal `json:"amt"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
}
FlexLoanInfoLoan is one borrowed currency within a flexible-loan position.
type FlexLoanInterestAccrued ¶
type FlexLoanInterestAccrued struct {
Currency string `json:"ccy"`
Interest decimal.Decimal `json:"interest"`
InterestRate decimal.Decimal `json:"interestRate"`
Timestamp time.Time `json:"ts"`
}
FlexLoanInterestAccrued is one accrued-interest record.
type FlexLoanMaxLoan ¶
type FlexLoanMaxLoan struct {
BorrowCurrency string `json:"borrowCcy"`
MaxLoan decimal.Decimal `json:"maxLoan"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
RemainingQuota decimal.Decimal `json:"remainingQuota"`
}
FlexLoanMaxLoan is the computed max-loan result for a borrow currency.
type FlexLoanSupCollateral ¶
type FlexLoanSupCollateral struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
}
FlexLoanSupCollateral is one supplementary-collateral item passed to the max-loan calculation.
type FundingBalance ¶
type FundingBalance struct {
Currency string `json:"ccy"`
Balance decimal.Decimal `json:"bal"`
FrozenBalance decimal.Decimal `json:"frozenBal"`
AvailableBalance decimal.Decimal `json:"availBal"`
}
FundingBalance is a currency's balance in the funding account.
type FundingRate ¶
type FundingRate struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Method string `json:"method"`
FormulaType string `json:"formulaType"`
FundingRate decimal.Decimal `json:"fundingRate"`
NextFundingRate decimal.Decimal `json:"nextFundingRate"`
FundingTime time.Time `json:"fundingTime"`
NextFundingTime time.Time `json:"nextFundingTime"`
MinFundingRate decimal.Decimal `json:"minFundingRate"`
MaxFundingRate decimal.Decimal `json:"maxFundingRate"`
InterestRate decimal.Decimal `json:"interestRate"`
ImpactValue decimal.Decimal `json:"impactValue"`
SettlementState publicSettState `json:"settState"`
SettlementFundingRate decimal.Decimal `json:"settFundingRate"`
Premium decimal.Decimal `json:"premium"`
PreviousFundingTime time.Time `json:"prevFundingTime"`
Timestamp time.Time `json:"ts"`
}
FundingRate is a perpetual swap's current funding rate.
type FundingRateHistory ¶
type FundingRateHistory struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Method string `json:"method"`
FormulaType string `json:"formulaType"`
FundingRate decimal.Decimal `json:"fundingRate"`
RealizedRate decimal.Decimal `json:"realizedRate"`
FundingTime time.Time `json:"fundingTime"`
}
FundingRateHistory is one realized funding-rate record.
type FundsTransfer ¶
type FundsTransfer struct {
TransferID string `json:"transId"`
ClientID string `json:"clientId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
From AssetAcctType `json:"from"`
To AssetAcctType `json:"to"`
}
FundsTransfer is the acknowledgement of a funds transfer.
type FundsTransferService ¶
type FundsTransferService struct {
// contains filtered or unexported fields
}
FundsTransferService -- POST /api/v5/asset/transfer (private)
Transfers funds between the funding account and the trading account, or between a master account and its sub-accounts. IMPLEMENT-ONLY: this moves real funds and must never be executed by the test suite.
func (*FundsTransferService) Do ¶
func (s *FundsTransferService) Do(ctx context.Context) (*FundsTransfer, error)
func (*FundsTransferService) SetClientId ¶
func (s *FundsTransferService) SetClientId(clientId string) *FundsTransferService
SetClientId sets a client-supplied transfer id.
func (*FundsTransferService) SetLoanTrans ¶
func (s *FundsTransferService) SetLoanTrans(loanTrans bool) *FundsTransferService
SetLoanTrans enables transfer of borrowed funds under Spot mode / Multi-currency margin / Portfolio margin.
func (*FundsTransferService) SetOmitPosRisk ¶
func (s *FundsTransferService) SetOmitPosRisk(omitPosRisk string) *FundsTransferService
SetOmitPosRisk skips the position-risk check (Portfolio margin only).
func (*FundsTransferService) SetSubAcct ¶
func (s *FundsTransferService) SetSubAcct(subAcct string) *FundsTransferService
SetSubAcct sets the sub-account name (required for master<->sub transfers).
func (*FundsTransferService) SetType ¶
func (s *FundsTransferService) SetType(typ AssetTransferType) *FundsTransferService
SetType sets the transfer type (default "0" within own account).
type GLPAccount ¶ added in v0.20260723.0
type GLPAccount struct {
MasterAccountID string `json:"masterAccountId"`
CombinedAccountIDs []string `json:"combinedAccountIds"`
}
GLPAccount identifies the master account and any combined accounts assessed together for GLP.
type GLPCategoryBreakdown ¶ added in v0.20260723.0
type GLPCategoryBreakdown struct {
TypeA GLPMakerTaker `json:"typeA"`
TypeBTotal GLPMakerTaker `json:"typeBTotal"`
TypeBAdj GLPMakerTaker `json:"typeBAdj"`
TradFiX2 GLPMakerTaker `json:"tradfiX2"`
Total GLPMakerTaker `json:"total"`
}
GLPCategoryBreakdown splits a metric (volume or share) by GLP pair-type category, each carrying a maker/taker pair.
type GLPHistoricalPerformance ¶ added in v0.20260723.0
type GLPHistoricalPerformance struct {
Date string `json:"date"`
Volume GLPCategoryBreakdown `json:"volume"`
}
GLPHistoricalPerformance is one day of a program's GLP performance history.
type GLPMakerTaker ¶ added in v0.20260723.0
type GLPMakerTaker struct {
Maker decimal.Decimal `json:"maker"`
Taker decimal.Decimal `json:"taker"`
}
GLPMakerTaker is a maker/taker value pair (decimal-encoded strings).
type GLPPeriodPerf ¶ added in v0.20260723.0
type GLPPeriodPerf struct {
Volume GLPCategoryBreakdown `json:"volume"`
}
GLPPeriodPerf holds a period's volume and share breakdowns.
type GLPProgram ¶ added in v0.20260723.0
type GLPProgram string
GLPProgram selects a GLP (Global Liquidity Program) business line for the historical-performance endpoint.
const ( GLPProgramSpot GLPProgram = "SPOT" GLPProgramPerp GLPProgram = "PERP" GLPProgramFutNto GLPProgram = "FUT_NTO" )
type GLPProgramPerf ¶ added in v0.20260723.0
type GLPProgramPerf struct {
Program string `json:"program"`
MarketMakerBusinessID string `json:"marketMakerBusinessId"`
EnrollmentStatus string `json:"enrollmentStatus"`
MarketMakerLevelID string `json:"marketMakerLevelId"`
EnrolledTierDisplay string `json:"enrolledTierDisplay"`
QualifyingPool string `json:"qualifyingPool"`
QualifyingRows []GLPQualifyingRow `json:"qualifyingRows"`
Daily GLPPeriodPerf `json:"daily"`
MonthToDate GLPPeriodPerf `json:"mtd"`
}
GLPProgramPerf is one enrolled program's daily and month-to-date performance.
type GLPQualifyingRow ¶ added in v0.20260723.0
type GLPQualifyingRow struct {
PairType string `json:"pairType"`
Volume decimal.Decimal `json:"volume"`
}
GLPQualifyingRow is one row of a program's qualifying-pool breakdown. Modeled from the OKX docs; unknown keys decode away.
type GLPTodayPerformance ¶ added in v0.20260723.0
type GLPTodayPerformance struct {
DataReady bool `json:"dataReady"`
DataDate string `json:"dataDate"`
Account GLPAccount `json:"account"`
Programs []GLPProgramPerf `json:"programs"`
}
GLPTodayPerformance is the today / month-to-date GLP snapshot. The validating account is not enrolled in any GLP program, so the field set is modeled from the OKX doc field tables.
type GetAccountConfigService ¶
type GetAccountConfigService struct {
// contains filtered or unexported fields
}
GetAccountConfigService -- GET /api/v5/account/config (Read)
Returns the account's configuration: account level, position mode, fee/greeks settings and related flags.
func (*GetAccountConfigService) Do ¶
func (s *GetAccountConfigService) Do(ctx context.Context) (*AccountConfig, error)
type GetAccountInstrumentsService ¶
type GetAccountInstrumentsService struct {
// contains filtered or unexported fields
}
GetAccountInstrumentsService -- GET /api/v5/account/instruments (Read)
Returns the instruments tradable by the current account for a product line. The shape matches the public instruments endpoint, so it reuses Instrument.
func (*GetAccountInstrumentsService) Do ¶
func (s *GetAccountInstrumentsService) Do(ctx context.Context) ([]Instrument, error)
func (*GetAccountInstrumentsService) SetInstFamily ¶
func (s *GetAccountInstrumentsService) SetInstFamily(instFamily string) *GetAccountInstrumentsService
SetInstFamily filters by instrument family (FUTURES/SWAP/OPTION).
func (*GetAccountInstrumentsService) SetInstId ¶
func (s *GetAccountInstrumentsService) SetInstId(instId string) *GetAccountInstrumentsService
SetInstId filters by a single instrument id.
func (*GetAccountInstrumentsService) SetUly ¶
func (s *GetAccountInstrumentsService) SetUly(uly string) *GetAccountInstrumentsService
SetUly filters by underlying (FUTURES/SWAP/OPTION).
type GetAccountPositionRiskService ¶
type GetAccountPositionRiskService struct {
// contains filtered or unexported fields
}
GetAccountPositionRiskService -- GET /api/v5/account/account-position-risk (Read)
Returns the account- and position-level risk snapshot (equity per currency and per-position notional/quantity) at a single point in time.
func (*GetAccountPositionRiskService) Do ¶
func (s *GetAccountPositionRiskService) Do(ctx context.Context) (*AccountPositionRisk, error)
func (*GetAccountPositionRiskService) SetInstType ¶
func (s *GetAccountPositionRiskService) SetInstType(instType InstType) *GetAccountPositionRiskService
SetInstType filters by product line (MARGIN/SWAP/FUTURES/OPTION).
type GetAccountPositionTiersService ¶
type GetAccountPositionTiersService struct {
// contains filtered or unexported fields
}
GetAccountPositionTiersService -- GET /api/v5/account/position-tiers (Read)
Returns the account's maximum position size per underlying / instrument family (the per-account view of the public position-tier schedule).
func (*GetAccountPositionTiersService) Do ¶
func (s *GetAccountPositionTiersService) Do(ctx context.Context) ([]AccountPositionTier, error)
func (*GetAccountPositionTiersService) SetInstFamily ¶
func (s *GetAccountPositionTiersService) SetInstFamily(instFamily string) *GetAccountPositionTiersService
SetInstFamily filters by instrument family (comma-separated for several).
func (*GetAccountPositionTiersService) SetUly ¶
func (s *GetAccountPositionTiersService) SetUly(uly string) *GetAccountPositionTiersService
SetUly filters by underlying (comma-separated for several).
type GetAccountRateLimitService ¶
type GetAccountRateLimitService struct {
// contains filtered or unexported fields
}
GetAccountRateLimitService -- GET /api/v5/trade/account-rate-limit (Read)
Returns the account's order-placement rate limit and current fill ratio.
func (*GetAccountRateLimitService) Do ¶
func (s *GetAccountRateLimitService) Do(ctx context.Context) (*AccountRateLimit, error)
type GetAdjustLeverageInfoService ¶
type GetAdjustLeverageInfoService struct {
// contains filtered or unexported fields
}
GetAdjustLeverageInfoService -- GET /api/v5/account/adjust-leverage-info (Read)
Returns the estimated information (available transfer, liq price, max amount) for adjusting leverage to a target value.
func (*GetAdjustLeverageInfoService) Do ¶
func (s *GetAdjustLeverageInfoService) Do(ctx context.Context) (*AdjustLeverageInfo, error)
func (*GetAdjustLeverageInfoService) SetCcy ¶
func (s *GetAdjustLeverageInfoService) SetCcy(ccy string) *GetAdjustLeverageInfoService
SetCcy sets the margin currency (required for cross MARGIN unless instId is set).
func (*GetAdjustLeverageInfoService) SetInstId ¶
func (s *GetAdjustLeverageInfoService) SetInstId(instId string) *GetAdjustLeverageInfoService
SetInstId sets the instrument id (required unless ccy is set).
func (*GetAdjustLeverageInfoService) SetPosSide ¶
func (s *GetAdjustLeverageInfoService) SetPosSide(posSide PosSide) *GetAdjustLeverageInfoService
SetPosSide sets the position side (long/short/net).
type GetAffiliateInviteeDetailService ¶
type GetAffiliateInviteeDetailService struct {
// contains filtered or unexported fields
}
GetAffiliateInviteeDetailService -- GET /api/v5/affiliate/invitee/detail (Read)
Returns the affiliate-relationship detail for one of the calling affiliate's invitees, identified by the invitee's user id (uid). Only accounts with the affiliate/agent role may call this; other accounts get OKX code 51620 ("Only affiliates can perform this action").
Path is curl-verified live: an account without the affiliate role receives code 51620 (path REAL, capability-gated). The other affiliate paths probed (performance-summary, invitee-list, co-inviter-link-list, link-list, sub-affiliate-list) return HTTP 404 — they are not part of the public OKX v5 REST API and were therefore dropped.
func (*GetAffiliateInviteeDetailService) Do ¶
func (s *GetAffiliateInviteeDetailService) Do(ctx context.Context) (*AffiliateInviteeDetail, error)
type GetAlgoOrderService ¶
type GetAlgoOrderService struct {
// contains filtered or unexported fields
}
GetAlgoOrderService -- GET /api/v5/trade/order-algo (Read)
Returns the details of a single algo order. One of algoId / algoClOrdId is required.
func (*GetAlgoOrderService) Do ¶
func (s *GetAlgoOrderService) Do(ctx context.Context) (*AlgoOrder, error)
func (*GetAlgoOrderService) SetAlgoClOrdId ¶
func (s *GetAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *GetAlgoOrderService
SetAlgoClOrdId targets the algo order by client-supplied id.
func (*GetAlgoOrderService) SetAlgoId ¶
func (s *GetAlgoOrderService) SetAlgoId(algoId string) *GetAlgoOrderService
SetAlgoId targets the algo order by id.
type GetAlgoOrdersHistoryService ¶
type GetAlgoOrdersHistoryService struct {
// contains filtered or unexported fields
}
GetAlgoOrdersHistoryService -- GET /api/v5/trade/orders-algo-history (Read)
Returns the account's completed algo orders (canceled or effective) for a given ordType over the last three months. Either state or algoId is required in addition to ordType.
func (*GetAlgoOrdersHistoryService) Do ¶
func (s *GetAlgoOrdersHistoryService) Do(ctx context.Context) ([]AlgoOrder, error)
func (*GetAlgoOrdersHistoryService) SetAfter ¶
func (s *GetAlgoOrdersHistoryService) SetAfter(algoId string) *GetAlgoOrdersHistoryService
SetAfter pages to records with an algoId earlier than the given one.
func (*GetAlgoOrdersHistoryService) SetAlgoId ¶
func (s *GetAlgoOrdersHistoryService) SetAlgoId(algoId string) *GetAlgoOrdersHistoryService
SetAlgoId filters by algo order id.
func (*GetAlgoOrdersHistoryService) SetBefore ¶
func (s *GetAlgoOrdersHistoryService) SetBefore(algoId string) *GetAlgoOrdersHistoryService
SetBefore pages to records with an algoId later than the given one.
func (*GetAlgoOrdersHistoryService) SetInstId ¶
func (s *GetAlgoOrdersHistoryService) SetInstId(instId string) *GetAlgoOrdersHistoryService
SetInstId filters by instrument id.
func (*GetAlgoOrdersHistoryService) SetInstType ¶
func (s *GetAlgoOrdersHistoryService) SetInstType(instType InstType) *GetAlgoOrdersHistoryService
SetInstType filters by product line (SPOT/MARGIN/SWAP/FUTURES).
func (*GetAlgoOrdersHistoryService) SetLimit ¶
func (s *GetAlgoOrdersHistoryService) SetLimit(limit int) *GetAlgoOrdersHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetAlgoOrdersHistoryService) SetState ¶
func (s *GetAlgoOrdersHistoryService) SetState(state AlgoState) *GetAlgoOrdersHistoryService
SetState filters by terminal state (effective / canceled / order_failed).
type GetAlgoOrdersPendingService ¶
type GetAlgoOrdersPendingService struct {
// contains filtered or unexported fields
}
GetAlgoOrdersPendingService -- GET /api/v5/trade/orders-algo-pending (Read)
Returns the account's incomplete algo orders for a given ordType.
func (*GetAlgoOrdersPendingService) Do ¶
func (s *GetAlgoOrdersPendingService) Do(ctx context.Context) ([]AlgoOrder, error)
func (*GetAlgoOrdersPendingService) SetAfter ¶
func (s *GetAlgoOrdersPendingService) SetAfter(algoId string) *GetAlgoOrdersPendingService
SetAfter pages to records with an algoId earlier than the given one.
func (*GetAlgoOrdersPendingService) SetAlgoClOrdId ¶
func (s *GetAlgoOrdersPendingService) SetAlgoClOrdId(algoClOrdId string) *GetAlgoOrdersPendingService
SetAlgoClOrdId filters by client-supplied algo order id.
func (*GetAlgoOrdersPendingService) SetAlgoId ¶
func (s *GetAlgoOrdersPendingService) SetAlgoId(algoId string) *GetAlgoOrdersPendingService
SetAlgoId filters by algo order id.
func (*GetAlgoOrdersPendingService) SetBefore ¶
func (s *GetAlgoOrdersPendingService) SetBefore(algoId string) *GetAlgoOrdersPendingService
SetBefore pages to records with an algoId later than the given one.
func (*GetAlgoOrdersPendingService) SetInstId ¶
func (s *GetAlgoOrdersPendingService) SetInstId(instId string) *GetAlgoOrdersPendingService
SetInstId filters by instrument id.
func (*GetAlgoOrdersPendingService) SetInstType ¶
func (s *GetAlgoOrdersPendingService) SetInstType(instType InstType) *GetAlgoOrdersPendingService
SetInstType filters by product line (SPOT/MARGIN/SWAP/FUTURES).
func (*GetAlgoOrdersPendingService) SetLimit ¶
func (s *GetAlgoOrdersPendingService) SetLimit(limit int) *GetAlgoOrdersPendingService
SetLimit caps the number of records returned (max 100).
type GetAnnouncementTypesService ¶
type GetAnnouncementTypesService struct {
// contains filtered or unexported fields
}
GetAnnouncementTypesService -- GET /api/v5/support/announcement-types (signed)
Returns the set of announcement types usable as the annType filter of GetAnnouncementsService.
func (*GetAnnouncementTypesService) Do ¶
func (s *GetAnnouncementTypesService) Do(ctx context.Context) ([]AnnouncementType, error)
type GetAnnouncementsService ¶
type GetAnnouncementsService struct {
// contains filtered or unexported fields
}
GetAnnouncementsService -- GET /api/v5/support/announcements (signed)
Returns paginated OKX support announcements. Each data element wraps a page of announcement details plus the total page count.
func (*GetAnnouncementsService) Do ¶
func (s *GetAnnouncementsService) Do(ctx context.Context) ([]Announcements, error)
func (*GetAnnouncementsService) SetAnnType ¶
func (s *GetAnnouncementsService) SetAnnType(annType string) *GetAnnouncementsService
SetAnnType filters by announcement type (see GetAnnouncementTypesService for the available values).
func (*GetAnnouncementsService) SetPage ¶
func (s *GetAnnouncementsService) SetPage(page int) *GetAnnouncementsService
SetPage selects the page of results (1-based).
type GetAssetBillsService ¶
type GetAssetBillsService struct {
// contains filtered or unexported fields
}
GetAssetBillsService -- GET /api/v5/asset/bills (private)
Returns the funding-account bill (balance-change) history of the last year.
func (*GetAssetBillsService) Do ¶
func (s *GetAssetBillsService) Do(ctx context.Context) ([]AssetBill, error)
func (*GetAssetBillsService) SetAfter ¶
func (s *GetAssetBillsService) SetAfter(t time.Time) *GetAssetBillsService
SetAfter paginates to records earlier than the given time (older).
func (*GetAssetBillsService) SetBefore ¶
func (s *GetAssetBillsService) SetBefore(t time.Time) *GetAssetBillsService
SetBefore paginates to records later than the given time (newer).
func (*GetAssetBillsService) SetCcy ¶
func (s *GetAssetBillsService) SetCcy(ccy string) *GetAssetBillsService
SetCcy filters by currency.
func (*GetAssetBillsService) SetClientId ¶
func (s *GetAssetBillsService) SetClientId(clientId string) *GetAssetBillsService
SetClientId filters by client-supplied id.
func (*GetAssetBillsService) SetLimit ¶
func (s *GetAssetBillsService) SetLimit(limit int) *GetAssetBillsService
SetLimit caps the number of records returned (max 100).
func (*GetAssetBillsService) SetType ¶
func (s *GetAssetBillsService) SetType(typ string) *GetAssetBillsService
SetType filters by bill type (see OKX docs for the numeric type codes).
type GetAssetValuationService ¶
type GetAssetValuationService struct {
// contains filtered or unexported fields
}
GetAssetValuationService -- GET /api/v5/asset/asset-valuation (private)
Returns the total valuation of all assets across the account's sub-accounts (funding, trading, classic, earn), denominated in a chosen currency.
func (*GetAssetValuationService) Do ¶
func (s *GetAssetValuationService) Do(ctx context.Context) (*AssetValuation, error)
func (*GetAssetValuationService) SetCcy ¶
func (s *GetAssetValuationService) SetCcy(ccy string) *GetAssetValuationService
SetCcy sets the valuation currency (e.g. BTC, USDT; default BTC).
type GetBalanceService ¶
type GetBalanceService struct {
// contains filtered or unexported fields
}
GetBalanceService -- GET /api/v5/account/balance (Read)
Returns the trading account's balance, total equity and per-currency details.
func (*GetBalanceService) Do ¶
func (s *GetBalanceService) Do(ctx context.Context) (*Balance, error)
func (*GetBalanceService) SetCcy ¶
func (s *GetBalanceService) SetCcy(ccy string) *GetBalanceService
SetCcy filters the details to a single currency (comma-separated for several).
type GetBillsArchiveService ¶
type GetBillsArchiveService struct {
// contains filtered or unexported fields
}
GetBillsArchiveService -- GET /api/v5/account/bills-archive (Read)
Returns the account's bill (balance-change) records for the last 3 months, most recent first. Same shape and filters as /account/bills.
func (*GetBillsArchiveService) Do ¶
func (s *GetBillsArchiveService) Do(ctx context.Context) ([]Bill, error)
func (*GetBillsArchiveService) SetAfter ¶
func (s *GetBillsArchiveService) SetAfter(billId string) *GetBillsArchiveService
SetAfter paginates to bills with a billId smaller than the given value (older).
func (*GetBillsArchiveService) SetBefore ¶
func (s *GetBillsArchiveService) SetBefore(billId string) *GetBillsArchiveService
SetBefore paginates to bills with a billId larger than the given value (newer).
func (*GetBillsArchiveService) SetBegin ¶
func (s *GetBillsArchiveService) SetBegin(t time.Time) *GetBillsArchiveService
SetBegin filters to bills at or after the given time (by ts).
func (*GetBillsArchiveService) SetCcy ¶
func (s *GetBillsArchiveService) SetCcy(ccy string) *GetBillsArchiveService
SetCcy filters bills by currency.
func (*GetBillsArchiveService) SetCtType ¶
func (s *GetBillsArchiveService) SetCtType(ctType CtType) *GetBillsArchiveService
SetCtType filters bills by contract type (linear/inverse).
func (*GetBillsArchiveService) SetEnd ¶
func (s *GetBillsArchiveService) SetEnd(t time.Time) *GetBillsArchiveService
SetEnd filters to bills at or before the given time (by ts).
func (*GetBillsArchiveService) SetInstId ¶
func (s *GetBillsArchiveService) SetInstId(instId string) *GetBillsArchiveService
SetInstId filters bills by a single instrument id.
func (*GetBillsArchiveService) SetInstType ¶
func (s *GetBillsArchiveService) SetInstType(instType InstType) *GetBillsArchiveService
SetInstType filters bills by instrument type (SPOT/MARGIN/SWAP/FUTURES/OPTION).
func (*GetBillsArchiveService) SetLimit ¶
func (s *GetBillsArchiveService) SetLimit(limit int) *GetBillsArchiveService
SetLimit caps the number of records returned (max 100, default 100).
func (*GetBillsArchiveService) SetMgnMode ¶
func (s *GetBillsArchiveService) SetMgnMode(mgnMode MgnMode) *GetBillsArchiveService
SetMgnMode filters bills by margin mode (isolated/cross).
func (*GetBillsArchiveService) SetSubType ¶
func (s *GetBillsArchiveService) SetSubType(subType string) *GetBillsArchiveService
SetSubType filters bills by bill sub-type (e.g. "1" buy, "2" sell).
func (*GetBillsArchiveService) SetType ¶
func (s *GetBillsArchiveService) SetType(typ string) *GetBillsArchiveService
SetType filters bills by bill type (e.g. "1" transfer, "2" trade, "8" funding fee).
type GetBillsHistoryArchiveService ¶
type GetBillsHistoryArchiveService struct {
// contains filtered or unexported fields
}
GetBillsHistoryArchiveService -- GET /api/v5/account/bills-history-archive (Read)
Returns the download link and state of a previously requested quarterly bills archive (apply first via ApplyBillsHistoryArchiveService).
func (*GetBillsHistoryArchiveService) Do ¶
func (s *GetBillsHistoryArchiveService) Do(ctx context.Context) (*BillsHistoryArchive, error)
type GetBillsService ¶
type GetBillsService struct {
// contains filtered or unexported fields
}
GetBillsService -- GET /api/v5/account/bills (Read)
Returns the account's bill (balance-change) records for the last 7 days, most recent first.
func (*GetBillsService) SetAfter ¶
func (s *GetBillsService) SetAfter(billId string) *GetBillsService
SetAfter paginates to bills with a billId smaller than the given value (older).
func (*GetBillsService) SetBefore ¶
func (s *GetBillsService) SetBefore(billId string) *GetBillsService
SetBefore paginates to bills with a billId larger than the given value (newer).
func (*GetBillsService) SetBegin ¶
func (s *GetBillsService) SetBegin(t time.Time) *GetBillsService
SetBegin filters to bills at or after the given time (by ts).
func (*GetBillsService) SetCcy ¶
func (s *GetBillsService) SetCcy(ccy string) *GetBillsService
SetCcy filters bills by currency.
func (*GetBillsService) SetCtType ¶
func (s *GetBillsService) SetCtType(ctType CtType) *GetBillsService
SetCtType filters bills by contract type (linear/inverse).
func (*GetBillsService) SetEnd ¶
func (s *GetBillsService) SetEnd(t time.Time) *GetBillsService
SetEnd filters to bills at or before the given time (by ts).
func (*GetBillsService) SetInstId ¶
func (s *GetBillsService) SetInstId(instId string) *GetBillsService
SetInstId filters bills by a single instrument id.
func (*GetBillsService) SetInstType ¶
func (s *GetBillsService) SetInstType(instType InstType) *GetBillsService
SetInstType filters bills by instrument type (SPOT/MARGIN/SWAP/FUTURES/OPTION).
func (*GetBillsService) SetLimit ¶
func (s *GetBillsService) SetLimit(limit int) *GetBillsService
SetLimit caps the number of records returned (max 100, default 100).
func (*GetBillsService) SetMgnMode ¶
func (s *GetBillsService) SetMgnMode(mgnMode MgnMode) *GetBillsService
SetMgnMode filters bills by margin mode (isolated/cross).
func (*GetBillsService) SetSubType ¶
func (s *GetBillsService) SetSubType(subType string) *GetBillsService
SetSubType filters bills by bill sub-type (e.g. "1" buy, "2" sell).
func (*GetBillsService) SetType ¶
func (s *GetBillsService) SetType(typ string) *GetBillsService
SetType filters bills by bill type (e.g. "1" transfer, "2" trade, "8" funding fee).
type GetBlockTickersService ¶
type GetBlockTickersService struct {
// contains filtered or unexported fields
}
GetBlockTickersService -- GET /api/v5/market/block-tickers (public)
Returns the block-trade tickers for every instrument of a product line.
func (*GetBlockTickersService) Do ¶
func (s *GetBlockTickersService) Do(ctx context.Context) ([]BlockTicker, error)
func (*GetBlockTickersService) SetInstFamily ¶
func (s *GetBlockTickersService) SetInstFamily(instFamily string) *GetBlockTickersService
SetInstFamily filters block tickers by instrument family (FUTURES/SWAP/OPTION).
func (*GetBlockTickersService) SetUly ¶
func (s *GetBlockTickersService) SetUly(uly string) *GetBlockTickersService
SetUly filters block tickers by underlying (FUTURES/SWAP/OPTION).
type GetBooksFullService ¶
type GetBooksFullService struct {
// contains filtered or unexported fields
}
GetBooksFullService -- GET /api/v5/market/books-full (public)
Returns the full-depth order book (up to 5000 levels) for an instrument.
func (*GetBooksFullService) Do ¶
func (s *GetBooksFullService) Do(ctx context.Context) (*OrderBook, error)
func (*GetBooksFullService) SetSz ¶
func (s *GetBooksFullService) SetSz(sz int) *GetBooksFullService
SetSz sets the order book depth (number of price levels, max 5000).
type GetBooksService ¶
type GetBooksService struct {
// contains filtered or unexported fields
}
GetBooksService -- GET /api/v5/market/books (public)
Returns the order book (up to 400 levels) for an instrument.
func (*GetBooksService) SetSz ¶
func (s *GetBooksService) SetSz(sz int) *GetBooksService
SetSz sets the order book depth (number of price levels).
type GetBorrowRepayHistoryService ¶
type GetBorrowRepayHistoryService struct {
// contains filtered or unexported fields
}
GetBorrowRepayHistoryService -- GET /api/v5/account/borrow-repay-history (Read)
Returns the VIP-loan borrow and repay history.
func (*GetBorrowRepayHistoryService) Do ¶
func (s *GetBorrowRepayHistoryService) Do(ctx context.Context) ([]BorrowRepayHistory, error)
func (*GetBorrowRepayHistoryService) SetAfter ¶
func (s *GetBorrowRepayHistoryService) SetAfter(t time.Time) *GetBorrowRepayHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetBorrowRepayHistoryService) SetBefore ¶
func (s *GetBorrowRepayHistoryService) SetBefore(t time.Time) *GetBorrowRepayHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetBorrowRepayHistoryService) SetCcy ¶
func (s *GetBorrowRepayHistoryService) SetCcy(ccy string) *GetBorrowRepayHistoryService
SetCcy filters by currency.
func (*GetBorrowRepayHistoryService) SetLimit ¶
func (s *GetBorrowRepayHistoryService) SetLimit(limit int) *GetBorrowRepayHistoryService
SetLimit caps the number of records returned (max 100).
type GetCandlesService ¶
type GetCandlesService struct {
// contains filtered or unexported fields
}
GetCandlesService -- GET /api/v5/market/candles (public)
Returns recent candlestick data for an instrument.
func (*GetCandlesService) Do ¶
func (s *GetCandlesService) Do(ctx context.Context) ([]Candle, error)
func (*GetCandlesService) SetAfter ¶
func (s *GetCandlesService) SetAfter(after time.Time) *GetCandlesService
SetAfter requests candles before the given timestamp (paging backward).
func (*GetCandlesService) SetBar ¶
func (s *GetCandlesService) SetBar(bar MarketBar) *GetCandlesService
SetBar sets the candle time granularity (default 1m).
func (*GetCandlesService) SetBefore ¶
func (s *GetCandlesService) SetBefore(before time.Time) *GetCandlesService
SetBefore requests candles after the given timestamp (paging forward).
func (*GetCandlesService) SetLimit ¶
func (s *GetCandlesService) SetLimit(limit int) *GetCandlesService
SetLimit caps the number of returned candles (max 300, default 100).
type GetCollateralAssetsService ¶
type GetCollateralAssetsService struct {
// contains filtered or unexported fields
}
GetCollateralAssetsService -- GET /api/v5/account/collateral-assets (Read)
Returns the per-currency collateral-enabled state of the account.
func (*GetCollateralAssetsService) Do ¶
func (s *GetCollateralAssetsService) Do(ctx context.Context) ([]CollateralAsset, error)
func (*GetCollateralAssetsService) SetCcy ¶
func (s *GetCollateralAssetsService) SetCcy(ccy string) *GetCollateralAssetsService
SetCcy filters by a single currency.
func (*GetCollateralAssetsService) SetCollateralEnabled ¶
func (s *GetCollateralAssetsService) SetCollateralEnabled(enabled bool) *GetCollateralAssetsService
SetCollateralEnabled filters by collateral-enabled state.
type GetContractsOpenInterestVolumeService ¶
type GetContractsOpenInterestVolumeService struct {
// contains filtered or unexported fields
}
GetContractsOpenInterestVolumeService -- GET /api/v5/rubik/stat/contracts/open-interest-volume (public)
Returns the aggregated contract open interest and trading volume per time bar for a currency.
func (*GetContractsOpenInterestVolumeService) Do ¶
func (s *GetContractsOpenInterestVolumeService) Do(ctx context.Context) ([]RubikOpenInterestVolume, error)
func (*GetContractsOpenInterestVolumeService) SetBegin ¶
func (s *GetContractsOpenInterestVolumeService) SetBegin(t time.Time) *GetContractsOpenInterestVolumeService
func (*GetContractsOpenInterestVolumeService) SetEnd ¶
func (s *GetContractsOpenInterestVolumeService) SetEnd(t time.Time) *GetContractsOpenInterestVolumeService
func (*GetContractsOpenInterestVolumeService) SetPeriod ¶
func (s *GetContractsOpenInterestVolumeService) SetPeriod(p RubikStatPeriod) *GetContractsOpenInterestVolumeService
type GetConvertContractCoinService ¶
type GetConvertContractCoinService struct {
// contains filtered or unexported fields
}
GetConvertContractCoinService -- GET /api/v5/public/convert-contract-coin (public)
Converts between a contract quantity and its coin amount for a derivatives instrument.
func (*GetConvertContractCoinService) Do ¶
func (s *GetConvertContractCoinService) Do(ctx context.Context) (*ConvertContractCoin, error)
func (*GetConvertContractCoinService) SetPx ¶
func (s *GetConvertContractCoinService) SetPx(px string) *GetConvertContractCoinService
SetPx sets the order price (required for inverse contracts, ignored for linear).
func (*GetConvertContractCoinService) SetUnit ¶
func (s *GetConvertContractCoinService) SetUnit(unit string) *GetConvertContractCoinService
SetUnit sets the coin unit ("coin" or "usds") when converting to coin.
type GetConvertCurrenciesService ¶
type GetConvertCurrenciesService struct {
// contains filtered or unexported fields
}
GetConvertCurrenciesService -- GET /api/v5/asset/convert/currencies (Read)
Returns the list of currencies that can be used in small-asset conversions.
func (*GetConvertCurrenciesService) Do ¶
func (s *GetConvertCurrenciesService) Do(ctx context.Context) ([]ConvertCurrency, error)
type GetConvertCurrencyPairService ¶
type GetConvertCurrencyPairService struct {
// contains filtered or unexported fields
}
GetConvertCurrencyPairService -- GET /api/v5/asset/convert/currency-pair (Read)
Returns the tradable convert pair and its per-currency size bounds for a from/to currency combination.
func (*GetConvertCurrencyPairService) Do ¶
func (s *GetConvertCurrencyPairService) Do(ctx context.Context) (*ConvertCurrencyPair, error)
type GetConvertHistoryService ¶
type GetConvertHistoryService struct {
// contains filtered or unexported fields
}
GetConvertHistoryService -- GET /api/v5/asset/convert/history (Read)
Returns the account's past conversions (last three months).
func (*GetConvertHistoryService) Do ¶
func (s *GetConvertHistoryService) Do(ctx context.Context) ([]ConvertHistory, error)
func (*GetConvertHistoryService) SetAfter ¶
func (s *GetConvertHistoryService) SetAfter(t time.Time) *GetConvertHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetConvertHistoryService) SetBefore ¶
func (s *GetConvertHistoryService) SetBefore(t time.Time) *GetConvertHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetConvertHistoryService) SetLimit ¶
func (s *GetConvertHistoryService) SetLimit(limit int) *GetConvertHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetConvertHistoryService) SetTag ¶
func (s *GetConvertHistoryService) SetTag(tag string) *GetConvertHistoryService
SetTag filters by order tag (broker id).
type GetCopyBatchLeverageInfoService ¶
type GetCopyBatchLeverageInfoService struct {
// contains filtered or unexported fields
}
GetCopyBatchLeverageInfoService -- GET /api/v5/copytrading/batch-leverage-info (Read)
Returns the leverage a lead trader uses for a set of instruments under the given margin mode.
func (*GetCopyBatchLeverageInfoService) Do ¶
func (s *GetCopyBatchLeverageInfoService) Do(ctx context.Context) ([]CopyBatchLeverageInfo, error)
func (*GetCopyBatchLeverageInfoService) SetInstId ¶
func (s *GetCopyBatchLeverageInfoService) SetInstId(instId string) *GetCopyBatchLeverageInfoService
SetInstId filters by instrument id (single or comma-separated).
type GetCopyConfigService ¶
type GetCopyConfigService struct {
// contains filtered or unexported fields
}
GetCopyConfigService -- GET /api/v5/copytrading/config (Read)
Returns the current account's copy-trading role configuration (lead / copy state and per-role nick names / unique codes).
func (*GetCopyConfigService) Do ¶
func (s *GetCopyConfigService) Do(ctx context.Context) (*CopyConfig, error)
type GetCopyCurrentSubpositionsService ¶
type GetCopyCurrentSubpositionsService struct {
// contains filtered or unexported fields
}
GetCopyCurrentSubpositionsService -- GET /api/v5/copytrading/current-subpositions (Read)
Returns the lead trader's currently open sub-positions (the positions copiers are mirroring).
func (*GetCopyCurrentSubpositionsService) Do ¶
func (s *GetCopyCurrentSubpositionsService) Do(ctx context.Context) ([]CopySubPosition, error)
func (*GetCopyCurrentSubpositionsService) SetAfter ¶
func (s *GetCopyCurrentSubpositionsService) SetAfter(after string) *GetCopyCurrentSubpositionsService
SetAfter paginates to records with subPosId earlier than the given id.
func (*GetCopyCurrentSubpositionsService) SetBefore ¶
func (s *GetCopyCurrentSubpositionsService) SetBefore(before string) *GetCopyCurrentSubpositionsService
SetBefore paginates to records with subPosId newer than the given id.
func (*GetCopyCurrentSubpositionsService) SetInstId ¶
func (s *GetCopyCurrentSubpositionsService) SetInstId(instId string) *GetCopyCurrentSubpositionsService
SetInstId filters by a single instrument id.
func (*GetCopyCurrentSubpositionsService) SetInstType ¶
func (s *GetCopyCurrentSubpositionsService) SetInstType(instType InstType) *GetCopyCurrentSubpositionsService
SetInstType filters by product line (SWAP).
func (*GetCopyCurrentSubpositionsService) SetLimit ¶
func (s *GetCopyCurrentSubpositionsService) SetLimit(limit int) *GetCopyCurrentSubpositionsService
SetLimit caps the number of records returned (max 100).
func (*GetCopyCurrentSubpositionsService) SetSubPosType ¶
func (s *GetCopyCurrentSubpositionsService) SetSubPosType(subPosType CopySubPosType) *GetCopyCurrentSubpositionsService
SetSubPosType filters by sub-position side (long/short).
type GetCopyInstrumentsService ¶
type GetCopyInstrumentsService struct {
// contains filtered or unexported fields
}
GetCopyInstrumentsService -- GET /api/v5/copytrading/instruments (Read)
Returns the instruments the current lead trader can lead-trade and whether each is enabled for leading.
func (*GetCopyInstrumentsService) Do ¶
func (s *GetCopyInstrumentsService) Do(ctx context.Context) ([]CopyInstrument, error)
func (*GetCopyInstrumentsService) SetInstType ¶
func (s *GetCopyInstrumentsService) SetInstType(instType InstType) *GetCopyInstrumentsService
SetInstType filters by product line (SWAP).
type GetCopyLeadTradersService ¶
type GetCopyLeadTradersService struct {
// contains filtered or unexported fields
}
GetCopyLeadTradersService -- GET /api/v5/copytrading/lead-traders (Read)
Returns the lead-trader ranking visible to the current (signed) account. Shape matches the public ranking but the rows additionally carry chanType.
func (*GetCopyLeadTradersService) Do ¶
func (s *GetCopyLeadTradersService) Do(ctx context.Context) (*CopyLeadTradersPage, error)
func (*GetCopyLeadTradersService) SetDataVer ¶
func (s *GetCopyLeadTradersService) SetDataVer(dataVer string) *GetCopyLeadTradersService
SetDataVer sets the data version (snapshot id from a prior call).
func (*GetCopyLeadTradersService) SetInstType ¶
func (s *GetCopyLeadTradersService) SetInstType(instType InstType) *GetCopyLeadTradersService
SetInstType filters by product line (SWAP).
func (*GetCopyLeadTradersService) SetLimit ¶
func (s *GetCopyLeadTradersService) SetLimit(limit int) *GetCopyLeadTradersService
SetLimit caps the number of records returned (max 20, default 10).
func (*GetCopyLeadTradersService) SetMaxAssets ¶
func (s *GetCopyLeadTradersService) SetMaxAssets(maxAssets decimal.Decimal) *GetCopyLeadTradersService
SetMaxAssets filters by maximum trading assets.
func (*GetCopyLeadTradersService) SetMaxAum ¶
func (s *GetCopyLeadTradersService) SetMaxAum(maxAum decimal.Decimal) *GetCopyLeadTradersService
SetMaxAum filters by maximum assets under management.
func (*GetCopyLeadTradersService) SetMinAssets ¶
func (s *GetCopyLeadTradersService) SetMinAssets(minAssets decimal.Decimal) *GetCopyLeadTradersService
SetMinAssets filters by minimum trading assets.
func (*GetCopyLeadTradersService) SetMinAum ¶
func (s *GetCopyLeadTradersService) SetMinAum(minAum decimal.Decimal) *GetCopyLeadTradersService
SetMinAum filters by minimum assets under management.
func (*GetCopyLeadTradersService) SetMinLeadDays ¶
func (s *GetCopyLeadTradersService) SetMinLeadDays(minLeadDays string) *GetCopyLeadTradersService
SetMinLeadDays filters by minimum lead days (1/2/3/4 buckets).
func (*GetCopyLeadTradersService) SetPage ¶
func (s *GetCopyLeadTradersService) SetPage(page int) *GetCopyLeadTradersService
SetPage sets the page number.
func (*GetCopyLeadTradersService) SetSortType ¶
func (s *GetCopyLeadTradersService) SetSortType(sortType CopySortType) *GetCopyLeadTradersService
SetSortType sets the ranking sort key (overview/pnl/pnlRatio/aum/winRatio).
func (*GetCopyLeadTradersService) SetState ¶
func (s *GetCopyLeadTradersService) SetState(state CopyState) *GetCopyLeadTradersService
SetState filters by copy state ("0" not copying / "1" copying).
type GetCopyProfitSharingDetailsService ¶
type GetCopyProfitSharingDetailsService struct {
// contains filtered or unexported fields
}
GetCopyProfitSharingDetailsService -- GET /api/v5/copytrading/profit-sharing-details (Read)
Returns the lead trader's profit-sharing detail records (the share collected from each copier).
func (*GetCopyProfitSharingDetailsService) Do ¶
func (s *GetCopyProfitSharingDetailsService) Do(ctx context.Context) ([]CopyProfitSharingDetail, error)
func (*GetCopyProfitSharingDetailsService) SetAfter ¶
func (s *GetCopyProfitSharingDetailsService) SetAfter(after string) *GetCopyProfitSharingDetailsService
SetAfter paginates to records with profitSharingId earlier than the given id.
func (*GetCopyProfitSharingDetailsService) SetBefore ¶
func (s *GetCopyProfitSharingDetailsService) SetBefore(before string) *GetCopyProfitSharingDetailsService
SetBefore paginates to records with profitSharingId newer than the given id.
func (*GetCopyProfitSharingDetailsService) SetInstType ¶
func (s *GetCopyProfitSharingDetailsService) SetInstType(instType InstType) *GetCopyProfitSharingDetailsService
SetInstType filters by product line (SWAP).
func (*GetCopyProfitSharingDetailsService) SetLimit ¶
func (s *GetCopyProfitSharingDetailsService) SetLimit(limit int) *GetCopyProfitSharingDetailsService
SetLimit caps the number of records returned (max 100).
type GetCopyPublicConfigService ¶
type GetCopyPublicConfigService struct {
// contains filtered or unexported fields
}
GetCopyPublicConfigService -- GET /api/v5/copytrading/public-config (public)
Returns the platform-wide copy-trading limits (min/max copy amounts, ratios and SL/TP caps). Public; no signing required.
func (*GetCopyPublicConfigService) Do ¶
func (s *GetCopyPublicConfigService) Do(ctx context.Context) (*CopyPublicConfig, error)
func (*GetCopyPublicConfigService) SetInstType ¶
func (s *GetCopyPublicConfigService) SetInstType(instType InstType) *GetCopyPublicConfigService
SetInstType filters by product line (SWAP).
type GetCopyPublicLeadTradersService ¶
type GetCopyPublicLeadTradersService struct {
// contains filtered or unexported fields
}
GetCopyPublicLeadTradersService -- GET /api/v5/copytrading/public-lead-traders (public)
Returns the public lead-trader ranking. Public; no signing required.
func (*GetCopyPublicLeadTradersService) Do ¶
func (s *GetCopyPublicLeadTradersService) Do(ctx context.Context) (*CopyLeadTradersPage, error)
func (*GetCopyPublicLeadTradersService) SetDataVer ¶
func (s *GetCopyPublicLeadTradersService) SetDataVer(dataVer string) *GetCopyPublicLeadTradersService
SetDataVer sets the data version (snapshot id from a prior call).
func (*GetCopyPublicLeadTradersService) SetInstType ¶
func (s *GetCopyPublicLeadTradersService) SetInstType(instType InstType) *GetCopyPublicLeadTradersService
SetInstType filters by product line (SWAP).
func (*GetCopyPublicLeadTradersService) SetLimit ¶
func (s *GetCopyPublicLeadTradersService) SetLimit(limit int) *GetCopyPublicLeadTradersService
SetLimit caps the number of records returned (max 20, default 10).
func (*GetCopyPublicLeadTradersService) SetMaxAssets ¶
func (s *GetCopyPublicLeadTradersService) SetMaxAssets(maxAssets decimal.Decimal) *GetCopyPublicLeadTradersService
SetMaxAssets filters by maximum trading assets.
func (*GetCopyPublicLeadTradersService) SetMaxAum ¶
func (s *GetCopyPublicLeadTradersService) SetMaxAum(maxAum decimal.Decimal) *GetCopyPublicLeadTradersService
SetMaxAum filters by maximum assets under management.
func (*GetCopyPublicLeadTradersService) SetMinAssets ¶
func (s *GetCopyPublicLeadTradersService) SetMinAssets(minAssets decimal.Decimal) *GetCopyPublicLeadTradersService
SetMinAssets filters by minimum trading assets.
func (*GetCopyPublicLeadTradersService) SetMinAum ¶
func (s *GetCopyPublicLeadTradersService) SetMinAum(minAum decimal.Decimal) *GetCopyPublicLeadTradersService
SetMinAum filters by minimum assets under management.
func (*GetCopyPublicLeadTradersService) SetMinLeadDays ¶
func (s *GetCopyPublicLeadTradersService) SetMinLeadDays(minLeadDays string) *GetCopyPublicLeadTradersService
SetMinLeadDays filters by minimum lead days (1/2/3/4 buckets).
func (*GetCopyPublicLeadTradersService) SetPage ¶
func (s *GetCopyPublicLeadTradersService) SetPage(page int) *GetCopyPublicLeadTradersService
SetPage sets the page number.
func (*GetCopyPublicLeadTradersService) SetSortType ¶
func (s *GetCopyPublicLeadTradersService) SetSortType(sortType CopySortType) *GetCopyPublicLeadTradersService
SetSortType sets the ranking sort key (overview/pnl/pnlRatio/aum/winRatio).
func (*GetCopyPublicLeadTradersService) SetState ¶
func (s *GetCopyPublicLeadTradersService) SetState(state CopyState) *GetCopyPublicLeadTradersService
SetState filters by copy state ("0" not copying / "1" copying).
type GetCopySettingsService ¶
type GetCopySettingsService struct {
// contains filtered or unexported fields
}
GetCopySettingsService -- GET /api/v5/copytrading/copy-settings (Read)
Returns the current account's copy settings for a specific lead trader.
func (*GetCopySettingsService) Do ¶
func (s *GetCopySettingsService) Do(ctx context.Context) (*CopySettings, error)
type GetCopySubpositionsHistoryService ¶
type GetCopySubpositionsHistoryService struct {
// contains filtered or unexported fields
}
GetCopySubpositionsHistoryService -- GET /api/v5/copytrading/subpositions-history (Read)
Returns the lead trader's closed sub-position history.
func (*GetCopySubpositionsHistoryService) Do ¶
func (s *GetCopySubpositionsHistoryService) Do(ctx context.Context) ([]CopySubPositionHistory, error)
func (*GetCopySubpositionsHistoryService) SetAfter ¶
func (s *GetCopySubpositionsHistoryService) SetAfter(after string) *GetCopySubpositionsHistoryService
SetAfter paginates to records with subPosId earlier than the given id.
func (*GetCopySubpositionsHistoryService) SetBefore ¶
func (s *GetCopySubpositionsHistoryService) SetBefore(before string) *GetCopySubpositionsHistoryService
SetBefore paginates to records with subPosId newer than the given id.
func (*GetCopySubpositionsHistoryService) SetInstId ¶
func (s *GetCopySubpositionsHistoryService) SetInstId(instId string) *GetCopySubpositionsHistoryService
SetInstId filters by a single instrument id.
func (*GetCopySubpositionsHistoryService) SetInstType ¶
func (s *GetCopySubpositionsHistoryService) SetInstType(instType InstType) *GetCopySubpositionsHistoryService
SetInstType filters by product line (SWAP).
func (*GetCopySubpositionsHistoryService) SetLimit ¶
func (s *GetCopySubpositionsHistoryService) SetLimit(limit int) *GetCopySubpositionsHistoryService
SetLimit caps the number of records returned (max 100).
type GetCopyTotalProfitSharingService ¶
type GetCopyTotalProfitSharingService struct {
// contains filtered or unexported fields
}
GetCopyTotalProfitSharingService -- GET /api/v5/copytrading/total-profit-sharing (Read)
Returns the lead trader's accumulated profit-sharing amount per currency.
func (*GetCopyTotalProfitSharingService) Do ¶
func (s *GetCopyTotalProfitSharingService) Do(ctx context.Context) ([]CopyTotalProfitSharing, error)
func (*GetCopyTotalProfitSharingService) SetInstType ¶
func (s *GetCopyTotalProfitSharingService) SetInstType(instType InstType) *GetCopyTotalProfitSharingService
SetInstType filters by product line (SWAP).
type GetCopyTotalUnrealizedProfitSharingService ¶
type GetCopyTotalUnrealizedProfitSharingService struct {
// contains filtered or unexported fields
}
GetCopyTotalUnrealizedProfitSharingService -- GET /api/v5/copytrading/total-unrealized-profit-sharing (Read)
Returns the lead trader's total pending (unrealized) profit-sharing per currency.
func (*GetCopyTotalUnrealizedProfitSharingService) Do ¶
func (s *GetCopyTotalUnrealizedProfitSharingService) Do(ctx context.Context) ([]CopyTotalUnrealizedProfitSharing, error)
func (*GetCopyTotalUnrealizedProfitSharingService) SetInstType ¶
func (s *GetCopyTotalUnrealizedProfitSharingService) SetInstType(instType InstType) *GetCopyTotalUnrealizedProfitSharingService
SetInstType filters by product line (SWAP).
type GetCopyTradersService ¶
type GetCopyTradersService struct {
// contains filtered or unexported fields
}
GetCopyTradersService -- GET /api/v5/copytrading/copy-traders (Read)
Returns the copiers currently following a given lead trader.
func (*GetCopyTradersService) Do ¶
func (s *GetCopyTradersService) Do(ctx context.Context) (*CopyTradersPage, error)
func (*GetCopyTradersService) SetInstType ¶
func (s *GetCopyTradersService) SetInstType(instType InstType) *GetCopyTradersService
SetInstType filters by product line (SWAP).
func (*GetCopyTradersService) SetLimit ¶
func (s *GetCopyTradersService) SetLimit(limit int) *GetCopyTradersService
SetLimit caps the number of records returned (max 10, default 10).
type GetCopyUnrealizedProfitSharingDetailsService ¶
type GetCopyUnrealizedProfitSharingDetailsService struct {
// contains filtered or unexported fields
}
GetCopyUnrealizedProfitSharingDetailsService -- GET /api/v5/copytrading/unrealized-profit-sharing-details (Read)
Returns the lead trader's pending (unrealized) profit-sharing per copier.
func (*GetCopyUnrealizedProfitSharingDetailsService) Do ¶
func (s *GetCopyUnrealizedProfitSharingDetailsService) Do(ctx context.Context) ([]CopyUnrealizedProfitSharingDetail, error)
func (*GetCopyUnrealizedProfitSharingDetailsService) SetInstType ¶
func (s *GetCopyUnrealizedProfitSharingDetailsService) SetInstType(instType InstType) *GetCopyUnrealizedProfitSharingDetailsService
SetInstType filters by product line (SWAP).
type GetCurrenciesService ¶
type GetCurrenciesService struct {
// contains filtered or unexported fields
}
GetCurrenciesService -- GET /api/v5/asset/currencies (private)
Returns the list of all currencies (per chain) available to the account, including deposit/withdrawal capability flags, fee schedule and quotas.
func (*GetCurrenciesService) Do ¶
func (s *GetCurrenciesService) Do(ctx context.Context) ([]Currency, error)
func (*GetCurrenciesService) SetCcy ¶
func (s *GetCurrenciesService) SetCcy(ccy string) *GetCurrenciesService
SetCcy filters by a single (or comma-separated) currency.
type GetDeliveryExerciseHistoryService ¶
type GetDeliveryExerciseHistoryService struct {
// contains filtered or unexported fields
}
GetDeliveryExerciseHistoryService -- GET /api/v5/public/delivery-exercise-history (public)
Returns the delivery (FUTURES) / exercise (OPTION) records of an underlying or instrument family over the last three months.
func (*GetDeliveryExerciseHistoryService) Do ¶
func (s *GetDeliveryExerciseHistoryService) Do(ctx context.Context) ([]DeliveryExerciseHistory, error)
func (*GetDeliveryExerciseHistoryService) SetAfter ¶
func (s *GetDeliveryExerciseHistoryService) SetAfter(t time.Time) *GetDeliveryExerciseHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetDeliveryExerciseHistoryService) SetBefore ¶
func (s *GetDeliveryExerciseHistoryService) SetBefore(t time.Time) *GetDeliveryExerciseHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetDeliveryExerciseHistoryService) SetInstFamily ¶
func (s *GetDeliveryExerciseHistoryService) SetInstFamily(instFamily string) *GetDeliveryExerciseHistoryService
SetInstFamily filters by instrument family.
func (*GetDeliveryExerciseHistoryService) SetLimit ¶
func (s *GetDeliveryExerciseHistoryService) SetLimit(limit int) *GetDeliveryExerciseHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetDeliveryExerciseHistoryService) SetUly ¶
func (s *GetDeliveryExerciseHistoryService) SetUly(uly string) *GetDeliveryExerciseHistoryService
SetUly filters by underlying.
type GetDepositAddressService ¶
type GetDepositAddressService struct {
// contains filtered or unexported fields
}
GetDepositAddressService -- GET /api/v5/asset/deposit-address (private)
Returns the deposit addresses of a currency (one per chain / sub-address).
func (*GetDepositAddressService) Do ¶
func (s *GetDepositAddressService) Do(ctx context.Context) ([]DepositAddress, error)
type GetDepositHistoryService ¶
type GetDepositHistoryService struct {
// contains filtered or unexported fields
}
GetDepositHistoryService -- GET /api/v5/asset/deposit-history (private)
Returns the deposit records of the account.
func (*GetDepositHistoryService) Do ¶
func (s *GetDepositHistoryService) Do(ctx context.Context) ([]DepositHistory, error)
func (*GetDepositHistoryService) SetAfter ¶
func (s *GetDepositHistoryService) SetAfter(t time.Time) *GetDepositHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetDepositHistoryService) SetBefore ¶
func (s *GetDepositHistoryService) SetBefore(t time.Time) *GetDepositHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetDepositHistoryService) SetCcy ¶
func (s *GetDepositHistoryService) SetCcy(ccy string) *GetDepositHistoryService
SetCcy filters by currency.
func (*GetDepositHistoryService) SetDepId ¶
func (s *GetDepositHistoryService) SetDepId(depId string) *GetDepositHistoryService
SetDepId filters by deposit id.
func (*GetDepositHistoryService) SetFromWdId ¶
func (s *GetDepositHistoryService) SetFromWdId(fromWdId string) *GetDepositHistoryService
SetFromWdId filters by the internal-transfer withdrawal id of the sender.
func (*GetDepositHistoryService) SetLimit ¶
func (s *GetDepositHistoryService) SetLimit(limit int) *GetDepositHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetDepositHistoryService) SetState ¶
func (s *GetDepositHistoryService) SetState(state string) *GetDepositHistoryService
SetState filters by deposit state code.
func (*GetDepositHistoryService) SetTxId ¶
func (s *GetDepositHistoryService) SetTxId(txId string) *GetDepositHistoryService
SetTxId filters by the on-chain transaction hash.
func (*GetDepositHistoryService) SetType ¶
func (s *GetDepositHistoryService) SetType(typ string) *GetDepositHistoryService
SetType filters by deposit type code.
type GetDepositWithdrawStatusService ¶
type GetDepositWithdrawStatusService struct {
// contains filtered or unexported fields
}
GetDepositWithdrawStatusService -- GET /api/v5/asset/deposit-withdraw-status (private)
Returns the on-chain status of a deposit or withdrawal. Query by withdrawal id (wdId) for a withdrawal, or by txId + ccy + to + chain for a deposit.
func (*GetDepositWithdrawStatusService) Do ¶
func (s *GetDepositWithdrawStatusService) Do(ctx context.Context) ([]DepositWithdrawStatus, error)
func (*GetDepositWithdrawStatusService) SetCcy ¶
func (s *GetDepositWithdrawStatusService) SetCcy(ccy string) *GetDepositWithdrawStatusService
SetCcy sets the currency (deposit query).
func (*GetDepositWithdrawStatusService) SetChain ¶
func (s *GetDepositWithdrawStatusService) SetChain(chain string) *GetDepositWithdrawStatusService
SetChain sets the chain (deposit query).
func (*GetDepositWithdrawStatusService) SetTo ¶
func (s *GetDepositWithdrawStatusService) SetTo(to string) *GetDepositWithdrawStatusService
SetTo sets the receiving address (deposit query).
func (*GetDepositWithdrawStatusService) SetTxId ¶
func (s *GetDepositWithdrawStatusService) SetTxId(txId string) *GetDepositWithdrawStatusService
SetTxId queries by the on-chain transaction hash (deposit; with ccy/to/chain).
func (*GetDepositWithdrawStatusService) SetWdId ¶
func (s *GetDepositWithdrawStatusService) SetWdId(wdId string) *GetDepositWithdrawStatusService
SetWdId queries by withdrawal id.
type GetDiscountRateInterestFreeQuotaService ¶
type GetDiscountRateInterestFreeQuotaService struct {
// contains filtered or unexported fields
}
GetDiscountRateInterestFreeQuotaService -- GET /api/v5/public/discount-rate-interest-free-quota (public)
Returns the discount-rate tiers and interest-free quota per currency.
func (*GetDiscountRateInterestFreeQuotaService) Do ¶
func (s *GetDiscountRateInterestFreeQuotaService) Do(ctx context.Context) ([]DiscountRateInterestFreeQuota, error)
func (*GetDiscountRateInterestFreeQuotaService) SetCcy ¶
func (s *GetDiscountRateInterestFreeQuotaService) SetCcy(ccy string) *GetDiscountRateInterestFreeQuotaService
SetCcy filters by currency.
func (*GetDiscountRateInterestFreeQuotaService) SetDiscountLv ¶
func (s *GetDiscountRateInterestFreeQuotaService) SetDiscountLv(discountLv string) *GetDiscountRateInterestFreeQuotaService
SetDiscountLv filters by discount level.
type GetEasyConvertCurrencyListService ¶
type GetEasyConvertCurrencyListService struct {
// contains filtered or unexported fields
}
GetEasyConvertCurrencyListService -- GET /api/v5/trade/easy-convert-currency-list (Read)
Returns the small-balance ("dust") currencies eligible for one-click easy-convert and the mainstream currencies they can be converted to.
func (*GetEasyConvertCurrencyListService) Do ¶
func (s *GetEasyConvertCurrencyListService) Do(ctx context.Context) (*EasyConvertCurrencyList, error)
func (*GetEasyConvertCurrencyListService) SetSource ¶
func (s *GetEasyConvertCurrencyListService) SetSource(source ConvertSource) *GetEasyConvertCurrencyListService
SetSource sets the funding source: "1" (trading account, default) or "2" (funding account).
type GetEasyConvertHistoryService ¶
type GetEasyConvertHistoryService struct {
// contains filtered or unexported fields
}
GetEasyConvertHistoryService -- GET /api/v5/trade/easy-convert-history (Read)
Returns the easy-convert order history (last 7 days).
func (*GetEasyConvertHistoryService) Do ¶
func (s *GetEasyConvertHistoryService) Do(ctx context.Context) ([]EasyConvertHistory, error)
func (*GetEasyConvertHistoryService) SetAfter ¶
func (s *GetEasyConvertHistoryService) SetAfter(t time.Time) *GetEasyConvertHistoryService
SetAfter returns records earlier than the given time (paginates by uTime).
func (*GetEasyConvertHistoryService) SetBefore ¶
func (s *GetEasyConvertHistoryService) SetBefore(t time.Time) *GetEasyConvertHistoryService
SetBefore returns records newer than the given time (paginates by uTime).
func (*GetEasyConvertHistoryService) SetLimit ¶
func (s *GetEasyConvertHistoryService) SetLimit(limit int) *GetEasyConvertHistoryService
SetLimit sets the number of results per request (max 100, default 100).
type GetEconomicCalendarService ¶
type GetEconomicCalendarService struct {
// contains filtered or unexported fields
}
GetEconomicCalendarService -- GET /api/v5/public/economic-calendar (signed)
Returns macro-economic calendar events (releases, forecasts and actuals) scoped by region and importance.
func (*GetEconomicCalendarService) Do ¶
func (s *GetEconomicCalendarService) Do(ctx context.Context) ([]EconomicCalendar, error)
func (*GetEconomicCalendarService) SetAfter ¶
func (s *GetEconomicCalendarService) SetAfter(after time.Time) *GetEconomicCalendarService
SetAfter returns events occurring after the given time (pagination by event date, exclusive).
func (*GetEconomicCalendarService) SetBefore ¶
func (s *GetEconomicCalendarService) SetBefore(before time.Time) *GetEconomicCalendarService
SetBefore returns events occurring before the given time (pagination by event date, exclusive).
func (*GetEconomicCalendarService) SetImportance ¶
func (s *GetEconomicCalendarService) SetImportance(importance EconomicCalendarImportance) *GetEconomicCalendarService
SetImportance filters by market-impact rating (1 low / 2 medium / 3 high).
func (*GetEconomicCalendarService) SetLimit ¶
func (s *GetEconomicCalendarService) SetLimit(limit int) *GetEconomicCalendarService
SetLimit caps the number of results (default 100, max 100).
func (*GetEconomicCalendarService) SetRegion ¶
func (s *GetEconomicCalendarService) SetRegion(region string) *GetEconomicCalendarService
SetRegion filters by country/region.
type GetEntrustSubAccountListService ¶
type GetEntrustSubAccountListService struct {
// contains filtered or unexported fields
}
GetEntrustSubAccountListService -- GET /api/v5/users/entrust-subaccount-list (Read)
Returns the custody (entrusted) trading sub-accounts the trading-team master account manages.
func (*GetEntrustSubAccountListService) Do ¶
func (s *GetEntrustSubAccountListService) Do(ctx context.Context) ([]EntrustSubAccount, error)
func (*GetEntrustSubAccountListService) SetSubAcct ¶
func (s *GetEntrustSubAccountListService) SetSubAcct(subAcct string) *GetEntrustSubAccountListService
SetSubAcct filters by sub-account name.
type GetEstimatedPriceService ¶
type GetEstimatedPriceService struct {
// contains filtered or unexported fields
}
GetEstimatedPriceService -- GET /api/v5/public/estimated-price (public)
Returns the estimated delivery/exercise price of a FUTURES or OPTION instrument (only available within the hour before delivery/exercise).
func (*GetEstimatedPriceService) Do ¶
func (s *GetEstimatedPriceService) Do(ctx context.Context) (*EstimatedPrice, error)
type GetEthStakingApyHistoryService ¶
type GetEthStakingApyHistoryService struct {
// contains filtered or unexported fields
}
GetEthStakingApyHistoryService -- GET /api/v5/finance/staking-defi/eth/apy-history (Read)
Returns the ETH staking APY history for the trailing number of days.
func (*GetEthStakingApyHistoryService) Do ¶
func (s *GetEthStakingApyHistoryService) Do(ctx context.Context) ([]StakingApyHistory, error)
type GetEthStakingBalanceService ¶
type GetEthStakingBalanceService struct {
// contains filtered or unexported fields
}
GetEthStakingBalanceService -- GET /api/v5/finance/staking-defi/eth/balance (Read)
Returns the account's BETH balance and accrued staking interest.
func (*GetEthStakingBalanceService) Do ¶
func (s *GetEthStakingBalanceService) Do(ctx context.Context) ([]EthStakingBalance, error)
type GetEthStakingHistoryService ¶
type GetEthStakingHistoryService struct {
// contains filtered or unexported fields
}
GetEthStakingHistoryService -- GET /api/v5/finance/staking-defi/eth/purchase-redeem-history (Read)
Returns the account's ETH staking purchase and redemption history.
func (*GetEthStakingHistoryService) Do ¶
func (s *GetEthStakingHistoryService) Do(ctx context.Context) ([]EthStakingHistory, error)
func (*GetEthStakingHistoryService) SetAfter ¶
func (s *GetEthStakingHistoryService) SetAfter(t time.Time) *GetEthStakingHistoryService
SetAfter paginates to records earlier than the given request time (older).
func (*GetEthStakingHistoryService) SetBefore ¶
func (s *GetEthStakingHistoryService) SetBefore(t time.Time) *GetEthStakingHistoryService
SetBefore paginates to records later than the given request time (newer).
func (*GetEthStakingHistoryService) SetLimit ¶
func (s *GetEthStakingHistoryService) SetLimit(limit int) *GetEthStakingHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetEthStakingHistoryService) SetStatus ¶
func (s *GetEthStakingHistoryService) SetStatus(status string) *GetEthStakingHistoryService
SetStatus filters by record status (pending/success/failed).
func (*GetEthStakingHistoryService) SetType ¶
func (s *GetEthStakingHistoryService) SetType(typ string) *GetEthStakingHistoryService
SetType filters by record type (purchase/redeem).
type GetEthStakingProductInfoService ¶
type GetEthStakingProductInfoService struct {
// contains filtered or unexported fields
}
GetEthStakingProductInfoService -- GET /api/v5/finance/staking-defi/eth/product-info (Read)
Returns the ETH staking product parameters (rate, min amount, redemption window and fast-redemption daily limit).
func (*GetEthStakingProductInfoService) Do ¶
func (s *GetEthStakingProductInfoService) Do(ctx context.Context) (*EthStakingProductInfo, error)
type GetExchangeListService ¶
type GetExchangeListService struct {
// contains filtered or unexported fields
}
GetExchangeListService -- GET /api/v5/asset/exchange-list (private)
Returns the list of supported exchanges and their ids (used to tag counterparty exchanges for travel-rule withdrawals).
type GetExchangeRateService ¶
type GetExchangeRateService struct {
// contains filtered or unexported fields
}
GetExchangeRateService -- GET /api/v5/market/exchange-rate (public)
Retrieves the average exchange rate for USD-CNY over the past 2 weeks.
func (*GetExchangeRateService) Do ¶
func (s *GetExchangeRateService) Do(ctx context.Context) (*ExchangeRate, error)
type GetFillsHistoryService ¶
type GetFillsHistoryService struct {
// contains filtered or unexported fields
}
GetFillsHistoryService -- GET /api/v5/trade/fills-history (Read)
Returns the account's transaction (fill) details over the last three months. instType is required.
func (*GetFillsHistoryService) Do ¶
func (s *GetFillsHistoryService) Do(ctx context.Context) ([]Fill, error)
func (*GetFillsHistoryService) SetAfter ¶
func (s *GetFillsHistoryService) SetAfter(after string) *GetFillsHistoryService
SetAfter paginates to records with a billId earlier than the given one (older).
func (*GetFillsHistoryService) SetBefore ¶
func (s *GetFillsHistoryService) SetBefore(before string) *GetFillsHistoryService
SetBefore paginates to records with a billId later than the given one (newer).
func (*GetFillsHistoryService) SetBegin ¶
func (s *GetFillsHistoryService) SetBegin(t time.Time) *GetFillsHistoryService
SetBegin filters to fills at or after the given time (by ts).
func (*GetFillsHistoryService) SetEnd ¶
func (s *GetFillsHistoryService) SetEnd(t time.Time) *GetFillsHistoryService
SetEnd filters to fills at or before the given time (by ts).
func (*GetFillsHistoryService) SetInstFamily ¶
func (s *GetFillsHistoryService) SetInstFamily(instFamily string) *GetFillsHistoryService
SetInstFamily filters by instrument family.
func (*GetFillsHistoryService) SetInstId ¶
func (s *GetFillsHistoryService) SetInstId(instId string) *GetFillsHistoryService
SetInstId filters by instrument id.
func (*GetFillsHistoryService) SetLimit ¶
func (s *GetFillsHistoryService) SetLimit(limit int) *GetFillsHistoryService
SetLimit caps the number of records returned (max 100, default 100).
func (*GetFillsHistoryService) SetOrdId ¶
func (s *GetFillsHistoryService) SetOrdId(ordId string) *GetFillsHistoryService
SetOrdId filters by order id.
func (*GetFillsHistoryService) SetSubType ¶
func (s *GetFillsHistoryService) SetSubType(subType string) *GetFillsHistoryService
SetSubType filters by transaction type (e.g. 1 buy, 2 sell, ...).
func (*GetFillsHistoryService) SetUly ¶
func (s *GetFillsHistoryService) SetUly(uly string) *GetFillsHistoryService
SetUly filters by underlying.
type GetFillsService ¶
type GetFillsService struct {
// contains filtered or unexported fields
}
GetFillsService -- GET /api/v5/trade/fills (Read)
Returns the account's transaction (fill) details for the last three days.
func (*GetFillsService) SetAfter ¶
func (s *GetFillsService) SetAfter(after string) *GetFillsService
SetAfter paginates to records with a billId earlier than the given one (older).
func (*GetFillsService) SetBefore ¶
func (s *GetFillsService) SetBefore(before string) *GetFillsService
SetBefore paginates to records with a billId later than the given one (newer).
func (*GetFillsService) SetBegin ¶
func (s *GetFillsService) SetBegin(t time.Time) *GetFillsService
SetBegin filters to fills at or after the given time (by ts).
func (*GetFillsService) SetEnd ¶
func (s *GetFillsService) SetEnd(t time.Time) *GetFillsService
SetEnd filters to fills at or before the given time (by ts).
func (*GetFillsService) SetInstFamily ¶
func (s *GetFillsService) SetInstFamily(instFamily string) *GetFillsService
SetInstFamily filters by instrument family.
func (*GetFillsService) SetInstId ¶
func (s *GetFillsService) SetInstId(instId string) *GetFillsService
SetInstId filters by instrument id.
func (*GetFillsService) SetInstType ¶
func (s *GetFillsService) SetInstType(instType InstType) *GetFillsService
SetInstType filters by product line (SPOT/MARGIN/SWAP/FUTURES/OPTION).
func (*GetFillsService) SetLimit ¶
func (s *GetFillsService) SetLimit(limit int) *GetFillsService
SetLimit caps the number of records returned (max 100, default 100).
func (*GetFillsService) SetOrdId ¶
func (s *GetFillsService) SetOrdId(ordId string) *GetFillsService
SetOrdId filters by order id.
func (*GetFillsService) SetSubType ¶
func (s *GetFillsService) SetSubType(subType string) *GetFillsService
SetSubType filters by transaction type (e.g. 1 buy, 2 sell, ...).
func (*GetFillsService) SetUly ¶
func (s *GetFillsService) SetUly(uly string) *GetFillsService
SetUly filters by underlying.
type GetFixedLoanLendingApyHistoryService ¶
type GetFixedLoanLendingApyHistoryService struct {
// contains filtered or unexported fields
}
GetFixedLoanLendingApyHistoryService -- GET /api/v5/finance/fixed-loan/lending-apy-history (Read)
Returns the historical lending APY for a currency/term.
func (*GetFixedLoanLendingApyHistoryService) Do ¶
func (s *GetFixedLoanLendingApyHistoryService) Do(ctx context.Context) ([]FixedLoanLendingApyHistory, error)
type GetFixedLoanLendingOffersService ¶
type GetFixedLoanLendingOffersService struct {
// contains filtered or unexported fields
}
GetFixedLoanLendingOffersService -- GET /api/v5/finance/fixed-loan/lending-offers (Read)
Returns the available fixed-loan lending offers (estimated APY and limits per currency/term).
func (*GetFixedLoanLendingOffersService) Do ¶
func (s *GetFixedLoanLendingOffersService) Do(ctx context.Context) ([]FixedLoanLendingOffer, error)
func (*GetFixedLoanLendingOffersService) SetCcy ¶
func (s *GetFixedLoanLendingOffersService) SetCcy(ccy string) *GetFixedLoanLendingOffersService
SetCcy filters by lending currency.
func (*GetFixedLoanLendingOffersService) SetTerm ¶
func (s *GetFixedLoanLendingOffersService) SetTerm(term string) *GetFixedLoanLendingOffersService
SetTerm filters by lending term (e.g. 30D).
type GetFixedLoanLendingOrdersListService ¶
type GetFixedLoanLendingOrdersListService struct {
// contains filtered or unexported fields
}
GetFixedLoanLendingOrdersListService -- GET /api/v5/finance/fixed-loan/lending-orders-list (Read)
Returns the account's fixed-loan lending orders.
func (*GetFixedLoanLendingOrdersListService) Do ¶
func (s *GetFixedLoanLendingOrdersListService) Do(ctx context.Context) ([]FixedLoanLendingOrder, error)
func (*GetFixedLoanLendingOrdersListService) SetAfter ¶
func (s *GetFixedLoanLendingOrdersListService) SetAfter(t time.Time) *GetFixedLoanLendingOrdersListService
SetAfter paginates to records earlier than the given time (older).
func (*GetFixedLoanLendingOrdersListService) SetBefore ¶
func (s *GetFixedLoanLendingOrdersListService) SetBefore(t time.Time) *GetFixedLoanLendingOrdersListService
SetBefore paginates to records later than the given time (newer).
func (*GetFixedLoanLendingOrdersListService) SetCcy ¶
func (s *GetFixedLoanLendingOrdersListService) SetCcy(ccy string) *GetFixedLoanLendingOrdersListService
SetCcy filters by lending currency.
func (*GetFixedLoanLendingOrdersListService) SetLimit ¶
func (s *GetFixedLoanLendingOrdersListService) SetLimit(limit int) *GetFixedLoanLendingOrdersListService
SetLimit caps the number of records returned (max 100).
func (*GetFixedLoanLendingOrdersListService) SetOrdId ¶
func (s *GetFixedLoanLendingOrdersListService) SetOrdId(ordId string) *GetFixedLoanLendingOrdersListService
SetOrdId filters by order id.
func (*GetFixedLoanLendingOrdersListService) SetState ¶
func (s *GetFixedLoanLendingOrdersListService) SetState(state string) *GetFixedLoanLendingOrdersListService
SetState filters by order state.
func (*GetFixedLoanLendingOrdersListService) SetTerm ¶
func (s *GetFixedLoanLendingOrdersListService) SetTerm(term string) *GetFixedLoanLendingOrdersListService
SetTerm filters by lending term.
type GetFixedLoanLendingSubOrdersService ¶
type GetFixedLoanLendingSubOrdersService struct {
// contains filtered or unexported fields
}
GetFixedLoanLendingSubOrdersService -- GET /api/v5/finance/fixed-loan/lending-sub-orders (Read)
Returns the sub-orders of a fixed-loan lending order.
func (*GetFixedLoanLendingSubOrdersService) Do ¶
func (s *GetFixedLoanLendingSubOrdersService) Do(ctx context.Context) ([]FixedLoanLendingSubOrder, error)
type GetFixedLoanPendingLendingVolumeService ¶
type GetFixedLoanPendingLendingVolumeService struct {
// contains filtered or unexported fields
}
GetFixedLoanPendingLendingVolumeService -- GET /api/v5/finance/fixed-loan/pending-lending-volume (Read)
Returns the pending (queued) lending volume for a currency/term.
func (*GetFixedLoanPendingLendingVolumeService) Do ¶
func (s *GetFixedLoanPendingLendingVolumeService) Do(ctx context.Context) ([]FixedLoanPendingLendingVolume, error)
type GetFlexLoanBorrowCurrenciesService ¶
type GetFlexLoanBorrowCurrenciesService struct {
// contains filtered or unexported fields
}
GetFlexLoanBorrowCurrenciesService -- GET /api/v5/finance/flexible-loan/borrow-currencies (Read)
Returns the currencies that can be borrowed via flexible loan.
func (*GetFlexLoanBorrowCurrenciesService) Do ¶
func (s *GetFlexLoanBorrowCurrenciesService) Do(ctx context.Context) ([]FlexLoanBorrowCurrency, error)
type GetFlexLoanCollateralAssetsService ¶
type GetFlexLoanCollateralAssetsService struct {
// contains filtered or unexported fields
}
GetFlexLoanCollateralAssetsService -- GET /api/v5/finance/flexible-loan/collateral-assets (Read)
Returns the assets eligible as flexible-loan collateral. The data is a single object wrapping an "assets" array.
func (*GetFlexLoanCollateralAssetsService) Do ¶
func (s *GetFlexLoanCollateralAssetsService) Do(ctx context.Context) (*FlexLoanCollateralAssets, error)
func (*GetFlexLoanCollateralAssetsService) SetCcy ¶
func (s *GetFlexLoanCollateralAssetsService) SetCcy(ccy string) *GetFlexLoanCollateralAssetsService
SetCcy filters by collateral currency.
type GetFlexLoanInterestAccruedService ¶
type GetFlexLoanInterestAccruedService struct {
// contains filtered or unexported fields
}
GetFlexLoanInterestAccruedService -- GET /api/v5/finance/flexible-loan/interest-accrued (Read)
Returns the account's accrued flexible-loan interest records. The validating account has no records (empty data), so FlexLoanInterestAccrued is modeled from the OKX doc field table.
func (*GetFlexLoanInterestAccruedService) Do ¶
func (s *GetFlexLoanInterestAccruedService) Do(ctx context.Context) ([]FlexLoanInterestAccrued, error)
func (*GetFlexLoanInterestAccruedService) SetAfter ¶
func (s *GetFlexLoanInterestAccruedService) SetAfter(t time.Time) *GetFlexLoanInterestAccruedService
SetAfter paginates to records earlier than the given time (older).
func (*GetFlexLoanInterestAccruedService) SetBefore ¶
func (s *GetFlexLoanInterestAccruedService) SetBefore(t time.Time) *GetFlexLoanInterestAccruedService
SetBefore paginates to records later than the given time (newer).
func (*GetFlexLoanInterestAccruedService) SetCcy ¶
func (s *GetFlexLoanInterestAccruedService) SetCcy(ccy string) *GetFlexLoanInterestAccruedService
SetCcy filters by borrowed currency.
func (*GetFlexLoanInterestAccruedService) SetLimit ¶
func (s *GetFlexLoanInterestAccruedService) SetLimit(limit int) *GetFlexLoanInterestAccruedService
SetLimit caps the number of records returned (max 100).
type GetFlexLoanLoanHistoryService ¶
type GetFlexLoanLoanHistoryService struct {
// contains filtered or unexported fields
}
GetFlexLoanLoanHistoryService -- GET /api/v5/finance/flexible-loan/loan-history (Read)
Returns the account's flexible-loan event history (borrow / repay / liquidation). The validating account has no history (empty data), so FlexLoanHistory is modeled from the OKX doc field table.
func (*GetFlexLoanLoanHistoryService) Do ¶
func (s *GetFlexLoanLoanHistoryService) Do(ctx context.Context) ([]FlexLoanHistory, error)
func (*GetFlexLoanLoanHistoryService) SetAfter ¶
func (s *GetFlexLoanLoanHistoryService) SetAfter(t time.Time) *GetFlexLoanLoanHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetFlexLoanLoanHistoryService) SetBefore ¶
func (s *GetFlexLoanLoanHistoryService) SetBefore(t time.Time) *GetFlexLoanLoanHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetFlexLoanLoanHistoryService) SetLimit ¶
func (s *GetFlexLoanLoanHistoryService) SetLimit(limit int) *GetFlexLoanLoanHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetFlexLoanLoanHistoryService) SetType ¶
func (s *GetFlexLoanLoanHistoryService) SetType(typ string) *GetFlexLoanLoanHistoryService
SetType filters by event type.
type GetFlexLoanLoanInfoService ¶
type GetFlexLoanLoanInfoService struct {
// contains filtered or unexported fields
}
GetFlexLoanLoanInfoService -- GET /api/v5/finance/flexible-loan/loan-info (Read)
Returns the account's current flexible-loan position (borrowed amounts, collateral and loan-to-value ratios). The validating account has no flexible loan (empty data), so FlexLoanInfo is modeled from the OKX doc field table.
func (*GetFlexLoanLoanInfoService) Do ¶
func (s *GetFlexLoanLoanInfoService) Do(ctx context.Context) (*FlexLoanInfo, error)
type GetFlexLoanMaxLoanService ¶
type GetFlexLoanMaxLoanService struct {
// contains filtered or unexported fields
}
GetFlexLoanMaxLoanService -- POST /api/v5/finance/flexible-loan/max-loan (Read)
Computes the maximum loanable amount for a borrow currency given the supplied (or current) collateral. This is a non-state-changing calculation served over POST (it returns 405 to GET).
func (*GetFlexLoanMaxLoanService) Do ¶
func (s *GetFlexLoanMaxLoanService) Do(ctx context.Context) ([]FlexLoanMaxLoan, error)
func (*GetFlexLoanMaxLoanService) SetSupCollateral ¶
func (s *GetFlexLoanMaxLoanService) SetSupCollateral(supCollateral []FlexLoanSupCollateral) *GetFlexLoanMaxLoanService
SetSupCollateral sets the supplementary collateral used in the calculation (each item a {ccy, amt} pair).
type GetFundingBalanceService ¶
type GetFundingBalanceService struct {
// contains filtered or unexported fields
}
GetFundingBalanceService -- GET /api/v5/asset/balances (private)
Returns the balances in the funding account.
func (*GetFundingBalanceService) Do ¶
func (s *GetFundingBalanceService) Do(ctx context.Context) ([]FundingBalance, error)
func (*GetFundingBalanceService) SetCcy ¶
func (s *GetFundingBalanceService) SetCcy(ccy string) *GetFundingBalanceService
SetCcy filters by a single (or comma-separated) currency.
type GetFundingRateHistoryService ¶
type GetFundingRateHistoryService struct {
// contains filtered or unexported fields
}
GetFundingRateHistoryService -- GET /api/v5/public/funding-rate-history (public)
Returns the historical (realized) funding rates of a perpetual swap.
func (*GetFundingRateHistoryService) Do ¶
func (s *GetFundingRateHistoryService) Do(ctx context.Context) ([]FundingRateHistory, error)
func (*GetFundingRateHistoryService) SetAfter ¶
func (s *GetFundingRateHistoryService) SetAfter(t time.Time) *GetFundingRateHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetFundingRateHistoryService) SetBefore ¶
func (s *GetFundingRateHistoryService) SetBefore(t time.Time) *GetFundingRateHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetFundingRateHistoryService) SetLimit ¶
func (s *GetFundingRateHistoryService) SetLimit(limit int) *GetFundingRateHistoryService
SetLimit caps the number of records returned (max 100).
type GetFundingRateService ¶
type GetFundingRateService struct {
// contains filtered or unexported fields
}
GetFundingRateService -- GET /api/v5/public/funding-rate (public)
Returns the current funding rate of a perpetual swap.
func (*GetFundingRateService) Do ¶
func (s *GetFundingRateService) Do(ctx context.Context) (*FundingRate, error)
type GetGLPHistoricalPerformanceService ¶ added in v0.20260723.0
type GetGLPHistoricalPerformanceService struct {
// contains filtered or unexported fields
}
GetGLPHistoricalPerformanceService -- GET /api/v5/users/glp/historical-performance (Read)
Returns the enrolled GLP account's daily performance history for one program, sorted newest-first.
func (*GetGLPHistoricalPerformanceService) Do ¶ added in v0.20260723.0
func (s *GetGLPHistoricalPerformanceService) Do(ctx context.Context) ([]GLPHistoricalPerformance, error)
func (*GetGLPHistoricalPerformanceService) SetBegin ¶ added in v0.20260723.0
func (s *GetGLPHistoricalPerformanceService) SetBegin(ms int64) *GetGLPHistoricalPerformanceService
SetBegin filters to records at or after the given ms timestamp.
func (*GetGLPHistoricalPerformanceService) SetEnd ¶ added in v0.20260723.0
func (s *GetGLPHistoricalPerformanceService) SetEnd(ms int64) *GetGLPHistoricalPerformanceService
SetEnd filters to records at or before the given ms timestamp.
func (*GetGLPHistoricalPerformanceService) SetLimit ¶ added in v0.20260723.0
func (s *GetGLPHistoricalPerformanceService) SetLimit(limit int) *GetGLPHistoricalPerformanceService
SetLimit caps the number of daily records returned (default 31, max 100).
type GetGLPTodayPerformanceService ¶ added in v0.20260723.0
type GetGLPTodayPerformanceService struct {
// contains filtered or unexported fields
}
GetGLPTodayPerformanceService -- GET /api/v5/users/glp/today-performance (Read)
Returns the enrolled GLP (Global Liquidity Program) account's current-day and month-to-date assessment snapshots across all programs. Only available to accounts enrolled in a GLP market-maker program; the account is resolved from the API key, so there are no request parameters.
func (*GetGLPTodayPerformanceService) Do ¶ added in v0.20260723.0
func (s *GetGLPTodayPerformanceService) Do(ctx context.Context) (*GLPTodayPerformance, error)
type GetGreeksService ¶
type GetGreeksService struct {
// contains filtered or unexported fields
}
GetGreeksService -- GET /api/v5/account/greeks (Read)
Returns the account's per-currency option greeks.
func (*GetGreeksService) SetCcy ¶
func (s *GetGreeksService) SetCcy(ccy string) *GetGreeksService
SetCcy filters by currency.
type GetGridAIParamService ¶
type GetGridAIParamService struct {
// contains filtered or unexported fields
}
GetGridAIParamService -- GET /api/v5/tradingBot/grid/ai-param (public)
Returns OKX's AI-recommended grid parameters for an instrument. Public (no signing required).
func (*GetGridAIParamService) Do ¶
func (s *GetGridAIParamService) Do(ctx context.Context) ([]GridAIParam, error)
func (*GetGridAIParamService) SetDirection ¶
func (s *GetGridAIParamService) SetDirection(direction GridDirection) *GetGridAIParamService
SetDirection sets the contract grid direction (contract_grid only).
func (*GetGridAIParamService) SetDuration ¶
func (s *GetGridAIParamService) SetDuration(duration string) *GetGridAIParamService
SetDuration sets the back-test duration (e.g. "7D", "30D", "180D").
type GetGridAlgoDetailsService ¶
type GetGridAlgoDetailsService struct {
// contains filtered or unexported fields
}
GetGridAlgoDetailsService -- GET /api/v5/tradingBot/grid/orders-algo-details (Read)
Returns the full detail of a single grid algo order.
func (*GetGridAlgoDetailsService) Do ¶
func (s *GetGridAlgoDetailsService) Do(ctx context.Context) (*GridAlgoOrder, error)
type GetGridAlgoHistoryService ¶
type GetGridAlgoHistoryService struct {
// contains filtered or unexported fields
}
GetGridAlgoHistoryService -- GET /api/v5/tradingBot/grid/orders-algo-history (Read)
Returns the account's stopped (historical) grid algo orders.
func (*GetGridAlgoHistoryService) Do ¶
func (s *GetGridAlgoHistoryService) Do(ctx context.Context) ([]GridAlgoOrder, error)
func (*GetGridAlgoHistoryService) SetAfter ¶
func (s *GetGridAlgoHistoryService) SetAfter(algoId string) *GetGridAlgoHistoryService
SetAfter paginates to records earlier than the given algoId (older).
func (*GetGridAlgoHistoryService) SetAlgoId ¶
func (s *GetGridAlgoHistoryService) SetAlgoId(algoId string) *GetGridAlgoHistoryService
SetAlgoId filters by algo order id.
func (*GetGridAlgoHistoryService) SetBefore ¶
func (s *GetGridAlgoHistoryService) SetBefore(algoId string) *GetGridAlgoHistoryService
SetBefore paginates to records later than the given algoId (newer).
func (*GetGridAlgoHistoryService) SetInstId ¶
func (s *GetGridAlgoHistoryService) SetInstId(instId string) *GetGridAlgoHistoryService
SetInstId filters by instrument id.
func (*GetGridAlgoHistoryService) SetInstType ¶
func (s *GetGridAlgoHistoryService) SetInstType(instType InstType) *GetGridAlgoHistoryService
SetInstType filters by product line.
func (*GetGridAlgoHistoryService) SetLimit ¶
func (s *GetGridAlgoHistoryService) SetLimit(limit int) *GetGridAlgoHistoryService
SetLimit caps the number of records returned (max 100).
type GetGridAlgoPendingService ¶
type GetGridAlgoPendingService struct {
// contains filtered or unexported fields
}
GetGridAlgoPendingService -- GET /api/v5/tradingBot/grid/orders-algo-pending (Read)
Returns the account's currently running (pending) grid algo orders.
func (*GetGridAlgoPendingService) Do ¶
func (s *GetGridAlgoPendingService) Do(ctx context.Context) ([]GridAlgoOrder, error)
func (*GetGridAlgoPendingService) SetAfter ¶
func (s *GetGridAlgoPendingService) SetAfter(algoId string) *GetGridAlgoPendingService
SetAfter paginates to records earlier than the given algoId (older).
func (*GetGridAlgoPendingService) SetAlgoId ¶
func (s *GetGridAlgoPendingService) SetAlgoId(algoId string) *GetGridAlgoPendingService
SetAlgoId filters by algo order id.
func (*GetGridAlgoPendingService) SetBefore ¶
func (s *GetGridAlgoPendingService) SetBefore(algoId string) *GetGridAlgoPendingService
SetBefore paginates to records later than the given algoId (newer).
func (*GetGridAlgoPendingService) SetInstId ¶
func (s *GetGridAlgoPendingService) SetInstId(instId string) *GetGridAlgoPendingService
SetInstId filters by instrument id.
func (*GetGridAlgoPendingService) SetInstType ¶
func (s *GetGridAlgoPendingService) SetInstType(instType InstType) *GetGridAlgoPendingService
SetInstType filters by product line.
func (*GetGridAlgoPendingService) SetLimit ¶
func (s *GetGridAlgoPendingService) SetLimit(limit int) *GetGridAlgoPendingService
SetLimit caps the number of records returned (max 100).
type GetGridMinInvestmentService ¶
type GetGridMinInvestmentService struct {
// contains filtered or unexported fields
}
GetGridMinInvestmentService -- POST /api/v5/tradingBot/grid/min-investment (public calc)
Computes the minimum investment required for a given grid configuration. This is a public stateless calculator (no signing required), but its body carries several conditional fields, so it is provided implement-only and is not exercised by the live test. Returns the minimum investable amount per currency.
func (*GetGridMinInvestmentService) Do ¶
func (s *GetGridMinInvestmentService) Do(ctx context.Context) (*GridMinInvestment, error)
func (*GetGridMinInvestmentService) SetAmt ¶
func (s *GetGridMinInvestmentService) SetAmt(amt decimal.Decimal) *GetGridMinInvestmentService
SetAmt sets the planned investment amount.
func (*GetGridMinInvestmentService) SetBasePos ¶
func (s *GetGridMinInvestmentService) SetBasePos(basePos bool) *GetGridMinInvestmentService
SetBasePos toggles whether to open a base position (contract_grid only).
func (*GetGridMinInvestmentService) SetDirection ¶
func (s *GetGridMinInvestmentService) SetDirection(direction GridDirection) *GetGridMinInvestmentService
SetDirection sets the contract grid direction (contract_grid only).
func (*GetGridMinInvestmentService) SetInvestmentData ¶
func (s *GetGridMinInvestmentService) SetInvestmentData(data []GridInvestmentDataInput) *GetGridMinInvestmentService
SetInvestmentData sets per-currency planned investment entries.
func (*GetGridMinInvestmentService) SetInvestmentType ¶
func (s *GetGridMinInvestmentService) SetInvestmentType(investmentType string) *GetGridMinInvestmentService
SetInvestmentType sets the investment type ("quote", "base").
func (*GetGridMinInvestmentService) SetLever ¶
func (s *GetGridMinInvestmentService) SetLever(lever decimal.Decimal) *GetGridMinInvestmentService
SetLever sets the leverage (contract_grid only).
type GetGridPositionsService ¶
type GetGridPositionsService struct {
// contains filtered or unexported fields
}
GetGridPositionsService -- GET /api/v5/tradingBot/grid/positions (Read)
Returns the open positions held by a contract grid algo order.
func (*GetGridPositionsService) Do ¶
func (s *GetGridPositionsService) Do(ctx context.Context) ([]GridPosition, error)
type GetGridRSIBackTestingService ¶
type GetGridRSIBackTestingService struct {
// contains filtered or unexported fields
}
GetGridRSIBackTestingService -- GET /api/v5/tradingBot/public/rsi-back-testing (public)
Back-tests how many times an RSI trigger condition would have fired for an instrument over a duration. Public (no signing required).
func (*GetGridRSIBackTestingService) Do ¶
func (s *GetGridRSIBackTestingService) Do(ctx context.Context) (*GridRSIBackTesting, error)
type GetGridSubOrdersService ¶
type GetGridSubOrdersService struct {
// contains filtered or unexported fields
}
GetGridSubOrdersService -- GET /api/v5/tradingBot/grid/sub-orders (Read)
Returns the live or filled sub-orders of a grid algo order.
func (*GetGridSubOrdersService) Do ¶
func (s *GetGridSubOrdersService) Do(ctx context.Context) ([]GridSubOrder, error)
func (*GetGridSubOrdersService) SetAfter ¶
func (s *GetGridSubOrdersService) SetAfter(ordId string) *GetGridSubOrdersService
SetAfter paginates to records earlier than the given ordId (older).
func (*GetGridSubOrdersService) SetBefore ¶
func (s *GetGridSubOrdersService) SetBefore(ordId string) *GetGridSubOrdersService
SetBefore paginates to records later than the given ordId (newer).
func (*GetGridSubOrdersService) SetGroupId ¶
func (s *GetGridSubOrdersService) SetGroupId(groupId string) *GetGridSubOrdersService
SetGroupId filters by grid group id.
func (*GetGridSubOrdersService) SetInstType ¶
func (s *GetGridSubOrdersService) SetInstType(instType InstType) *GetGridSubOrdersService
SetInstType filters by product line.
func (*GetGridSubOrdersService) SetLimit ¶
func (s *GetGridSubOrdersService) SetLimit(limit int) *GetGridSubOrdersService
SetLimit caps the number of records returned (max 100).
type GetHistoryCandlesService ¶
type GetHistoryCandlesService struct {
// contains filtered or unexported fields
}
GetHistoryCandlesService -- GET /api/v5/market/history-candles (public)
Returns historical candlestick data for an instrument.
func (*GetHistoryCandlesService) Do ¶
func (s *GetHistoryCandlesService) Do(ctx context.Context) ([]Candle, error)
func (*GetHistoryCandlesService) SetAfter ¶
func (s *GetHistoryCandlesService) SetAfter(after time.Time) *GetHistoryCandlesService
SetAfter requests candles before the given timestamp (paging backward).
func (*GetHistoryCandlesService) SetBar ¶
func (s *GetHistoryCandlesService) SetBar(bar MarketBar) *GetHistoryCandlesService
SetBar sets the candle time granularity (default 1m).
func (*GetHistoryCandlesService) SetBefore ¶
func (s *GetHistoryCandlesService) SetBefore(before time.Time) *GetHistoryCandlesService
SetBefore requests candles after the given timestamp (paging forward).
func (*GetHistoryCandlesService) SetLimit ¶
func (s *GetHistoryCandlesService) SetLimit(limit int) *GetHistoryCandlesService
SetLimit caps the number of returned candles (max 100, default 100).
type GetHistoryIndexCandlesService ¶
type GetHistoryIndexCandlesService struct {
// contains filtered or unexported fields
}
GetHistoryIndexCandlesService -- GET /api/v5/market/history-index-candles (public)
Retrieves the older candlestick charts of an index from the last 3 months.
func (*GetHistoryIndexCandlesService) Do ¶
func (s *GetHistoryIndexCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
func (*GetHistoryIndexCandlesService) SetAfter ¶
func (s *GetHistoryIndexCandlesService) SetAfter(v time.Time) *GetHistoryIndexCandlesService
SetAfter requests records earlier than the given timestamp (pagination).
func (*GetHistoryIndexCandlesService) SetBar ¶
func (s *GetHistoryIndexCandlesService) SetBar(v string) *GetHistoryIndexCandlesService
SetBar sets the bar size (e.g. 1m, 5m, 1H, 1D). Default is 1m.
func (*GetHistoryIndexCandlesService) SetBefore ¶
func (s *GetHistoryIndexCandlesService) SetBefore(v time.Time) *GetHistoryIndexCandlesService
SetBefore requests records newer than the given timestamp (pagination).
func (*GetHistoryIndexCandlesService) SetLimit ¶
func (s *GetHistoryIndexCandlesService) SetLimit(v int) *GetHistoryIndexCandlesService
SetLimit sets the number of results per request (max 100, default 100).
type GetHistoryMarkPriceCandlesService ¶
type GetHistoryMarkPriceCandlesService struct {
// contains filtered or unexported fields
}
GetHistoryMarkPriceCandlesService -- GET /api/v5/market/history-mark-price-candles (public)
Retrieves the older candlestick charts of the mark price from the last 3 months.
func (*GetHistoryMarkPriceCandlesService) Do ¶
func (s *GetHistoryMarkPriceCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
func (*GetHistoryMarkPriceCandlesService) SetAfter ¶
func (s *GetHistoryMarkPriceCandlesService) SetAfter(v time.Time) *GetHistoryMarkPriceCandlesService
SetAfter requests records earlier than the given timestamp (pagination).
func (*GetHistoryMarkPriceCandlesService) SetBar ¶
func (s *GetHistoryMarkPriceCandlesService) SetBar(v string) *GetHistoryMarkPriceCandlesService
SetBar sets the bar size (e.g. 1m, 5m, 1H, 1D). Default is 1m.
func (*GetHistoryMarkPriceCandlesService) SetBefore ¶
func (s *GetHistoryMarkPriceCandlesService) SetBefore(v time.Time) *GetHistoryMarkPriceCandlesService
SetBefore requests records newer than the given timestamp (pagination).
func (*GetHistoryMarkPriceCandlesService) SetLimit ¶
func (s *GetHistoryMarkPriceCandlesService) SetLimit(v int) *GetHistoryMarkPriceCandlesService
SetLimit sets the number of results per request (max 100, default 100).
type GetHistoryTradesService ¶
type GetHistoryTradesService struct {
// contains filtered or unexported fields
}
GetHistoryTradesService -- GET /api/v5/market/history-trades (public)
Returns historical public trades for an instrument (paged).
func (*GetHistoryTradesService) Do ¶
func (s *GetHistoryTradesService) Do(ctx context.Context) ([]Trade, error)
func (*GetHistoryTradesService) SetAfter ¶
func (s *GetHistoryTradesService) SetAfter(after string) *GetHistoryTradesService
SetAfter pages backward from the given tradeId or timestamp (per type).
func (*GetHistoryTradesService) SetBefore ¶
func (s *GetHistoryTradesService) SetBefore(before string) *GetHistoryTradesService
SetBefore pages forward from the given tradeId (type=1 only).
func (*GetHistoryTradesService) SetLimit ¶
func (s *GetHistoryTradesService) SetLimit(limit int) *GetHistoryTradesService
SetLimit caps the number of returned trades (max 100, default 100).
func (*GetHistoryTradesService) SetType ¶
func (s *GetHistoryTradesService) SetType(typ MarketHistoryTradeType) *GetHistoryTradesService
SetType selects the paging field: "1" by tradeId (default), "2" by ts.
type GetIndexCandlesService ¶
type GetIndexCandlesService struct {
// contains filtered or unexported fields
}
GetIndexCandlesService -- GET /api/v5/market/index-candles (public)
Retrieves the candlestick charts of an index. Data is sorted newest-first and is returned for up to the most recent ~1440 bars.
func (*GetIndexCandlesService) Do ¶
func (s *GetIndexCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
func (*GetIndexCandlesService) SetAfter ¶
func (s *GetIndexCandlesService) SetAfter(v time.Time) *GetIndexCandlesService
SetAfter requests records earlier than the given timestamp (pagination).
func (*GetIndexCandlesService) SetBar ¶
func (s *GetIndexCandlesService) SetBar(v string) *GetIndexCandlesService
SetBar sets the bar size (e.g. 1m, 5m, 1H, 1D). Default is 1m.
func (*GetIndexCandlesService) SetBefore ¶
func (s *GetIndexCandlesService) SetBefore(v time.Time) *GetIndexCandlesService
SetBefore requests records newer than the given timestamp (pagination).
func (*GetIndexCandlesService) SetLimit ¶
func (s *GetIndexCandlesService) SetLimit(v int) *GetIndexCandlesService
SetLimit sets the number of results per request (max 100, default 100).
type GetIndexComponentsService ¶
type GetIndexComponentsService struct {
// contains filtered or unexported fields
}
GetIndexComponentsService -- GET /api/v5/market/index-components (public)
Retrieves the constituent components of an index and their weights.
func (*GetIndexComponentsService) Do ¶
func (s *GetIndexComponentsService) Do(ctx context.Context) (*IndexComponents, error)
type GetIndexTickersService ¶
type GetIndexTickersService struct {
// contains filtered or unexported fields
}
GetIndexTickersService -- GET /api/v5/market/index-tickers (public)
Retrieves index tickers. Either quoteCcy or instId is required.
func (*GetIndexTickersService) Do ¶
func (s *GetIndexTickersService) Do(ctx context.Context) ([]IndexTicker, error)
func (*GetIndexTickersService) SetInstId ¶
func (s *GetIndexTickersService) SetInstId(v string) *GetIndexTickersService
SetInstId sets the index instrument ID (e.g. BTC-USDT).
func (*GetIndexTickersService) SetQuoteCcy ¶
func (s *GetIndexTickersService) SetQuoteCcy(v string) *GetIndexTickersService
SetQuoteCcy sets the quote currency filter (e.g. USD, USDT, BTC). Currently only USD, USDT and BTC are supported.
type GetInstrumentTickBandsService ¶
type GetInstrumentTickBandsService struct {
// contains filtered or unexported fields
}
GetInstrumentTickBandsService -- GET /api/v5/public/instrument-tick-bands (public)
Returns the tick-size bands of OPTION instruments by instrument family.
func (*GetInstrumentTickBandsService) Do ¶
func (s *GetInstrumentTickBandsService) Do(ctx context.Context) ([]InstrumentTickBands, error)
func (*GetInstrumentTickBandsService) SetInstFamily ¶
func (s *GetInstrumentTickBandsService) SetInstFamily(instFamily string) *GetInstrumentTickBandsService
SetInstFamily filters by instrument family.
type GetInstrumentsService ¶
type GetInstrumentsService struct {
// contains filtered or unexported fields
}
GetInstrumentsService -- GET /api/v5/public/instruments (public)
Returns the tradable instruments for a product line, including their lot/tick sizes, contract specs and listing state.
func (*GetInstrumentsService) Do ¶
func (s *GetInstrumentsService) Do(ctx context.Context) ([]Instrument, error)
func (*GetInstrumentsService) SetInstFamily ¶
func (s *GetInstrumentsService) SetInstFamily(instFamily string) *GetInstrumentsService
SetInstFamily filters by instrument family (applicable to FUTURES/SWAP/OPTION).
func (*GetInstrumentsService) SetInstId ¶
func (s *GetInstrumentsService) SetInstId(instId string) *GetInstrumentsService
SetInstId filters by a single instrument id.
func (*GetInstrumentsService) SetSeriesID ¶ added in v0.20260707.0
func (s *GetInstrumentsService) SetSeriesID(seriesId string) *GetInstrumentsService
SetSeriesID filters by event-contract series id (required when instType is EVENTS), e.g. "BTC-ABOVE-DAILY".
func (*GetInstrumentsService) SetUly ¶
func (s *GetInstrumentsService) SetUly(uly string) *GetInstrumentsService
SetUly filters by underlying (applicable to FUTURES/SWAP/OPTION).
type GetInsuranceFundService ¶
type GetInsuranceFundService struct {
// contains filtered or unexported fields
}
GetInsuranceFundService -- GET /api/v5/public/insurance-fund (public)
Returns the insurance-fund balance and its recent change records for a product line.
func (*GetInsuranceFundService) Do ¶
func (s *GetInsuranceFundService) Do(ctx context.Context) (*InsuranceFund, error)
func (*GetInsuranceFundService) SetAfter ¶
func (s *GetInsuranceFundService) SetAfter(t time.Time) *GetInsuranceFundService
SetAfter paginates to records earlier than the given time (older).
func (*GetInsuranceFundService) SetBefore ¶
func (s *GetInsuranceFundService) SetBefore(t time.Time) *GetInsuranceFundService
SetBefore paginates to records later than the given time (newer).
func (*GetInsuranceFundService) SetCcy ¶
func (s *GetInsuranceFundService) SetCcy(ccy string) *GetInsuranceFundService
SetCcy filters by currency (MARGIN/OPTION).
func (*GetInsuranceFundService) SetInstFamily ¶
func (s *GetInsuranceFundService) SetInstFamily(instFamily string) *GetInsuranceFundService
SetInstFamily filters by instrument family.
func (*GetInsuranceFundService) SetLimit ¶
func (s *GetInsuranceFundService) SetLimit(limit int) *GetInsuranceFundService
SetLimit caps the number of records returned (max 100).
func (*GetInsuranceFundService) SetType ¶
func (s *GetInsuranceFundService) SetType(typ string) *GetInsuranceFundService
SetType filters by record type (e.g. liquidation_balance_deposit, bankruptcy_loss, platform_revenue).
func (*GetInsuranceFundService) SetUly ¶
func (s *GetInsuranceFundService) SetUly(uly string) *GetInsuranceFundService
SetUly filters by underlying.
type GetInterestAccruedService ¶
type GetInterestAccruedService struct {
// contains filtered or unexported fields
}
GetInterestAccruedService -- GET /api/v5/account/interest-accrued (Read)
Returns the interest accrued on margin and quick-margin borrowings.
func (*GetInterestAccruedService) Do ¶
func (s *GetInterestAccruedService) Do(ctx context.Context) ([]InterestAccrued, error)
func (*GetInterestAccruedService) SetAfter ¶
func (s *GetInterestAccruedService) SetAfter(t time.Time) *GetInterestAccruedService
SetAfter paginates to records earlier than the given time (older).
func (*GetInterestAccruedService) SetBefore ¶
func (s *GetInterestAccruedService) SetBefore(t time.Time) *GetInterestAccruedService
SetBefore paginates to records later than the given time (newer).
func (*GetInterestAccruedService) SetCcy ¶
func (s *GetInterestAccruedService) SetCcy(ccy string) *GetInterestAccruedService
SetCcy filters by currency.
func (*GetInterestAccruedService) SetInstId ¶
func (s *GetInterestAccruedService) SetInstId(instId string) *GetInterestAccruedService
SetInstId filters by instrument id (only applicable to isolated margin).
func (*GetInterestAccruedService) SetLimit ¶
func (s *GetInterestAccruedService) SetLimit(limit int) *GetInterestAccruedService
SetLimit caps the number of records returned (max 100).
func (*GetInterestAccruedService) SetMgnMode ¶
func (s *GetInterestAccruedService) SetMgnMode(mgnMode MgnMode) *GetInterestAccruedService
SetMgnMode filters by margin mode (cross / isolated).
func (*GetInterestAccruedService) SetType ¶
func (s *GetInterestAccruedService) SetType(typ string) *GetInterestAccruedService
SetType filters by loan type ("1" VIP loan, "2" market loan).
type GetInterestLimitsService ¶
type GetInterestLimitsService struct {
// contains filtered or unexported fields
}
GetInterestLimitsService -- GET /api/v5/account/interest-limits (Read)
Returns the borrowing-interest summary and the per-currency loan-quota / interest schedule for the account.
func (*GetInterestLimitsService) Do ¶
func (s *GetInterestLimitsService) Do(ctx context.Context) (*InterestLimits, error)
func (*GetInterestLimitsService) SetCcy ¶
func (s *GetInterestLimitsService) SetCcy(ccy string) *GetInterestLimitsService
SetCcy filters by currency.
func (*GetInterestLimitsService) SetType ¶
func (s *GetInterestLimitsService) SetType(typ string) *GetInterestLimitsService
SetType filters by loan type ("1" VIP loan, "2" market loan).
type GetInterestRateLoanQuotaService ¶
type GetInterestRateLoanQuotaService struct {
// contains filtered or unexported fields
}
GetInterestRateLoanQuotaService -- GET /api/v5/public/interest-rate-loan-quota (public)
Returns the basic and VIP interest rates plus the margin-loan quota schedule.
func (*GetInterestRateLoanQuotaService) Do ¶
func (s *GetInterestRateLoanQuotaService) Do(ctx context.Context) (*InterestRateLoanQuota, error)
type GetInterestRateService ¶
type GetInterestRateService struct {
// contains filtered or unexported fields
}
GetInterestRateService -- GET /api/v5/account/interest-rate (Read)
Returns the current per-currency borrowing interest rate for the account.
func (*GetInterestRateService) Do ¶
func (s *GetInterestRateService) Do(ctx context.Context) ([]InterestRate, error)
func (*GetInterestRateService) SetCcy ¶
func (s *GetInterestRateService) SetCcy(ccy string) *GetInterestRateService
SetCcy filters by currency.
type GetLeverageInfoService ¶
type GetLeverageInfoService struct {
// contains filtered or unexported fields
}
GetLeverageInfoService -- GET /api/v5/account/leverage-info (Read)
Returns the account's current leverage setting for an instrument under the given margin mode.
func (*GetLeverageInfoService) Do ¶
func (s *GetLeverageInfoService) Do(ctx context.Context) ([]LeverageInfo, error)
type GetLoanRatioService ¶
type GetLoanRatioService struct {
// contains filtered or unexported fields
}
GetLoanRatioService -- GET /api/v5/rubik/stat/margin/loan-ratio (public)
Returns the margin lending ratio (margin long vs short) per time bar for a currency.
func (*GetLoanRatioService) Do ¶
func (s *GetLoanRatioService) Do(ctx context.Context) ([]RubikRatio, error)
func (*GetLoanRatioService) SetBegin ¶
func (s *GetLoanRatioService) SetBegin(t time.Time) *GetLoanRatioService
func (*GetLoanRatioService) SetEnd ¶
func (s *GetLoanRatioService) SetEnd(t time.Time) *GetLoanRatioService
func (*GetLoanRatioService) SetPeriod ¶
func (s *GetLoanRatioService) SetPeriod(p RubikStatPeriod) *GetLoanRatioService
type GetLongShortAccountRatioContractService ¶
type GetLongShortAccountRatioContractService struct {
// contains filtered or unexported fields
}
GetLongShortAccountRatioContractService -- GET /api/v5/rubik/stat/contracts/long-short-account-ratio-contract (public)
Returns the long/short account ratio per time bar for a single contract instrument.
func (*GetLongShortAccountRatioContractService) Do ¶
func (s *GetLongShortAccountRatioContractService) Do(ctx context.Context) ([]RubikRatio, error)
func (*GetLongShortAccountRatioContractService) SetBegin ¶
func (s *GetLongShortAccountRatioContractService) SetBegin(t time.Time) *GetLongShortAccountRatioContractService
func (*GetLongShortAccountRatioContractService) SetEnd ¶
func (s *GetLongShortAccountRatioContractService) SetEnd(t time.Time) *GetLongShortAccountRatioContractService
func (*GetLongShortAccountRatioContractService) SetPeriod ¶
func (s *GetLongShortAccountRatioContractService) SetPeriod(p RubikStatPeriod) *GetLongShortAccountRatioContractService
type GetLongShortAccountRatioContractTopTraderService ¶
type GetLongShortAccountRatioContractTopTraderService struct {
// contains filtered or unexported fields
}
GetLongShortAccountRatioContractTopTraderService -- GET /api/v5/rubik/stat/contracts/long-short-account-ratio-contract-top-trader (public)
Returns the long/short account ratio of top traders per time bar for a single contract instrument.
func (*GetLongShortAccountRatioContractTopTraderService) Do ¶
func (s *GetLongShortAccountRatioContractTopTraderService) Do(ctx context.Context) ([]RubikRatio, error)
func (*GetLongShortAccountRatioContractTopTraderService) SetBegin ¶
func (s *GetLongShortAccountRatioContractTopTraderService) SetBegin(t time.Time) *GetLongShortAccountRatioContractTopTraderService
type GetLongShortAccountRatioService ¶
type GetLongShortAccountRatioService struct {
// contains filtered or unexported fields
}
GetLongShortAccountRatioService -- GET /api/v5/rubik/stat/contracts/long-short-account-ratio (public)
Returns the ratio of accounts net-long vs net-short on derivatives per time bar for a currency.
func (*GetLongShortAccountRatioService) Do ¶
func (s *GetLongShortAccountRatioService) Do(ctx context.Context) ([]RubikRatio, error)
func (*GetLongShortAccountRatioService) SetBegin ¶
func (s *GetLongShortAccountRatioService) SetBegin(t time.Time) *GetLongShortAccountRatioService
func (*GetLongShortAccountRatioService) SetEnd ¶
func (s *GetLongShortAccountRatioService) SetEnd(t time.Time) *GetLongShortAccountRatioService
func (*GetLongShortAccountRatioService) SetPeriod ¶
func (s *GetLongShortAccountRatioService) SetPeriod(p RubikStatPeriod) *GetLongShortAccountRatioService
type GetLongShortPositionRatioContractTopTraderService ¶
type GetLongShortPositionRatioContractTopTraderService struct {
// contains filtered or unexported fields
}
GetLongShortPositionRatioContractTopTraderService -- GET /api/v5/rubik/stat/contracts/long-short-position-ratio-contract-top-trader (public)
Returns the long/short position ratio of top traders per time bar for a single contract instrument.
func (*GetLongShortPositionRatioContractTopTraderService) Do ¶
func (s *GetLongShortPositionRatioContractTopTraderService) Do(ctx context.Context) ([]RubikRatio, error)
type GetMMInstrumentTypesService ¶ added in v0.20260703.0
type GetMMInstrumentTypesService struct {
// contains filtered or unexported fields
}
GetMMInstrumentTypesService -- GET /api/v5/public/mm-instrument-types (public)
Returns the MM (market-maker) program instrument-type classifications for SPOT and SWAP (and FUTURES) instruments. With no filter it lists every classified instrument.
func (*GetMMInstrumentTypesService) Do ¶ added in v0.20260703.0
func (s *GetMMInstrumentTypesService) Do(ctx context.Context) ([]MMInstrumentType, error)
func (*GetMMInstrumentTypesService) SetInstFamily ¶ added in v0.20260703.0
func (s *GetMMInstrumentTypesService) SetInstFamily(instFamily string) *GetMMInstrumentTypesService
SetInstFamily filters by instrument family (requires instType).
func (*GetMMInstrumentTypesService) SetInstId ¶ added in v0.20260703.0
func (s *GetMMInstrumentTypesService) SetInstId(instId string) *GetMMInstrumentTypesService
SetInstId filters by a single instrument id.
func (*GetMMInstrumentTypesService) SetInstType ¶ added in v0.20260703.0
func (s *GetMMInstrumentTypesService) SetInstType(instType InstType) *GetMMInstrumentTypesService
SetInstType filters by instrument type (SPOT/SWAP/FUTURES).
type GetMMPConfigService ¶
type GetMMPConfigService struct {
// contains filtered or unexported fields
}
GetMMPConfigService -- GET /api/v5/account/mmp-config (Read)
Returns the Market Maker Protection configuration of an option instrument family. Requires market-maker permission.
type GetManagedSubAccountBillsService ¶
type GetManagedSubAccountBillsService struct {
// contains filtered or unexported fields
}
GetManagedSubAccountBillsService -- GET /api/v5/asset/subaccount/managed-subaccount-bills (Read)
Returns the asset-transfer history of managed (custody) sub-accounts, callable only by the trading-team master account.
Note: /api/v5/account/subaccount/managed-subaccount-bills does NOT exist (HTTP 404); the real path is under /api/v5/asset/.
func (*GetManagedSubAccountBillsService) Do ¶
func (s *GetManagedSubAccountBillsService) Do(ctx context.Context) ([]ManagedSubAccountBill, error)
func (*GetManagedSubAccountBillsService) SetAfter ¶
func (s *GetManagedSubAccountBillsService) SetAfter(t time.Time) *GetManagedSubAccountBillsService
SetAfter paginates to records earlier than the given time (older).
func (*GetManagedSubAccountBillsService) SetBefore ¶
func (s *GetManagedSubAccountBillsService) SetBefore(t time.Time) *GetManagedSubAccountBillsService
SetBefore paginates to records later than the given time (newer).
func (*GetManagedSubAccountBillsService) SetCcy ¶
func (s *GetManagedSubAccountBillsService) SetCcy(ccy string) *GetManagedSubAccountBillsService
SetCcy filters by currency.
func (*GetManagedSubAccountBillsService) SetLimit ¶
func (s *GetManagedSubAccountBillsService) SetLimit(limit int) *GetManagedSubAccountBillsService
SetLimit caps the number of records returned (max 100).
func (*GetManagedSubAccountBillsService) SetSubAcct ¶
func (s *GetManagedSubAccountBillsService) SetSubAcct(subAcct string) *GetManagedSubAccountBillsService
SetSubAcct filters by managed sub-account name.
func (*GetManagedSubAccountBillsService) SetSubUid ¶
func (s *GetManagedSubAccountBillsService) SetSubUid(subUid string) *GetManagedSubAccountBillsService
SetSubUid filters by managed sub-account uid.
func (*GetManagedSubAccountBillsService) SetType ¶
func (s *GetManagedSubAccountBillsService) SetType(typ string) *GetManagedSubAccountBillsService
SetType filters by transfer type ("0" transfer in, "1" transfer out).
type GetMarkPriceCandlesService ¶
type GetMarkPriceCandlesService struct {
// contains filtered or unexported fields
}
GetMarkPriceCandlesService -- GET /api/v5/market/mark-price-candles (public)
Retrieves the candlestick charts of the mark price. Data is sorted newest-first for up to the most recent ~1440 bars.
func (*GetMarkPriceCandlesService) Do ¶
func (s *GetMarkPriceCandlesService) Do(ctx context.Context) ([]IndexCandle, error)
func (*GetMarkPriceCandlesService) SetAfter ¶
func (s *GetMarkPriceCandlesService) SetAfter(v time.Time) *GetMarkPriceCandlesService
SetAfter requests records earlier than the given timestamp (pagination).
func (*GetMarkPriceCandlesService) SetBar ¶
func (s *GetMarkPriceCandlesService) SetBar(v string) *GetMarkPriceCandlesService
SetBar sets the bar size (e.g. 1m, 5m, 1H, 1D). Default is 1m.
func (*GetMarkPriceCandlesService) SetBefore ¶
func (s *GetMarkPriceCandlesService) SetBefore(v time.Time) *GetMarkPriceCandlesService
SetBefore requests records newer than the given timestamp (pagination).
func (*GetMarkPriceCandlesService) SetLimit ¶
func (s *GetMarkPriceCandlesService) SetLimit(v int) *GetMarkPriceCandlesService
SetLimit sets the number of results per request (max 100, default 100).
type GetMarkPriceService ¶
type GetMarkPriceService struct {
// contains filtered or unexported fields
}
GetMarkPriceService -- GET /api/v5/public/mark-price (public)
Returns the mark prices of instruments in a product line.
func (*GetMarkPriceService) Do ¶
func (s *GetMarkPriceService) Do(ctx context.Context) ([]MarkPrice, error)
func (*GetMarkPriceService) SetInstFamily ¶
func (s *GetMarkPriceService) SetInstFamily(instFamily string) *GetMarkPriceService
SetInstFamily filters by instrument family.
func (*GetMarkPriceService) SetInstId ¶
func (s *GetMarkPriceService) SetInstId(instId string) *GetMarkPriceService
SetInstId filters by a single instrument id.
func (*GetMarkPriceService) SetUly ¶
func (s *GetMarkPriceService) SetUly(uly string) *GetMarkPriceService
SetUly filters by underlying.
type GetMaxAvailSizeService ¶
type GetMaxAvailSizeService struct {
// contains filtered or unexported fields
}
GetMaxAvailSizeService -- GET /api/v5/account/max-avail-size (Read)
Returns the maximum available tradable amount of an instrument under the given trade mode (accounting for current balance and positions).
func (*GetMaxAvailSizeService) Do ¶
func (s *GetMaxAvailSizeService) Do(ctx context.Context) ([]MaxAvailSize, error)
func (*GetMaxAvailSizeService) SetCcy ¶
func (s *GetMaxAvailSizeService) SetCcy(ccy string) *GetMaxAvailSizeService
SetCcy sets the margin currency (MARGIN cross only).
func (*GetMaxAvailSizeService) SetPx ¶
func (s *GetMaxAvailSizeService) SetPx(px decimal.Decimal) *GetMaxAvailSizeService
SetPx sets the order price used to estimate the available size.
func (*GetMaxAvailSizeService) SetQuickMgnType ¶
func (s *GetMaxAvailSizeService) SetQuickMgnType(quickMgnType string) *GetMaxAvailSizeService
SetQuickMgnType sets the quick-margin borrow type (manual/auto_borrow/auto_borrow_repay).
func (*GetMaxAvailSizeService) SetReduceOnly ¶
func (s *GetMaxAvailSizeService) SetReduceOnly(reduceOnly bool) *GetMaxAvailSizeService
SetReduceOnly restricts the estimate to reduce-only sizing.
func (*GetMaxAvailSizeService) SetUnSpotOffset ¶
func (s *GetMaxAvailSizeService) SetUnSpotOffset(unSpotOffset bool) *GetMaxAvailSizeService
SetUnSpotOffset toggles whether spot-derivatives offset is excluded.
type GetMaxLoanService ¶
type GetMaxLoanService struct {
// contains filtered or unexported fields
}
GetMaxLoanService -- GET /api/v5/account/max-loan (Read)
Returns the account's maximum loanable amount for an instrument/currency under the given margin mode.
func (*GetMaxLoanService) Do ¶
func (s *GetMaxLoanService) Do(ctx context.Context) ([]MaxLoan, error)
func (*GetMaxLoanService) SetCcy ¶
func (s *GetMaxLoanService) SetCcy(ccy string) *GetMaxLoanService
SetCcy sets the borrow currency (cross MARGIN).
func (*GetMaxLoanService) SetInstId ¶
func (s *GetMaxLoanService) SetInstId(instId string) *GetMaxLoanService
SetInstId sets the instrument id (single or comma-separated).
func (*GetMaxLoanService) SetMgnCcy ¶
func (s *GetMaxLoanService) SetMgnCcy(mgnCcy string) *GetMaxLoanService
SetMgnCcy sets the margin currency (cross MARGIN).
type GetMaxSizeService ¶
type GetMaxSizeService struct {
// contains filtered or unexported fields
}
GetMaxSizeService -- GET /api/v5/account/max-size (Read)
Returns the maximum buyable/sellable (or openable) size of an instrument under the given trade mode.
func (*GetMaxSizeService) Do ¶
func (s *GetMaxSizeService) Do(ctx context.Context) ([]MaxSize, error)
func (*GetMaxSizeService) SetCcy ¶
func (s *GetMaxSizeService) SetCcy(ccy string) *GetMaxSizeService
SetCcy sets the margin currency (MARGIN cross only).
func (*GetMaxSizeService) SetLeverage ¶
func (s *GetMaxSizeService) SetLeverage(leverage decimal.Decimal) *GetMaxSizeService
SetLeverage sets the leverage used to estimate the max size.
func (*GetMaxSizeService) SetPx ¶
func (s *GetMaxSizeService) SetPx(px decimal.Decimal) *GetMaxSizeService
SetPx sets the order price used to estimate the max size.
func (*GetMaxSizeService) SetUnSpotOffset ¶
func (s *GetMaxSizeService) SetUnSpotOffset(unSpotOffset bool) *GetMaxSizeService
SetUnSpotOffset toggles whether spot-derivatives offset is excluded.
type GetMaxWithdrawalService ¶
type GetMaxWithdrawalService struct {
// contains filtered or unexported fields
}
GetMaxWithdrawalService -- GET /api/v5/account/max-withdrawal (Read)
Returns the maximum amount that can be transferred out of the trading account per currency.
func (*GetMaxWithdrawalService) Do ¶
func (s *GetMaxWithdrawalService) Do(ctx context.Context) ([]MaxWithdrawal, error)
func (*GetMaxWithdrawalService) SetCcy ¶
func (s *GetMaxWithdrawalService) SetCcy(ccy string) *GetMaxWithdrawalService
SetCcy filters by currency (comma-separated for several).
type GetMonthlyStatementService ¶
type GetMonthlyStatementService struct {
// contains filtered or unexported fields
}
GetMonthlyStatementService -- GET /api/v5/asset/monthly-statement (private)
Returns the download link for a previously applied-for monthly statement.
func (*GetMonthlyStatementService) Do ¶
func (s *GetMonthlyStatementService) Do(ctx context.Context) (*MonthlyStatement, error)
type GetMovePositionsHistoryService ¶
type GetMovePositionsHistoryService struct {
// contains filtered or unexported fields
}
GetMovePositionsHistoryService -- GET /api/v5/account/move-positions-history (Read)
Returns the history of move-positions (block transfer) requests.
func (*GetMovePositionsHistoryService) Do ¶
func (s *GetMovePositionsHistoryService) Do(ctx context.Context) ([]MovePositionsHistory, error)
func (*GetMovePositionsHistoryService) SetBeginTs ¶
func (s *GetMovePositionsHistoryService) SetBeginTs(t time.Time) *GetMovePositionsHistoryService
SetBeginTs filters to requests at or after the given time.
func (*GetMovePositionsHistoryService) SetBlockTdId ¶
func (s *GetMovePositionsHistoryService) SetBlockTdId(blockTdId string) *GetMovePositionsHistoryService
SetBlockTdId filters by block trade id.
func (*GetMovePositionsHistoryService) SetClientId ¶
func (s *GetMovePositionsHistoryService) SetClientId(clientId string) *GetMovePositionsHistoryService
SetClientId filters by client-supplied id.
func (*GetMovePositionsHistoryService) SetEndTs ¶
func (s *GetMovePositionsHistoryService) SetEndTs(t time.Time) *GetMovePositionsHistoryService
SetEndTs filters to requests at or before the given time.
func (*GetMovePositionsHistoryService) SetLimit ¶
func (s *GetMovePositionsHistoryService) SetLimit(limit int) *GetMovePositionsHistoryService
SetLimit caps the number of records returned.
func (*GetMovePositionsHistoryService) SetState ¶
func (s *GetMovePositionsHistoryService) SetState(state string) *GetMovePositionsHistoryService
SetState filters by transfer state ("filled" / "pending").
type GetNonTradableAssetsService ¶
type GetNonTradableAssetsService struct {
// contains filtered or unexported fields
}
GetNonTradableAssetsService -- GET /api/v5/asset/non-tradable-assets (private)
Returns the non-tradable assets held in the funding account (assets that can only be withdrawn, not traded).
func (*GetNonTradableAssetsService) Do ¶
func (s *GetNonTradableAssetsService) Do(ctx context.Context) ([]NonTradableAsset, error)
func (*GetNonTradableAssetsService) SetCcy ¶
func (s *GetNonTradableAssetsService) SetCcy(ccy string) *GetNonTradableAssetsService
SetCcy filters by a single (or comma-separated) currency.
type GetOKUSDLimitsService ¶ added in v0.20260703.0
type GetOKUSDLimitsService struct {
// contains filtered or unexported fields
}
GetOKUSDLimitsService -- GET /api/v5/finance/okusd/limits (Read)
Returns the account's remaining daily OKUSD subscription and redemption limits (personal VIP-tier limits and platform-wide limits, plus redemption fee rates).
func (*GetOKUSDLimitsService) Do ¶ added in v0.20260703.0
func (s *GetOKUSDLimitsService) Do(ctx context.Context) (*OKUSDLimits, error)
type GetOneClickRepayCurrencyListService ¶
type GetOneClickRepayCurrencyListService struct {
// contains filtered or unexported fields
}
GetOneClickRepayCurrencyListService -- GET /api/v5/trade/one-click-repay-currency-list (Read)
Returns the cross/isolated debt currencies eligible for one-click repay and the currencies that can be used to repay them.
func (*GetOneClickRepayCurrencyListService) Do ¶
func (s *GetOneClickRepayCurrencyListService) Do(ctx context.Context) ([]OneClickRepayCurrencyList, error)
func (*GetOneClickRepayCurrencyListService) SetDebtType ¶
func (s *GetOneClickRepayCurrencyListService) SetDebtType(debtType DebtType) *GetOneClickRepayCurrencyListService
SetDebtType filters by debt type: "cross" or "isolated".
type GetOneClickRepayCurrencyListV2Service ¶
type GetOneClickRepayCurrencyListV2Service struct {
// contains filtered or unexported fields
}
GetOneClickRepayCurrencyListV2Service -- GET /api/v5/trade/one-click-repay-currency-list-v2 (Read)
Returns the debt currencies eligible for one-click repay (v2) and the currencies that can be used to repay them.
func (*GetOneClickRepayCurrencyListV2Service) Do ¶
func (s *GetOneClickRepayCurrencyListV2Service) Do(ctx context.Context) ([]OneClickRepayCurrencyListV2, error)
type GetOneClickRepayHistoryService ¶
type GetOneClickRepayHistoryService struct {
// contains filtered or unexported fields
}
GetOneClickRepayHistoryService -- GET /api/v5/trade/one-click-repay-history (Read)
Returns the one-click repay order history (last 7 days).
func (*GetOneClickRepayHistoryService) Do ¶
func (s *GetOneClickRepayHistoryService) Do(ctx context.Context) ([]OneClickRepayHistory, error)
func (*GetOneClickRepayHistoryService) SetAfter ¶
func (s *GetOneClickRepayHistoryService) SetAfter(t time.Time) *GetOneClickRepayHistoryService
SetAfter returns records earlier than the given time (paginates by uTime).
func (*GetOneClickRepayHistoryService) SetBefore ¶
func (s *GetOneClickRepayHistoryService) SetBefore(t time.Time) *GetOneClickRepayHistoryService
SetBefore returns records newer than the given time (paginates by uTime).
func (*GetOneClickRepayHistoryService) SetLimit ¶
func (s *GetOneClickRepayHistoryService) SetLimit(limit int) *GetOneClickRepayHistoryService
SetLimit sets the number of results per request (max 100, default 100).
type GetOneClickRepayHistoryV2Service ¶
type GetOneClickRepayHistoryV2Service struct {
// contains filtered or unexported fields
}
GetOneClickRepayHistoryV2Service -- GET /api/v5/trade/one-click-repay-history-v2 (Read)
Returns the one-click repay (v2) order history.
func (*GetOneClickRepayHistoryV2Service) Do ¶
func (s *GetOneClickRepayHistoryV2Service) Do(ctx context.Context) ([]OneClickRepayHistoryV2, error)
func (*GetOneClickRepayHistoryV2Service) SetAfter ¶
func (s *GetOneClickRepayHistoryV2Service) SetAfter(t time.Time) *GetOneClickRepayHistoryV2Service
SetAfter returns records earlier than (included) the given ts.
func (*GetOneClickRepayHistoryV2Service) SetBefore ¶
func (s *GetOneClickRepayHistoryV2Service) SetBefore(t time.Time) *GetOneClickRepayHistoryV2Service
SetBefore returns records newer than (included) the given ts.
func (*GetOneClickRepayHistoryV2Service) SetLimit ¶
func (s *GetOneClickRepayHistoryV2Service) SetLimit(limit int) *GetOneClickRepayHistoryV2Service
SetLimit sets the number of results per request (max 100, default 100).
type GetOpenInterestHistoryService ¶
type GetOpenInterestHistoryService struct {
// contains filtered or unexported fields
}
GetOpenInterestHistoryService -- GET /api/v5/rubik/stat/contracts/open-interest-history (public)
Returns the historical open interest per time bar for a single contract instrument, in contracts, base currency and USD.
func (*GetOpenInterestHistoryService) Do ¶
func (s *GetOpenInterestHistoryService) Do(ctx context.Context) ([]RubikOpenInterestHistory, error)
func (*GetOpenInterestHistoryService) SetBegin ¶
func (s *GetOpenInterestHistoryService) SetBegin(t time.Time) *GetOpenInterestHistoryService
func (*GetOpenInterestHistoryService) SetEnd ¶
func (s *GetOpenInterestHistoryService) SetEnd(t time.Time) *GetOpenInterestHistoryService
func (*GetOpenInterestHistoryService) SetLimit ¶
func (s *GetOpenInterestHistoryService) SetLimit(limit int) *GetOpenInterestHistoryService
func (*GetOpenInterestHistoryService) SetPeriod ¶
func (s *GetOpenInterestHistoryService) SetPeriod(p RubikStatPeriod) *GetOpenInterestHistoryService
type GetOpenInterestService ¶
type GetOpenInterestService struct {
// contains filtered or unexported fields
}
GetOpenInterestService -- GET /api/v5/public/open-interest (public)
Returns the open interest of derivatives (SWAP/FUTURES/OPTION).
func (*GetOpenInterestService) Do ¶
func (s *GetOpenInterestService) Do(ctx context.Context) ([]OpenInterest, error)
func (*GetOpenInterestService) SetInstFamily ¶
func (s *GetOpenInterestService) SetInstFamily(instFamily string) *GetOpenInterestService
SetInstFamily filters by instrument family.
func (*GetOpenInterestService) SetInstId ¶
func (s *GetOpenInterestService) SetInstId(instId string) *GetOpenInterestService
SetInstId filters by a single instrument id.
func (*GetOpenInterestService) SetUly ¶
func (s *GetOpenInterestService) SetUly(uly string) *GetOpenInterestService
SetUly filters by underlying.
type GetOptSummaryService ¶
type GetOptSummaryService struct {
// contains filtered or unexported fields
}
GetOptSummaryService -- GET /api/v5/public/opt-summary (public)
Returns the option market-data summary (greeks and implied volatilities) for an underlying or instrument family.
func (*GetOptSummaryService) Do ¶
func (s *GetOptSummaryService) Do(ctx context.Context) ([]OptSummary, error)
func (*GetOptSummaryService) SetExpTime ¶
func (s *GetOptSummaryService) SetExpTime(expTime string) *GetOptSummaryService
SetExpTime filters by an option expiry (YYYYMMdd).
func (*GetOptSummaryService) SetInstFamily ¶
func (s *GetOptSummaryService) SetInstFamily(instFamily string) *GetOptSummaryService
SetInstFamily filters by instrument family.
func (*GetOptSummaryService) SetUly ¶
func (s *GetOptSummaryService) SetUly(uly string) *GetOptSummaryService
SetUly filters by underlying.
type GetOptionInstrumentFamilyTradesService ¶
type GetOptionInstrumentFamilyTradesService struct {
// contains filtered or unexported fields
}
GetOptionInstrumentFamilyTradesService -- GET /api/v5/market/option/instrument-family-trades (public)
Returns the most recent trades per strike for an option instrument family.
func (*GetOptionInstrumentFamilyTradesService) Do ¶
func (s *GetOptionInstrumentFamilyTradesService) Do(ctx context.Context) ([]OptionFamilyTrades, error)
type GetOptionOpenInterestVolumeExpiryService ¶
type GetOptionOpenInterestVolumeExpiryService struct {
// contains filtered or unexported fields
}
GetOptionOpenInterestVolumeExpiryService -- GET /api/v5/rubik/stat/option/open-interest-volume-expiry (public)
Returns option open interest and volume broken down by expiry per time bar for a currency.
func (*GetOptionOpenInterestVolumeExpiryService) Do ¶
func (s *GetOptionOpenInterestVolumeExpiryService) Do(ctx context.Context) ([]RubikOpenInterestVolumeExpiry, error)
func (*GetOptionOpenInterestVolumeExpiryService) SetPeriod ¶
func (s *GetOptionOpenInterestVolumeExpiryService) SetPeriod(p RubikStatPeriod) *GetOptionOpenInterestVolumeExpiryService
type GetOptionOpenInterestVolumeService ¶
type GetOptionOpenInterestVolumeService struct {
// contains filtered or unexported fields
}
GetOptionOpenInterestVolumeService -- GET /api/v5/rubik/stat/option/open-interest-volume (public)
Returns the aggregated option open interest and trading volume per time bar for a currency.
func (*GetOptionOpenInterestVolumeService) Do ¶
func (s *GetOptionOpenInterestVolumeService) Do(ctx context.Context) ([]RubikOpenInterestVolume, error)
func (*GetOptionOpenInterestVolumeService) SetPeriod ¶
func (s *GetOptionOpenInterestVolumeService) SetPeriod(p RubikStatPeriod) *GetOptionOpenInterestVolumeService
type GetOptionOpenInterestVolumeStrikeService ¶
type GetOptionOpenInterestVolumeStrikeService struct {
// contains filtered or unexported fields
}
GetOptionOpenInterestVolumeStrikeService -- GET /api/v5/rubik/stat/option/open-interest-volume-strike (public)
Returns option open interest and volume broken down by strike price for a given expiry per time bar for a currency.
func (*GetOptionOpenInterestVolumeStrikeService) Do ¶
func (s *GetOptionOpenInterestVolumeStrikeService) Do(ctx context.Context) ([]RubikOpenInterestVolumeStrike, error)
func (*GetOptionOpenInterestVolumeStrikeService) SetPeriod ¶
func (s *GetOptionOpenInterestVolumeStrikeService) SetPeriod(p RubikStatPeriod) *GetOptionOpenInterestVolumeStrikeService
type GetOptionTakerBlockVolumeService ¶
type GetOptionTakerBlockVolumeService struct {
// contains filtered or unexported fields
}
GetOptionTakerBlockVolumeService -- GET /api/v5/rubik/stat/option/taker-block-volume (public)
Returns the latest option taker buy/sell and block-trade volumes for calls and puts of a currency. Unlike the other rubik endpoints, the data array is a single flat positional array (one snapshot), not an array of bars.
func (*GetOptionTakerBlockVolumeService) Do ¶
func (s *GetOptionTakerBlockVolumeService) Do(ctx context.Context) (*RubikOptionTakerBlockVolume, error)
func (*GetOptionTakerBlockVolumeService) SetPeriod ¶
func (s *GetOptionTakerBlockVolumeService) SetPeriod(p RubikStatPeriod) *GetOptionTakerBlockVolumeService
type GetOrderService ¶
type GetOrderService struct {
// contains filtered or unexported fields
}
GetOrderService -- GET /api/v5/trade/order (Read)
Returns the details of a single order by ordId or clOrdId.
func (*GetOrderService) SetClOrdId ¶
func (s *GetOrderService) SetClOrdId(clOrdId string) *GetOrderService
SetClOrdId sets the client-supplied order id (either ordId or clOrdId is required).
func (*GetOrderService) SetOrdId ¶
func (s *GetOrderService) SetOrdId(ordId string) *GetOrderService
SetOrdId sets the order id (either ordId or clOrdId is required).
type GetOrdersHistoryArchiveService ¶
type GetOrdersHistoryArchiveService struct {
// contains filtered or unexported fields
}
GetOrdersHistoryArchiveService -- GET /api/v5/trade/orders-history-archive (Read)
Returns the account's completed orders from the last three months.
func (*GetOrdersHistoryArchiveService) Do ¶
func (s *GetOrdersHistoryArchiveService) Do(ctx context.Context) ([]Order, error)
func (*GetOrdersHistoryArchiveService) SetAfter ¶
func (s *GetOrdersHistoryArchiveService) SetAfter(ordId string) *GetOrdersHistoryArchiveService
SetAfter pages to orders with an ordId earlier than this value.
func (*GetOrdersHistoryArchiveService) SetBefore ¶
func (s *GetOrdersHistoryArchiveService) SetBefore(ordId string) *GetOrdersHistoryArchiveService
SetBefore pages to orders with an ordId later than this value.
func (*GetOrdersHistoryArchiveService) SetBegin ¶
func (s *GetOrdersHistoryArchiveService) SetBegin(t time.Time) *GetOrdersHistoryArchiveService
SetBegin filters to orders created at or after the given time.
func (*GetOrdersHistoryArchiveService) SetCategory ¶
func (s *GetOrdersHistoryArchiveService) SetCategory(category string) *GetOrdersHistoryArchiveService
SetCategory filters by order category.
func (*GetOrdersHistoryArchiveService) SetEnd ¶
func (s *GetOrdersHistoryArchiveService) SetEnd(t time.Time) *GetOrdersHistoryArchiveService
SetEnd filters to orders created at or before the given time.
func (*GetOrdersHistoryArchiveService) SetInstFamily ¶
func (s *GetOrdersHistoryArchiveService) SetInstFamily(instFamily string) *GetOrdersHistoryArchiveService
SetInstFamily filters by instrument family.
func (*GetOrdersHistoryArchiveService) SetInstId ¶
func (s *GetOrdersHistoryArchiveService) SetInstId(instId string) *GetOrdersHistoryArchiveService
SetInstId filters by instrument id.
func (*GetOrdersHistoryArchiveService) SetLimit ¶
func (s *GetOrdersHistoryArchiveService) SetLimit(limit int) *GetOrdersHistoryArchiveService
SetLimit caps the number of records returned (max 100).
func (*GetOrdersHistoryArchiveService) SetOrdType ¶
func (s *GetOrdersHistoryArchiveService) SetOrdType(ordType OrdType) *GetOrdersHistoryArchiveService
SetOrdType filters by order type.
func (*GetOrdersHistoryArchiveService) SetState ¶
func (s *GetOrdersHistoryArchiveService) SetState(state OrdState) *GetOrdersHistoryArchiveService
SetState filters by order state (canceled/filled/mmp_canceled).
func (*GetOrdersHistoryArchiveService) SetUly ¶
func (s *GetOrdersHistoryArchiveService) SetUly(uly string) *GetOrdersHistoryArchiveService
SetUly filters by underlying.
type GetOrdersHistoryService ¶
type GetOrdersHistoryService struct {
// contains filtered or unexported fields
}
GetOrdersHistoryService -- GET /api/v5/trade/orders-history (Read)
Returns the account's completed orders from the last seven days.
func (*GetOrdersHistoryService) Do ¶
func (s *GetOrdersHistoryService) Do(ctx context.Context) ([]Order, error)
func (*GetOrdersHistoryService) SetAfter ¶
func (s *GetOrdersHistoryService) SetAfter(ordId string) *GetOrdersHistoryService
SetAfter pages to orders with an ordId earlier than this value.
func (*GetOrdersHistoryService) SetBefore ¶
func (s *GetOrdersHistoryService) SetBefore(ordId string) *GetOrdersHistoryService
SetBefore pages to orders with an ordId later than this value.
func (*GetOrdersHistoryService) SetBegin ¶
func (s *GetOrdersHistoryService) SetBegin(t time.Time) *GetOrdersHistoryService
SetBegin filters to orders created at or after the given time.
func (*GetOrdersHistoryService) SetCategory ¶
func (s *GetOrdersHistoryService) SetCategory(category string) *GetOrdersHistoryService
SetCategory filters by order category (twap/adl/full_liquidation/...).
func (*GetOrdersHistoryService) SetEnd ¶
func (s *GetOrdersHistoryService) SetEnd(t time.Time) *GetOrdersHistoryService
SetEnd filters to orders created at or before the given time.
func (*GetOrdersHistoryService) SetInstFamily ¶
func (s *GetOrdersHistoryService) SetInstFamily(instFamily string) *GetOrdersHistoryService
SetInstFamily filters by instrument family.
func (*GetOrdersHistoryService) SetInstId ¶
func (s *GetOrdersHistoryService) SetInstId(instId string) *GetOrdersHistoryService
SetInstId filters by instrument id.
func (*GetOrdersHistoryService) SetLimit ¶
func (s *GetOrdersHistoryService) SetLimit(limit int) *GetOrdersHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetOrdersHistoryService) SetOrdType ¶
func (s *GetOrdersHistoryService) SetOrdType(ordType OrdType) *GetOrdersHistoryService
SetOrdType filters by order type.
func (*GetOrdersHistoryService) SetState ¶
func (s *GetOrdersHistoryService) SetState(state OrdState) *GetOrdersHistoryService
SetState filters by order state (canceled/filled/mmp_canceled).
func (*GetOrdersHistoryService) SetUly ¶
func (s *GetOrdersHistoryService) SetUly(uly string) *GetOrdersHistoryService
SetUly filters by underlying.
type GetOrdersPendingService ¶
type GetOrdersPendingService struct {
// contains filtered or unexported fields
}
GetOrdersPendingService -- GET /api/v5/trade/orders-pending (Read)
Returns the account's currently live (incomplete) orders.
func (*GetOrdersPendingService) Do ¶
func (s *GetOrdersPendingService) Do(ctx context.Context) ([]Order, error)
func (*GetOrdersPendingService) SetAfter ¶
func (s *GetOrdersPendingService) SetAfter(ordId string) *GetOrdersPendingService
SetAfter pages to orders with an ordId earlier than this value.
func (*GetOrdersPendingService) SetBefore ¶
func (s *GetOrdersPendingService) SetBefore(ordId string) *GetOrdersPendingService
SetBefore pages to orders with an ordId later than this value.
func (*GetOrdersPendingService) SetInstFamily ¶
func (s *GetOrdersPendingService) SetInstFamily(instFamily string) *GetOrdersPendingService
SetInstFamily filters by instrument family.
func (*GetOrdersPendingService) SetInstId ¶
func (s *GetOrdersPendingService) SetInstId(instId string) *GetOrdersPendingService
SetInstId filters by instrument id.
func (*GetOrdersPendingService) SetInstType ¶
func (s *GetOrdersPendingService) SetInstType(instType InstType) *GetOrdersPendingService
SetInstType filters by product line (SPOT/MARGIN/SWAP/FUTURES/OPTION).
func (*GetOrdersPendingService) SetLimit ¶
func (s *GetOrdersPendingService) SetLimit(limit int) *GetOrdersPendingService
SetLimit caps the number of records returned (max 100).
func (*GetOrdersPendingService) SetOrdType ¶
func (s *GetOrdersPendingService) SetOrdType(ordType OrdType) *GetOrdersPendingService
SetOrdType filters by order type (market/limit/post_only/fok/ioc/...).
func (*GetOrdersPendingService) SetState ¶
func (s *GetOrdersPendingService) SetState(state OrdState) *GetOrdersPendingService
SetState filters by order state (live/partially_filled).
func (*GetOrdersPendingService) SetUly ¶
func (s *GetOrdersPendingService) SetUly(uly string) *GetOrdersPendingService
SetUly filters by underlying.
type GetPlatform24VolumeService ¶
type GetPlatform24VolumeService struct {
// contains filtered or unexported fields
}
GetPlatform24VolumeService -- GET /api/v5/market/platform-24-volume (public)
Returns the platform-wide 24h trading volume.
func (*GetPlatform24VolumeService) Do ¶
func (s *GetPlatform24VolumeService) Do(ctx context.Context) (*Platform24Volume, error)
type GetPositionTiersService ¶
type GetPositionTiersService struct {
// contains filtered or unexported fields
}
GetPositionTiersService -- GET /api/v5/public/position-tiers (public)
Returns the position-tier (leverage / margin requirement) schedule for an instrument family or underlying.
func (*GetPositionTiersService) Do ¶
func (s *GetPositionTiersService) Do(ctx context.Context) ([]PositionTier, error)
func (*GetPositionTiersService) SetCcy ¶
func (s *GetPositionTiersService) SetCcy(ccy string) *GetPositionTiersService
SetCcy filters by margin currency (MARGIN cross only).
func (*GetPositionTiersService) SetInstFamily ¶
func (s *GetPositionTiersService) SetInstFamily(instFamily string) *GetPositionTiersService
SetInstFamily filters by instrument family (comma-separated for multiple).
func (*GetPositionTiersService) SetInstId ¶
func (s *GetPositionTiersService) SetInstId(instId string) *GetPositionTiersService
SetInstId filters by a single instrument id (SPOT/MARGIN).
func (*GetPositionTiersService) SetTier ¶
func (s *GetPositionTiersService) SetTier(tier string) *GetPositionTiersService
SetTier filters by a single tier.
func (*GetPositionTiersService) SetUly ¶
func (s *GetPositionTiersService) SetUly(uly string) *GetPositionTiersService
SetUly filters by underlying (comma-separated for multiple).
type GetPositionsHistoryService ¶
type GetPositionsHistoryService struct {
// contains filtered or unexported fields
}
GetPositionsHistoryService -- GET /api/v5/account/positions-history (Read)
Returns the account's closed-position history over the last three months.
func (*GetPositionsHistoryService) Do ¶
func (s *GetPositionsHistoryService) Do(ctx context.Context) ([]PositionHistory, error)
func (*GetPositionsHistoryService) SetAfter ¶
func (s *GetPositionsHistoryService) SetAfter(t time.Time) *GetPositionsHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetPositionsHistoryService) SetBefore ¶
func (s *GetPositionsHistoryService) SetBefore(t time.Time) *GetPositionsHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetPositionsHistoryService) SetInstId ¶
func (s *GetPositionsHistoryService) SetInstId(instId string) *GetPositionsHistoryService
SetInstId filters by instrument id.
func (*GetPositionsHistoryService) SetInstType ¶
func (s *GetPositionsHistoryService) SetInstType(instType InstType) *GetPositionsHistoryService
SetInstType filters by product line (MARGIN/SWAP/FUTURES/OPTION).
func (*GetPositionsHistoryService) SetLimit ¶
func (s *GetPositionsHistoryService) SetLimit(limit int) *GetPositionsHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetPositionsHistoryService) SetMgnMode ¶
func (s *GetPositionsHistoryService) SetMgnMode(mgnMode MgnMode) *GetPositionsHistoryService
SetMgnMode filters by margin mode (cross/isolated).
func (*GetPositionsHistoryService) SetPosId ¶
func (s *GetPositionsHistoryService) SetPosId(posId string) *GetPositionsHistoryService
SetPosId filters by position id.
func (*GetPositionsHistoryService) SetType ¶
func (s *GetPositionsHistoryService) SetType(typ string) *GetPositionsHistoryService
SetType filters by close type (1 partial close ... 5 partial liquidation, ...).
type GetPositionsService ¶
type GetPositionsService struct {
// contains filtered or unexported fields
}
GetPositionsService -- GET /api/v5/account/positions (Read)
Returns the account's currently open positions.
func (*GetPositionsService) Do ¶
func (s *GetPositionsService) Do(ctx context.Context) ([]Position, error)
func (*GetPositionsService) SetInstId ¶
func (s *GetPositionsService) SetInstId(instId string) *GetPositionsService
SetInstId filters by instrument id (comma-separated for several).
func (*GetPositionsService) SetInstType ¶
func (s *GetPositionsService) SetInstType(instType InstType) *GetPositionsService
SetInstType filters by product line (MARGIN/SWAP/FUTURES/OPTION).
func (*GetPositionsService) SetPosId ¶
func (s *GetPositionsService) SetPosId(posId string) *GetPositionsService
SetPosId filters by position id (comma-separated for several).
type GetPremiumHistoryService ¶
type GetPremiumHistoryService struct {
// contains filtered or unexported fields
}
GetPremiumHistoryService -- GET /api/v5/public/premium-history (public)
Returns the premium-index history (spot vs perpetual mid) of an instrument.
func (*GetPremiumHistoryService) Do ¶
func (s *GetPremiumHistoryService) Do(ctx context.Context) ([]PremiumHistory, error)
func (*GetPremiumHistoryService) SetAfter ¶
func (s *GetPremiumHistoryService) SetAfter(t time.Time) *GetPremiumHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetPremiumHistoryService) SetBefore ¶
func (s *GetPremiumHistoryService) SetBefore(t time.Time) *GetPremiumHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetPremiumHistoryService) SetLimit ¶
func (s *GetPremiumHistoryService) SetLimit(limit int) *GetPremiumHistoryService
SetLimit caps the number of records returned (max 100).
type GetPriceLimitService ¶
type GetPriceLimitService struct {
// contains filtered or unexported fields
}
GetPriceLimitService -- GET /api/v5/public/price-limit (public)
Returns the highest buy and lowest sell limit prices of an instrument.
func (*GetPriceLimitService) Do ¶
func (s *GetPriceLimitService) Do(ctx context.Context) (*PriceLimit, error)
type GetRecurringOrderDetailsService ¶
type GetRecurringOrderDetailsService struct {
// contains filtered or unexported fields
}
GetRecurringOrderDetailsService -- GET /api/v5/tradingBot/recurring/orders-algo-details (Read)
Returns the full detail of a single recurring-buy strategy.
func (*GetRecurringOrderDetailsService) Do ¶
func (s *GetRecurringOrderDetailsService) Do(ctx context.Context) (*RecurringOrder, error)
type GetRecurringOrdersHistoryService ¶
type GetRecurringOrdersHistoryService struct {
// contains filtered or unexported fields
}
GetRecurringOrdersHistoryService -- GET /api/v5/tradingBot/recurring/orders-algo-history (Read)
Returns the account's stopped recurring-buy strategies.
func (*GetRecurringOrdersHistoryService) Do ¶
func (s *GetRecurringOrdersHistoryService) Do(ctx context.Context) ([]RecurringOrder, error)
func (*GetRecurringOrdersHistoryService) SetAfter ¶
func (s *GetRecurringOrdersHistoryService) SetAfter(after string) *GetRecurringOrdersHistoryService
SetAfter pages backward from the given algoId (records older than it).
func (*GetRecurringOrdersHistoryService) SetAlgoId ¶
func (s *GetRecurringOrdersHistoryService) SetAlgoId(algoId string) *GetRecurringOrdersHistoryService
SetAlgoId filters to a single strategy id.
func (*GetRecurringOrdersHistoryService) SetBefore ¶
func (s *GetRecurringOrdersHistoryService) SetBefore(before string) *GetRecurringOrdersHistoryService
SetBefore pages forward from the given algoId (records newer than it).
func (*GetRecurringOrdersHistoryService) SetLimit ¶
func (s *GetRecurringOrdersHistoryService) SetLimit(limit int) *GetRecurringOrdersHistoryService
SetLimit caps the number of returned strategies (max 100, default 100).
type GetRecurringOrdersPendingService ¶
type GetRecurringOrdersPendingService struct {
// contains filtered or unexported fields
}
GetRecurringOrdersPendingService -- GET /api/v5/tradingBot/recurring/orders-algo-pending (Read)
Returns the account's active (not-yet-stopped) recurring-buy strategies.
func (*GetRecurringOrdersPendingService) Do ¶
func (s *GetRecurringOrdersPendingService) Do(ctx context.Context) ([]RecurringOrder, error)
func (*GetRecurringOrdersPendingService) SetAfter ¶
func (s *GetRecurringOrdersPendingService) SetAfter(after string) *GetRecurringOrdersPendingService
SetAfter pages backward from the given algoId (records older than it).
func (*GetRecurringOrdersPendingService) SetAlgoId ¶
func (s *GetRecurringOrdersPendingService) SetAlgoId(algoId string) *GetRecurringOrdersPendingService
SetAlgoId filters to a single strategy id.
func (*GetRecurringOrdersPendingService) SetBefore ¶
func (s *GetRecurringOrdersPendingService) SetBefore(before string) *GetRecurringOrdersPendingService
SetBefore pages forward from the given algoId (records newer than it).
func (*GetRecurringOrdersPendingService) SetLimit ¶
func (s *GetRecurringOrdersPendingService) SetLimit(limit int) *GetRecurringOrdersPendingService
SetLimit caps the number of returned strategies (max 100, default 100).
type GetRecurringSubOrdersService ¶
type GetRecurringSubOrdersService struct {
// contains filtered or unexported fields
}
GetRecurringSubOrdersService -- GET /api/v5/tradingBot/recurring/sub-orders (Read)
Returns the individual sub-orders placed by a recurring-buy strategy.
func (*GetRecurringSubOrdersService) Do ¶
func (s *GetRecurringSubOrdersService) Do(ctx context.Context) ([]RecurringSubOrder, error)
func (*GetRecurringSubOrdersService) SetAfter ¶
func (s *GetRecurringSubOrdersService) SetAfter(after string) *GetRecurringSubOrdersService
SetAfter pages backward from the given ordId (records older than it).
func (*GetRecurringSubOrdersService) SetBefore ¶
func (s *GetRecurringSubOrdersService) SetBefore(before string) *GetRecurringSubOrdersService
SetBefore pages forward from the given ordId (records newer than it).
func (*GetRecurringSubOrdersService) SetLimit ¶
func (s *GetRecurringSubOrdersService) SetLimit(limit int) *GetRecurringSubOrdersService
SetLimit caps the number of returned sub-orders (max 100, default 100).
func (*GetRecurringSubOrdersService) SetOrdId ¶
func (s *GetRecurringSubOrdersService) SetOrdId(ordId string) *GetRecurringSubOrdersService
SetOrdId filters to a single sub-order id.
type GetRfqBlockTickerService ¶
type GetRfqBlockTickerService struct {
// contains filtered or unexported fields
}
GetRfqBlockTickerService -- GET /api/v5/market/block-ticker (public)
Returns the 24h block-trade volume ticker for a single instrument. NOTE: OKX documents this under /api/v5/rfq/block-ticker but that path returns HTTP 404; the live endpoint is /api/v5/market/block-ticker.
func (*GetRfqBlockTickerService) Do ¶
func (s *GetRfqBlockTickerService) Do(ctx context.Context) (*RfqBlockTicker, error)
type GetRfqBlockTickersService ¶
type GetRfqBlockTickersService struct {
// contains filtered or unexported fields
}
GetRfqBlockTickersService -- GET /api/v5/market/block-tickers (public)
Returns the 24h block-trade volume tickers for every instrument of a product line. NOTE: OKX documents this under /api/v5/rfq/block-tickers but that path returns HTTP 404; the live endpoint is /api/v5/market/block-tickers.
func (*GetRfqBlockTickersService) Do ¶
func (s *GetRfqBlockTickersService) Do(ctx context.Context) ([]RfqBlockTicker, error)
func (*GetRfqBlockTickersService) SetInstFamily ¶
func (s *GetRfqBlockTickersService) SetInstFamily(instFamily string) *GetRfqBlockTickersService
SetInstFamily filters by instrument family (FUTURES/SWAP/OPTION).
func (*GetRfqBlockTickersService) SetUly ¶
func (s *GetRfqBlockTickersService) SetUly(uly string) *GetRfqBlockTickersService
SetUly filters by underlying (FUTURES/SWAP/OPTION).
type GetRfqCounterpartiesService ¶
type GetRfqCounterpartiesService struct {
// contains filtered or unexported fields
}
GetRfqCounterpartiesService -- GET /api/v5/rfq/counterparties (Read)
Returns the list of counterparties (makers) the account may direct RFQs to.
func (*GetRfqCounterpartiesService) Do ¶
func (s *GetRfqCounterpartiesService) Do(ctx context.Context) ([]RfqCounterparty, error)
type GetRfqMakerInstrumentSettingsService ¶
type GetRfqMakerInstrumentSettingsService struct {
// contains filtered or unexported fields
}
GetRfqMakerInstrumentSettingsService -- GET /api/v5/rfq/maker-instrument-settings (Read)
Returns the maker's per-instrument-type quoting settings (the instruments a maker is configured to quote and their parameters).
func (*GetRfqMakerInstrumentSettingsService) Do ¶
func (s *GetRfqMakerInstrumentSettingsService) Do(ctx context.Context) ([]RfqMakerInstrumentSetting, error)
type GetRfqMmpConfigService ¶
type GetRfqMmpConfigService struct {
// contains filtered or unexported fields
}
GetRfqMmpConfigService -- GET /api/v5/rfq/mmp-config (Read)
Returns the maker's MMP (market-maker protection) configuration.
func (*GetRfqMmpConfigService) Do ¶
func (s *GetRfqMmpConfigService) Do(ctx context.Context) (*RfqMmpConfig, error)
type GetRfqPublicTradesService ¶
type GetRfqPublicTradesService struct {
// contains filtered or unexported fields
}
GetRfqPublicTradesService -- GET /api/v5/rfq/public-trades (public)
Returns the most recent public block trades across all counterparties.
func (*GetRfqPublicTradesService) Do ¶
func (s *GetRfqPublicTradesService) Do(ctx context.Context) ([]RfqPublicTrade, error)
func (*GetRfqPublicTradesService) SetBeginId ¶
func (s *GetRfqPublicTradesService) SetBeginId(beginId string) *GetRfqPublicTradesService
SetBeginId pages from a starting block-trade id (records newer than the id).
func (*GetRfqPublicTradesService) SetEndId ¶
func (s *GetRfqPublicTradesService) SetEndId(endId string) *GetRfqPublicTradesService
SetEndId pages up to an ending block-trade id (records older than the id).
func (*GetRfqPublicTradesService) SetLimit ¶
func (s *GetRfqPublicTradesService) SetLimit(limit int) *GetRfqPublicTradesService
SetLimit caps the number of records returned (max 100).
type GetRfqQuoteProductsService ¶
type GetRfqQuoteProductsService struct {
// contains filtered or unexported fields
}
GetRfqQuoteProductsService -- GET /api/v5/rfq/quote-products (deprecated)
Returns the maker's configured quote products. DEPRECATED: this legacy path now returns HTTP 404; OKX folded quote-product configuration into /api/v5/rfq/maker-instrument-settings. Kept implement-only and NOT exercised by the test suite. Prefer GetRfqMakerInstrumentSettingsService.
func (*GetRfqQuoteProductsService) Do ¶
func (s *GetRfqQuoteProductsService) Do(ctx context.Context) ([]RfqQuoteProduct, error)
type GetRfqQuotesService ¶
type GetRfqQuotesService struct {
// contains filtered or unexported fields
}
GetRfqQuotesService -- GET /api/v5/rfq/quotes (Read)
Returns the account's quote records (quotes it made, or quotes it received as taker).
func (*GetRfqQuotesService) Do ¶
func (s *GetRfqQuotesService) Do(ctx context.Context) ([]RfqQuote, error)
func (*GetRfqQuotesService) SetBeginId ¶
func (s *GetRfqQuotesService) SetBeginId(beginId string) *GetRfqQuotesService
SetBeginId pages from a starting quote id (records newer than the id).
func (*GetRfqQuotesService) SetClQuoteId ¶
func (s *GetRfqQuotesService) SetClQuoteId(clQuoteId string) *GetRfqQuotesService
SetClQuoteId filters by client-supplied quote id.
func (*GetRfqQuotesService) SetClRfqId ¶
func (s *GetRfqQuotesService) SetClRfqId(clRfqId string) *GetRfqQuotesService
SetClRfqId filters by client-supplied RFQ id.
func (*GetRfqQuotesService) SetEndId ¶
func (s *GetRfqQuotesService) SetEndId(endId string) *GetRfqQuotesService
SetEndId pages up to an ending quote id (records older than the id).
func (*GetRfqQuotesService) SetLimit ¶
func (s *GetRfqQuotesService) SetLimit(limit int) *GetRfqQuotesService
SetLimit caps the number of records returned (max 100).
func (*GetRfqQuotesService) SetQuoteId ¶
func (s *GetRfqQuotesService) SetQuoteId(quoteId string) *GetRfqQuotesService
SetQuoteId filters by quote id.
func (*GetRfqQuotesService) SetRfqId ¶
func (s *GetRfqQuotesService) SetRfqId(rfqId string) *GetRfqQuotesService
SetRfqId filters by RFQ id.
func (*GetRfqQuotesService) SetState ¶
func (s *GetRfqQuotesService) SetState(state RfqQuoteState) *GetRfqQuotesService
SetState filters by quote state.
type GetRfqTradesService ¶
type GetRfqTradesService struct {
// contains filtered or unexported fields
}
GetRfqTradesService -- GET /api/v5/rfq/trades (Read)
Returns the account's executed block trades (RFQ trades).
func (*GetRfqTradesService) Do ¶
func (s *GetRfqTradesService) Do(ctx context.Context) ([]RfqTrade, error)
func (*GetRfqTradesService) SetBeginId ¶
func (s *GetRfqTradesService) SetBeginId(beginId string) *GetRfqTradesService
SetBeginId pages from a starting block-trade id (records newer than the id).
func (*GetRfqTradesService) SetBeginTs ¶
func (s *GetRfqTradesService) SetBeginTs(t time.Time) *GetRfqTradesService
SetBeginTs filters to trades at or after the given time (ms).
func (*GetRfqTradesService) SetClQuoteId ¶
func (s *GetRfqTradesService) SetClQuoteId(clQuoteId string) *GetRfqTradesService
SetClQuoteId filters by client-supplied quote id.
func (*GetRfqTradesService) SetClRfqId ¶
func (s *GetRfqTradesService) SetClRfqId(clRfqId string) *GetRfqTradesService
SetClRfqId filters by client-supplied RFQ id.
func (*GetRfqTradesService) SetEndId ¶
func (s *GetRfqTradesService) SetEndId(endId string) *GetRfqTradesService
SetEndId pages up to an ending block-trade id (records older than the id).
func (*GetRfqTradesService) SetEndTs ¶
func (s *GetRfqTradesService) SetEndTs(t time.Time) *GetRfqTradesService
SetEndTs filters to trades at or before the given time (ms).
func (*GetRfqTradesService) SetLimit ¶
func (s *GetRfqTradesService) SetLimit(limit int) *GetRfqTradesService
SetLimit caps the number of records returned (max 100).
func (*GetRfqTradesService) SetQuoteId ¶
func (s *GetRfqTradesService) SetQuoteId(quoteId string) *GetRfqTradesService
SetQuoteId filters by quote id.
func (*GetRfqTradesService) SetRfqId ¶
func (s *GetRfqTradesService) SetRfqId(rfqId string) *GetRfqTradesService
SetRfqId filters by RFQ id.
func (*GetRfqTradesService) SetState ¶
func (s *GetRfqTradesService) SetState(state string) *GetRfqTradesService
SetState filters by trade state.
type GetRfqsService ¶
type GetRfqsService struct {
// contains filtered or unexported fields
}
GetRfqsService -- GET /api/v5/rfq/rfqs (Read)
Returns the account's RFQ records, both created (taker) and received (maker).
func (*GetRfqsService) SetBeginId ¶
func (s *GetRfqsService) SetBeginId(beginId string) *GetRfqsService
SetBeginId pages from a starting RFQ id (records newer than the id).
func (*GetRfqsService) SetClRfqId ¶
func (s *GetRfqsService) SetClRfqId(clRfqId string) *GetRfqsService
SetClRfqId filters by client-supplied RFQ id.
func (*GetRfqsService) SetEndId ¶
func (s *GetRfqsService) SetEndId(endId string) *GetRfqsService
SetEndId pages up to an ending RFQ id (records older than the id).
func (*GetRfqsService) SetLimit ¶
func (s *GetRfqsService) SetLimit(limit int) *GetRfqsService
SetLimit caps the number of records returned (max 100).
func (*GetRfqsService) SetRfqId ¶
func (s *GetRfqsService) SetRfqId(rfqId string) *GetRfqsService
SetRfqId filters by RFQ id.
func (*GetRfqsService) SetState ¶
func (s *GetRfqsService) SetState(state RfqState) *GetRfqsService
SetState filters by RFQ state.
type GetRiskStateService ¶
type GetRiskStateService struct {
// contains filtered or unexported fields
}
GetRiskStateService -- GET /api/v5/account/risk-state (Read)
Returns the portfolio-margin account's auto-borrow/auto-repay risk state. Only available when the account is in portfolio-margin mode.
type GetSavingsBalanceService ¶
type GetSavingsBalanceService struct {
// contains filtered or unexported fields
}
GetSavingsBalanceService -- GET /api/v5/finance/savings/balance (Read)
Returns the Simple Earn Flexible (savings) balance of each currency the account is subscribed to.
func (*GetSavingsBalanceService) Do ¶
func (s *GetSavingsBalanceService) Do(ctx context.Context) ([]SavingsBalance, error)
func (*GetSavingsBalanceService) SetCcy ¶
func (s *GetSavingsBalanceService) SetCcy(ccy string) *GetSavingsBalanceService
SetCcy filters by currency.
type GetSavingsLendingHistoryService ¶
type GetSavingsLendingHistoryService struct {
// contains filtered or unexported fields
}
GetSavingsLendingHistoryService -- GET /api/v5/finance/savings/lending-history (Read)
Returns the account's savings lending history.
func (*GetSavingsLendingHistoryService) Do ¶
func (s *GetSavingsLendingHistoryService) Do(ctx context.Context) ([]SavingsLendingHistory, error)
func (*GetSavingsLendingHistoryService) SetAfter ¶
func (s *GetSavingsLendingHistoryService) SetAfter(t time.Time) *GetSavingsLendingHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetSavingsLendingHistoryService) SetBefore ¶
func (s *GetSavingsLendingHistoryService) SetBefore(t time.Time) *GetSavingsLendingHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetSavingsLendingHistoryService) SetCcy ¶
func (s *GetSavingsLendingHistoryService) SetCcy(ccy string) *GetSavingsLendingHistoryService
SetCcy filters by currency.
func (*GetSavingsLendingHistoryService) SetLimit ¶
func (s *GetSavingsLendingHistoryService) SetLimit(limit int) *GetSavingsLendingHistoryService
SetLimit caps the number of records returned (max 100).
type GetSavingsLendingRateHistoryService ¶
type GetSavingsLendingRateHistoryService struct {
// contains filtered or unexported fields
}
GetSavingsLendingRateHistoryService -- GET /api/v5/finance/savings/lending-rate-history (Read)
Returns the historical public lending rates per savings currency.
func (*GetSavingsLendingRateHistoryService) Do ¶
func (s *GetSavingsLendingRateHistoryService) Do(ctx context.Context) ([]SavingsLendingRateHistory, error)
func (*GetSavingsLendingRateHistoryService) SetAfter ¶
func (s *GetSavingsLendingRateHistoryService) SetAfter(t time.Time) *GetSavingsLendingRateHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetSavingsLendingRateHistoryService) SetBefore ¶
func (s *GetSavingsLendingRateHistoryService) SetBefore(t time.Time) *GetSavingsLendingRateHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetSavingsLendingRateHistoryService) SetCcy ¶
func (s *GetSavingsLendingRateHistoryService) SetCcy(ccy string) *GetSavingsLendingRateHistoryService
SetCcy filters by currency.
func (*GetSavingsLendingRateHistoryService) SetLimit ¶
func (s *GetSavingsLendingRateHistoryService) SetLimit(limit int) *GetSavingsLendingRateHistoryService
SetLimit caps the number of records returned (max 100).
type GetSavingsLendingRateSummaryService ¶
type GetSavingsLendingRateSummaryService struct {
// contains filtered or unexported fields
}
GetSavingsLendingRateSummaryService -- GET /api/v5/finance/savings/lending-rate-summary (Read)
Returns the current public lending-rate summary (estimated/previous/average rates) per savings currency.
func (*GetSavingsLendingRateSummaryService) Do ¶
func (s *GetSavingsLendingRateSummaryService) Do(ctx context.Context) ([]SavingsLendingRateSummary, error)
func (*GetSavingsLendingRateSummaryService) SetCcy ¶
func (s *GetSavingsLendingRateSummaryService) SetCcy(ccy string) *GetSavingsLendingRateSummaryService
SetCcy filters by currency.
type GetSettlementHistoryService ¶
type GetSettlementHistoryService struct {
// contains filtered or unexported fields
}
GetSettlementHistoryService -- GET /api/v5/public/settlement-history (public)
Returns the futures settlement history of an instrument family.
func (*GetSettlementHistoryService) Do ¶
func (s *GetSettlementHistoryService) Do(ctx context.Context) ([]SettlementHistory, error)
func (*GetSettlementHistoryService) SetAfter ¶
func (s *GetSettlementHistoryService) SetAfter(t time.Time) *GetSettlementHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetSettlementHistoryService) SetBefore ¶
func (s *GetSettlementHistoryService) SetBefore(t time.Time) *GetSettlementHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetSettlementHistoryService) SetLimit ¶
func (s *GetSettlementHistoryService) SetLimit(limit int) *GetSettlementHistoryService
SetLimit caps the number of records returned (max 100).
type GetSolStakingApyHistoryService ¶
type GetSolStakingApyHistoryService struct {
// contains filtered or unexported fields
}
GetSolStakingApyHistoryService -- GET /api/v5/finance/staking-defi/sol/apy-history (Read)
Returns the SOL staking APY history for the trailing number of days.
func (*GetSolStakingApyHistoryService) Do ¶
func (s *GetSolStakingApyHistoryService) Do(ctx context.Context) ([]StakingApyHistory, error)
type GetSolStakingBalanceService ¶
type GetSolStakingBalanceService struct {
// contains filtered or unexported fields
}
GetSolStakingBalanceService -- GET /api/v5/finance/staking-defi/sol/balance (Read)
Returns the account's OKSOL balance and accrued staking interest.
func (*GetSolStakingBalanceService) Do ¶
func (s *GetSolStakingBalanceService) Do(ctx context.Context) ([]SolStakingBalance, error)
type GetSolStakingHistoryService ¶
type GetSolStakingHistoryService struct {
// contains filtered or unexported fields
}
GetSolStakingHistoryService -- GET /api/v5/finance/staking-defi/sol/purchase-redeem-history (Read)
Returns the account's SOL staking purchase and redemption history.
func (*GetSolStakingHistoryService) Do ¶
func (s *GetSolStakingHistoryService) Do(ctx context.Context) ([]SolStakingHistory, error)
func (*GetSolStakingHistoryService) SetAfter ¶
func (s *GetSolStakingHistoryService) SetAfter(t time.Time) *GetSolStakingHistoryService
SetAfter paginates to records earlier than the given request time (older).
func (*GetSolStakingHistoryService) SetBefore ¶
func (s *GetSolStakingHistoryService) SetBefore(t time.Time) *GetSolStakingHistoryService
SetBefore paginates to records later than the given request time (newer).
func (*GetSolStakingHistoryService) SetLimit ¶
func (s *GetSolStakingHistoryService) SetLimit(limit int) *GetSolStakingHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetSolStakingHistoryService) SetStatus ¶
func (s *GetSolStakingHistoryService) SetStatus(status string) *GetSolStakingHistoryService
SetStatus filters by record status (pending/success/failed).
func (*GetSolStakingHistoryService) SetType ¶
func (s *GetSolStakingHistoryService) SetType(typ string) *GetSolStakingHistoryService
SetType filters by record type (purchase/redeem).
type GetSolStakingProductInfoService ¶
type GetSolStakingProductInfoService struct {
// contains filtered or unexported fields
}
GetSolStakingProductInfoService -- GET /api/v5/finance/staking-defi/sol/product-info (Read)
Returns the SOL staking product parameters. Unlike the ETH variant, OKX returns this endpoint's "data" as a single JSON object, so it decodes via DoObject.
func (*GetSolStakingProductInfoService) Do ¶
func (s *GetSolStakingProductInfoService) Do(ctx context.Context) (*SolStakingProductInfo, error)
type GetSpotBorrowRepayHistoryService ¶
type GetSpotBorrowRepayHistoryService struct {
// contains filtered or unexported fields
}
GetSpotBorrowRepayHistoryService -- GET /api/v5/account/spot-borrow-repay-history (Read)
Returns the history of spot (auto / manual) borrows and repayments.
func (*GetSpotBorrowRepayHistoryService) Do ¶
func (s *GetSpotBorrowRepayHistoryService) Do(ctx context.Context) ([]SpotBorrowRepayHistory, error)
func (*GetSpotBorrowRepayHistoryService) SetAfter ¶
func (s *GetSpotBorrowRepayHistoryService) SetAfter(t time.Time) *GetSpotBorrowRepayHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetSpotBorrowRepayHistoryService) SetBefore ¶
func (s *GetSpotBorrowRepayHistoryService) SetBefore(t time.Time) *GetSpotBorrowRepayHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetSpotBorrowRepayHistoryService) SetCcy ¶
func (s *GetSpotBorrowRepayHistoryService) SetCcy(ccy string) *GetSpotBorrowRepayHistoryService
SetCcy filters by currency.
func (*GetSpotBorrowRepayHistoryService) SetLimit ¶
func (s *GetSpotBorrowRepayHistoryService) SetLimit(limit int) *GetSpotBorrowRepayHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetSpotBorrowRepayHistoryService) SetType ¶
func (s *GetSpotBorrowRepayHistoryService) SetType(typ string) *GetSpotBorrowRepayHistoryService
SetType filters by event type (auto_borrow / auto_repay / manual_borrow / manual_repay).
type GetSprdBooksService ¶
type GetSprdBooksService struct {
// contains filtered or unexported fields
}
GetSprdBooksService -- GET /api/v5/sprd/books (public)
Returns the order book of a spread.
func (*GetSprdBooksService) Do ¶
func (s *GetSprdBooksService) Do(ctx context.Context) (*SprdOrderBook, error)
func (*GetSprdBooksService) SetSz ¶
func (s *GetSprdBooksService) SetSz(sz int) *GetSprdBooksService
SetSz sets the order book depth (number of price levels, max 400).
type GetSprdCandlesService ¶
type GetSprdCandlesService struct {
// contains filtered or unexported fields
}
GetSprdCandlesService -- GET /api/v5/market/sprd-candles (public)
Returns recent candlestick data for a spread. Note the path lives under /market/, not /sprd/.
func (*GetSprdCandlesService) Do ¶
func (s *GetSprdCandlesService) Do(ctx context.Context) ([]SprdCandle, error)
func (*GetSprdCandlesService) SetAfter ¶
func (s *GetSprdCandlesService) SetAfter(after time.Time) *GetSprdCandlesService
SetAfter requests candles before the given timestamp (paging backward).
func (*GetSprdCandlesService) SetBar ¶
func (s *GetSprdCandlesService) SetBar(bar MarketBar) *GetSprdCandlesService
SetBar sets the candle time granularity (default 1m).
func (*GetSprdCandlesService) SetBefore ¶
func (s *GetSprdCandlesService) SetBefore(before time.Time) *GetSprdCandlesService
SetBefore requests candles after the given timestamp (paging forward).
func (*GetSprdCandlesService) SetLimit ¶
func (s *GetSprdCandlesService) SetLimit(limit int) *GetSprdCandlesService
SetLimit caps the number of returned candles (max 100, default 100).
type GetSprdHistoryCandlesService ¶
type GetSprdHistoryCandlesService struct {
// contains filtered or unexported fields
}
GetSprdHistoryCandlesService -- GET /api/v5/market/sprd-history-candles (public)
Returns historical candlestick data for a spread. Note the path lives under /market/, not /sprd/.
func (*GetSprdHistoryCandlesService) Do ¶
func (s *GetSprdHistoryCandlesService) Do(ctx context.Context) ([]SprdCandle, error)
func (*GetSprdHistoryCandlesService) SetAfter ¶
func (s *GetSprdHistoryCandlesService) SetAfter(after time.Time) *GetSprdHistoryCandlesService
SetAfter requests candles before the given timestamp (paging backward).
func (*GetSprdHistoryCandlesService) SetBar ¶
func (s *GetSprdHistoryCandlesService) SetBar(bar MarketBar) *GetSprdHistoryCandlesService
SetBar sets the candle time granularity (default 1m).
func (*GetSprdHistoryCandlesService) SetBefore ¶
func (s *GetSprdHistoryCandlesService) SetBefore(before time.Time) *GetSprdHistoryCandlesService
SetBefore requests candles after the given timestamp (paging forward).
func (*GetSprdHistoryCandlesService) SetLimit ¶
func (s *GetSprdHistoryCandlesService) SetLimit(limit int) *GetSprdHistoryCandlesService
SetLimit caps the number of returned candles (max 100, default 100).
type GetSprdOrderAlgoService ¶
type GetSprdOrderAlgoService struct {
// contains filtered or unexported fields
}
GetSprdOrderAlgoService -- GET /api/v5/sprd/order-algo (Read)
Returns the details of a single spread algo order. Either algoId or algoClOrdId must be supplied.
NOTE: live verification (2026-06) returns HTTP 404 for this path on www.okx.com; the spread algo-order endpoints are not currently deployed. The service is modeled from the OKX docs so it works if/when OKX enables it.
func (*GetSprdOrderAlgoService) Do ¶
func (s *GetSprdOrderAlgoService) Do(ctx context.Context) (*SprdAlgoOrder, error)
func (*GetSprdOrderAlgoService) SetAlgoClOrdId ¶
func (s *GetSprdOrderAlgoService) SetAlgoClOrdId(algoClOrdId string) *GetSprdOrderAlgoService
SetAlgoClOrdId looks the algo order up by its client-supplied id.
func (*GetSprdOrderAlgoService) SetAlgoId ¶
func (s *GetSprdOrderAlgoService) SetAlgoId(algoId string) *GetSprdOrderAlgoService
SetAlgoId looks the algo order up by its OKX algo id.
type GetSprdOrderService ¶
type GetSprdOrderService struct {
// contains filtered or unexported fields
}
GetSprdOrderService -- GET /api/v5/sprd/order (Read)
Returns the details of a single spread order. Either ordId or clOrdId must be supplied.
func (*GetSprdOrderService) Do ¶
func (s *GetSprdOrderService) Do(ctx context.Context) (*SprdOrder, error)
func (*GetSprdOrderService) SetClOrdId ¶
func (s *GetSprdOrderService) SetClOrdId(clOrdId string) *GetSprdOrderService
SetClOrdId looks the order up by its client-supplied order id.
func (*GetSprdOrderService) SetOrdId ¶
func (s *GetSprdOrderService) SetOrdId(ordId string) *GetSprdOrderService
SetOrdId looks the order up by its OKX order id.
type GetSprdOrdersAlgoHistoryService ¶
type GetSprdOrdersAlgoHistoryService struct {
// contains filtered or unexported fields
}
GetSprdOrdersAlgoHistoryService -- GET /api/v5/sprd/orders-algo-history (Read)
Returns the account's completed spread algo orders.
NOTE: live verification (2026-06) returns HTTP 404 for this path on www.okx.com; the spread algo-order endpoints are not currently deployed.
func (*GetSprdOrdersAlgoHistoryService) Do ¶
func (s *GetSprdOrdersAlgoHistoryService) Do(ctx context.Context) ([]SprdAlgoOrder, error)
func (*GetSprdOrdersAlgoHistoryService) SetAlgoId ¶
func (s *GetSprdOrdersAlgoHistoryService) SetAlgoId(algoId string) *GetSprdOrdersAlgoHistoryService
SetAlgoId filters by a single algo id.
func (*GetSprdOrdersAlgoHistoryService) SetBegin ¶
func (s *GetSprdOrdersAlgoHistoryService) SetBegin(t time.Time) *GetSprdOrdersAlgoHistoryService
SetBegin filters to algo orders created at or after the given time.
func (*GetSprdOrdersAlgoHistoryService) SetEnd ¶
func (s *GetSprdOrdersAlgoHistoryService) SetEnd(t time.Time) *GetSprdOrdersAlgoHistoryService
SetEnd filters to algo orders created at or before the given time.
func (*GetSprdOrdersAlgoHistoryService) SetLimit ¶
func (s *GetSprdOrdersAlgoHistoryService) SetLimit(limit int) *GetSprdOrdersAlgoHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetSprdOrdersAlgoHistoryService) SetOrdType ¶
func (s *GetSprdOrdersAlgoHistoryService) SetOrdType(ordType string) *GetSprdOrdersAlgoHistoryService
SetOrdType filters by algo order type.
func (*GetSprdOrdersAlgoHistoryService) SetSprdId ¶
func (s *GetSprdOrdersAlgoHistoryService) SetSprdId(sprdId string) *GetSprdOrdersAlgoHistoryService
SetSprdId filters by spread id.
func (*GetSprdOrdersAlgoHistoryService) SetState ¶
func (s *GetSprdOrdersAlgoHistoryService) SetState(state string) *GetSprdOrdersAlgoHistoryService
SetState filters by algo order state.
type GetSprdOrdersAlgoPendingService ¶
type GetSprdOrdersAlgoPendingService struct {
// contains filtered or unexported fields
}
GetSprdOrdersAlgoPendingService -- GET /api/v5/sprd/orders-algo-pending (Read)
Returns the account's currently open spread algo orders.
NOTE: live verification (2026-06) returns HTTP 404 for this path on www.okx.com; the spread algo-order endpoints are not currently deployed.
func (*GetSprdOrdersAlgoPendingService) Do ¶
func (s *GetSprdOrdersAlgoPendingService) Do(ctx context.Context) ([]SprdAlgoOrder, error)
func (*GetSprdOrdersAlgoPendingService) SetAlgoId ¶
func (s *GetSprdOrdersAlgoPendingService) SetAlgoId(algoId string) *GetSprdOrdersAlgoPendingService
SetAlgoId filters by a single algo id.
func (*GetSprdOrdersAlgoPendingService) SetOrdType ¶
func (s *GetSprdOrdersAlgoPendingService) SetOrdType(ordType string) *GetSprdOrdersAlgoPendingService
SetOrdType filters by algo order type.
func (*GetSprdOrdersAlgoPendingService) SetSprdId ¶
func (s *GetSprdOrdersAlgoPendingService) SetSprdId(sprdId string) *GetSprdOrdersAlgoPendingService
SetSprdId filters by spread id.
func (*GetSprdOrdersAlgoPendingService) SetState ¶
func (s *GetSprdOrdersAlgoPendingService) SetState(state string) *GetSprdOrdersAlgoPendingService
SetState filters by algo order state.
type GetSprdOrdersHistoryArchiveService ¶
type GetSprdOrdersHistoryArchiveService struct {
// contains filtered or unexported fields
}
GetSprdOrdersHistoryArchiveService -- GET /api/v5/sprd/orders-history-archive (Read)
Returns the account's archived (older than 21 days) completed spread orders.
func (*GetSprdOrdersHistoryArchiveService) Do ¶
func (s *GetSprdOrdersHistoryArchiveService) Do(ctx context.Context) ([]SprdOrder, error)
func (*GetSprdOrdersHistoryArchiveService) SetBegin ¶
func (s *GetSprdOrdersHistoryArchiveService) SetBegin(t time.Time) *GetSprdOrdersHistoryArchiveService
SetBegin filters to orders created at or after the given time.
func (*GetSprdOrdersHistoryArchiveService) SetBeginId ¶
func (s *GetSprdOrdersHistoryArchiveService) SetBeginId(beginId string) *GetSprdOrdersHistoryArchiveService
SetBeginId pages from orders with an id newer than beginId.
func (*GetSprdOrdersHistoryArchiveService) SetEnd ¶
func (s *GetSprdOrdersHistoryArchiveService) SetEnd(t time.Time) *GetSprdOrdersHistoryArchiveService
SetEnd filters to orders created at or before the given time.
func (*GetSprdOrdersHistoryArchiveService) SetEndId ¶
func (s *GetSprdOrdersHistoryArchiveService) SetEndId(endId string) *GetSprdOrdersHistoryArchiveService
SetEndId pages to orders with an id older than endId.
func (*GetSprdOrdersHistoryArchiveService) SetLimit ¶
func (s *GetSprdOrdersHistoryArchiveService) SetLimit(limit int) *GetSprdOrdersHistoryArchiveService
SetLimit caps the number of records returned (max 100).
func (*GetSprdOrdersHistoryArchiveService) SetOrdType ¶
func (s *GetSprdOrdersHistoryArchiveService) SetOrdType(ordType SprdOrdType) *GetSprdOrdersHistoryArchiveService
SetOrdType filters by order type.
func (*GetSprdOrdersHistoryArchiveService) SetSprdId ¶
func (s *GetSprdOrdersHistoryArchiveService) SetSprdId(sprdId string) *GetSprdOrdersHistoryArchiveService
SetSprdId filters by spread id.
func (*GetSprdOrdersHistoryArchiveService) SetState ¶
func (s *GetSprdOrdersHistoryArchiveService) SetState(state SprdOrdState) *GetSprdOrdersHistoryArchiveService
SetState filters by order state (canceled / filled).
type GetSprdOrdersHistoryService ¶
type GetSprdOrdersHistoryService struct {
// contains filtered or unexported fields
}
GetSprdOrdersHistoryService -- GET /api/v5/sprd/orders-history (Read)
Returns the account's completed spread orders from the last 21 days.
func (*GetSprdOrdersHistoryService) Do ¶
func (s *GetSprdOrdersHistoryService) Do(ctx context.Context) ([]SprdOrder, error)
func (*GetSprdOrdersHistoryService) SetBegin ¶
func (s *GetSprdOrdersHistoryService) SetBegin(t time.Time) *GetSprdOrdersHistoryService
SetBegin filters to orders created at or after the given time.
func (*GetSprdOrdersHistoryService) SetBeginId ¶
func (s *GetSprdOrdersHistoryService) SetBeginId(beginId string) *GetSprdOrdersHistoryService
SetBeginId pages from orders with an id newer than beginId.
func (*GetSprdOrdersHistoryService) SetEnd ¶
func (s *GetSprdOrdersHistoryService) SetEnd(t time.Time) *GetSprdOrdersHistoryService
SetEnd filters to orders created at or before the given time.
func (*GetSprdOrdersHistoryService) SetEndId ¶
func (s *GetSprdOrdersHistoryService) SetEndId(endId string) *GetSprdOrdersHistoryService
SetEndId pages to orders with an id older than endId.
func (*GetSprdOrdersHistoryService) SetLimit ¶
func (s *GetSprdOrdersHistoryService) SetLimit(limit int) *GetSprdOrdersHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetSprdOrdersHistoryService) SetOrdType ¶
func (s *GetSprdOrdersHistoryService) SetOrdType(ordType SprdOrdType) *GetSprdOrdersHistoryService
SetOrdType filters by order type.
func (*GetSprdOrdersHistoryService) SetSprdId ¶
func (s *GetSprdOrdersHistoryService) SetSprdId(sprdId string) *GetSprdOrdersHistoryService
SetSprdId filters by spread id.
func (*GetSprdOrdersHistoryService) SetState ¶
func (s *GetSprdOrdersHistoryService) SetState(state SprdOrdState) *GetSprdOrdersHistoryService
SetState filters by order state (canceled / filled).
type GetSprdOrdersPendingService ¶
type GetSprdOrdersPendingService struct {
// contains filtered or unexported fields
}
GetSprdOrdersPendingService -- GET /api/v5/sprd/orders-pending (Read)
Returns the account's currently open (incomplete) spread orders.
func (*GetSprdOrdersPendingService) Do ¶
func (s *GetSprdOrdersPendingService) Do(ctx context.Context) ([]SprdOrder, error)
func (*GetSprdOrdersPendingService) SetBeginId ¶
func (s *GetSprdOrdersPendingService) SetBeginId(beginId string) *GetSprdOrdersPendingService
SetBeginId pages from orders with an id newer than beginId.
func (*GetSprdOrdersPendingService) SetEndId ¶
func (s *GetSprdOrdersPendingService) SetEndId(endId string) *GetSprdOrdersPendingService
SetEndId pages to orders with an id older than endId.
func (*GetSprdOrdersPendingService) SetLimit ¶
func (s *GetSprdOrdersPendingService) SetLimit(limit int) *GetSprdOrdersPendingService
SetLimit caps the number of records returned (max 100).
func (*GetSprdOrdersPendingService) SetOrdType ¶
func (s *GetSprdOrdersPendingService) SetOrdType(ordType SprdOrdType) *GetSprdOrdersPendingService
SetOrdType filters by order type.
func (*GetSprdOrdersPendingService) SetSprdId ¶
func (s *GetSprdOrdersPendingService) SetSprdId(sprdId string) *GetSprdOrdersPendingService
SetSprdId filters by spread id.
func (*GetSprdOrdersPendingService) SetState ¶
func (s *GetSprdOrdersPendingService) SetState(state SprdOrdState) *GetSprdOrdersPendingService
SetState filters by order state (live / partially_filled).
type GetSprdPublicTradesService ¶
type GetSprdPublicTradesService struct {
// contains filtered or unexported fields
}
GetSprdPublicTradesService -- GET /api/v5/sprd/public-trades (public)
Returns the most recent public trades for spreads.
func (*GetSprdPublicTradesService) Do ¶
func (s *GetSprdPublicTradesService) Do(ctx context.Context) ([]SprdPublicTrade, error)
func (*GetSprdPublicTradesService) SetSprdId ¶
func (s *GetSprdPublicTradesService) SetSprdId(sprdId string) *GetSprdPublicTradesService
SetSprdId filters trades to a single spread.
type GetSprdSpreadsService ¶
type GetSprdSpreadsService struct {
// contains filtered or unexported fields
}
GetSprdSpreadsService -- GET /api/v5/sprd/spreads (public)
Returns the tradable spreads, their legs and lot/tick sizes.
func (*GetSprdSpreadsService) Do ¶
func (s *GetSprdSpreadsService) Do(ctx context.Context) ([]SprdSpread, error)
func (*GetSprdSpreadsService) SetBaseCcy ¶
func (s *GetSprdSpreadsService) SetBaseCcy(baseCcy string) *GetSprdSpreadsService
SetBaseCcy filters by base currency.
func (*GetSprdSpreadsService) SetInstId ¶
func (s *GetSprdSpreadsService) SetInstId(instId string) *GetSprdSpreadsService
SetInstId filters to spreads that include the given instrument as a leg.
func (*GetSprdSpreadsService) SetSprdId ¶
func (s *GetSprdSpreadsService) SetSprdId(sprdId string) *GetSprdSpreadsService
SetSprdId filters by a single spread id.
func (*GetSprdSpreadsService) SetState ¶
func (s *GetSprdSpreadsService) SetState(state SprdState) *GetSprdSpreadsService
SetState filters by spread state.
type GetSprdTickerService ¶
type GetSprdTickerService struct {
// contains filtered or unexported fields
}
GetSprdTickerService -- GET /api/v5/sprd/ticker (public)
Returns the latest ticker for a spread.
func (*GetSprdTickerService) Do ¶
func (s *GetSprdTickerService) Do(ctx context.Context) (*SprdTicker, error)
type GetSprdTradesService ¶
type GetSprdTradesService struct {
// contains filtered or unexported fields
}
GetSprdTradesService -- GET /api/v5/sprd/trades (Read)
Returns the account's spread fills from the last 21 days.
func (*GetSprdTradesService) Do ¶
func (s *GetSprdTradesService) Do(ctx context.Context) ([]SprdTrade, error)
func (*GetSprdTradesService) SetBegin ¶
func (s *GetSprdTradesService) SetBegin(t time.Time) *GetSprdTradesService
SetBegin filters to fills at or after the given time.
func (*GetSprdTradesService) SetBeginId ¶
func (s *GetSprdTradesService) SetBeginId(beginId string) *GetSprdTradesService
SetBeginId pages from fills with an id newer than beginId.
func (*GetSprdTradesService) SetEnd ¶
func (s *GetSprdTradesService) SetEnd(t time.Time) *GetSprdTradesService
SetEnd filters to fills at or before the given time.
func (*GetSprdTradesService) SetEndId ¶
func (s *GetSprdTradesService) SetEndId(endId string) *GetSprdTradesService
SetEndId pages to fills with an id older than endId.
func (*GetSprdTradesService) SetLimit ¶
func (s *GetSprdTradesService) SetLimit(limit int) *GetSprdTradesService
SetLimit caps the number of records returned (max 100).
func (*GetSprdTradesService) SetOrdId ¶
func (s *GetSprdTradesService) SetOrdId(ordId string) *GetSprdTradesService
SetOrdId filters fills by their parent order id.
func (*GetSprdTradesService) SetSprdId ¶
func (s *GetSprdTradesService) SetSprdId(sprdId string) *GetSprdTradesService
SetSprdId filters by spread id.
func (*GetSprdTradesService) SetTradeId ¶
func (s *GetSprdTradesService) SetTradeId(tradeId string) *GetSprdTradesService
SetTradeId filters by a single trade id.
type GetStakingActiveOrdersService ¶
type GetStakingActiveOrdersService struct {
// contains filtered or unexported fields
}
GetStakingActiveOrdersService -- GET /api/v5/finance/staking-defi/orders-active (Read)
Returns the account's active (not yet fully redeemed) on-chain earn orders.
func (*GetStakingActiveOrdersService) Do ¶
func (s *GetStakingActiveOrdersService) Do(ctx context.Context) ([]StakingActiveOrder, error)
func (*GetStakingActiveOrdersService) SetCcy ¶
func (s *GetStakingActiveOrdersService) SetCcy(ccy string) *GetStakingActiveOrdersService
SetCcy filters by investment currency.
func (*GetStakingActiveOrdersService) SetProductId ¶
func (s *GetStakingActiveOrdersService) SetProductId(productId string) *GetStakingActiveOrdersService
SetProductId filters by product id.
func (*GetStakingActiveOrdersService) SetProtocolType ¶
func (s *GetStakingActiveOrdersService) SetProtocolType(protocolType StakingProtocolType) *GetStakingActiveOrdersService
SetProtocolType filters by protocol category (defi/staking).
func (*GetStakingActiveOrdersService) SetState ¶
func (s *GetStakingActiveOrdersService) SetState(state StakingOrderState) *GetStakingActiveOrdersService
SetState filters by order state.
type GetStakingOffersService ¶
type GetStakingOffersService struct {
// contains filtered or unexported fields
}
GetStakingOffersService -- GET /api/v5/finance/staking-defi/offers (Read)
Returns the available on-chain earn (staking/defi) offers, including the per-currency invest constraints and the assets earned.
func (*GetStakingOffersService) Do ¶
func (s *GetStakingOffersService) Do(ctx context.Context) ([]StakingOffer, error)
func (*GetStakingOffersService) SetCcy ¶
func (s *GetStakingOffersService) SetCcy(ccy string) *GetStakingOffersService
SetCcy filters by investment currency.
func (*GetStakingOffersService) SetProductId ¶
func (s *GetStakingOffersService) SetProductId(productId string) *GetStakingOffersService
SetProductId filters by a single product id.
func (*GetStakingOffersService) SetProtocolType ¶
func (s *GetStakingOffersService) SetProtocolType(protocolType StakingProtocolType) *GetStakingOffersService
SetProtocolType filters by protocol category (defi/staking).
type GetStakingOrdersHistoryService ¶
type GetStakingOrdersHistoryService struct {
// contains filtered or unexported fields
}
GetStakingOrdersHistoryService -- GET /api/v5/finance/staking-defi/orders-history (Read)
Returns the account's completed/redeemed on-chain earn orders.
func (*GetStakingOrdersHistoryService) Do ¶
func (s *GetStakingOrdersHistoryService) Do(ctx context.Context) ([]StakingHistoryOrder, error)
func (*GetStakingOrdersHistoryService) SetAfter ¶
func (s *GetStakingOrdersHistoryService) SetAfter(t time.Time) *GetStakingOrdersHistoryService
SetAfter paginates to records earlier than the given order-creation time (older).
func (*GetStakingOrdersHistoryService) SetBefore ¶
func (s *GetStakingOrdersHistoryService) SetBefore(t time.Time) *GetStakingOrdersHistoryService
SetBefore paginates to records later than the given order-creation time (newer).
func (*GetStakingOrdersHistoryService) SetCcy ¶
func (s *GetStakingOrdersHistoryService) SetCcy(ccy string) *GetStakingOrdersHistoryService
SetCcy filters by investment currency.
func (*GetStakingOrdersHistoryService) SetLimit ¶
func (s *GetStakingOrdersHistoryService) SetLimit(limit int) *GetStakingOrdersHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetStakingOrdersHistoryService) SetProductId ¶
func (s *GetStakingOrdersHistoryService) SetProductId(productId string) *GetStakingOrdersHistoryService
SetProductId filters by product id.
func (*GetStakingOrdersHistoryService) SetProtocolType ¶
func (s *GetStakingOrdersHistoryService) SetProtocolType(protocolType StakingProtocolType) *GetStakingOrdersHistoryService
SetProtocolType filters by protocol category (defi/staking).
type GetSubAccountApiKeyService ¶
type GetSubAccountApiKeyService struct {
// contains filtered or unexported fields
}
GetSubAccountApiKeyService -- GET /api/v5/users/subaccount/apikey (Read)
Returns the API keys (excluding the secret) of a sub-account.
func (*GetSubAccountApiKeyService) Do ¶
func (s *GetSubAccountApiKeyService) Do(ctx context.Context) ([]SubAccountApiKey, error)
func (*GetSubAccountApiKeyService) SetApiKey ¶
func (s *GetSubAccountApiKeyService) SetApiKey(apiKey string) *GetSubAccountApiKeyService
SetApiKey filters by a single API key.
type GetSubAccountBillsService ¶
type GetSubAccountBillsService struct {
// contains filtered or unexported fields
}
GetSubAccountBillsService -- GET /api/v5/asset/subaccount/bills (Read)
Returns the master-account funding transfer records to/from sub-accounts over the last three months.
func (*GetSubAccountBillsService) Do ¶
func (s *GetSubAccountBillsService) Do(ctx context.Context) ([]SubAccountBill, error)
func (*GetSubAccountBillsService) SetAfter ¶
func (s *GetSubAccountBillsService) SetAfter(t time.Time) *GetSubAccountBillsService
SetAfter paginates to records earlier than the given time (older).
func (*GetSubAccountBillsService) SetBefore ¶
func (s *GetSubAccountBillsService) SetBefore(t time.Time) *GetSubAccountBillsService
SetBefore paginates to records later than the given time (newer).
func (*GetSubAccountBillsService) SetCcy ¶
func (s *GetSubAccountBillsService) SetCcy(ccy string) *GetSubAccountBillsService
SetCcy filters by currency.
func (*GetSubAccountBillsService) SetLimit ¶
func (s *GetSubAccountBillsService) SetLimit(limit int) *GetSubAccountBillsService
SetLimit caps the number of records returned (max 100).
func (*GetSubAccountBillsService) SetSubAcct ¶
func (s *GetSubAccountBillsService) SetSubAcct(subAcct string) *GetSubAccountBillsService
SetSubAcct filters by sub-account name.
func (*GetSubAccountBillsService) SetType ¶
func (s *GetSubAccountBillsService) SetType(typ string) *GetSubAccountBillsService
SetType filters by transfer type ("0" master->sub, "1" sub->master).
type GetSubAccountFundingBalancesService ¶
type GetSubAccountFundingBalancesService struct {
// contains filtered or unexported fields
}
GetSubAccountFundingBalancesService -- GET /api/v5/asset/subaccount/balances (Read)
Returns a sub-account's funding-account balances (master account).
func (*GetSubAccountFundingBalancesService) Do ¶
func (s *GetSubAccountFundingBalancesService) Do(ctx context.Context) ([]SubAccountFundingBalance, error)
func (*GetSubAccountFundingBalancesService) SetCcy ¶
func (s *GetSubAccountFundingBalancesService) SetCcy(ccy string) *GetSubAccountFundingBalancesService
SetCcy filters by a single currency.
type GetSubAccountListService ¶
type GetSubAccountListService struct {
// contains filtered or unexported fields
}
GetSubAccountListService -- GET /api/v5/users/subaccount/list (Read)
Returns the list of sub-accounts under the (master) account, with their enable/trade-out flags and creation time.
func (*GetSubAccountListService) Do ¶
func (s *GetSubAccountListService) Do(ctx context.Context) ([]SubAccount, error)
func (*GetSubAccountListService) SetAfter ¶
func (s *GetSubAccountListService) SetAfter(t time.Time) *GetSubAccountListService
SetAfter paginates to sub-accounts created earlier than the given time (older).
func (*GetSubAccountListService) SetBefore ¶
func (s *GetSubAccountListService) SetBefore(t time.Time) *GetSubAccountListService
SetBefore paginates to sub-accounts created later than the given time (newer).
func (*GetSubAccountListService) SetEnable ¶
func (s *GetSubAccountListService) SetEnable(enable bool) *GetSubAccountListService
SetEnable filters by sub-account enabled state.
func (*GetSubAccountListService) SetLimit ¶
func (s *GetSubAccountListService) SetLimit(limit int) *GetSubAccountListService
SetLimit caps the number of records returned (max 100).
func (*GetSubAccountListService) SetSubAcct ¶
func (s *GetSubAccountListService) SetSubAcct(subAcct string) *GetSubAccountListService
SetSubAcct filters by a single sub-account name.
type GetSubAccountMaxWithdrawalService ¶
type GetSubAccountMaxWithdrawalService struct {
// contains filtered or unexported fields
}
GetSubAccountMaxWithdrawalService -- GET /api/v5/account/subaccount/max-withdrawal (Read)
Returns a sub-account's maximum withdrawal amount per currency (master account).
func (*GetSubAccountMaxWithdrawalService) Do ¶
func (s *GetSubAccountMaxWithdrawalService) Do(ctx context.Context) ([]SubAccountMaxWithdrawal, error)
func (*GetSubAccountMaxWithdrawalService) SetCcy ¶
func (s *GetSubAccountMaxWithdrawalService) SetCcy(ccy string) *GetSubAccountMaxWithdrawalService
SetCcy filters by a single currency.
type GetSubAccountTradingBalancesService ¶
type GetSubAccountTradingBalancesService struct {
// contains filtered or unexported fields
}
GetSubAccountTradingBalancesService -- GET /api/v5/account/subaccount/balances (Read)
Returns a sub-account's trading-account balance details (master account).
func (*GetSubAccountTradingBalancesService) Do ¶
func (s *GetSubAccountTradingBalancesService) Do(ctx context.Context) ([]SubAccountTradingBalance, error)
type GetSupportCoinService ¶
type GetSupportCoinService struct {
// contains filtered or unexported fields
}
GetSupportCoinService -- GET /api/v5/rubik/stat/trading-data/support-coin (public)
Returns the currencies supported by the trading-statistics endpoints, grouped by product line.
func (*GetSupportCoinService) Do ¶
func (s *GetSupportCoinService) Do(ctx context.Context) (*RubikSupportCoin, error)
type GetSystemStatusService ¶
type GetSystemStatusService struct {
// contains filtered or unexported fields
}
GetSystemStatusService -- GET /api/v5/system/status (public)
Returns scheduled and ongoing system maintenance windows. The data array is empty when no maintenance is planned or in progress.
func (*GetSystemStatusService) Do ¶
func (s *GetSystemStatusService) Do(ctx context.Context) ([]SystemStatus, error)
func (*GetSystemStatusService) SetState ¶
func (s *GetSystemStatusService) SetState(state SystemStatusState) *GetSystemStatusService
SetState filters by maintenance state (scheduled / ongoing / pre_open / completed / canceled).
type GetSystemTimeService ¶
type GetSystemTimeService struct {
// contains filtered or unexported fields
}
GetSystemTimeService -- GET /api/v5/public/time
Returns the current OKX server time. Used by Client.SyncServerTime to align the request-signing clock.
func (*GetSystemTimeService) Do ¶
func (s *GetSystemTimeService) Do(ctx context.Context) (*SystemTime, error)
type GetTakerVolumeService ¶
type GetTakerVolumeService struct {
// contains filtered or unexported fields
}
GetTakerVolumeService -- GET /api/v5/rubik/stat/taker-volume (public)
Returns the taker buy/sell trading volume per time bar for a currency and product line.
func (*GetTakerVolumeService) Do ¶
func (s *GetTakerVolumeService) Do(ctx context.Context) ([]RubikTakerVolume, error)
func (*GetTakerVolumeService) SetBegin ¶
func (s *GetTakerVolumeService) SetBegin(t time.Time) *GetTakerVolumeService
func (*GetTakerVolumeService) SetEnd ¶
func (s *GetTakerVolumeService) SetEnd(t time.Time) *GetTakerVolumeService
func (*GetTakerVolumeService) SetPeriod ¶
func (s *GetTakerVolumeService) SetPeriod(p RubikStatPeriod) *GetTakerVolumeService
type GetTickerService ¶
type GetTickerService struct {
// contains filtered or unexported fields
}
GetTickerService -- GET /api/v5/market/ticker (public)
Returns the latest ticker for a single instrument.
type GetTickersService ¶
type GetTickersService struct {
// contains filtered or unexported fields
}
GetTickersService -- GET /api/v5/market/tickers (public)
Returns the latest tickers for every instrument of a product line.
func (*GetTickersService) Do ¶
func (s *GetTickersService) Do(ctx context.Context) ([]Ticker, error)
func (*GetTickersService) SetInstFamily ¶
func (s *GetTickersService) SetInstFamily(instFamily string) *GetTickersService
SetInstFamily filters tickers by instrument family (FUTURES/SWAP/OPTION).
func (*GetTickersService) SetUly ¶
func (s *GetTickersService) SetUly(uly string) *GetTickersService
SetUly filters tickers by underlying (FUTURES/SWAP/OPTION).
type GetTradeFeeService ¶
type GetTradeFeeService struct {
// contains filtered or unexported fields
}
GetTradeFeeService -- GET /api/v5/account/trade-fee (Read)
Returns the account's maker/taker trading fee rates for a product line.
func (*GetTradeFeeService) Do ¶
func (s *GetTradeFeeService) Do(ctx context.Context) (*TradeFee, error)
func (*GetTradeFeeService) SetInstFamily ¶
func (s *GetTradeFeeService) SetInstFamily(instFamily string) *GetTradeFeeService
SetInstFamily filters by instrument family (FUTURES/SWAP/OPTION).
func (*GetTradeFeeService) SetInstId ¶
func (s *GetTradeFeeService) SetInstId(instId string) *GetTradeFeeService
SetInstId filters by a single instrument id (SPOT/MARGIN).
func (*GetTradeFeeService) SetRuleType ¶
func (s *GetTradeFeeService) SetRuleType(ruleType string) *GetTradeFeeService
SetRuleType filters by rule type (normal/pre_market).
func (*GetTradeFeeService) SetUly ¶
func (s *GetTradeFeeService) SetUly(uly string) *GetTradeFeeService
SetUly filters by underlying (FUTURES/SWAP/OPTION).
type GetTradesService ¶
type GetTradesService struct {
// contains filtered or unexported fields
}
GetTradesService -- GET /api/v5/market/trades (public)
Returns the most recent public trades for an instrument.
func (*GetTradesService) SetLimit ¶
func (s *GetTradesService) SetLimit(limit int) *GetTradesService
SetLimit caps the number of returned trades (max 500, default 100).
type GetTransferStateService ¶
type GetTransferStateService struct {
// contains filtered or unexported fields
}
GetTransferStateService -- GET /api/v5/asset/transfer-state (private)
Returns the status of a funds transfer by transfer id or client id.
func (*GetTransferStateService) Do ¶
func (s *GetTransferStateService) Do(ctx context.Context) ([]TransferState, error)
func (*GetTransferStateService) SetClientId ¶
func (s *GetTransferStateService) SetClientId(clientId string) *GetTransferStateService
SetClientId filters by client-supplied transfer id.
func (*GetTransferStateService) SetTransId ¶
func (s *GetTransferStateService) SetTransId(transId string) *GetTransferStateService
SetTransId filters by transfer id (mutually exclusive with clientId).
func (*GetTransferStateService) SetType ¶
func (s *GetTransferStateService) SetType(typ AssetTransferType) *GetTransferStateService
SetType sets the transfer type (default "0").
type GetUnderlyingService ¶
type GetUnderlyingService struct {
// contains filtered or unexported fields
}
GetUnderlyingService -- GET /api/v5/public/underlying (public)
Returns the underlyings available for a derivatives product line. The data is an array containing a single array of underlying strings.
type GetVipInterestAccruedService ¶
type GetVipInterestAccruedService struct {
// contains filtered or unexported fields
}
GetVipInterestAccruedService -- GET /api/v5/account/vip-interest-accrued (Read)
Returns the interest accrued on the account's VIP loans.
func (*GetVipInterestAccruedService) Do ¶
func (s *GetVipInterestAccruedService) Do(ctx context.Context) ([]VipInterestAccrued, error)
func (*GetVipInterestAccruedService) SetAfter ¶
func (s *GetVipInterestAccruedService) SetAfter(t time.Time) *GetVipInterestAccruedService
SetAfter paginates to records earlier than the given time (older).
func (*GetVipInterestAccruedService) SetBefore ¶
func (s *GetVipInterestAccruedService) SetBefore(t time.Time) *GetVipInterestAccruedService
SetBefore paginates to records later than the given time (newer).
func (*GetVipInterestAccruedService) SetCcy ¶
func (s *GetVipInterestAccruedService) SetCcy(ccy string) *GetVipInterestAccruedService
SetCcy filters by currency.
func (*GetVipInterestAccruedService) SetLimit ¶
func (s *GetVipInterestAccruedService) SetLimit(limit int) *GetVipInterestAccruedService
SetLimit caps the number of records returned (max 100).
func (*GetVipInterestAccruedService) SetOrdId ¶
func (s *GetVipInterestAccruedService) SetOrdId(ordId string) *GetVipInterestAccruedService
SetOrdId filters by VIP loan order id.
type GetVipInterestDeductedService ¶
type GetVipInterestDeductedService struct {
// contains filtered or unexported fields
}
GetVipInterestDeductedService -- GET /api/v5/account/vip-interest-deducted (Read)
Returns the interest deducted from the account's VIP loans.
func (*GetVipInterestDeductedService) Do ¶
func (s *GetVipInterestDeductedService) Do(ctx context.Context) ([]VipInterestDeducted, error)
func (*GetVipInterestDeductedService) SetAfter ¶
func (s *GetVipInterestDeductedService) SetAfter(t time.Time) *GetVipInterestDeductedService
SetAfter paginates to records earlier than the given time (older).
func (*GetVipInterestDeductedService) SetBefore ¶
func (s *GetVipInterestDeductedService) SetBefore(t time.Time) *GetVipInterestDeductedService
SetBefore paginates to records later than the given time (newer).
func (*GetVipInterestDeductedService) SetCcy ¶
func (s *GetVipInterestDeductedService) SetCcy(ccy string) *GetVipInterestDeductedService
SetCcy filters by currency.
func (*GetVipInterestDeductedService) SetLimit ¶
func (s *GetVipInterestDeductedService) SetLimit(limit int) *GetVipInterestDeductedService
SetLimit caps the number of records returned (max 100).
func (*GetVipInterestDeductedService) SetOrdId ¶
func (s *GetVipInterestDeductedService) SetOrdId(ordId string) *GetVipInterestDeductedService
SetOrdId filters by VIP loan order id.
type GetVipLoanOrderDetailService ¶
type GetVipLoanOrderDetailService struct {
// contains filtered or unexported fields
}
GetVipLoanOrderDetailService -- GET /api/v5/account/vip-loan-order-detail (Read)
Returns the detail (per-event borrow/repay records) of a single VIP loan order.
func (*GetVipLoanOrderDetailService) Do ¶
func (s *GetVipLoanOrderDetailService) Do(ctx context.Context) ([]VipLoanOrderDetail, error)
func (*GetVipLoanOrderDetailService) SetAfter ¶
func (s *GetVipLoanOrderDetailService) SetAfter(t time.Time) *GetVipLoanOrderDetailService
SetAfter paginates to records earlier than the given time (older).
func (*GetVipLoanOrderDetailService) SetBefore ¶
func (s *GetVipLoanOrderDetailService) SetBefore(t time.Time) *GetVipLoanOrderDetailService
SetBefore paginates to records later than the given time (newer).
func (*GetVipLoanOrderDetailService) SetCcy ¶
func (s *GetVipLoanOrderDetailService) SetCcy(ccy string) *GetVipLoanOrderDetailService
SetCcy filters by currency.
func (*GetVipLoanOrderDetailService) SetLimit ¶
func (s *GetVipLoanOrderDetailService) SetLimit(limit int) *GetVipLoanOrderDetailService
SetLimit caps the number of records returned (max 100).
type GetVipLoanOrderListService ¶
type GetVipLoanOrderListService struct {
// contains filtered or unexported fields
}
GetVipLoanOrderListService -- GET /api/v5/account/vip-loan-order-list (Read)
Returns the account's VIP loan orders.
func (*GetVipLoanOrderListService) Do ¶
func (s *GetVipLoanOrderListService) Do(ctx context.Context) ([]VipLoanOrder, error)
func (*GetVipLoanOrderListService) SetAfter ¶
func (s *GetVipLoanOrderListService) SetAfter(t time.Time) *GetVipLoanOrderListService
SetAfter paginates to orders earlier than the given time (older).
func (*GetVipLoanOrderListService) SetBefore ¶
func (s *GetVipLoanOrderListService) SetBefore(t time.Time) *GetVipLoanOrderListService
SetBefore paginates to orders later than the given time (newer).
func (*GetVipLoanOrderListService) SetCcy ¶
func (s *GetVipLoanOrderListService) SetCcy(ccy string) *GetVipLoanOrderListService
SetCcy filters by currency.
func (*GetVipLoanOrderListService) SetLimit ¶
func (s *GetVipLoanOrderListService) SetLimit(limit int) *GetVipLoanOrderListService
SetLimit caps the number of orders returned (max 100).
func (*GetVipLoanOrderListService) SetOrdId ¶
func (s *GetVipLoanOrderListService) SetOrdId(ordId string) *GetVipLoanOrderListService
SetOrdId filters by VIP loan order id.
func (*GetVipLoanOrderListService) SetState ¶
func (s *GetVipLoanOrderListService) SetState(state VipLoanState) *GetVipLoanOrderListService
SetState filters by loan order state (1 borrowing / 2 borrowed / 3 partially repaid / 4 repaid / 5 repaying).
type GetWithdrawalHistoryService ¶
type GetWithdrawalHistoryService struct {
// contains filtered or unexported fields
}
GetWithdrawalHistoryService -- GET /api/v5/asset/withdrawal-history (private)
Returns the withdrawal records of the account.
func (*GetWithdrawalHistoryService) Do ¶
func (s *GetWithdrawalHistoryService) Do(ctx context.Context) ([]WithdrawalHistory, error)
func (*GetWithdrawalHistoryService) SetAfter ¶
func (s *GetWithdrawalHistoryService) SetAfter(t time.Time) *GetWithdrawalHistoryService
SetAfter paginates to records earlier than the given time (older).
func (*GetWithdrawalHistoryService) SetBefore ¶
func (s *GetWithdrawalHistoryService) SetBefore(t time.Time) *GetWithdrawalHistoryService
SetBefore paginates to records later than the given time (newer).
func (*GetWithdrawalHistoryService) SetCcy ¶
func (s *GetWithdrawalHistoryService) SetCcy(ccy string) *GetWithdrawalHistoryService
SetCcy filters by currency.
func (*GetWithdrawalHistoryService) SetClientId ¶
func (s *GetWithdrawalHistoryService) SetClientId(clientId string) *GetWithdrawalHistoryService
SetClientId filters by client-supplied id.
func (*GetWithdrawalHistoryService) SetLimit ¶
func (s *GetWithdrawalHistoryService) SetLimit(limit int) *GetWithdrawalHistoryService
SetLimit caps the number of records returned (max 100).
func (*GetWithdrawalHistoryService) SetState ¶
func (s *GetWithdrawalHistoryService) SetState(state string) *GetWithdrawalHistoryService
SetState filters by withdrawal state code.
func (*GetWithdrawalHistoryService) SetTxId ¶
func (s *GetWithdrawalHistoryService) SetTxId(txId string) *GetWithdrawalHistoryService
SetTxId filters by the on-chain transaction hash.
func (*GetWithdrawalHistoryService) SetType ¶
func (s *GetWithdrawalHistoryService) SetType(typ string) *GetWithdrawalHistoryService
SetType filters by withdrawal type code.
func (*GetWithdrawalHistoryService) SetWdId ¶
func (s *GetWithdrawalHistoryService) SetWdId(wdId string) *GetWithdrawalHistoryService
SetWdId filters by withdrawal id.
type Greeks ¶
type Greeks struct {
Currency string `json:"ccy"`
DeltaBS decimal.Decimal `json:"deltaBS"`
DeltaPA decimal.Decimal `json:"deltaPA"`
GammaBS decimal.Decimal `json:"gammaBS"`
GammaPA decimal.Decimal `json:"gammaPA"`
ThetaBS decimal.Decimal `json:"thetaBS"`
ThetaPA decimal.Decimal `json:"thetaPA"`
VegaBS decimal.Decimal `json:"vegaBS"`
VegaPA decimal.Decimal `json:"vegaPA"`
Timestamp time.Time `json:"ts"`
}
Greeks is a currency's aggregated option greeks. The account used to validate this SDK had no option positions, so the field set is modeled from the OKX doc field table.
type GreeksSetting ¶
type GreeksSetting struct {
GreeksType GreeksType `json:"greeksType"`
}
GreeksSetting is the set-greeks acknowledgement.
type GreeksType ¶
type GreeksType string
GreeksType is the display type of option greeks: "PA" (in coins) or "BS" (Black-Scholes, in dollars).
const ( GreeksTypePA GreeksType = "PA" GreeksTypeBS GreeksType = "BS" )
type GridAIParam ¶
type GridAIParam struct {
AlgoOrderType GridAlgoOrdType `json:"algoOrdType"`
AnnualizedRate decimal.Decimal `json:"annualizedRate"`
Currency string `json:"ccy"`
Direction GridDirection `json:"direction"`
Duration string `json:"duration"`
GridNumber decimal.Decimal `json:"gridNum"`
InstrumentID string `json:"instId"`
Leverage decimal.Decimal `json:"lever"`
MaxPrice decimal.Decimal `json:"maxPx"`
MinPrice decimal.Decimal `json:"minPx"`
MinInvestment decimal.Decimal `json:"minInvestment"`
PerMaxProfitRate decimal.Decimal `json:"perMaxProfitRate"`
PerMinProfitRate decimal.Decimal `json:"perMinProfitRate"`
PerGridProfitRatio decimal.Decimal `json:"perGridProfitRatio"`
RunType GridRunType `json:"runType"`
SourceCurrency string `json:"sourceCcy"`
}
GridAIParam is OKX's AI-recommended grid parameters for an instrument.
type GridAdjustInvestmentResult ¶
type GridAdjustInvestmentResult struct {
AlgoID string `json:"algoId"`
Investment decimal.Decimal `json:"investment"`
}
GridAdjustInvestmentResult is the ack of a grid investment top-up.
type GridAlgoOrdType ¶
type GridAlgoOrdType string
GridAlgoOrdType is the kind of grid bot: spot/margin grid ("grid") or contract (perpetual/futures) grid ("contract_grid").
const ( GridAlgoOrdTypeGrid GridAlgoOrdType = "grid" GridAlgoOrdTypeContractGrid GridAlgoOrdType = "contract_grid" )
type GridAlgoOrder ¶
type GridAlgoOrder struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
AlgoOrderType GridAlgoOrdType `json:"algoOrdType"`
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
State string `json:"state"`
RunType GridRunType `json:"runType"`
GridNumber decimal.Decimal `json:"gridNum"`
MaxPrice decimal.Decimal `json:"maxPx"`
MinPrice decimal.Decimal `json:"minPx"`
GridProfit decimal.Decimal `json:"gridProfit"`
TotalPnl decimal.Decimal `json:"totalPnl"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
FloatProfit decimal.Decimal `json:"floatProfit"`
TotalAnnualizedRate decimal.Decimal `json:"totalAnnualizedRate"`
AnnualizedRate decimal.Decimal `json:"annualizedRate"`
Investment decimal.Decimal `json:"investment"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
CancelType string `json:"cancelType"`
StopType string `json:"stopType"`
StopResult string `json:"stopResult"`
ActiveOrderNumber decimal.Decimal `json:"activeOrdNum"`
Tag string `json:"tag"`
ProfitSharingRatio decimal.Decimal `json:"profitSharingRatio"`
CopyType string `json:"copyType"`
Fee decimal.Decimal `json:"fee"`
FundingFee decimal.Decimal `json:"fundingFee"`
RebateTransfer []GridRebateTrans `json:"rebateTrans"`
TriggerParams []GridTriggerParam `json:"triggerParams"`
TriggerTime time.Time `json:"triggerTime"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
// --- spot/margin grid ("grid") ---
BaseSize decimal.Decimal `json:"baseSz"`
QuoteSize decimal.Decimal `json:"quoteSz"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
TradeMode TdMode `json:"tdMode"`
Leverage decimal.Decimal `json:"lever"`
ProfitAndLoss decimal.Decimal `json:"profitAndLoss"`
GridArithmeticGeometric string `json:"gridArithGeo"`
MinTradeFeeRate decimal.Decimal `json:"minTradeFeeRate"`
// --- contract grid ("contract_grid") ---
Direction GridDirection `json:"direction"`
BasePosition bool `json:"basePos"`
Size decimal.Decimal `json:"sz"`
Currency string `json:"ccy"`
Equity decimal.Decimal `json:"eq"`
Underlying string `json:"uly"`
InstrumentFamily string `json:"instFamily"`
TakeProfitRatio decimal.Decimal `json:"tpRatio"`
StopLossRatio decimal.Decimal `json:"slRatio"`
AvailableEquity decimal.Decimal `json:"availEq"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
UPLRatio decimal.Decimal `json:"uplRatio"`
UPL decimal.Decimal `json:"upl"`
TotalInvestment decimal.Decimal `json:"totalInvestment"`
GridInvestment decimal.Decimal `json:"gridInvestment"`
MarginRatio decimal.Decimal `json:"marginRatio"`
Arbitrage decimal.Decimal `json:"arbitrage"`
SingleAmount decimal.Decimal `json:"singleAmt"`
PerMaxProfitRate decimal.Decimal `json:"perMaxProfitRate"`
PerMinProfitRate decimal.Decimal `json:"perMinProfitRate"`
OrderFrozen decimal.Decimal `json:"ordFrozen"`
ActualLeverage decimal.Decimal `json:"actualLever"`
InvestmentCurrency string `json:"investmentCcy"`
}
GridAlgoOrder is a single grid algo order (spot/margin or contract grid). The validating account had no grid orders, so the field set is modeled from the OKX doc field table (union of spot-grid and contract-grid fields). Fields that apply to only one grid kind are simply empty for the other.
type GridCancelCloseOrderResult ¶
type GridCancelCloseOrderResult struct {
AlgoID string `json:"algoId"`
OrderID string `json:"ordId"`
}
GridCancelCloseOrderResult is the ack of a cancel-close-order request.
type GridClosePositionResult ¶
type GridClosePositionResult struct {
AlgoID string `json:"algoId"`
OrderID string `json:"ordId"`
AlgoClientOrderID string `json:"algoClOrdId"`
Tag string `json:"tag"`
}
GridClosePositionResult is the ack of a contract-grid close-position request.
type GridComputeMarginBalance ¶
type GridComputeMarginBalance struct {
Leverage decimal.Decimal `json:"lever"`
MaxAmount decimal.Decimal `json:"maxAmt"`
}
GridComputeMarginBalance is the estimated result of a margin-balance change.
type GridDirection ¶
type GridDirection string
GridDirection is the direction of a contract grid (long/short/neutral).
const ( GridDirectionLong GridDirection = "long" GridDirectionShort GridDirection = "short" GridDirectionNeutral GridDirection = "neutral" )
type GridInstantTriggerResult ¶
type GridInstantTriggerResult struct {
AlgoID string `json:"algoId"`
}
GridInstantTriggerResult is the ack of an order-instant-trigger request.
type GridInvestmentDataInput ¶
type GridInvestmentDataInput struct {
Amount decimal.Decimal `json:"amt"`
Currency string `json:"ccy"`
}
GridInvestmentDataInput is one per-currency planned investment entry of a min-investment request.
type GridMarginBalanceResult ¶
type GridMarginBalanceResult struct {
AlgoID string `json:"algoId"`
}
GridMarginBalanceResult is the ack of a margin-balance adjustment.
type GridMinInvestment ¶
type GridMinInvestment struct {
MinInvestmentData []GridMinInvestmentData `json:"minInvestmentData"`
SingleAmount decimal.Decimal `json:"singleAmt"`
}
GridMinInvestment is the minimum-investment computation result.
type GridMinInvestmentData ¶
type GridMinInvestmentData struct {
Amount decimal.Decimal `json:"amt"`
Currency string `json:"ccy"`
}
GridMinInvestmentData is one currency's minimum investable amount.
type GridPosition ¶
type GridPosition struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
PositionSide PosSide `json:"posSide"`
MarginMode MgnMode `json:"mgnMode"`
Position decimal.Decimal `json:"pos"`
AveragePrice decimal.Decimal `json:"avgPx"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
MarkPrice decimal.Decimal `json:"markPx"`
Leverage decimal.Decimal `json:"lever"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
Margin decimal.Decimal `json:"margin"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
Last decimal.Decimal `json:"last"`
UPL decimal.Decimal `json:"upl"`
UPLRatio decimal.Decimal `json:"uplRatio"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
GridPosition is the position held by a contract grid algo order. The validating account had no grid orders, so the field set is modeled from the OKX doc field table.
type GridRSIBackTesting ¶
type GridRSIBackTesting struct {
TriggerNumber string `json:"triggerNum"`
}
GridRSIBackTesting is the RSI back-test result (how many times the condition fired over the duration).
type GridRebateTrans ¶
type GridRebateTrans struct {
Rebate decimal.Decimal `json:"rebate"`
RebateCurrency string `json:"rebateCcy"`
}
GridRebateTrans is one rebate-transfer record attached to a grid algo order.
type GridResult ¶
type GridResult struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
Tag string `json:"tag"`
}
GridResult is the per-item ack of a grid algo place/amend/stop operation. The real reason for a failure is carried in sCode/sMsg even when the top-level envelope code is "1".
func (GridResult) Err ¶ added in v0.20260623.1
func (r GridResult) Err() error
type GridRunType ¶
type GridRunType string
GridRunType is the grid spacing mode: "1" arithmetic, "2" geometric.
const ( GridRunTypeArithmetic GridRunType = "1" GridRunTypeGeometric GridRunType = "2" )
type GridStopArg ¶
type GridStopArg struct {
AlgoID string `json:"algoId"`
InstrumentID string `json:"instId"`
AlgoOrderType GridAlgoOrdType `json:"algoOrdType"`
StopType string `json:"stopType"`
}
GridStopArg is one entry of a batch grid-stop request.
type GridSubOrder ¶
type GridSubOrder struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
AlgoOrderType GridAlgoOrdType `json:"algoOrdType"`
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
GroupID string `json:"groupId"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
OrderType OrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
Currency string `json:"ccy"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
State OrdState `json:"state"`
AccumulatedFillSize decimal.Decimal `json:"accFillSz"`
AveragePrice decimal.Decimal `json:"avgPx"`
Leverage decimal.Decimal `json:"lever"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
Rebate decimal.Decimal `json:"rebate"`
RebateCurrency string `json:"rebateCcy"`
Pnl decimal.Decimal `json:"pnl"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
GridSubOrder is one sub-order (working leg) of a grid algo order. The validating account had no grid orders, so the field set is modeled from the OKX doc field table.
type GridSubOrderType ¶
type GridSubOrderType string
GridSubOrderType selects which sub-orders to return: "live" (open) or "filled".
const ( GridSubOrderTypeLive GridSubOrderType = "live" GridSubOrderTypeFilled GridSubOrderType = "filled" )
type GridTriggerParam ¶
type GridTriggerParam struct {
TriggerAction string `json:"triggerAction"`
TriggerStrategy string `json:"triggerStrategy"`
DelaySeconds string `json:"delaySeconds"`
TriggerType string `json:"triggerType"`
Timeframe string `json:"timeframe"`
Thold string `json:"thold"`
TriggerCond string `json:"triggerCond"`
TimePeriod string `json:"timePeriod"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
StopType string `json:"stopType"`
TriggerTime time.Time `json:"triggerTime"`
}
GridTriggerParam is one advanced trigger configuration of a grid algo order (used both in the order detail and in the amend request body).
type GridWithdrawIncomeResult ¶
type GridWithdrawIncomeResult struct {
AlgoID string `json:"algoId"`
Profit decimal.Decimal `json:"profit"`
}
GridWithdrawIncomeResult is the ack of a grid income withdrawal.
type IndexCandle ¶
type IndexCandle struct {
Timestamp time.Time `json:"ts"`
Open decimal.Decimal `json:"o"`
High decimal.Decimal `json:"h"`
Low decimal.Decimal `json:"l"`
Close decimal.Decimal `json:"c"`
Confirm string `json:"confirm"`
}
IndexCandle is one row of an index or mark-price candlestick. OKX returns these endpoints as arrays-of-arrays with 6 columns: [ts, o, h, l, c, confirm]. Confirm is "0" for an in-progress bar and "1" once the bar is closed.
type IndexComponent ¶
type IndexComponent struct {
Symbol string `json:"symbol"`
SymbolPrice decimal.Decimal `json:"symPx"`
Weight decimal.Decimal `json:"wgt"`
ConvertPrice decimal.Decimal `json:"cnvPx"`
Exch string `json:"exch"`
}
IndexComponent is one venue's contribution to an index.
type IndexComponents ¶
type IndexComponents struct {
Index string `json:"index"`
Last decimal.Decimal `json:"last"`
Timestamp time.Time `json:"ts"`
Components []IndexComponent `json:"components"`
}
IndexComponents describes an index, its latest value and the venues that make it up.
type IndexTicker ¶
type IndexTicker struct {
InstrumentID string `json:"instId"`
IndexPrice decimal.Decimal `json:"idxPx"`
High24h decimal.Decimal `json:"high24h"`
StartOfDayUTC0 decimal.Decimal `json:"sodUtc0"`
Open24h decimal.Decimal `json:"open24h"`
Low24h decimal.Decimal `json:"low24h"`
StartOfDayUTC8 decimal.Decimal `json:"sodUtc8"`
Timestamp time.Time `json:"ts"`
}
IndexTicker is the latest index price snapshot for an index instrument.
type InstType ¶
type InstType string
InstType is an OKX instrument type. It selects the product line for market and account queries.
type InstantTriggerGridService ¶
type InstantTriggerGridService struct {
// contains filtered or unexported fields
}
InstantTriggerGridService -- POST /api/v5/tradingBot/grid/order-instant-trigger (Trade)
Manually triggers a pending grid algo order immediately. IMPLEMENT-ONLY.
func (*InstantTriggerGridService) Do ¶
func (s *InstantTriggerGridService) Do(ctx context.Context) (*GridInstantTriggerResult, error)
type Instrument ¶
type Instrument struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
InstrumentIDCode int64 `json:"instIdCode"`
Underlying string `json:"uly"`
InstrumentFamily string `json:"instFamily"`
Category string `json:"category"`
InstrumentCategory string `json:"instCategory"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
SettleCurrency string `json:"settleCcy"`
ContractValue decimal.Decimal `json:"ctVal"`
ContractMultiplier decimal.Decimal `json:"ctMult"`
ContractValueCurrency string `json:"ctValCcy"`
OptionType OptType `json:"optType"`
Strike decimal.Decimal `json:"stk"`
ListTime time.Time `json:"listTime"`
AuctionEndTime time.Time `json:"auctionEndTime"`
ContinuousTradeSwitchTime time.Time `json:"contTdSwTime"`
OpenType publicOpenType `json:"openType"`
ExpiryTime time.Time `json:"expTime"`
Leverage decimal.Decimal `json:"lever"`
TickSize decimal.Decimal `json:"tickSz"`
LotSize decimal.Decimal `json:"lotSz"`
MinSize decimal.Decimal `json:"minSz"`
ContractType CtType `json:"ctType"`
Alias string `json:"alias"`
State InstState `json:"state"`
// RuleType is the trading rule type: "normal" (normal trading),
// "pre_market" (pre-market trading, including pre-market X-Perp FUTURES),
// "rebase_contract" (pre-market rebase contract) and "xperp"
// (perpetual-style FUTURES; a pre-market X-Perp changes from "pre_market"
// to "xperp" once it converts to a normal X-Perp).
RuleType string `json:"ruleType"`
MaxLimitSize decimal.Decimal `json:"maxLmtSz"`
MaxMarketSize decimal.Decimal `json:"maxMktSz"`
MaxLimitAmount decimal.Decimal `json:"maxLmtAmt"`
MaxMarketAmount decimal.Decimal `json:"maxMktAmt"`
MaxTWAPSize decimal.Decimal `json:"maxTwapSz"`
MaxIcebergSize decimal.Decimal `json:"maxIcebergSz"`
MaxTriggerSize decimal.Decimal `json:"maxTriggerSz"`
MaxStopSize decimal.Decimal `json:"maxStopSz"`
MaxPlatformOpenInterestLimit decimal.Decimal `json:"maxPlatOILmt"`
MaxPlatformOpenInterestCoinLimit decimal.Decimal `json:"maxPlatOICoinLmt"`
FutureSettlement bool `json:"futureSettlement"`
TradeQuoteCurrencyList []string `json:"tradeQuoteCcyList"`
UpcomingChange []InstrumentUpcChg `json:"upcChg"`
Freq string `json:"freq"`
GroupID string `json:"groupId"`
SeriesID string `json:"seriesId"`
// Method is the settlement method for EVENTS. Values include "hit" (price
// touches the strike, settles immediately) and "between" (settle price
// within a range).
Method string `json:"method"`
LongPositionRemainingQuota decimal.Decimal `json:"longPosRemainingQuota"`
ShortPositionRemainingQuota decimal.Decimal `json:"shortPosRemainingQuota"`
PositionLimitAmount decimal.Decimal `json:"posLmtAmt"`
PositionLimitPercent decimal.Decimal `json:"posLmtPct"`
// PreMarketSwitchTime is the time a pre-market instrument switched to normal
// trading. Only applicable to pre-market SWAP and pre-market X-Perp FUTURES;
// populated when a pre-market X-Perp converts to a normal X-Perp.
PreMarketSwitchTime time.Time `json:"preMktSwTime"`
// InitialPriceLimitPercent is the initial price-limit band applied during the
// first 10 minutes after contract listing. Empty for OPTION and EVENTS.
InitialPriceLimitPercent decimal.Decimal `json:"initPxLmtPct"`
// FloatingPriceLimitPercent is the floating price-limit band during normal
// trading. Empty for OPTION and EVENTS.
FloatingPriceLimitPercent decimal.Decimal `json:"floatPxLmtPct"`
// MaxPriceLimitPercent is the maximum price-limit cap (hard ceiling). Empty
// for OPTION and EVENTS.
MaxPriceLimitPercent decimal.Decimal `json:"maxPxLmtPct"`
// CapStrike is the maximum expiration value that leads to a YES outcome for
// the "between" settlement method (EVENTS only). "INF" means no upper bound
// (the topmost bracket); empty for non-"between" methods.
CapStrike string `json:"capStrike"`
// HitDirection is the hit direction, applicable only when the settlement
// method is "hit" (EVENTS only). "up": price hit from below; "dn": price hit
// from above; empty for non-"hit" methods.
HitDirection string `json:"hitDir"`
// Elp is the ELP (Enhanced Liquidity Program) maker permission, returned only
// by the private GET /api/v5/account/instruments variant (empty on the public
// endpoint): "0" ELP not enabled for this symbol; "1" enabled but the current
// user lacks permission to place ELP orders; "2" enabled and permitted. OKX is
// rebranding ELP to RPI (Retail Price Improvement); the json key stays "elp"
// until the old names retire on 2026-10-31, after which it becomes "rpi".
Elp string `json:"elp"`
}
Instrument is a single tradable instrument.
type InstrumentTickBands ¶
type InstrumentTickBands struct {
InstrumentType InstType `json:"instType"`
InstrumentFamily string `json:"instFamily"`
SeriesID string `json:"seriesId"`
TickBand []TickBand `json:"tickBand"`
}
InstrumentTickBands is the tick-size band schedule of an instrument family.
type InstrumentUpcChg ¶
type InstrumentUpcChg struct {
EffectiveTime time.Time `json:"effTime"`
NewValue string `json:"newValue"`
Param string `json:"param"`
}
InstrumentUpcChg is a scheduled upcoming change to one of an instrument's trading rules (e.g. a tickSz adjustment).
type InsuranceFund ¶
type InsuranceFund struct {
InstrumentType InstType `json:"instType"`
InstrumentFamily string `json:"instFamily"`
Total decimal.Decimal `json:"total"`
Details []InsuranceFundDetail `json:"details"`
}
InsuranceFund is the insurance-fund summary and its change records.
type InsuranceFundDetail ¶
type InsuranceFundDetail struct {
Type string `json:"type"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Balance decimal.Decimal `json:"balance"`
MaxBalance decimal.Decimal `json:"maxBal"`
MaxBalanceTimestamp time.Time `json:"maxBalTs"`
DecRate decimal.Decimal `json:"decRate"`
ADLType string `json:"adlType"`
Timestamp time.Time `json:"ts"`
}
InsuranceFundDetail is one insurance-fund change record.
type InterestAccrued ¶
type InterestAccrued struct {
Type string `json:"type"`
Currency string `json:"ccy"`
InstrumentID string `json:"instId"`
MarginMode MgnMode `json:"mgnMode"`
Interest decimal.Decimal `json:"interest"`
InterestRate decimal.Decimal `json:"interestRate"`
Liability decimal.Decimal `json:"liab"`
Timestamp time.Time `json:"ts"`
}
InterestAccrued is one accrued-interest record.
type InterestLimits ¶
type InterestLimits struct {
Debt decimal.Decimal `json:"debt"`
Interest decimal.Decimal `json:"interest"`
NextDiscountTime time.Time `json:"nextDiscountTime"`
NextInterestTime time.Time `json:"nextInterestTime"`
LoanAlloc decimal.Decimal `json:"loanAlloc"`
Records []InterestLimitsRecord `json:"records"`
}
InterestLimits is the account's interest summary and per-currency loan-quota schedule.
type InterestLimitsRecord ¶
type InterestLimitsRecord struct {
Currency string `json:"ccy"`
Rate decimal.Decimal `json:"rate"`
LoanQuota decimal.Decimal `json:"loanQuota"`
SurplusLimit decimal.Decimal `json:"surplusLmt"`
SurplusLimitDetails SurplusLmtDetails `json:"surplusLmtDetails"`
UsedLimit decimal.Decimal `json:"usedLmt"`
Interest decimal.Decimal `json:"interest"`
InterestFreeLiability decimal.Decimal `json:"interestFreeLiab"`
PositionLoan decimal.Decimal `json:"posLoan"`
AvailableLoan decimal.Decimal `json:"availLoan"`
UsedLoan decimal.Decimal `json:"usedLoan"`
AverageRate decimal.Decimal `json:"avgRate"`
PotentialBorrowingAmount decimal.Decimal `json:"potentialBorrowingAmt"`
}
InterestLimitsRecord is one currency's loan-quota and interest detail within the account interest-limits schedule.
type InterestRate ¶
type InterestRate struct {
Currency string `json:"ccy"`
InterestRate decimal.Decimal `json:"interestRate"`
NextEstimatedRate decimal.Decimal `json:"nextEstRate"`
Timestamp time.Time `json:"ts"`
}
InterestRate is a currency's current account borrowing interest rate.
type InterestRateBasic ¶
type InterestRateBasic struct {
Currency string `json:"ccy"`
Rate decimal.Decimal `json:"rate"`
Quota decimal.Decimal `json:"quota"`
}
InterestRateBasic is the basic per-currency interest rate and borrow quota.
type InterestRateCcy ¶
InterestRateCcy is a currency's configured base interest rate.
type InterestRateConfig ¶
type InterestRateConfig struct {
Currency string `json:"ccy"`
Level string `json:"level"`
Quota decimal.Decimal `json:"quota"`
StrategyType string `json:"stgyType"`
}
InterestRateConfig is one currency's per-level loan-quota config entry.
type InterestRateLevel ¶
type InterestRateLevel struct {
Level string `json:"level"`
LoanQuotaCoefficient decimal.Decimal `json:"loanQuotaCoef"`
InterestRateDiscount decimal.Decimal `json:"irDiscount"`
}
InterestRateLevel is a VIP/regular tier's interest discount and quota coefficient.
type InterestRateLoanQuota ¶
type InterestRateLoanQuota struct {
Basic []InterestRateBasic `json:"basic"`
VIP []InterestRateLevel `json:"vip"`
Regular []InterestRateLevel `json:"regular"`
Config []InterestRateConfig `json:"config"`
ConfigCurrencyList []InterestRateCcy `json:"configCcyList"`
}
InterestRateLoanQuota is the platform's interest-rate and loan-quota schedule.
type IsoModeType ¶
type IsoModeType string
IsoModeType is the instrument scope of an isolated-margin setting.
const ( IsoModeTypeMargin IsoModeType = "MARGIN" IsoModeTypeContracts IsoModeType = "CONTRACTS" )
type IsolatedModeSetting ¶
type IsolatedModeSetting struct {
IsolatedMode IsoMode `json:"isoMode"`
}
IsolatedModeSetting is the set-isolated-mode acknowledgement.
type LeverageInfo ¶
type LeverageInfo struct {
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
MarginMode MgnMode `json:"mgnMode"`
PositionSide PosSide `json:"posSide"`
Leverage decimal.Decimal `json:"lever"`
}
LeverageInfo is the account's leverage setting for an instrument/side.
type LeverageSetting ¶
type LeverageSetting struct {
Leverage decimal.Decimal `json:"lever"`
MarginMode MgnMode `json:"mgnMode"`
InstrumentID string `json:"instId"`
PositionSide PosSide `json:"posSide"`
}
LeverageSetting is the set-leverage acknowledgement.
type MMInstrumentType ¶ added in v0.20260703.0
type MMInstrumentType struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
PairType string `json:"pairType"`
}
MMInstrumentType is one instrument's MM-program classification. PairType is a free-form tier label (e.g. "Type A", "Type B-Crypto", "Type B-TradFi", "FULL").
type MMPConfig ¶
type MMPConfig struct {
InstrumentFamily string `json:"instFamily"`
MMPFrozen bool `json:"mmpFrozen"`
MMPFrozenUntil time.Time `json:"mmpFrozenUntil"`
TimeInterval decimal.Decimal `json:"timeInterval"`
FrozenInterval decimal.Decimal `json:"frozenInterval"`
QtyLimit decimal.Decimal `json:"qtyLimit"`
}
MMPConfig is a Market Maker Protection configuration and current state.
type MMPConfigSetting ¶
type MMPConfigSetting struct {
InstrumentFamily string `json:"instFamily"`
TimeInterval decimal.Decimal `json:"timeInterval"`
FrozenInterval decimal.Decimal `json:"frozenInterval"`
QtyLimit decimal.Decimal `json:"qtyLimit"`
}
MMPConfigSetting is the set-MMP acknowledgement.
type MMPReset ¶
type MMPReset struct {
Result bool `json:"result"`
}
MMPReset is the mmp-reset acknowledgement.
type ManagedSubAccountBill ¶
type ManagedSubAccountBill struct {
BillID string `json:"billId"`
Type string `json:"type"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
SubAccount string `json:"subAcct"`
SubUID string `json:"subUid"`
Timestamp time.Time `json:"ts"`
}
ManagedSubAccountBill is one managed-sub-account asset-transfer record.
type MarginBalance ¶
type MarginBalance struct {
InstrumentID string `json:"instId"`
PositionSide PosSide `json:"posSide"`
Amount decimal.Decimal `json:"amt"`
Type MarginBalanceType `json:"type"`
Leverage decimal.Decimal `json:"leverage"`
Currency string `json:"ccy"`
}
MarginBalance is the position-margin adjustment acknowledgement.
type MarginBalanceType ¶
type MarginBalanceType string
MarginBalanceType selects whether a position-margin adjustment adds or reduces margin.
const ( MarginBalanceTypeAdd MarginBalanceType = "add" MarginBalanceTypeReduce MarginBalanceType = "reduce" )
type MarkPrice ¶
type MarkPrice struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
MarkPrice decimal.Decimal `json:"markPx"`
Timestamp time.Time `json:"ts"`
}
MarkPrice is an instrument's mark price.
type MarketBar ¶
type MarketBar string
MarketBar is a candlestick time granularity (e.g. "1m", "1H", "1D").
const ( MarketBar1m MarketBar = "1m" MarketBar3m MarketBar = "3m" MarketBar5m MarketBar = "5m" MarketBar15m MarketBar = "15m" MarketBar30m MarketBar = "30m" MarketBar1H MarketBar = "1H" MarketBar2H MarketBar = "2H" MarketBar4H MarketBar = "4H" MarketBar6H MarketBar = "6H" MarketBar12H MarketBar = "12H" MarketBar1D MarketBar = "1D" MarketBar2D MarketBar = "2D" MarketBar3D MarketBar = "3D" MarketBar1W MarketBar = "1W" MarketBar1M MarketBar = "1M" MarketBar3M MarketBar = "3M" MarketBar6Hutc MarketBar = "6Hutc" MarketBar12Hutc MarketBar = "12Hutc" MarketBar1Dutc MarketBar = "1Dutc" MarketBar2Dutc MarketBar = "2Dutc" MarketBar3Dutc MarketBar = "3Dutc" MarketBar1Wutc MarketBar = "1Wutc" MarketBar1Mutc MarketBar = "1Mutc" MarketBar3Mutc MarketBar = "3Mutc" )
OKX candle bar granularities. Note the case convention OKX requires: minute bars are lower-case "m" while hour/day/week/month bars are upper-case (H/D/W/M). The ...UTC variants align the bar boundary to 00:00 UTC instead of the default Hong Kong time (UTC+8).
type MarketHistoryTradeType ¶
type MarketHistoryTradeType string
MarketHistoryTradeType selects the paging field for history-trades: "1" by tradeId (default), "2" by ts.
const ( MarketHistoryTradeTypeTradeId MarketHistoryTradeType = "1" MarketHistoryTradeTypeTs MarketHistoryTradeType = "2" )
type MassCancelResult ¶
type MassCancelResult struct {
Result bool `json:"result"`
}
MassCancelResult is the ack returned by the mass-cancel endpoint.
type MassCancelService ¶
type MassCancelService struct {
// contains filtered or unexported fields
}
MassCancelService -- POST /api/v5/trade/mass-cancel (Trade)
Cancels all pending MMP orders for an instrument family (market-maker protection).
func (*MassCancelService) Do ¶
func (s *MassCancelService) Do(ctx context.Context) (*MassCancelResult, error)
func (*MassCancelService) SetLockInterval ¶
func (s *MassCancelService) SetLockInterval(ms int) *MassCancelService
SetLockInterval sets the auto-cancel lock interval in milliseconds (0-10000).
type MaxAvailSize ¶
type MaxAvailSize struct {
InstrumentID string `json:"instId"`
AvailableBuy decimal.Decimal `json:"availBuy"`
AvailableSell decimal.Decimal `json:"availSell"`
TradeQuoteCurrency string `json:"tradeQuoteCcy"`
}
MaxAvailSize is the maximum available buy/sell amount of an instrument.
type MaxLoan ¶
type MaxLoan struct {
InstrumentID string `json:"instId"`
MarginMode MgnMode `json:"mgnMode"`
MarginCurrency string `json:"mgnCcy"`
MaxLoan decimal.Decimal `json:"maxLoan"`
Currency string `json:"ccy"`
Side Side `json:"side"`
}
MaxLoan is the account's maximum loanable amount for an instrument side.
type MaxSize ¶
type MaxSize struct {
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
MaxBuy decimal.Decimal `json:"maxBuy"`
MaxSell decimal.Decimal `json:"maxSell"`
TradeQuoteCurrency string `json:"tradeQuoteCcy"`
}
MaxSize is the maximum buy/sell size of an instrument.
type MaxWithdrawal ¶
type MaxWithdrawal struct {
Currency string `json:"ccy"`
MaxWithdrawal decimal.Decimal `json:"maxWd"`
MaxWdEx decimal.Decimal `json:"maxWdEx"`
SpotOffsetMaxWithdrawal decimal.Decimal `json:"spotOffsetMaxWd"`
SpotOffsetMaxWdEx decimal.Decimal `json:"spotOffsetMaxWdEx"`
}
MaxWithdrawal is a currency's maximum transferable-out amount.
type MgnMode ¶
type MgnMode string
MgnMode is a margin mode (used by positions, leverage and borrowing).
type ModifySubAccountApiKeyService ¶
type ModifySubAccountApiKeyService struct {
// contains filtered or unexported fields
}
ModifySubAccountApiKeyService -- POST /api/v5/users/subaccount/modify-apikey (Trade)
Modifies (master account) a sub-account API key's permissions, label or IP allow-list. Implement-only: never executed by the live test suite.
func (*ModifySubAccountApiKeyService) Do ¶
func (s *ModifySubAccountApiKeyService) Do(ctx context.Context) (*SubAccountApiKey, error)
func (*ModifySubAccountApiKeyService) SetIP ¶
func (s *ModifySubAccountApiKeyService) SetIP(ip string) *ModifySubAccountApiKeyService
SetIP sets the IP allow-list (comma-separated, up to 20 addresses).
func (*ModifySubAccountApiKeyService) SetLabel ¶
func (s *ModifySubAccountApiKeyService) SetLabel(label string) *ModifySubAccountApiKeyService
SetLabel sets a new label for the API key.
func (*ModifySubAccountApiKeyService) SetPerm ¶
func (s *ModifySubAccountApiKeyService) SetPerm(perm string) *ModifySubAccountApiKeyService
SetPerm sets the API key permissions (comma-separated: read_only, trade).
type MonthlyStatement ¶
type MonthlyStatement struct {
FileHref string `json:"fileHref"`
State string `json:"state"`
Timestamp time.Time `json:"ts"`
}
MonthlyStatement is the download link and state of a monthly statement.
type MonthlyStatementApply ¶
MonthlyStatementApply is the acknowledgement of a monthly-statement request.
type MovePositionLeg ¶
type MovePositionLeg struct {
From MovePositionLegFromReq `json:"from"`
To MovePositionLegToReq `json:"to"`
}
MovePositionLeg is one position to move in a move-positions request. From describes the source-account leg and To the destination-account leg.
type MovePositionLegFromReq ¶
type MovePositionLegFromReq struct {
PositionID string `json:"posId"`
Size string `json:"sz"`
Side Side `json:"side"`
}
MovePositionLegFromReq is the source leg of a move-positions request.
type MovePositionLegToReq ¶
type MovePositionLegToReq struct {
TradeMode TdMode `json:"tdMode,omitempty"`
PositionSide PosSide `json:"posSide,omitempty"`
Currency string `json:"ccy,omitempty"`
}
MovePositionLegToReq is the destination leg of a move-positions request.
type MovePositions ¶
type MovePositions struct {
BlockTradeID string `json:"blockTdId"`
ClientID string `json:"clientId"`
State string `json:"state"`
FromAccount string `json:"fromAcct"`
ToAccount string `json:"toAcct"`
Legs []MovePositionsLeg `json:"legs"`
Timestamp time.Time `json:"ts"`
}
MovePositions is the move-positions acknowledgement.
type MovePositionsHistory ¶
type MovePositionsHistory struct {
ClientID string `json:"clientId"`
BlockTradeID string `json:"blockTdId"`
State string `json:"state"`
Timestamp time.Time `json:"ts"`
FromAccount string `json:"fromAcct"`
ToAccount string `json:"toAcct"`
Legs []MovePositionsHistoryLeg `json:"legs"`
}
MovePositionsHistory is one move-positions (block transfer) record.
type MovePositionsHistoryLeg ¶
type MovePositionsHistoryLeg struct {
From MovePositionsHistoryLegFrom `json:"from"`
To MovePositionsHistoryLegTo `json:"to"`
}
MovePositionsHistoryLeg is one leg of a move-positions history record.
type MovePositionsHistoryLegFrom ¶
type MovePositionsHistoryLegFrom struct {
InstrumentID string `json:"instId"`
PositionID string `json:"posId"`
Price decimal.Decimal `json:"px"`
Side Side `json:"side"`
Size decimal.Decimal `json:"sz"`
}
MovePositionsHistoryLegFrom is the source-account side of a history leg.
type MovePositionsHistoryLegTo ¶
type MovePositionsHistoryLegTo struct {
InstrumentID string `json:"instId"`
Price decimal.Decimal `json:"px"`
Side Side `json:"side"`
Size decimal.Decimal `json:"sz"`
TradeMode TdMode `json:"tdMode"`
PositionSide PosSide `json:"posSide"`
Currency string `json:"ccy"`
}
MovePositionsHistoryLegTo is the destination-account side of a history leg.
type MovePositionsLeg ¶
type MovePositionsLeg struct {
From MovePositionsLegFrom `json:"from"`
To MovePositionsLegTo `json:"to"`
}
MovePositionsLeg is one moved-position leg in a move-positions response.
type MovePositionsLegFrom ¶
type MovePositionsLegFrom struct {
InstrumentID string `json:"instId"`
PositionID string `json:"posId"`
Price decimal.Decimal `json:"px"`
Side Side `json:"side"`
Size decimal.Decimal `json:"sz"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
MovePositionsLegFrom is the source-account side of a moved-position leg.
type MovePositionsLegTo ¶
type MovePositionsLegTo struct {
InstrumentID string `json:"instId"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
Price decimal.Decimal `json:"px"`
Currency string `json:"ccy"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
MovePositionsLegTo is the destination-account side of a moved-position leg.
type MovePositionsService ¶
type MovePositionsService struct {
// contains filtered or unexported fields
}
MovePositionsService -- POST /api/v5/account/move-positions (Trade)
Moves positions between the master account and a managed sub-account (block transfer). Each leg pairs a source-account position with its destination.
func (*MovePositionsService) Do ¶
func (s *MovePositionsService) Do(ctx context.Context) (*MovePositions, error)
type NonTradableAsset ¶
type NonTradableAsset struct {
Currency string `json:"ccy"`
Name string `json:"name"`
LogoLink string `json:"logoLink"`
Balance decimal.Decimal `json:"bal"`
CanWithdrawal bool `json:"canWd"`
Chain string `json:"chain"`
ContractAddress string `json:"ctAddr"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
MinWithdrawal decimal.Decimal `json:"minWd"`
WithdrawalTickSize decimal.Decimal `json:"wdTickSz"`
WithdrawalAll bool `json:"wdAll"`
NeedTag bool `json:"needTag"`
BurningFeeRate decimal.Decimal `json:"burningFeeRate"`
}
NonTradableAsset is a single non-tradable asset and its withdrawal rules.
type OKUSDLimits ¶ added in v0.20260703.0
type OKUSDLimits struct {
SubLimit OKUSDSubLimit `json:"subLimit"`
FastRedeemLimit OKUSDRedeemLimit `json:"fastRedeemLimit"`
StdRedeemLimit OKUSDRedeemLimit `json:"stdRedeemLimit"`
Timestamp time.Time `json:"ts"`
}
OKUSDLimits is the account's OKUSD subscription/redemption limit snapshot.
type OKUSDRedeemLimit ¶ added in v0.20260703.0
type OKUSDRedeemLimit struct {
PersonalDailyLimit decimal.Decimal `json:"personalDailyLimit"`
PersonalUsedAmount decimal.Decimal `json:"personalUsedAmt"`
PlatformDailyLimit decimal.Decimal `json:"platformDailyLimit"`
PlatformUsedAmount decimal.Decimal `json:"platformUsedAmt"`
FeeRate decimal.Decimal `json:"feeRate"`
}
OKUSDRedeemLimit holds a redemption limit tier's figures (OKUSD) and its fee rate.
type OKUSDRedeemType ¶ added in v0.20260703.0
type OKUSDRedeemType string
OKUSDRedeemType selects how an OKUSD redemption settles.
const ( // OKUSDRedeemTypeFast settles in real time. OKUSDRedeemTypeFast OKUSDRedeemType = "1" // OKUSDRedeemTypeStandard settles in D+5 business days. OKUSDRedeemTypeStandard OKUSDRedeemType = "2" )
type OKUSDRedemption ¶ added in v0.20260703.0
type OKUSDRedemption struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Fee decimal.Decimal `json:"fee"`
USDTAmount decimal.Decimal `json:"usdtAmt"`
RedeemType OKUSDRedeemType `json:"redeemType"`
State string `json:"state"`
EstimatedSettlementTime time.Time `json:"estSettlementTime"`
Timestamp time.Time `json:"ts"`
}
OKUSDRedemption is the ack of an OKUSD redemption.
type OKUSDSubLimit ¶ added in v0.20260703.0
type OKUSDSubLimit struct {
MaxSubAmount decimal.Decimal `json:"maxSubAmt"`
PersonalDailyLimit decimal.Decimal `json:"personalDailyLimit"`
PersonalUsedAmount decimal.Decimal `json:"personalUsedAmt"`
PlatformDailyLimit decimal.Decimal `json:"platformDailyLimit"`
PlatformUsedAmount decimal.Decimal `json:"platformUsedAmt"`
}
OKUSDSubLimit holds the subscription limit figures (USDT).
type OKUSDSubscription ¶ added in v0.20260703.0
type OKUSDSubscription struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
OKUSDAmount decimal.Decimal `json:"okusdAmt"`
State string `json:"state"`
Timestamp time.Time `json:"ts"`
}
OKUSDSubscription is the ack of an OKUSD subscription.
type OneClickRepayCurrencyList ¶
type OneClickRepayCurrencyList struct {
DebtType DebtType `json:"debtType"`
DebtData []OneClickRepayDebt `json:"debtData"`
RepayData []OneClickRepayRepay `json:"repayData"`
}
OneClickRepayCurrencyList is the set of repayable debt currencies and the currencies available to repay them, grouped by debt type.
type OneClickRepayCurrencyListV2 ¶
type OneClickRepayCurrencyListV2 struct {
DebtData []OneClickRepayDebt `json:"debtData"`
RepayData []OneClickRepayRepay `json:"repayData"`
}
OneClickRepayCurrencyListV2 is the set of repayable debt currencies and the currencies available to repay them (v2).
type OneClickRepayDebt ¶
type OneClickRepayDebt struct {
DebtCurrency string `json:"debtCcy"`
DebtAmount decimal.Decimal `json:"debtAmt"`
}
OneClickRepayDebt is a single debt currency and its outstanding amount.
type OneClickRepayHistory ¶
type OneClickRepayHistory struct {
DebtCurrency string `json:"debtCcy"`
FillDebtSize decimal.Decimal `json:"fillDebtSz"`
RepayCurrency string `json:"repayCcy"`
FillRepaySize decimal.Decimal `json:"fillRepaySz"`
Status ConvertStatus `json:"status"`
UpdateTime time.Time `json:"uTime"`
}
OneClickRepayHistory is a single past one-click repay order.
type OneClickRepayHistoryV2 ¶
type OneClickRepayHistoryV2 struct {
DebtCurrency string `json:"debtCcy"`
RepayCurrencyList []string `json:"repayCcyList"`
FillDebtSize decimal.Decimal `json:"fillDebtSz"`
Status ConvertStatus `json:"status"`
OrderIDInfo []OneClickRepayOrderRef `json:"ordIdInfo"`
Timestamp time.Time `json:"ts"`
}
OneClickRepayHistoryV2 is a single past one-click repay (v2) order.
type OneClickRepayOrderRef ¶
type OneClickRepayOrderRef struct {
OrderID string `json:"ordId"`
InstrumentID string `json:"instId"`
OrderType OrdType `json:"ordType"`
Side Side `json:"side"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
FillPrice decimal.Decimal `json:"fillPx"`
FillSize decimal.Decimal `json:"fillSz"`
State OrdState `json:"state"`
CreationTime time.Time `json:"cTime"`
}
OneClickRepayOrderRef is a single underlying order placed to execute a one-click repay (v2).
type OneClickRepayRepay ¶
type OneClickRepayRepay struct {
RepayCurrency string `json:"repayCcy"`
RepayAmount decimal.Decimal `json:"repayAmt"`
}
OneClickRepayRepay is a single currency available to repay debt and its available balance.
type OneClickRepayResult ¶
type OneClickRepayResult struct {
Status ConvertStatus `json:"status"`
DebtCurrency string `json:"debtCcy"`
RepayCurrency string `json:"repayCcy"`
FillDebtSize decimal.Decimal `json:"fillDebtSz"`
FillRepaySize decimal.Decimal `json:"fillRepaySz"`
UpdateTime time.Time `json:"uTime"`
}
OneClickRepayResult is the acknowledgement for a one-click repay order.
type OneClickRepayResultV2 ¶
type OneClickRepayResultV2 struct {
DebtCurrency string `json:"debtCcy"`
RepayCurrencyList []string `json:"repayCcyList"`
Timestamp time.Time `json:"ts"`
}
OneClickRepayResultV2 is the acknowledgement for a one-click repay (v2) order.
type OpenInterest ¶
type OpenInterest struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
OpenInterest decimal.Decimal `json:"oi"`
OpenInterestCurrency decimal.Decimal `json:"oiCcy"`
OpenInterestUSD decimal.Decimal `json:"oiUsd"`
Timestamp time.Time `json:"ts"`
}
OpenInterest is an instrument's open interest.
type OptSummary ¶
type OptSummary struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Underlying string `json:"uly"`
Delta decimal.Decimal `json:"delta"`
Gamma decimal.Decimal `json:"gamma"`
Theta decimal.Decimal `json:"theta"`
Vega decimal.Decimal `json:"vega"`
DeltaBS decimal.Decimal `json:"deltaBS"`
GammaBS decimal.Decimal `json:"gammaBS"`
ThetaBS decimal.Decimal `json:"thetaBS"`
VegaBS decimal.Decimal `json:"vegaBS"`
RealizedVolatility decimal.Decimal `json:"realVol"`
BidVolatility decimal.Decimal `json:"bidVol"`
AskVolatility decimal.Decimal `json:"askVol"`
MarkVolatility decimal.Decimal `json:"markVol"`
Leverage decimal.Decimal `json:"lever"`
VolatilityLevel decimal.Decimal `json:"volLv"`
ForwardPrice decimal.Decimal `json:"fwdPx"`
Distance decimal.Decimal `json:"distance"`
BuyAPR decimal.Decimal `json:"buyApr"`
SellAPR decimal.Decimal `json:"sellApr"`
Timestamp time.Time `json:"ts"`
}
OptSummary is the greeks/IV summary of a single option instrument.
type OptionFamilyInfo ¶
type OptionFamilyInfo struct {
InstrumentID string `json:"instId"`
TradeID string `json:"tradeId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
Timestamp time.Time `json:"ts"`
}
OptionFamilyInfo is one trade within an option instrument family.
type OptionFamilyTrades ¶
type OptionFamilyTrades struct {
OptionType OptType `json:"optType"`
Volume24h decimal.Decimal `json:"vol24h"`
TradeInfo []OptionFamilyInfo `json:"tradeInfo"`
}
OptionFamilyTrades groups recent option trades by option type and underlying 24h volume.
type OrdType ¶
type OrdType string
OrdType is an order type. It doubles as the time-in-force selector OKX folds into the order type (fok / ioc / post_only).
type Order ¶
type Order struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
TargetCurrency TgtCcy `json:"tgtCcy"`
Currency string `json:"ccy"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
Price decimal.Decimal `json:"px"`
PriceUSD decimal.Decimal `json:"pxUsd"`
PriceVolatility decimal.Decimal `json:"pxVol"`
PriceType string `json:"pxType"`
Size decimal.Decimal `json:"sz"`
Pnl decimal.Decimal `json:"pnl"`
OrderType OrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
AccumulatedFillSize decimal.Decimal `json:"accFillSz"`
FillPrice decimal.Decimal `json:"fillPx"`
TradeID string `json:"tradeId"`
FillSize decimal.Decimal `json:"fillSz"`
FillTime time.Time `json:"fillTime"`
AveragePrice decimal.Decimal `json:"avgPx"`
State OrdState `json:"state"`
Leverage decimal.Decimal `json:"lever"`
AttachAlgoClientOrderID string `json:"attachAlgoClOrdId"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
StopLossTriggerPriceType string `json:"slTriggerPxType"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx"`
AttachAlgoOrders []AttachAlgoOrd `json:"attachAlgoOrds"`
STPID string `json:"stpId"`
STPMode string `json:"stpMode"`
FeeCurrency string `json:"feeCcy"`
Fee decimal.Decimal `json:"fee"`
RebateCurrency string `json:"rebateCcy"`
Rebate decimal.Decimal `json:"rebate"`
Source string `json:"source"`
Category string `json:"category"`
ReduceOnly string `json:"reduceOnly"` // OKX sends a quoted "true"/"false"
CancelSource string `json:"cancelSource"`
CancelSourceReason string `json:"cancelSourceReason"`
QuickMarginType string `json:"quickMgnType"`
AlgoClientOrderID string `json:"algoClOrdId"`
AlgoID string `json:"algoId"`
IsTakeProfitLimit string `json:"isTpLimit"`
Outcome string `json:"outcome"`
LinkedAlgoOrder OrderLinkedAlgo `json:"linkedAlgoOrd"`
UpdateTime time.Time `json:"uTime"`
CreationTime time.Time `json:"cTime"`
TradeQuoteCurrency string `json:"tradeQuoteCcy"`
}
Order is a single order record returned by the order / orders-pending / orders-history(-archive) endpoints. The validating account had no order history, so the field set is modeled from the OKX doc field table.
type OrderArg ¶
type OrderArg struct {
InstrumentID string `json:"instId"`
TradeMode TdMode `json:"tdMode"`
Side Side `json:"side"`
OrderType OrdType `json:"ordType"`
Size decimal.Decimal `json:"sz"`
Currency string `json:"ccy,omitempty"`
ClientOrderID string `json:"clOrdId,omitempty"`
Tag string `json:"tag,omitempty"`
PositionSide PosSide `json:"posSide,omitempty"`
Price decimal.Decimal `json:"px,omitzero"`
PriceUSD decimal.Decimal `json:"pxUsd,omitzero"`
PriceVolatility decimal.Decimal `json:"pxVol,omitzero"`
ReduceOnly bool `json:"reduceOnly,omitempty"`
TargetCurrency TgtCcy `json:"tgtCcy,omitempty"`
BanAmend bool `json:"banAmend,omitempty"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx,omitzero"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx,omitzero"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx,omitzero"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx,omitzero"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType,omitempty"`
StopLossTriggerPriceType string `json:"slTriggerPxType,omitempty"`
QuickMarginType string `json:"quickMgnType,omitempty"`
STPID string `json:"stpId,omitempty"`
STPMode string `json:"stpMode,omitempty"`
AttachAlgoOrders []AttachAlgoOrd `json:"attachAlgoOrds,omitempty"`
}
OrderArg is one order leg of a batch place-orders request body. It mirrors the single place-order body and is used by NewBatchOrdersService and NewPlaceOrderService.
type OrderBook ¶
type OrderBook struct {
Asks [][]string `json:"asks"`
Bids [][]string `json:"bids"`
Timestamp time.Time `json:"ts"`
SequenceID int64 `json:"seqId"`
}
OrderBook is an order book snapshot. Each ask/bid level is [price, size, deprecated("0"), numOrders] for /books and [price, size, numOrders] for /books-full.
type OrderLinkedAlgo ¶
type OrderLinkedAlgo struct {
AlgoID string `json:"algoId"`
}
OrderLinkedAlgo is the algo order linked to a regular order (returned by order-info as a nested object).
type OrderPrecheck ¶
type OrderPrecheck struct {
AdjustedEquity decimal.Decimal `json:"adjEq"`
AdjustedEquityChange decimal.Decimal `json:"adjEqChg"`
AvailableBalance decimal.Decimal `json:"availBal"`
AvailableBalanceChange decimal.Decimal `json:"availBalChg"`
IMR decimal.Decimal `json:"imr"`
IMRChange decimal.Decimal `json:"imrChg"`
Borrowed decimal.Decimal `json:"borrowed"`
Liability decimal.Decimal `json:"liab"`
LiabilityChange decimal.Decimal `json:"liabChg"`
LiabilityChangeCurrency string `json:"liabChgCcy"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
LiquidationPriceDiff decimal.Decimal `json:"liqPxDiff"`
LiquidationPriceDiffRatio decimal.Decimal `json:"liqPxDiffRatio"`
Margin decimal.Decimal `json:"mgn"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
MarginRatioChange decimal.Decimal `json:"mgnRatioChg"`
MMR decimal.Decimal `json:"mmr"`
MMRChange decimal.Decimal `json:"mmrChg"`
PositionBalance decimal.Decimal `json:"posBal"`
PositionBalanceChange decimal.Decimal `json:"posBalChg"`
Type string `json:"type"`
}
OrderPrecheck is the estimated account impact of a hypothetical order.
type OrderPrecheckService ¶
type OrderPrecheckService struct {
// contains filtered or unexported fields
}
OrderPrecheckService -- POST /api/v5/trade/order-precheck (Trade)
Pre-checks the account-level impact (estimated margin, available balance, liquidation price) of placing an order without actually placing it.
func (*OrderPrecheckService) Do ¶
func (s *OrderPrecheckService) Do(ctx context.Context) (*OrderPrecheck, error)
func (*OrderPrecheckService) SetAttachAlgoOrds ¶
func (s *OrderPrecheckService) SetAttachAlgoOrds(orders []AttachAlgoOrd) *OrderPrecheckService
SetAttachAlgoOrds attaches take-profit / stop-loss algo orders for the check.
func (*OrderPrecheckService) SetPosSide ¶
func (s *OrderPrecheckService) SetPosSide(posSide PosSide) *OrderPrecheckService
SetPosSide sets the position side (long/short/net).
func (*OrderPrecheckService) SetPx ¶
func (s *OrderPrecheckService) SetPx(px decimal.Decimal) *OrderPrecheckService
SetPx sets the order price (required for limit-type orders).
func (*OrderPrecheckService) SetReduceOnly ¶
func (s *OrderPrecheckService) SetReduceOnly(reduceOnly bool) *OrderPrecheckService
SetReduceOnly toggles reduce-only.
func (*OrderPrecheckService) SetTgtCcy ¶
func (s *OrderPrecheckService) SetTgtCcy(tgtCcy TgtCcy) *OrderPrecheckService
SetTgtCcy selects the unit of a spot market order's size (base_ccy/quote_ccy).
type OrderResult ¶
type OrderResult struct {
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
Timestamp time.Time `json:"ts"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
OrderResult is the ack returned by the place / batch-place / cancel / batch-cancel order endpoints. The real per-item status lives in sCode/sMsg.
func (OrderResult) Err ¶ added in v0.20260623.1
func (r OrderResult) Err() error
Err returns the per-item API error each batch result carries, or nil when that item succeeded.
type PlaceAlgoOrderService ¶
type PlaceAlgoOrderService struct {
// contains filtered or unexported fields
}
PlaceAlgoOrderService -- POST /api/v5/trade/order-algo (Trade)
Places a single algo (trigger / advanced) order: conditional, oco, trigger, move_order_stop (trailing), twap, iceberg or chase. The required body fields (instId, tdMode, side, ordType, sz) are constructor args; the many type-specific fields are optional setters.
func (*PlaceAlgoOrderService) Do ¶
func (s *PlaceAlgoOrderService) Do(ctx context.Context) (*AlgoResult, error)
func (*PlaceAlgoOrderService) SetActivePx ¶
func (s *PlaceAlgoOrderService) SetActivePx(px decimal.Decimal) *PlaceAlgoOrderService
SetActivePx sets the activation price (move_order_stop).
func (*PlaceAlgoOrderService) SetAdvChaseParams ¶ added in v0.20260723.0
func (s *PlaceAlgoOrderService) SetAdvChaseParams(params []AdvChaseParam) *PlaceAlgoOrderService
SetAdvChaseParams sets the chase parameters carried by a trigger order whose advanceOrdType is "chase" (FUTURES/SWAP).
func (*PlaceAlgoOrderService) SetAdvanceOrdType ¶ added in v0.20260723.0
func (s *PlaceAlgoOrderService) SetAdvanceOrdType(advanceOrdType string) *PlaceAlgoOrderService
SetAdvanceOrdType sets the order type spawned when a FUTURES/SWAP trigger order fires. Value "chase" makes the triggered order a chase limit order; ordPx is then not required and the chase parameters come from SetAdvChaseParams.
func (*PlaceAlgoOrderService) SetAlgoClOrdId ¶
func (s *PlaceAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *PlaceAlgoOrderService
SetAlgoClOrdId sets a client-supplied algo order id.
func (*PlaceAlgoOrderService) SetAttachAlgoOrds ¶
func (s *PlaceAlgoOrderService) SetAttachAlgoOrds(ords []AlgoAttachOrd) *PlaceAlgoOrderService
SetAttachAlgoOrds attaches a list of TP/SL orders to a trigger order.
func (*PlaceAlgoOrderService) SetCallbackRatio ¶
func (s *PlaceAlgoOrderService) SetCallbackRatio(ratio decimal.Decimal) *PlaceAlgoOrderService
SetCallbackRatio sets the trailing callback ratio (move_order_stop).
func (*PlaceAlgoOrderService) SetCallbackSpread ¶
func (s *PlaceAlgoOrderService) SetCallbackSpread(spread decimal.Decimal) *PlaceAlgoOrderService
SetCallbackSpread sets the trailing callback spread (move_order_stop).
func (*PlaceAlgoOrderService) SetCcy ¶
func (s *PlaceAlgoOrderService) SetCcy(ccy string) *PlaceAlgoOrderService
SetCcy sets the margin currency (single-currency margin only).
func (*PlaceAlgoOrderService) SetChaseType ¶
func (s *PlaceAlgoOrderService) SetChaseType(chaseType string) *PlaceAlgoOrderService
SetChaseType sets the chase distance type (distance / ratio).
func (*PlaceAlgoOrderService) SetChaseVal ¶
func (s *PlaceAlgoOrderService) SetChaseVal(val decimal.Decimal) *PlaceAlgoOrderService
SetChaseVal sets the chase distance value (chase).
func (*PlaceAlgoOrderService) SetClOrdId ¶
func (s *PlaceAlgoOrderService) SetClOrdId(clOrdId string) *PlaceAlgoOrderService
SetClOrdId sets a client-supplied order id for the resulting order.
func (*PlaceAlgoOrderService) SetCxlOnClosePos ¶
func (s *PlaceAlgoOrderService) SetCxlOnClosePos(cxl bool) *PlaceAlgoOrderService
SetCxlOnClosePos toggles whether the algo order is canceled when the position is fully closed (only for TP/SL orders bound to a position).
func (*PlaceAlgoOrderService) SetMaxChaseType ¶
func (s *PlaceAlgoOrderService) SetMaxChaseType(maxChaseType string) *PlaceAlgoOrderService
SetMaxChaseType sets the max-chase distance type (distance / ratio).
func (*PlaceAlgoOrderService) SetMaxChaseVal ¶
func (s *PlaceAlgoOrderService) SetMaxChaseVal(val decimal.Decimal) *PlaceAlgoOrderService
SetMaxChaseVal sets the max-chase distance value (chase).
func (*PlaceAlgoOrderService) SetOrdPx ¶
func (s *PlaceAlgoOrderService) SetOrdPx(px decimal.Decimal) *PlaceAlgoOrderService
SetOrdPx sets the order price for trigger/iceberg/twap ("-1" for market).
func (*PlaceAlgoOrderService) SetPosSide ¶
func (s *PlaceAlgoOrderService) SetPosSide(posSide PosSide) *PlaceAlgoOrderService
SetPosSide sets the position side (long/short/net).
func (*PlaceAlgoOrderService) SetPxLimit ¶
func (s *PlaceAlgoOrderService) SetPxLimit(pxLimit decimal.Decimal) *PlaceAlgoOrderService
SetPxLimit sets the price limit per child order (iceberg/twap).
func (*PlaceAlgoOrderService) SetPxSpread ¶
func (s *PlaceAlgoOrderService) SetPxSpread(pxSpread decimal.Decimal) *PlaceAlgoOrderService
SetPxSpread sets the price variance per child order (iceberg/twap, absolute).
func (*PlaceAlgoOrderService) SetPxVar ¶
func (s *PlaceAlgoOrderService) SetPxVar(pxVar decimal.Decimal) *PlaceAlgoOrderService
SetPxVar sets the price ratio versus the latest price (iceberg/twap, % offset).
func (*PlaceAlgoOrderService) SetQuickMgnType ¶
func (s *PlaceAlgoOrderService) SetQuickMgnType(quickMgnType string) *PlaceAlgoOrderService
SetQuickMgnType sets the quick-margin borrow type (manual/auto_borrow/auto_borrow_repay).
func (*PlaceAlgoOrderService) SetReduceOnly ¶
func (s *PlaceAlgoOrderService) SetReduceOnly(reduceOnly bool) *PlaceAlgoOrderService
SetReduceOnly toggles reduce-only (MARGIN/FUTURES/SWAP).
func (*PlaceAlgoOrderService) SetSlOrdPx ¶
func (s *PlaceAlgoOrderService) SetSlOrdPx(px decimal.Decimal) *PlaceAlgoOrderService
SetSlOrdPx sets the stop-loss order price ("-1" for market).
func (*PlaceAlgoOrderService) SetSlTriggerPx ¶
func (s *PlaceAlgoOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceAlgoOrderService
SetSlTriggerPx sets the stop-loss trigger price (conditional/oco).
func (*PlaceAlgoOrderService) SetSlTriggerPxType ¶
func (s *PlaceAlgoOrderService) SetSlTriggerPxType(pxType string) *PlaceAlgoOrderService
SetSlTriggerPxType sets the stop-loss trigger price type (last/index/mark).
func (*PlaceAlgoOrderService) SetSzLimit ¶
func (s *PlaceAlgoOrderService) SetSzLimit(szLimit decimal.Decimal) *PlaceAlgoOrderService
SetSzLimit sets the average amount per child order (iceberg/twap).
func (*PlaceAlgoOrderService) SetTag ¶
func (s *PlaceAlgoOrderService) SetTag(tag string) *PlaceAlgoOrderService
SetTag sets an order tag.
func (*PlaceAlgoOrderService) SetTgtCcy ¶
func (s *PlaceAlgoOrderService) SetTgtCcy(tgtCcy TgtCcy) *PlaceAlgoOrderService
SetTgtCcy sets the spot market size unit (base_ccy / quote_ccy).
func (*PlaceAlgoOrderService) SetTimeInterval ¶
func (s *PlaceAlgoOrderService) SetTimeInterval(seconds int) *PlaceAlgoOrderService
SetTimeInterval sets the interval in seconds between child orders (twap).
func (*PlaceAlgoOrderService) SetTpOrdKind ¶
func (s *PlaceAlgoOrderService) SetTpOrdKind(kind string) *PlaceAlgoOrderService
SetTpOrdKind sets the take-profit order kind (condition / limit).
func (*PlaceAlgoOrderService) SetTpOrdPx ¶
func (s *PlaceAlgoOrderService) SetTpOrdPx(px decimal.Decimal) *PlaceAlgoOrderService
SetTpOrdPx sets the take-profit order price ("-1" for market).
func (*PlaceAlgoOrderService) SetTpTriggerPx ¶
func (s *PlaceAlgoOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceAlgoOrderService
SetTpTriggerPx sets the take-profit trigger price (conditional/oco).
func (*PlaceAlgoOrderService) SetTpTriggerPxType ¶
func (s *PlaceAlgoOrderService) SetTpTriggerPxType(pxType string) *PlaceAlgoOrderService
SetTpTriggerPxType sets the take-profit trigger price type (last/index/mark).
func (*PlaceAlgoOrderService) SetTriggerPx ¶
func (s *PlaceAlgoOrderService) SetTriggerPx(px decimal.Decimal) *PlaceAlgoOrderService
SetTriggerPx sets the trigger price (trigger ordType).
func (*PlaceAlgoOrderService) SetTriggerPxType ¶
func (s *PlaceAlgoOrderService) SetTriggerPxType(pxType string) *PlaceAlgoOrderService
SetTriggerPxType sets the trigger price type (last/index/mark).
type PlaceCopyLeadStopOrderService ¶
type PlaceCopyLeadStopOrderService struct {
// contains filtered or unexported fields
}
PlaceCopyLeadStopOrderService -- POST /api/v5/copytrading/place-lead-stop-order (Trade)
Places a take-profit / stop-loss order against a lead trader's sub-position.
func (*PlaceCopyLeadStopOrderService) Do ¶
func (s *PlaceCopyLeadStopOrderService) Do(ctx context.Context) (*CopySubPosAck, error)
func (*PlaceCopyLeadStopOrderService) SetSlTriggerPx ¶
func (s *PlaceCopyLeadStopOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceCopyLeadStopOrderService
SetSlTriggerPx sets the stop-loss trigger price.
func (*PlaceCopyLeadStopOrderService) SetSlTriggerPxType ¶
func (s *PlaceCopyLeadStopOrderService) SetSlTriggerPxType(pxType string) *PlaceCopyLeadStopOrderService
SetSlTriggerPxType sets the stop-loss trigger price type (last/index/mark).
func (*PlaceCopyLeadStopOrderService) SetTpTriggerPx ¶
func (s *PlaceCopyLeadStopOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceCopyLeadStopOrderService
SetTpTriggerPx sets the take-profit trigger price.
func (*PlaceCopyLeadStopOrderService) SetTpTriggerPxType ¶
func (s *PlaceCopyLeadStopOrderService) SetTpTriggerPxType(pxType string) *PlaceCopyLeadStopOrderService
SetTpTriggerPxType sets the take-profit trigger price type (last/index/mark).
type PlaceEasyConvertService ¶
type PlaceEasyConvertService struct {
// contains filtered or unexported fields
}
PlaceEasyConvertService -- POST /api/v5/trade/easy-convert (Trade)
Converts up to five small-balance ("dust") currencies into a single mainstream currency. State-changing: implemented but never executed by tests.
func (*PlaceEasyConvertService) Do ¶
func (s *PlaceEasyConvertService) Do(ctx context.Context) ([]EasyConvertResult, error)
func (*PlaceEasyConvertService) SetSource ¶
func (s *PlaceEasyConvertService) SetSource(source ConvertSource) *PlaceEasyConvertService
SetSource sets the funding source: "1" (trading account, default) or "2" (funding account).
type PlaceFixedLoanLendingOrderService ¶
type PlaceFixedLoanLendingOrderService struct {
// contains filtered or unexported fields
}
PlaceFixedLoanLendingOrderService -- POST /api/v5/finance/fixed-loan/lending-order (Trade)
Places a fixed-loan lending order. State-changing: implemented but never executed by the test suite. The acknowledgement shape is modeled from the OKX doc field table.
func (*PlaceFixedLoanLendingOrderService) Do ¶
func (s *PlaceFixedLoanLendingOrderService) Do(ctx context.Context) (*FixedLoanLendingOrderAck, error)
func (*PlaceFixedLoanLendingOrderService) SetAutoRenewal ¶
func (s *PlaceFixedLoanLendingOrderService) SetAutoRenewal(autoRenewal bool) *PlaceFixedLoanLendingOrderService
SetAutoRenewal enables auto-renewal of the lending order on maturity.
type PlaceGridAlgoOrderService ¶
type PlaceGridAlgoOrderService struct {
// contains filtered or unexported fields
}
PlaceGridAlgoOrderService -- POST /api/v5/tradingBot/grid/order-algo (Trade)
Places a new spot/margin grid ("grid") or contract grid ("contract_grid") algo order. IMPLEMENT-ONLY: never executed during validation (real account).
func (*PlaceGridAlgoOrderService) Do ¶
func (s *PlaceGridAlgoOrderService) Do(ctx context.Context) (*GridResult, error)
func (*PlaceGridAlgoOrderService) SetAlgoClOrdId ¶
func (s *PlaceGridAlgoOrderService) SetAlgoClOrdId(algoClOrdId string) *PlaceGridAlgoOrderService
SetAlgoClOrdId sets a client-supplied algo order id.
func (*PlaceGridAlgoOrderService) SetBasePos ¶
func (s *PlaceGridAlgoOrderService) SetBasePos(basePos bool) *PlaceGridAlgoOrderService
SetBasePos toggles whether to open a base position immediately (contract grid).
func (*PlaceGridAlgoOrderService) SetBaseSz ¶
func (s *PlaceGridAlgoOrderService) SetBaseSz(sz decimal.Decimal) *PlaceGridAlgoOrderService
SetBaseSz sets the invested amount in the base currency (spot grid).
func (*PlaceGridAlgoOrderService) SetCcy ¶
func (s *PlaceGridAlgoOrderService) SetCcy(ccy string) *PlaceGridAlgoOrderService
SetCcy sets the margin currency (margin grid).
func (*PlaceGridAlgoOrderService) SetDirection ¶
func (s *PlaceGridAlgoOrderService) SetDirection(direction GridDirection) *PlaceGridAlgoOrderService
SetDirection sets the contract grid direction (long/short/neutral).
func (*PlaceGridAlgoOrderService) SetLever ¶
func (s *PlaceGridAlgoOrderService) SetLever(lever decimal.Decimal) *PlaceGridAlgoOrderService
SetLever sets the leverage (contract grid).
func (*PlaceGridAlgoOrderService) SetProfitSharingRatio ¶
func (s *PlaceGridAlgoOrderService) SetProfitSharingRatio(ratio decimal.Decimal) *PlaceGridAlgoOrderService
SetProfitSharingRatio sets the profit-sharing ratio (copy-trading leaders).
func (*PlaceGridAlgoOrderService) SetQuoteSz ¶
func (s *PlaceGridAlgoOrderService) SetQuoteSz(sz decimal.Decimal) *PlaceGridAlgoOrderService
SetQuoteSz sets the invested amount in the quote currency (spot grid).
func (*PlaceGridAlgoOrderService) SetRunType ¶
func (s *PlaceGridAlgoOrderService) SetRunType(runType GridRunType) *PlaceGridAlgoOrderService
SetRunType sets the grid spacing mode ("1" arithmetic, "2" geometric).
func (*PlaceGridAlgoOrderService) SetSlRatio ¶
func (s *PlaceGridAlgoOrderService) SetSlRatio(ratio decimal.Decimal) *PlaceGridAlgoOrderService
SetSlRatio sets the stop-loss ratio (contract grid).
func (*PlaceGridAlgoOrderService) SetSlTriggerPx ¶
func (s *PlaceGridAlgoOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceGridAlgoOrderService
SetSlTriggerPx sets the stop-loss trigger price (spot grid).
func (*PlaceGridAlgoOrderService) SetSz ¶
func (s *PlaceGridAlgoOrderService) SetSz(sz decimal.Decimal) *PlaceGridAlgoOrderService
SetSz sets the invested margin amount (contract grid).
func (*PlaceGridAlgoOrderService) SetTag ¶
func (s *PlaceGridAlgoOrderService) SetTag(tag string) *PlaceGridAlgoOrderService
SetTag sets an order tag.
func (*PlaceGridAlgoOrderService) SetTdMode ¶
func (s *PlaceGridAlgoOrderService) SetTdMode(tdMode TdMode) *PlaceGridAlgoOrderService
SetTdMode sets the trade mode (cross/isolated for margin grid; cash for spot).
func (*PlaceGridAlgoOrderService) SetTpRatio ¶
func (s *PlaceGridAlgoOrderService) SetTpRatio(ratio decimal.Decimal) *PlaceGridAlgoOrderService
SetTpRatio sets the take-profit ratio (contract grid).
func (*PlaceGridAlgoOrderService) SetTpTriggerPx ¶
func (s *PlaceGridAlgoOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceGridAlgoOrderService
SetTpTriggerPx sets the take-profit trigger price (spot grid).
type PlaceOrderService ¶
type PlaceOrderService struct {
// contains filtered or unexported fields
}
PlaceOrderService -- POST /api/v5/trade/order (Trade)
Places a single order. OKX may report failure with a top-level code "1" and the real reason in data[0].sCode, so the ack is read via DoListPartial and the first (only) element is returned, preserving sCode/sMsg.
func (*PlaceOrderService) Do ¶
func (s *PlaceOrderService) Do(ctx context.Context) (*OrderResult, error)
func (*PlaceOrderService) SetAttachAlgoOrds ¶
func (s *PlaceOrderService) SetAttachAlgoOrds(orders []AttachAlgoOrd) *PlaceOrderService
SetAttachAlgoOrds attaches take-profit / stop-loss algo orders.
func (*PlaceOrderService) SetBanAmend ¶
func (s *PlaceOrderService) SetBanAmend(banAmend bool) *PlaceOrderService
SetBanAmend forbids the order from being amended by the system on self-fill.
func (*PlaceOrderService) SetCcy ¶
func (s *PlaceOrderService) SetCcy(ccy string) *PlaceOrderService
SetCcy sets the margin currency (single-currency margin mode only).
func (*PlaceOrderService) SetClOrdId ¶
func (s *PlaceOrderService) SetClOrdId(clOrdId string) *PlaceOrderService
SetClOrdId sets the client-supplied order id.
func (*PlaceOrderService) SetPosSide ¶
func (s *PlaceOrderService) SetPosSide(posSide PosSide) *PlaceOrderService
SetPosSide sets the position side (long/short/net).
func (*PlaceOrderService) SetPx ¶
func (s *PlaceOrderService) SetPx(px decimal.Decimal) *PlaceOrderService
SetPx sets the limit price (required for limit-type orders).
func (*PlaceOrderService) SetQuickMgnType ¶
func (s *PlaceOrderService) SetQuickMgnType(quickMgnType string) *PlaceOrderService
SetQuickMgnType sets the quick-margin type (manual/auto_borrow/auto_borrow_repay).
func (*PlaceOrderService) SetReduceOnly ¶
func (s *PlaceOrderService) SetReduceOnly(reduceOnly bool) *PlaceOrderService
SetReduceOnly toggles reduce-only (cross MARGIN / FUTURES / SWAP).
func (*PlaceOrderService) SetSlOrdPx ¶
func (s *PlaceOrderService) SetSlOrdPx(px decimal.Decimal) *PlaceOrderService
SetSlOrdPx sets the stop-loss order price ("-1" for market).
func (*PlaceOrderService) SetSlTriggerPx ¶
func (s *PlaceOrderService) SetSlTriggerPx(px decimal.Decimal) *PlaceOrderService
SetSlTriggerPx sets the stop-loss trigger price.
func (*PlaceOrderService) SetSlTriggerPxType ¶
func (s *PlaceOrderService) SetSlTriggerPxType(pxType string) *PlaceOrderService
SetSlTriggerPxType sets the stop-loss trigger price type (last/index/mark).
func (*PlaceOrderService) SetStpId ¶
func (s *PlaceOrderService) SetStpId(stpId string) *PlaceOrderService
SetStpId sets the self-trade-prevention id.
func (*PlaceOrderService) SetStpMode ¶
func (s *PlaceOrderService) SetStpMode(stpMode string) *PlaceOrderService
SetStpMode sets the self-trade-prevention mode (cancel_maker/cancel_taker/cancel_both).
func (*PlaceOrderService) SetTag ¶
func (s *PlaceOrderService) SetTag(tag string) *PlaceOrderService
SetTag sets the order tag.
func (*PlaceOrderService) SetTgtCcy ¶
func (s *PlaceOrderService) SetTgtCcy(tgtCcy TgtCcy) *PlaceOrderService
SetTgtCcy selects the unit of a spot market order's size (base_ccy/quote_ccy).
func (*PlaceOrderService) SetTpOrdPx ¶
func (s *PlaceOrderService) SetTpOrdPx(px decimal.Decimal) *PlaceOrderService
SetTpOrdPx sets the take-profit order price ("-1" for market).
func (*PlaceOrderService) SetTpTriggerPx ¶
func (s *PlaceOrderService) SetTpTriggerPx(px decimal.Decimal) *PlaceOrderService
SetTpTriggerPx sets the take-profit trigger price.
func (*PlaceOrderService) SetTpTriggerPxType ¶
func (s *PlaceOrderService) SetTpTriggerPxType(pxType string) *PlaceOrderService
SetTpTriggerPxType sets the take-profit trigger price type (last/index/mark).
type PlaceRecurringOrderService ¶
type PlaceRecurringOrderService struct {
// contains filtered or unexported fields
}
PlaceRecurringOrderService -- POST /api/v5/tradingBot/recurring/order-algo (Trade)
Creates a recurring-buy (DCA) strategy that invests amt of investmentCcy across recurringList on the configured period/day/time.
func (*PlaceRecurringOrderService) Do ¶
func (s *PlaceRecurringOrderService) Do(ctx context.Context) (*RecurringResult, error)
func (*PlaceRecurringOrderService) SetAlgoClOrdId ¶
func (s *PlaceRecurringOrderService) SetAlgoClOrdId(algoClOrdId string) *PlaceRecurringOrderService
SetAlgoClOrdId sets a client-supplied strategy id.
func (*PlaceRecurringOrderService) SetRecurringDay ¶
func (s *PlaceRecurringOrderService) SetRecurringDay(recurringDay string) *PlaceRecurringOrderService
SetRecurringDay sets the day of the recurring buy. Required when period is "weekly" (1-7) or "monthly" (1-28).
func (*PlaceRecurringOrderService) SetRecurringHour ¶
func (s *PlaceRecurringOrderService) SetRecurringHour(recurringHour string) *PlaceRecurringOrderService
SetRecurringHour sets the hour of the recurring buy ("0"/"6"/"12"/"18"), required when period is "hourly".
func (*PlaceRecurringOrderService) SetTag ¶
func (s *PlaceRecurringOrderService) SetTag(tag string) *PlaceRecurringOrderService
SetTag sets an order tag for the strategy.
type PlaceSprdOrderAlgoService ¶
type PlaceSprdOrderAlgoService struct {
// contains filtered or unexported fields
}
PlaceSprdOrderAlgoService -- POST /api/v5/sprd/order-algo (Trade)
Places a spread algo (e.g. TWAP) order. sprdId, side, ordType and sz are required; the remaining params depend on the algo order type.
func (*PlaceSprdOrderAlgoService) Do ¶
func (s *PlaceSprdOrderAlgoService) Do(ctx context.Context) (*SprdAlgoAck, error)
func (*PlaceSprdOrderAlgoService) SetAlgoClOrdId ¶
func (s *PlaceSprdOrderAlgoService) SetAlgoClOrdId(algoClOrdId string) *PlaceSprdOrderAlgoService
SetAlgoClOrdId sets a client-supplied algo order id.
func (*PlaceSprdOrderAlgoService) SetPxLimit ¶
func (s *PlaceSprdOrderAlgoService) SetPxLimit(pxLimit string) *PlaceSprdOrderAlgoService
SetPxLimit sets the limit price (TWAP).
func (*PlaceSprdOrderAlgoService) SetPxSpread ¶
func (s *PlaceSprdOrderAlgoService) SetPxSpread(pxSpread string) *PlaceSprdOrderAlgoService
SetPxSpread sets the price spread (TWAP).
func (*PlaceSprdOrderAlgoService) SetPxVar ¶
func (s *PlaceSprdOrderAlgoService) SetPxVar(pxVar string) *PlaceSprdOrderAlgoService
SetPxVar sets the price variance (TWAP).
func (*PlaceSprdOrderAlgoService) SetSzLimit ¶
func (s *PlaceSprdOrderAlgoService) SetSzLimit(szLimit string) *PlaceSprdOrderAlgoService
SetSzLimit sets the per-interval size limit (TWAP).
func (*PlaceSprdOrderAlgoService) SetTag ¶
func (s *PlaceSprdOrderAlgoService) SetTag(tag string) *PlaceSprdOrderAlgoService
SetTag sets an order tag.
func (*PlaceSprdOrderAlgoService) SetTimeInterval ¶
func (s *PlaceSprdOrderAlgoService) SetTimeInterval(timeInterval string) *PlaceSprdOrderAlgoService
SetTimeInterval sets the order interval in seconds (TWAP).
type PlaceSprdOrderService ¶
type PlaceSprdOrderService struct {
// contains filtered or unexported fields
}
PlaceSprdOrderService -- POST /api/v5/sprd/order (Trade)
Places a spread order. sprdId, side, ordType and sz are required; px is required for limit / post_only / ioc orders.
func (*PlaceSprdOrderService) Do ¶
func (s *PlaceSprdOrderService) Do(ctx context.Context) (*SprdOrderAck, error)
func (*PlaceSprdOrderService) SetClOrdId ¶
func (s *PlaceSprdOrderService) SetClOrdId(clOrdId string) *PlaceSprdOrderService
SetClOrdId sets a client-supplied order id.
func (*PlaceSprdOrderService) SetPx ¶
func (s *PlaceSprdOrderService) SetPx(px string) *PlaceSprdOrderService
SetPx sets the order price (required for limit / post_only / ioc).
func (*PlaceSprdOrderService) SetTag ¶
func (s *PlaceSprdOrderService) SetTag(tag string) *PlaceSprdOrderService
SetTag sets an order tag.
type Platform24Volume ¶
type Platform24Volume struct {
VolumeUSD decimal.Decimal `json:"volUsd"`
VolumeCNY decimal.Decimal `json:"volCny"`
Timestamp time.Time `json:"ts"`
}
Platform24Volume is the platform-wide 24h trading volume in CNY and USD.
type PosMode ¶
type PosMode string
PosMode is the account-wide position mode (long/short hedging vs net).
type PosSide ¶
type PosSide string
PosSide is a position side. "net" is used in net mode; "long"/"short" in long/short mode.
type Position ¶
type Position struct {
InstrumentType InstType `json:"instType"`
MarginMode MgnMode `json:"mgnMode"`
PositionID string `json:"posId"`
PositionSide PosSide `json:"posSide"`
Position decimal.Decimal `json:"pos"`
BaseBalance decimal.Decimal `json:"baseBal"`
QuoteBalance decimal.Decimal `json:"quoteBal"`
BaseBorrowed decimal.Decimal `json:"baseBorrowed"`
BaseInterest decimal.Decimal `json:"baseInterest"`
QuoteBorrowed decimal.Decimal `json:"quoteBorrowed"`
QuoteInterest decimal.Decimal `json:"quoteInterest"`
PositionCurrency string `json:"posCcy"`
AvailablePosition decimal.Decimal `json:"availPos"`
AveragePrice decimal.Decimal `json:"avgPx"`
NonSettleAveragePrice decimal.Decimal `json:"nonSettleAvgPx"`
MarkPrice decimal.Decimal `json:"markPx"`
UPL decimal.Decimal `json:"upl"`
UPLRatio decimal.Decimal `json:"uplRatio"`
UPLLastPrice decimal.Decimal `json:"uplLastPx"`
UPLRatioLastPrice decimal.Decimal `json:"uplRatioLastPx"`
InstrumentID string `json:"instId"`
Leverage decimal.Decimal `json:"lever"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
IMR decimal.Decimal `json:"imr"`
Margin decimal.Decimal `json:"margin"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
MMR decimal.Decimal `json:"mmr"`
Liability decimal.Decimal `json:"liab"`
LiabilityCurrency string `json:"liabCcy"`
Interest decimal.Decimal `json:"interest"`
TradeID string `json:"tradeId"`
OptionValue decimal.Decimal `json:"optVal"`
PendingCloseOrderLiabilityValue decimal.Decimal `json:"pendingCloseOrdLiabVal"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
ADL decimal.Decimal `json:"adl"`
Currency string `json:"ccy"`
Last decimal.Decimal `json:"last"`
IndexPrice decimal.Decimal `json:"idxPx"`
USDPrice decimal.Decimal `json:"usdPx"`
BreakEvenPrice decimal.Decimal `json:"bePx"`
DeltaBS decimal.Decimal `json:"deltaBS"`
DeltaPA decimal.Decimal `json:"deltaPA"`
GammaBS decimal.Decimal `json:"gammaBS"`
GammaPA decimal.Decimal `json:"gammaPA"`
ThetaBS decimal.Decimal `json:"thetaBS"`
ThetaPA decimal.Decimal `json:"thetaPA"`
VegaBS decimal.Decimal `json:"vegaBS"`
VegaPA decimal.Decimal `json:"vegaPA"`
SpotInUseAmount decimal.Decimal `json:"spotInUseAmt"`
SpotInUseCurrency string `json:"spotInUseCcy"`
ClientSpotInUseAmount decimal.Decimal `json:"clSpotInUseAmt"`
MaxSpotInUseAmount decimal.Decimal `json:"maxSpotInUseAmt"`
RealizedPnl decimal.Decimal `json:"realizedPnl"`
SettledPnl decimal.Decimal `json:"settledPnl"`
Pnl decimal.Decimal `json:"pnl"`
Fee decimal.Decimal `json:"fee"`
FundingFee decimal.Decimal `json:"fundingFee"`
LiquidationPenalty decimal.Decimal `json:"liqPenalty"`
CloseOrderAlgo []PositionCloseOrderAlgo `json:"closeOrderAlgo"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
BusinessReferenceID string `json:"bizRefId"`
BusinessReferenceType string `json:"bizRefType"`
}
Position is a single open position. The account used to validate this SDK had no open positions, so the field set is modeled from the OKX doc field table.
type PositionBuilder ¶
type PositionBuilder struct {
Equity decimal.Decimal `json:"eq"`
TotalMMR decimal.Decimal `json:"totalMmr"`
TotalIMR decimal.Decimal `json:"totalImr"`
BorrowMMR decimal.Decimal `json:"borrowMmr"`
DerivativesMMR decimal.Decimal `json:"derivMmr"`
MarginRatio decimal.Decimal `json:"marginRatio"`
UPL decimal.Decimal `json:"upl"`
AccountLeverage decimal.Decimal `json:"acctLever"`
Timestamp time.Time `json:"ts"`
Assets []PositionBuilderAsset `json:"assets"`
RiskUnitData []PositionBuilderRiskUnit `json:"riskUnitData"`
Positions []PositionBuilderPosition `json:"positions"`
}
PositionBuilder is the result of a portfolio-margin simulation.
type PositionBuilderAsset ¶
type PositionBuilderAsset struct {
Currency string `json:"ccy"`
AvailableEquity decimal.Decimal `json:"availEq"`
SpotInUse decimal.Decimal `json:"spotInUse"`
BorrowMMR decimal.Decimal `json:"borrowMmr"`
BorrowIMR decimal.Decimal `json:"borrowImr"`
}
PositionBuilderAsset is one asset row of a position-builder simulation.
type PositionBuilderMr1Scenarios ¶
type PositionBuilderMr1Scenarios struct {
VolatilityShockDown map[string]string `json:"volShockDown"`
VolatilitySame map[string]string `json:"volSame"`
VolatilityShockUp map[string]string `json:"volShockUp"`
}
PositionBuilderMr1Scenarios holds the MR1 stress-test P&L grids keyed by price volatility ratio (a "change" -> "value" map per volatility shock direction).
type PositionBuilderMr6FinalResult ¶
type PositionBuilderMr6FinalResult struct {
Pnl decimal.Decimal `json:"pnl"`
SpotShock decimal.Decimal `json:"spotShock"`
}
PositionBuilderMr6FinalResult is the worst-case MR6 scenario.
type PositionBuilderMrFinalResult ¶
type PositionBuilderMrFinalResult struct {
Pnl decimal.Decimal `json:"pnl"`
SpotShock decimal.Decimal `json:"spotShock"`
VolatilityShock string `json:"volShock"`
}
PositionBuilderMrFinalResult is the worst-case MR1 scenario.
type PositionBuilderPortfolio ¶
type PositionBuilderPortfolio struct {
InstrumentID string `json:"instId"`
InstrumentType InstType `json:"instType"`
Amount decimal.Decimal `json:"amt"`
PositionSide PosSide `json:"posSide"`
AveragePrice decimal.Decimal `json:"avgPx"`
MarkPriceBefore decimal.Decimal `json:"markPxBf"`
MarkPrice decimal.Decimal `json:"markPx"`
FloatPnl decimal.Decimal `json:"floatPnl"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
Delta decimal.Decimal `json:"delta"`
Gamma decimal.Decimal `json:"gamma"`
Theta decimal.Decimal `json:"theta"`
Vega decimal.Decimal `json:"vega"`
IsRealPosition bool `json:"isRealPos"`
}
PositionBuilderPortfolio is one instrument within a risk unit (portfolio margin only).
type PositionBuilderPosition ¶
type PositionBuilderPosition struct {
InstrumentID string `json:"instId"`
InstrumentType InstType `json:"instType"`
Amount decimal.Decimal `json:"amt"`
PositionSide PosSide `json:"posSide"`
AveragePrice decimal.Decimal `json:"avgPx"`
MarkPriceBefore decimal.Decimal `json:"markPxBf"`
MarkPrice decimal.Decimal `json:"markPx"`
FloatPnl decimal.Decimal `json:"floatPnl"`
IMRBefore decimal.Decimal `json:"imrBf"`
IMR decimal.Decimal `json:"imr"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
Leverage decimal.Decimal `json:"lever"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
IsRealPosition bool `json:"isRealPos"`
}
PositionBuilderPosition is one position row (multi-currency margin only).
type PositionBuilderRiskUnit ¶
type PositionBuilderRiskUnit struct {
RiskUnit string `json:"riskUnit"`
MMRBefore decimal.Decimal `json:"mmrBf"`
MMR decimal.Decimal `json:"mmr"`
IMRBefore decimal.Decimal `json:"imrBf"`
IMR decimal.Decimal `json:"imr"`
UPL decimal.Decimal `json:"upl"`
Mr1 decimal.Decimal `json:"mr1"`
Mr2 decimal.Decimal `json:"mr2"`
Mr3 decimal.Decimal `json:"mr3"`
Mr4 decimal.Decimal `json:"mr4"`
Mr5 decimal.Decimal `json:"mr5"`
Mr6 decimal.Decimal `json:"mr6"`
Mr7 decimal.Decimal `json:"mr7"`
Mr8 decimal.Decimal `json:"mr8"`
Mr9 decimal.Decimal `json:"mr9"`
Mr1Scenarios PositionBuilderMr1Scenarios `json:"mr1Scenarios"`
Mr1FinalResult PositionBuilderMrFinalResult `json:"mr1FinalResult"`
Mr6FinalResult PositionBuilderMr6FinalResult `json:"mr6FinalResult"`
Delta decimal.Decimal `json:"delta"`
Gamma decimal.Decimal `json:"gamma"`
Theta decimal.Decimal `json:"theta"`
Vega decimal.Decimal `json:"vega"`
Portfolios []PositionBuilderPortfolio `json:"portfolios"`
}
PositionBuilderRiskUnit is one risk-unit row of a position-builder simulation.
type PositionBuilderService ¶
type PositionBuilderService struct {
// contains filtered or unexported fields
}
PositionBuilderService -- POST /api/v5/account/position-builder (Read)
Simulates portfolio-margin risk for a hypothetical set of positions and assets, returning the resulting margin requirements and greeks. This is a read-only simulation that does not change account state.
func (*PositionBuilderService) Do ¶
func (s *PositionBuilderService) Do(ctx context.Context) (*PositionBuilder, error)
func (*PositionBuilderService) SetAcctLv ¶
func (s *PositionBuilderService) SetAcctLv(acctLv string) *PositionBuilderService
SetAcctLv sets the simulated account mode.
func (*PositionBuilderService) SetGreeksType ¶
func (s *PositionBuilderService) SetGreeksType(greeksType GreeksType) *PositionBuilderService
SetGreeksType sets the greeks display type.
func (*PositionBuilderService) SetIdxVol ¶
func (s *PositionBuilderService) SetIdxVol(idxVol string) *PositionBuilderService
SetIdxVol sets the index volatility used for the stress-test scenarios.
func (*PositionBuilderService) SetInclRealPosAndEq ¶
func (s *PositionBuilderService) SetInclRealPosAndEq(incl bool) *PositionBuilderService
SetInclRealPosAndEq includes the account's real positions and equity in the simulation.
func (*PositionBuilderService) SetLever ¶
func (s *PositionBuilderService) SetLever(lever string) *PositionBuilderService
SetLever sets the simulated leverage.
func (*PositionBuilderService) SetSimAsset ¶
func (s *PositionBuilderService) SetSimAsset(simAsset []PositionBuilderSimAsset) *PositionBuilderService
SetSimAsset sets the simulated assets.
func (*PositionBuilderService) SetSimPos ¶
func (s *PositionBuilderService) SetSimPos(simPos []PositionBuilderSimPos) *PositionBuilderService
SetSimPos sets the simulated positions.
type PositionBuilderSimAsset ¶
PositionBuilderSimAsset is a simulated asset fed to the position builder.
type PositionBuilderSimPos ¶
type PositionBuilderSimPos struct {
InstrumentID string `json:"instId"`
Position string `json:"pos"`
AveragePrice string `json:"avgPx,omitempty"`
Leverage string `json:"lever,omitempty"`
}
PositionBuilderSimPos is a simulated position fed to the position builder.
type PositionCloseOrderAlgo ¶
type PositionCloseOrderAlgo struct {
AlgoID string `json:"algoId"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
StopLossTriggerPriceType string `json:"slTriggerPxType"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType"`
CloseFraction decimal.Decimal `json:"closeFraction"`
}
PositionCloseOrderAlgo is a take-profit / stop-loss algo order attached to a position.
type PositionHistory ¶
type PositionHistory struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
MarginMode MgnMode `json:"mgnMode"`
Type string `json:"type"`
Currency string `json:"ccy"`
PositionID string `json:"posId"`
PositionSide PosSide `json:"posSide"`
Direction string `json:"direction"`
Leverage decimal.Decimal `json:"lever"`
OpenAveragePrice decimal.Decimal `json:"openAvgPx"`
CloseAveragePrice decimal.Decimal `json:"closeAvgPx"`
NonSettleAveragePrice decimal.Decimal `json:"nonSettleAvgPx"`
OpenMaxPosition decimal.Decimal `json:"openMaxPos"`
CloseTotalPosition decimal.Decimal `json:"closeTotalPos"`
Pnl decimal.Decimal `json:"pnl"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
RealizedPnl decimal.Decimal `json:"realizedPnl"`
SettledPnl decimal.Decimal `json:"settledPnl"`
Fee decimal.Decimal `json:"fee"`
FundingFee decimal.Decimal `json:"fundingFee"`
LiquidationPenalty decimal.Decimal `json:"liqPenalty"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
Underlying string `json:"uly"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
PositionHistory is one closed-position record.
type PositionMode ¶
type PositionMode struct {
PositionMode PosMode `json:"posMode"`
}
PositionMode is the set-position-mode acknowledgement.
type PositionTier ¶
type PositionTier struct {
Underlying string `json:"uly"`
InstrumentFamily string `json:"instFamily"`
InstrumentID string `json:"instId"`
Tier string `json:"tier"`
MinSize decimal.Decimal `json:"minSz"`
MaxSize decimal.Decimal `json:"maxSz"`
MMR decimal.Decimal `json:"mmr"`
IMR decimal.Decimal `json:"imr"`
MaxLeverage decimal.Decimal `json:"maxLever"`
OptionMarginFactor decimal.Decimal `json:"optMgnFactor"`
QuoteMaxLoan decimal.Decimal `json:"quoteMaxLoan"`
BaseMaxLoan decimal.Decimal `json:"baseMaxLoan"`
}
PositionTier is one row of the position-tier schedule.
type PremiumHistory ¶
type PremiumHistory struct {
InstrumentID string `json:"instId"`
Premium decimal.Decimal `json:"premium"`
Timestamp time.Time `json:"ts"`
}
PremiumHistory is one premium-index record.
type PriceLimit ¶
type PriceLimit struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
BuyLimit decimal.Decimal `json:"buyLmt"`
SellLimit decimal.Decimal `json:"sellLmt"`
Enabled bool `json:"enabled"`
Timestamp time.Time `json:"ts"`
}
PriceLimit is an instrument's buy/sell price limits.
type PurchaseEthStakingService ¶
type PurchaseEthStakingService struct {
// contains filtered or unexported fields
}
PurchaseEthStakingService -- POST /api/v5/finance/staking-defi/eth/purchase (Trade)
Stakes ETH (receiving BETH). State-changing: implement-only.
func (*PurchaseEthStakingService) Do ¶
func (s *PurchaseEthStakingService) Do(ctx context.Context) (*EthStakingAck, error)
type PurchaseSolStakingService ¶
type PurchaseSolStakingService struct {
// contains filtered or unexported fields
}
PurchaseSolStakingService -- POST /api/v5/finance/staking-defi/sol/purchase (Trade)
Stakes SOL (receiving OKSOL). State-changing: implement-only.
func (*PurchaseSolStakingService) Do ¶
func (s *PurchaseSolStakingService) Do(ctx context.Context) (*SolStakingAck, error)
type PurchaseStakingService ¶
type PurchaseStakingService struct {
// contains filtered or unexported fields
}
PurchaseStakingService -- POST /api/v5/finance/staking-defi/purchase (Trade)
Subscribes to an on-chain earn offer. State-changing: implement-only, never executed by the SDK's test suite.
func (*PurchaseStakingService) Do ¶
func (s *PurchaseStakingService) Do(ctx context.Context) (*StakingOrderAck, error)
func (*PurchaseStakingService) SetTag ¶
func (s *PurchaseStakingService) SetTag(tag string) *PurchaseStakingService
SetTag sets an order tag (brokerId-issued label).
func (*PurchaseStakingService) SetTerm ¶
func (s *PurchaseStakingService) SetTerm(term string) *PurchaseStakingService
SetTerm sets the protocol term (required for fixed-term protocols).
type RecurringItem ¶
RecurringItem is one currency allocation within a recurring-buy strategy (used in both the create body and the strategy detail response).
type RecurringOrder ¶
type RecurringOrder struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
InstrumentType InstType `json:"instType"`
Cycles string `json:"cycles"`
StrategyName string `json:"stgyName"`
State RecurringState `json:"state"`
Period RecurringPeriod `json:"period"`
RecurringDay string `json:"recurringDay"`
RecurringHour string `json:"recurringHour"`
RecurringTime string `json:"recurringTime"`
TimeZone string `json:"timeZone"`
Amount decimal.Decimal `json:"amt"`
InvestmentCurrency string `json:"investmentCcy"`
InvestmentAmount decimal.Decimal `json:"investmentAmt"`
TotalPnl decimal.Decimal `json:"totalPnl"`
TotalAnnualRate decimal.Decimal `json:"totalAnnRate"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
MarketCapitalization decimal.Decimal `json:"mktCap"`
TradeMode TdMode `json:"tdMode"`
Tag string `json:"tag"`
RecurringList []RecurringItem `json:"recurringList"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
RecurringOrder is a recurring-buy (DCA) strategy bot.
type RecurringPeriod ¶
type RecurringPeriod string
RecurringPeriod is the cadence at which a recurring-buy strategy invests.
const ( RecurringPeriodMonthly RecurringPeriod = "monthly" RecurringPeriodWeekly RecurringPeriod = "weekly" RecurringPeriodDaily RecurringPeriod = "daily" RecurringPeriodHourly RecurringPeriod = "hourly" )
type RecurringResult ¶
type RecurringResult struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
Tag string `json:"tag"`
}
RecurringResult is the per-item ack of a recurring-buy create/stop op. OKX may set the top-level code to "1" with the real reason in sCode/sMsg.
func (RecurringResult) Err ¶ added in v0.20260623.1
func (r RecurringResult) Err() error
type RecurringState ¶
type RecurringState string
RecurringState is the lifecycle state of a recurring-buy strategy bot.
const ( RecurringStateStarting RecurringState = "starting" RecurringStateRunning RecurringState = "running" RecurringStateStopping RecurringState = "stopping" RecurringStateNotStarted RecurringState = "not_started" RecurringStateStopped RecurringState = "stopped" RecurringStatePause RecurringState = "pause" )
type RecurringSubOrder ¶
type RecurringSubOrder struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
InstrumentType InstType `json:"instType"`
BotID string `json:"botId"`
InstrumentID string `json:"instId"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
OrderType OrdType `json:"ordType"`
Side Side `json:"side"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
State OrdState `json:"state"`
AccumulatedFillSize decimal.Decimal `json:"accFillSz"`
AveragePrice decimal.Decimal `json:"avgPx"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
Tag string `json:"tag"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
RecurringSubOrder is a single underlying order executed by a recurring-buy strategy.
type RedeemEthStakingService ¶
type RedeemEthStakingService struct {
// contains filtered or unexported fields
}
RedeemEthStakingService -- POST /api/v5/finance/staking-defi/eth/redeem (Trade)
Redeems BETH back to ETH. State-changing: implement-only.
func (*RedeemEthStakingService) Do ¶
func (s *RedeemEthStakingService) Do(ctx context.Context) (*EthStakingAck, error)
type RedeemSolStakingService ¶
type RedeemSolStakingService struct {
// contains filtered or unexported fields
}
RedeemSolStakingService -- POST /api/v5/finance/staking-defi/sol/redeem (Trade)
Redeems OKSOL back to SOL. State-changing: implement-only.
func (*RedeemSolStakingService) Do ¶
func (s *RedeemSolStakingService) Do(ctx context.Context) (*SolStakingAck, error)
type RedeemStakingService ¶
type RedeemStakingService struct {
// contains filtered or unexported fields
}
RedeemStakingService -- POST /api/v5/finance/staking-defi/redeem (Trade)
Redeems an active on-chain earn order. State-changing: implement-only.
func (*RedeemStakingService) Do ¶
func (s *RedeemStakingService) Do(ctx context.Context) (*StakingOrderAck, error)
func (*RedeemStakingService) SetAllowEarlyRedeem ¶
func (s *RedeemStakingService) SetAllowEarlyRedeem(allow bool) *RedeemStakingService
SetAllowEarlyRedeem permits early redemption (incurring any applicable cost).
type ResetMMPService ¶
type ResetMMPService struct {
// contains filtered or unexported fields
}
ResetMMPService -- POST /api/v5/account/mmp-reset (Trade)
Resets the Market Maker Protection frozen state of an option instrument family, allowing quoting to resume.
func (*ResetMMPService) SetInstType ¶
func (s *ResetMMPService) SetInstType(instType InstType) *ResetMMPService
SetInstType sets the instrument type (optional).
type ResetRfqMmpService ¶
type ResetRfqMmpService struct {
// contains filtered or unexported fields
}
ResetRfqMmpService -- POST /api/v5/rfq/mmp-reset (Trade)
Resets (unfreezes) the maker's MMP state.
func (*ResetRfqMmpService) Do ¶
func (s *ResetRfqMmpService) Do(ctx context.Context) (*RfqMmpReset, error)
type Rfq ¶
type Rfq struct {
CreateTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
TraderCode string `json:"traderCode"`
RFQID string `json:"rfqId"`
ClientRFQID string `json:"clRfqId"`
State RfqState `json:"state"`
ValidUntil time.Time `json:"validUntil"`
Counterparties []string `json:"counterparties"`
Legs []RfqLeg `json:"legs"`
AllowPartial bool `json:"allowPartialExecution"`
}
Rfq is one RFQ record. The validating account has no RFQ history, so the field set is modeled from the OKX doc field table.
type RfqBlockTicker ¶
type RfqBlockTicker struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
VolumeCurrency24h decimal.Decimal `json:"volCcy24h"`
Volume24h decimal.Decimal `json:"vol24h"`
Timestamp time.Time `json:"ts"`
}
RfqBlockTicker is the 24h block-trade volume snapshot for an instrument.
type RfqCancelAck ¶
type RfqCancelAck struct {
RFQID string `json:"rfqId"`
ClientRFQID string `json:"clRfqId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
RfqCancelAck is the per-item ack of an RFQ cancel.
func (RfqCancelAck) Err ¶ added in v0.20260623.1
func (r RfqCancelAck) Err() error
type RfqCancelAllAfter ¶
type RfqCancelAllAfter struct {
TriggerTime time.Time `json:"triggerTime"`
Timestamp time.Time `json:"ts"`
}
RfqCancelAllAfter is the ack of a cancel-all-after action.
type RfqCounterparty ¶
type RfqCounterparty struct {
TraderName string `json:"traderName"`
TraderCode string `json:"traderCode"`
Type string `json:"type"`
}
RfqCounterparty is one available RFQ counterparty (maker).
type RfqCreateLeg ¶
type RfqCreateLeg struct {
InstrumentID string `json:"instId"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
TargetCurrency TgtCcy `json:"tgtCcy,omitempty"`
PositionSide PosSide `json:"posSide,omitempty"`
}
RfqCreateLeg is one leg supplied when creating an RFQ.
type RfqExecuteLeg ¶
RfqExecuteLeg is one leg supplied when executing a quote.
type RfqLeg ¶
type RfqLeg struct {
InstrumentID string `json:"instId"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
TargetCurrency TgtCcy `json:"tgtCcy"`
PositionSide PosSide `json:"posSide"`
}
RfqLeg is one leg of an RFQ.
type RfqMakerInstrumentSetting ¶
type RfqMakerInstrumentSetting struct {
InstrumentType InstType `json:"instType"`
IncludeALL bool `json:"includeALL"`
Data []RfqMakerInstrumentSettingData `json:"data"`
}
RfqMakerInstrumentSetting is the maker's quoting configuration for one instrument type. The validating account lacks maker permission (50030), so the field set is modeled from the OKX doc field table.
type RfqMakerInstrumentSettingData ¶
type RfqMakerInstrumentSettingData struct {
InstrumentFamily string `json:"instFamily"`
InstrumentID string `json:"instId"`
MaxBlockSize decimal.Decimal `json:"maxBlockSz"`
MakerPriceBand decimal.Decimal `json:"makerPxBand"`
}
RfqMakerInstrumentSettingData is one instrument-family/underlying entry within a maker's quoting configuration.
type RfqMmpConfig ¶
type RfqMmpConfig struct {
TimeInterval decimal.Decimal `json:"timeInterval"`
FrozenInterval decimal.Decimal `json:"frozenInterval"`
CountLimit decimal.Decimal `json:"countLimit"`
MMPFrozen bool `json:"mmpFrozen"`
MMPFrozenUntil time.Time `json:"mmpFrozenUntil"`
}
RfqMmpConfig is the maker's MMP configuration. The validating account lacks maker permission (50030), so the field set is modeled from the OKX doc field table.
type RfqMmpReset ¶
type RfqMmpReset struct {
Result bool `json:"result"`
}
RfqMmpReset is the ack of an MMP reset.
type RfqPublicTrade ¶
type RfqPublicTrade struct {
BlockTradeID string `json:"blockTdId"`
GroupID string `json:"groupId"`
Strategy string `json:"strategy"`
Inverse bool `json:"inverse"`
CreateTime time.Time `json:"cTime"`
Legs []RfqPublicTradeLeg `json:"legs"`
}
RfqPublicTrade is one public block trade.
type RfqPublicTradeLeg ¶
type RfqPublicTradeLeg struct {
InstrumentID string `json:"instId"`
Side Side `json:"side"`
Size decimal.Decimal `json:"sz"`
Price decimal.Decimal `json:"px"`
TradeID string `json:"tradeId"`
}
RfqPublicTradeLeg is one leg of a public block trade.
type RfqQuote ¶
type RfqQuote struct {
CreateTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
TraderCode string `json:"traderCode"`
RFQID string `json:"rfqId"`
ClientRFQID string `json:"clRfqId"`
QuoteID string `json:"quoteId"`
ClientQuoteID string `json:"clQuoteId"`
State RfqQuoteState `json:"state"`
ValidUntil time.Time `json:"validUntil"`
QuoteSide RfqQuoteSide `json:"quoteSide"`
Legs []RfqQuoteLeg `json:"legs"`
}
RfqQuote is one quote record. The validating account has no quote history, so the field set is modeled from the OKX doc field table.
type RfqQuoteCancelAck ¶
type RfqQuoteCancelAck struct {
QuoteID string `json:"quoteId"`
ClientQuoteID string `json:"clQuoteId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
RfqQuoteCancelAck is the per-item ack of a quote cancel.
func (RfqQuoteCancelAck) Err ¶ added in v0.20260623.1
func (r RfqQuoteCancelAck) Err() error
type RfqQuoteCreateLeg ¶
type RfqQuoteCreateLeg struct {
InstrumentID string `json:"instId"`
Size decimal.Decimal `json:"sz"`
Price decimal.Decimal `json:"px"`
Side Side `json:"side"`
TargetCurrency TgtCcy `json:"tgtCcy,omitempty"`
PositionSide PosSide `json:"posSide,omitempty"`
}
RfqQuoteCreateLeg is one leg supplied when creating a quote.
type RfqQuoteLeg ¶
type RfqQuoteLeg struct {
InstrumentID string `json:"instId"`
Size decimal.Decimal `json:"sz"`
Price decimal.Decimal `json:"px"`
Side Side `json:"side"`
TargetCurrency TgtCcy `json:"tgtCcy"`
PositionSide PosSide `json:"posSide"`
}
RfqQuoteLeg is one leg of a quote.
type RfqQuoteProduct ¶
type RfqQuoteProduct struct {
InstrumentType InstType `json:"instType"`
IncludeALL bool `json:"includeALL"`
Data []RfqQuoteProductData `json:"data"`
}
RfqQuoteProduct is one quote-product configuration. The validating account lacks maker permission, so the field set is modeled from the OKX doc field table.
type RfqQuoteProductData ¶
type RfqQuoteProductData struct {
Underlying string `json:"underlying"`
InstrumentFamily string `json:"instFamily"`
InstrumentID string `json:"instId"`
MaxBlockSize decimal.Decimal `json:"maxBlockSz"`
MakerPriceBand decimal.Decimal `json:"makerPxBand"`
}
RfqQuoteProductData is one instrument entry within a quote product.
type RfqQuoteSide ¶
type RfqQuoteSide string
RfqQuoteSide is the side a maker quotes an RFQ on.
const ( RfqQuoteSideBuy RfqQuoteSide = "buy" RfqQuoteSideSell RfqQuoteSide = "sell" )
type RfqQuoteState ¶
type RfqQuoteState string
RfqQuoteState is the lifecycle state of a quote.
const ( RfqQuoteStateActive RfqQuoteState = "active" RfqQuoteStateCanceled RfqQuoteState = "canceled" RfqQuoteStatePendFill RfqQuoteState = "pending_fill" RfqQuoteStateFilled RfqQuoteState = "filled" RfqQuoteStateExpired RfqQuoteState = "expired" RfqQuoteStateFailed RfqQuoteState = "failed" )
type RfqTimestampAck ¶
RfqTimestampAck is the ack of a bulk cancel/reset action, carrying the server timestamp at which the action took effect.
type RfqTrade ¶
type RfqTrade struct {
CreateTime time.Time `json:"cTime"`
RFQID string `json:"rfqId"`
ClientRFQID string `json:"clRfqId"`
QuoteID string `json:"quoteId"`
ClientQuoteID string `json:"clQuoteId"`
BlockTradeID string `json:"blockTdId"`
TakerTraderCode string `json:"tTraderCode"`
MakerTraderCode string `json:"mTraderCode"`
Tag string `json:"tag"`
Legs []RfqTradeLeg `json:"legs"`
}
RfqTrade is one executed block trade. The validating account has no block-trade history, so the field set is modeled from the OKX doc field table.
type RfqTradeLeg ¶
type RfqTradeLeg struct {
InstrumentID string `json:"instId"`
Side Side `json:"side"`
Size decimal.Decimal `json:"sz"`
Price decimal.Decimal `json:"px"`
TradeID string `json:"tradeId"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
TargetCurrency TgtCcy `json:"tgtCcy"`
PositionSide PosSide `json:"posSide"`
}
RfqTradeLeg is one leg of an executed block trade.
type RiskState ¶
type RiskState struct {
AtRisk bool `json:"atRisk"`
AtRiskIndex []string `json:"atRiskIdx"`
AtRiskMargin []string `json:"atRiskMgn"`
Timestamp time.Time `json:"ts"`
}
RiskState is the portfolio-margin account's risk-offset state. The validating account is not in portfolio-margin mode (the endpoint returns 51010), so the field set is modeled from the OKX doc field table.
type RubikOpenInterestHistory ¶
type RubikOpenInterestHistory struct {
Timestamp time.Time `json:"ts"`
OpenInterest decimal.Decimal `json:"oi"`
OpenInterestCurrency decimal.Decimal `json:"oiCcy"`
OpenInterestUSD decimal.Decimal `json:"oiUsd"`
}
RubikOpenInterestHistory is one open-interest-history bar: [ts, oi (contracts), oiCcy (base ccy), oiUsd].
type RubikOpenInterestVolume ¶
type RubikOpenInterestVolume struct {
Timestamp time.Time `json:"ts"`
OpenInterest decimal.Decimal `json:"oi"`
Volume decimal.Decimal `json:"vol"`
}
RubikOpenInterestVolume is one [ts, oi, vol] bar shared by the contract and option open-interest-volume endpoints.
type RubikOpenInterestVolumeExpiry ¶
type RubikOpenInterestVolumeExpiry struct {
Timestamp time.Time `json:"ts"`
ExpiryTime string `json:"expTime"`
CallOpenInterest decimal.Decimal `json:"callOI"`
PutOpenInterest decimal.Decimal `json:"putOI"`
CallVolume decimal.Decimal `json:"callVol"`
PutVolume decimal.Decimal `json:"putVol"`
}
RubikOpenInterestVolumeExpiry is one option-by-expiry bar: [ts, expTime, callOI, putOI, callVol, putVol]. ExpTime is the expiry date in YYYYMMDD form.
type RubikOpenInterestVolumeStrike ¶
type RubikOpenInterestVolumeStrike struct {
Timestamp time.Time `json:"ts"`
Strike decimal.Decimal `json:"strike"`
CallOpenInterest decimal.Decimal `json:"callOI"`
PutOpenInterest decimal.Decimal `json:"putOI"`
CallVolume decimal.Decimal `json:"callVol"`
PutVolume decimal.Decimal `json:"putVol"`
}
RubikOpenInterestVolumeStrike is one option-by-strike bar: [ts, strike, callOI, putOI, callVol, putVol].
type RubikOptionTakerBlockVolume ¶
type RubikOptionTakerBlockVolume struct {
Timestamp time.Time `json:"ts"`
CallBuyVolume decimal.Decimal `json:"callBuyVol"`
CallSellVolume decimal.Decimal `json:"callSellVol"`
PutBuyVolume decimal.Decimal `json:"putBuyVol"`
PutSellVolume decimal.Decimal `json:"putSellVol"`
CallBlockVolume decimal.Decimal `json:"callBlockVol"`
PutBlockVolume decimal.Decimal `json:"putBlockVol"`
}
RubikOptionTakerBlockVolume is the option taker/block-volume snapshot: [ts, callBuyVol, callSellVol, putBuyVol, putSellVol, callBlockVol, putBlockVol].
type RubikRatio ¶
RubikRatio is one [ts, ratio] bar shared by the loan-ratio and the long/short account/position ratio endpoints.
type RubikStatPeriod ¶
type RubikStatPeriod string
RubikStatPeriod is the bar/aggregation window accepted by the rubik trading-statistics endpoints (e.g. "5m", "1H", "1D"). Each endpoint documents the subset it supports; values are passed through verbatim.
const ( RubikStatPeriod5m RubikStatPeriod = "5m" RubikStatPeriod1H RubikStatPeriod = "1H" RubikStatPeriod1D RubikStatPeriod = "1D" )
type RubikSupportCoin ¶
type RubikSupportCoin struct {
Contract []string `json:"contract"`
Option []string `json:"option"`
Spot []string `json:"spot"`
}
RubikSupportCoin lists the currencies covered by the trading-statistics endpoints, split by product line.
type RubikTakerVolume ¶
type RubikTakerVolume struct {
Timestamp time.Time `json:"ts"`
SellVolume decimal.Decimal `json:"sellVol"`
BuyVolume decimal.Decimal `json:"buyVol"`
}
RubikTakerVolume is one taker-volume bar: [ts, sellVol, buyVol].
type SavingsBalance ¶
type SavingsBalance struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Earnings decimal.Decimal `json:"earnings"`
Rate decimal.Decimal `json:"rate"`
LoanAmount decimal.Decimal `json:"loanAmt"`
PendingAmount decimal.Decimal `json:"pendingAmt"`
RedemptionAmount decimal.Decimal `json:"redemptAmt"`
}
SavingsBalance is one currency's savings balance. The validating account holds no savings (the endpoint returns an empty data array), so the field set is modeled from the OKX doc field table.
type SavingsLendingHistory ¶
type SavingsLendingHistory struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Earnings decimal.Decimal `json:"earnings"`
Rate decimal.Decimal `json:"rate"`
Timestamp time.Time `json:"ts"`
}
SavingsLendingHistory is one savings lending record. The validating account has no lending history (the endpoint returns an empty data array), so the field set is modeled from the OKX doc field table.
type SavingsLendingRate ¶
SavingsLendingRate is the ack of a set-lending-rate action.
type SavingsLendingRateHistory ¶
type SavingsLendingRateHistory struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
LendingRate decimal.Decimal `json:"lendingRate"`
Rate decimal.Decimal `json:"rate"`
Timestamp time.Time `json:"ts"`
}
SavingsLendingRateHistory is one historical lending-rate record.
type SavingsLendingRateSummary ¶
type SavingsLendingRateSummary struct {
Currency string `json:"ccy"`
AverageAmount decimal.Decimal `json:"avgAmt"`
AverageAmountUSD decimal.Decimal `json:"avgAmtUsd"`
AverageRate decimal.Decimal `json:"avgRate"`
PreRate decimal.Decimal `json:"preRate"`
EstimatedRate decimal.Decimal `json:"estRate"`
}
SavingsLendingRateSummary is one currency's lending-rate summary.
type SavingsPurchaseRedemption ¶
type SavingsPurchaseRedemption struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Side SavingsSide `json:"side"`
Rate decimal.Decimal `json:"rate"`
}
SavingsPurchaseRedemption is the ack of a savings purchase/redemption action.
type SavingsSide ¶
type SavingsSide string
SavingsSide selects whether a Simple Earn Flexible (savings) purchase / redemption order is a subscribe (purchase) or a redeem (redempt).
const ( SavingsSidePurchase SavingsSide = "purchase" SavingsSideRedempt SavingsSide = "redempt" )
type SetAccountLevelService ¶
type SetAccountLevelService struct {
// contains filtered or unexported fields
}
SetAccountLevelService -- POST /api/v5/account/set-account-level (Trade)
Sets the account mode (acctLv: "1" spot, "2" spot&futures, "3" multi-currency margin, "4" portfolio margin). DANGEROUS: this changes the whole account's trading mode.
func (*SetAccountLevelService) Do ¶
func (s *SetAccountLevelService) Do(ctx context.Context) (*AccountLevelSetting, error)
type SetAutoLoanService ¶
type SetAutoLoanService struct {
// contains filtered or unexported fields
}
SetAutoLoanService -- POST /api/v5/account/set-auto-loan (Trade)
Enables or disables automatic margin borrowing for the account.
func (*SetAutoLoanService) Do ¶
func (s *SetAutoLoanService) Do(ctx context.Context) (*AutoLoanSetting, error)
type SetAutoRepayService ¶
type SetAutoRepayService struct {
// contains filtered or unexported fields
}
SetAutoRepayService -- POST /api/v5/account/set-auto-repay (Trade)
Enables or disables automatic repayment of spot borrowings.
State-changing: NOT exercised by the test suite.
type SetBorrowRepayService ¶
type SetBorrowRepayService struct {
// contains filtered or unexported fields
}
SetBorrowRepayService -- POST /api/v5/account/borrow-repay (Trade)
Borrows or repays a VIP loan.
State-changing: NOT exercised by the test suite.
func (*SetBorrowRepayService) Do ¶
func (s *SetBorrowRepayService) Do(ctx context.Context) (*BorrowRepay, error)
func (*SetBorrowRepayService) SetOrdId ¶
func (s *SetBorrowRepayService) SetOrdId(ordId string) *SetBorrowRepayService
SetOrdId targets an existing VIP loan order (required when repaying).
type SetCollateralAssetsService ¶
type SetCollateralAssetsService struct {
// contains filtered or unexported fields
}
SetCollateralAssetsService -- POST /api/v5/account/set-collateral-assets (Trade)
Enables or disables assets as collateral, either for all currencies (type "all") or for a custom currency list (type "custom", then set CcyList).
func (*SetCollateralAssetsService) Do ¶
func (s *SetCollateralAssetsService) Do(ctx context.Context) (*CollateralAssetsSetting, error)
func (*SetCollateralAssetsService) SetCcyList ¶
func (s *SetCollateralAssetsService) SetCcyList(ccyList []string) *SetCollateralAssetsService
SetCcyList sets the currency list (required when type is "custom").
type SetCopyLeverageService ¶
type SetCopyLeverageService struct {
// contains filtered or unexported fields
}
SetCopyLeverageService -- POST /api/v5/copytrading/set-leverage (Trade)
Sets the leverage a lead trader uses for one or more instruments.
func (*SetCopyLeverageService) Do ¶
func (s *SetCopyLeverageService) Do(ctx context.Context) ([]CopyBatchLeverageInfo, error)
func (*SetCopyLeverageService) SetInstId ¶
func (s *SetCopyLeverageService) SetInstId(instId string) *SetCopyLeverageService
SetInstId sets the comma-separated instruments to set leverage on.
type SetGreeksService ¶
type SetGreeksService struct {
// contains filtered or unexported fields
}
SetGreeksService -- POST /api/v5/account/set-greeks (Trade)
Sets the display type of option greeks ("PA" in coins or "BS" in dollars).
func (*SetGreeksService) Do ¶
func (s *SetGreeksService) Do(ctx context.Context) (*GreeksSetting, error)
type SetIsolatedModeService ¶
type SetIsolatedModeService struct {
// contains filtered or unexported fields
}
SetIsolatedModeService -- POST /api/v5/account/set-isolated-mode (Trade)
Sets the isolated-margin transfer behaviour (automatic vs autonomy) for the given instrument type (MARGIN or CONTRACTS).
func (*SetIsolatedModeService) Do ¶
func (s *SetIsolatedModeService) Do(ctx context.Context) (*IsolatedModeSetting, error)
type SetLeverageService ¶
type SetLeverageService struct {
// contains filtered or unexported fields
}
SetLeverageService -- POST /api/v5/account/set-leverage (Trade)
Sets the leverage of an instrument or currency. Either instId or ccy is required (instId for an instrument's leverage; ccy for cross-margin currency leverage in Futures mode).
func (*SetLeverageService) Do ¶
func (s *SetLeverageService) Do(ctx context.Context) (*LeverageSetting, error)
func (*SetLeverageService) SetCcy ¶
func (s *SetLeverageService) SetCcy(ccy string) *SetLeverageService
SetCcy sets the currency whose cross-margin leverage is changed (Futures mode).
func (*SetLeverageService) SetInstId ¶
func (s *SetLeverageService) SetInstId(instId string) *SetLeverageService
SetInstId sets the instrument whose leverage is changed.
func (*SetLeverageService) SetPosSide ¶
func (s *SetLeverageService) SetPosSide(posSide PosSide) *SetLeverageService
SetPosSide sets the position side (long/short) for isolated long/short mode.
type SetMMPConfigService ¶
type SetMMPConfigService struct {
// contains filtered or unexported fields
}
SetMMPConfigService -- POST /api/v5/account/mmp-config (Trade)
Sets the Market Maker Protection configuration of an option instrument family.
func (*SetMMPConfigService) Do ¶
func (s *SetMMPConfigService) Do(ctx context.Context) (*MMPConfigSetting, error)
type SetMarginBalanceService ¶
type SetMarginBalanceService struct {
// contains filtered or unexported fields
}
SetMarginBalanceService -- POST /api/v5/account/position/margin-balance (Trade)
Increases or decreases the margin of an isolated position.
func (*SetMarginBalanceService) Do ¶
func (s *SetMarginBalanceService) Do(ctx context.Context) (*MarginBalance, error)
func (*SetMarginBalanceService) SetAuto ¶
func (s *SetMarginBalanceService) SetAuto(auto bool) *SetMarginBalanceService
SetAuto enables automatic loan transfer when reducing margin.
func (*SetMarginBalanceService) SetCcy ¶
func (s *SetMarginBalanceService) SetCcy(ccy string) *SetMarginBalanceService
SetCcy sets the currency (applicable to isolated MARGIN positions).
type SetOKUSDRedeemService ¶ added in v0.20260703.0
type SetOKUSDRedeemService struct {
// contains filtered or unexported fields
}
SetOKUSDRedeemService -- POST /api/v5/finance/okusd/redeem (Trade)
Redeems OKUSD back to USDT, either fast (real-time) or standard (D+5).
State-changing: NOT exercised by the test suite.
func (*SetOKUSDRedeemService) Do ¶ added in v0.20260703.0
func (s *SetOKUSDRedeemService) Do(ctx context.Context) (*OKUSDRedemption, error)
type SetOKUSDSubscribeService ¶ added in v0.20260703.0
type SetOKUSDSubscribeService struct {
// contains filtered or unexported fields
}
SetOKUSDSubscribeService -- POST /api/v5/finance/okusd/subscribe (Trade)
Subscribes USDT to receive OKUSD at a 1:1 rate.
State-changing: NOT exercised by the test suite.
func (*SetOKUSDSubscribeService) Do ¶ added in v0.20260703.0
func (s *SetOKUSDSubscribeService) Do(ctx context.Context) (*OKUSDSubscription, error)
type SetPositionModeService ¶
type SetPositionModeService struct {
// contains filtered or unexported fields
}
SetPositionModeService -- POST /api/v5/account/set-position-mode (Trade)
Sets the account-wide position mode (long/short hedging or net) for derivatives. Single-currency margin accounts only.
func (*SetPositionModeService) Do ¶
func (s *SetPositionModeService) Do(ctx context.Context) (*PositionMode, error)
type SetRfqMakerInstrumentSettingsService ¶
type SetRfqMakerInstrumentSettingsService struct {
// contains filtered or unexported fields
}
SetRfqMakerInstrumentSettingsService -- POST /api/v5/rfq/maker-instrument-settings (Trade)
Sets the maker's per-instrument-type quoting settings.
func (*SetRfqMakerInstrumentSettingsService) Do ¶
func (s *SetRfqMakerInstrumentSettingsService) Do(ctx context.Context) (*RfqMmpReset, error)
type SetRfqMmpService ¶
type SetRfqMmpService struct {
// contains filtered or unexported fields
}
SetRfqMmpService -- POST /api/v5/rfq/set-mmp (Trade)
Sets the maker's MMP (market-maker protection) configuration.
func (*SetRfqMmpService) Do ¶
func (s *SetRfqMmpService) Do(ctx context.Context) (*RfqMmpConfig, error)
type SetRfqQuoteProductsService ¶
type SetRfqQuoteProductsService struct {
// contains filtered or unexported fields
}
SetRfqQuoteProductsService -- POST /api/v5/rfq/set-quote-products (Trade)
Sets the maker's quote products.
func (*SetRfqQuoteProductsService) Do ¶
func (s *SetRfqQuoteProductsService) Do(ctx context.Context) (*RfqMmpReset, error)
type SetSavingsLendingRateService ¶
type SetSavingsLendingRateService struct {
// contains filtered or unexported fields
}
SetSavingsLendingRateService -- POST /api/v5/finance/savings/set-lending-rate (Trade)
Sets the minimum lending rate the account is willing to accept for a savings currency.
State-changing: NOT exercised by the test suite.
func (*SetSavingsLendingRateService) Do ¶
func (s *SetSavingsLendingRateService) Do(ctx context.Context) (*SavingsLendingRate, error)
type SetSavingsPurchaseRedemptionService ¶
type SetSavingsPurchaseRedemptionService struct {
// contains filtered or unexported fields
}
SetSavingsPurchaseRedemptionService -- POST /api/v5/finance/savings/purchase-redemption (Trade)
Subscribes to (purchase) or redeems (redempt) a currency in Simple Earn Flexible savings.
State-changing: NOT exercised by the test suite.
func (*SetSavingsPurchaseRedemptionService) Do ¶
func (s *SetSavingsPurchaseRedemptionService) Do(ctx context.Context) (*SavingsPurchaseRedemption, error)
func (*SetSavingsPurchaseRedemptionService) SetRate ¶
func (s *SetSavingsPurchaseRedemptionService) SetRate(rate decimal.Decimal) *SetSavingsPurchaseRedemptionService
SetRate sets the lending rate (between 0.01 and 3.65, only applicable when subscribing).
type SetSpotManualBorrowRepayService ¶
type SetSpotManualBorrowRepayService struct {
// contains filtered or unexported fields
}
SetSpotManualBorrowRepayService -- POST /api/v5/account/spot-manual-borrow-repay (Trade)
Manually borrows or repays spot in the cross-margin account.
State-changing: NOT exercised by the test suite.
func (*SetSpotManualBorrowRepayService) Do ¶
func (s *SetSpotManualBorrowRepayService) Do(ctx context.Context) (*SpotManualBorrowRepay, error)
type SetSubAccountTransferOutService ¶
type SetSubAccountTransferOutService struct {
// contains filtered or unexported fields
}
SetSubAccountTransferOutService -- POST /api/v5/users/subaccount/set-transfer-out (Trade)
Sets whether a sub-account is permitted to transfer funds out (master account). Implement-only: never executed by the live test suite.
func (*SetSubAccountTransferOutService) Do ¶
func (s *SetSubAccountTransferOutService) Do(ctx context.Context) (*SubAccountTransferOut, error)
type SettlementHistory ¶
type SettlementHistory struct {
Timestamp time.Time `json:"ts"`
Details []SettlementHistoryDetail `json:"details"`
}
SettlementHistory is one settlement event and its per-instrument prices.
type SettlementHistoryDetail ¶
type SettlementHistoryDetail struct {
InstrumentID string `json:"instId"`
SettlePrice decimal.Decimal `json:"settlePx"`
}
SettlementHistoryDetail is a single instrument's settlement price.
type SolStakingAck ¶
type SolStakingAck struct{}
SolStakingAck is the (empty) acknowledgement returned by SOL purchase/redeem.
type SolStakingBalance ¶
type SolStakingBalance struct {
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
LatestInterestAccrual decimal.Decimal `json:"latestInterestAccrual"`
TotalInterestAccrual decimal.Decimal `json:"totalInterestAccrual"`
Timestamp time.Time `json:"ts"`
}
SolStakingBalance is the OKSOL balance and accrued interest.
type SolStakingHistory ¶
type SolStakingHistory struct {
Type string `json:"type"`
Amount decimal.Decimal `json:"amt"`
Status string `json:"status"`
RequestTime time.Time `json:"requestTime"`
CompletedTime time.Time `json:"completedTime"`
EstimatedCompletedTime time.Time `json:"estCompletedTime"`
}
SolStakingHistory is one SOL staking purchase/redemption record. The validating account has no SOL staking history, so the field set is modeled from the OKX doc field table.
type SolStakingProductInfo ¶
type SolStakingProductInfo struct {
FastRedemptionAvailable decimal.Decimal `json:"fastRedemptionAvail"`
FastRedemptionDailyLimit decimal.Decimal `json:"fastRedemptionDailyLimit"`
MinAmount decimal.Decimal `json:"minAmt"`
Rate decimal.Decimal `json:"rate"`
RedemptionDays decimal.Decimal `json:"redemptDays"`
}
SolStakingProductInfo is the SOL staking product configuration.
type SpotBorrowRepayHistory ¶
type SpotBorrowRepayHistory struct {
Currency string `json:"ccy"`
Type string `json:"type"`
Amount decimal.Decimal `json:"amt"`
AccumulatedBorrowed decimal.Decimal `json:"accBorrowed"`
Timestamp time.Time `json:"ts"`
}
SpotBorrowRepayHistory is one spot borrow/repay event.
type SpotManualBorrowRepay ¶
type SpotManualBorrowRepay struct {
Currency string `json:"ccy"`
Side BorrowRepayType `json:"side"`
Amount decimal.Decimal `json:"amt"`
}
SpotManualBorrowRepay is the ack of a manual spot borrow/repay action.
type SprdAlgoAck ¶
type SprdAlgoAck struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
SprdAlgoAck is the acknowledgement of a place / cancel spread algo order.
func (SprdAlgoAck) Err ¶ added in v0.20260623.1
func (r SprdAlgoAck) Err() error
type SprdAlgoOrder ¶
type SprdAlgoOrder struct {
SpreadID string `json:"sprdId"`
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
OrderType string `json:"ordType"`
Side Side `json:"side"`
Size decimal.Decimal `json:"sz"`
SizeLimit decimal.Decimal `json:"szLimit"`
PriceVariation decimal.Decimal `json:"pxVar"`
PriceSpread decimal.Decimal `json:"pxSpread"`
PriceLimit decimal.Decimal `json:"pxLimit"`
TimeInterval string `json:"timeInterval"`
State string `json:"state"`
Tag string `json:"tag"`
UpdateTime time.Time `json:"uTime"`
CreationTime time.Time `json:"cTime"`
}
SprdAlgoOrder is a single spread algo order's state.
type SprdAmendAck ¶
type SprdAmendAck struct {
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
RequestID string `json:"reqId"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
SprdAmendAck is the acknowledgement of an amend spread order request.
func (SprdAmendAck) Err ¶ added in v0.20260623.1
func (r SprdAmendAck) Err() error
type SprdCancelAllAck ¶
type SprdCancelAllAck struct {
TriggerTime time.Time `json:"triggerTime"`
Timestamp time.Time `json:"ts"`
}
SprdCancelAllAck is the acknowledgement of a cancel-all spread orders request.
type SprdCancelAllAfterAck ¶
type SprdCancelAllAfterAck struct {
TriggerTime time.Time `json:"triggerTime"`
Timestamp time.Time `json:"ts"`
}
SprdCancelAllAfterAck is the acknowledgement of a cancel-all-after request.
type SprdCancelAllAfterService ¶
type SprdCancelAllAfterService struct {
// contains filtered or unexported fields
}
SprdCancelAllAfterService -- POST /api/v5/sprd/cancel-all-after (Trade)
Arms or disarms the dead-man's-switch: all pending spread orders are canceled timeOut seconds after the last heartbeat. timeOut of 0 cancels the timer.
func (*SprdCancelAllAfterService) Do ¶
func (s *SprdCancelAllAfterService) Do(ctx context.Context) (*SprdCancelAllAfterAck, error)
type SprdCandle ¶
type SprdCandle struct {
Timestamp time.Time
Open decimal.Decimal
High decimal.Decimal
Low decimal.Decimal
Close decimal.Decimal
Volume decimal.Decimal
Confirm string
}
SprdCandle is one OHLCV candlestick for a spread. The raw response is an array-of-arrays with 7 columns: [ts, o, h, l, c, vol, confirm].
type SprdMassCancelAck ¶
type SprdMassCancelAck struct {
Result bool `json:"result"`
}
SprdMassCancelAck is the acknowledgement of a mass-cancel spread orders request.
type SprdMassCancelOrdersService ¶
type SprdMassCancelOrdersService struct {
// contains filtered or unexported fields
}
SprdMassCancelOrdersService -- POST /api/v5/sprd/mass-cancel (Trade)
Cancels all pending spread orders (mass cancel), optionally scoped to one spread.
func (*SprdMassCancelOrdersService) Do ¶
func (s *SprdMassCancelOrdersService) Do(ctx context.Context) (*SprdMassCancelAck, error)
func (*SprdMassCancelOrdersService) SetSprdId ¶
func (s *SprdMassCancelOrdersService) SetSprdId(sprdId string) *SprdMassCancelOrdersService
SetSprdId scopes the mass cancel to a single spread.
type SprdOrdState ¶
type SprdOrdState string
SprdOrdState is the lifecycle state of a spread order.
const ( SprdOrdStateLive SprdOrdState = "live" SprdOrdStatePartiallyFilled SprdOrdState = "partially_filled" SprdOrdStateFilled SprdOrdState = "filled" SprdOrdStateCanceled SprdOrdState = "canceled" )
type SprdOrdType ¶
type SprdOrdType string
SprdOrdType is a spread order type.
const ( SprdOrdTypeLimit SprdOrdType = "limit" SprdOrdTypeMarket SprdOrdType = "market" SprdOrdTypePostOnly SprdOrdType = "post_only" SprdOrdTypeIOC SprdOrdType = "ioc" )
type SprdOrder ¶
type SprdOrder struct {
SpreadID string `json:"sprdId"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
OrderType SprdOrdType `json:"ordType"`
Side Side `json:"side"`
FillSize decimal.Decimal `json:"fillSz"`
FillPrice decimal.Decimal `json:"fillPx"`
TradeID string `json:"tradeId"`
AccumulatedFillSize decimal.Decimal `json:"accFillSz"`
PendingFillSize decimal.Decimal `json:"pendingFillSz"`
PendingSettleSize decimal.Decimal `json:"pendingSettleSz"`
CanceledSize decimal.Decimal `json:"canceledSz"`
State SprdOrdState `json:"state"`
AveragePrice decimal.Decimal `json:"avgPx"`
CancelSource string `json:"cancelSource"`
UpdateTime time.Time `json:"uTime"`
CreationTime time.Time `json:"cTime"`
}
SprdOrder is a single spread order's full state.
type SprdOrderAck ¶
type SprdOrderAck struct {
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
SCode string `json:"sCode"`
SMsg string `json:"sMsg"`
}
SprdOrderAck is the acknowledgement of a place / amend / cancel spread order.
func (SprdOrderAck) Err ¶ added in v0.20260623.1
func (r SprdOrderAck) Err() error
type SprdOrderBook ¶
type SprdOrderBook struct {
Asks [][]string `json:"asks"`
Bids [][]string `json:"bids"`
Timestamp time.Time `json:"ts"`
}
SprdOrderBook is a spread's order book snapshot. Each ask/bid level is [price, size, numOrders].
type SprdPublicTrade ¶
type SprdPublicTrade struct {
SpreadID string `json:"sprdId"`
TradeID string `json:"tradeId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
Timestamp time.Time `json:"ts"`
}
SprdPublicTrade is a single public trade (taker fill) on a spread.
type SprdSpread ¶
type SprdSpread struct {
SpreadID string `json:"sprdId"`
SpreadType SprdType `json:"sprdType"`
State SprdState `json:"state"`
BaseCurrency string `json:"baseCcy"`
SizeCurrency string `json:"szCcy"`
QuoteCurrency string `json:"quoteCcy"`
TickSize decimal.Decimal `json:"tickSz"`
MinSize decimal.Decimal `json:"minSz"`
LotSize decimal.Decimal `json:"lotSz"`
ListTime time.Time `json:"listTime"`
Legs []SprdLeg `json:"legs"`
ExpiryTime time.Time `json:"expTime"`
UpdateTime time.Time `json:"uTime"`
}
SprdSpread is a single tradable spread and its legs.
type SprdTicker ¶
type SprdTicker struct {
SpreadID string `json:"sprdId"`
Last decimal.Decimal `json:"last"`
LastSize decimal.Decimal `json:"lastSz"`
AskPrice decimal.Decimal `json:"askPx"`
AskSize decimal.Decimal `json:"askSz"`
BidPrice decimal.Decimal `json:"bidPx"`
BidSize decimal.Decimal `json:"bidSz"`
Timestamp time.Time `json:"ts"`
}
SprdTicker is the latest market snapshot for a spread.
type SprdTrade ¶
type SprdTrade struct {
SpreadID string `json:"sprdId"`
TradeID string `json:"tradeId"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
FillPrice decimal.Decimal `json:"fillPx"`
FillSize decimal.Decimal `json:"fillSz"`
Side Side `json:"side"`
State string `json:"state"`
ExecutionType ExecType `json:"execType"`
Timestamp time.Time `json:"ts"`
Legs []SprdTradeLeg `json:"legs"`
Code string `json:"code"`
Message string `json:"msg"`
}
SprdTrade is a single account spread fill, including its per-leg fills.
type SprdTradeLeg ¶
type SprdTradeLeg struct {
InstrumentID string `json:"instId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
SizeContract decimal.Decimal `json:"szCont"`
Side Side `json:"side"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
TradeID string `json:"tradeId"`
}
SprdTradeLeg is one leg fill within a spread trade.
type StakingActiveOrder ¶
type StakingActiveOrder struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
ProductID string `json:"productId"`
State StakingOrderState `json:"state"`
Protocol string `json:"protocol"`
ProtocolType StakingProtocolType `json:"protocolType"`
Term string `json:"term"`
APY decimal.Decimal `json:"apy"`
InvestmentData []StakingOrderInvest `json:"investData"`
EarningData []StakingOrderEarn `json:"earningData"`
PurchasedTime time.Time `json:"purchasedTime"`
EstimatedSettlementTime time.Time `json:"estSettlementTime"`
CancelRedemptionDeadline time.Time `json:"cancelRedemptionDeadline"`
FastRedemptionData []StakingFastRedemption `json:"fastRedemptionData"`
Tag string `json:"tag"`
}
StakingActiveOrder is one active on-chain earn order. The validating account holds no on-chain earn orders, so the field set is modeled from the OKX doc field table.
type StakingApyHistory ¶
type StakingApyHistory struct {
Rate decimal.Decimal `json:"rate"`
Timestamp time.Time `json:"ts"`
}
StakingApyHistory is one daily APY point of the ETH/SOL staking APY history.
type StakingEarningData ¶
type StakingEarningData struct {
Currency string `json:"ccy"`
EarningType string `json:"earningType"`
}
StakingEarningData is one asset earned by an offer and how it is earned.
type StakingFastRedemption ¶
type StakingFastRedemption struct {
Currency string `json:"ccy"`
RedeemingAmount decimal.Decimal `json:"redeemingAmt"`
FastRedemptionAvailable decimal.Decimal `json:"fastRedemptionAvail"`
}
StakingFastRedemption is the fast-redemption availability of an order.
type StakingHistoryOrder ¶
type StakingHistoryOrder struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
ProductID string `json:"productId"`
State StakingOrderState `json:"state"`
Protocol string `json:"protocol"`
ProtocolType StakingProtocolType `json:"protocolType"`
Term string `json:"term"`
APY decimal.Decimal `json:"apy"`
InvestmentData []StakingOrderInvest `json:"investData"`
EarningData []StakingOrderEarn `json:"earningData"`
PurchasedTime time.Time `json:"purchasedTime"`
RedeemedTime time.Time `json:"redeemedTime"`
Tag string `json:"tag"`
}
StakingHistoryOrder is one completed on-chain earn order. The validating account holds no order history, so the field set is modeled from the OKX doc field table.
type StakingInvestData ¶
type StakingInvestData struct {
Balance decimal.Decimal `json:"bal"`
Currency string `json:"ccy"`
MaxAmount decimal.Decimal `json:"maxAmt"`
MinAmount decimal.Decimal `json:"minAmt"`
}
StakingInvestData is one investable currency's balance and amount limits within an offer.
type StakingOffer ¶
type StakingOffer struct {
Currency string `json:"ccy"`
ProductID string `json:"productId"`
Protocol string `json:"protocol"`
ProtocolType StakingProtocolType `json:"protocolType"`
Term string `json:"term"`
APY decimal.Decimal `json:"apy"`
EarlyRedeem bool `json:"earlyRedeem"`
State StakingOfferState `json:"state"`
InvestmentData []StakingInvestData `json:"investData"`
EarningData []StakingEarningData `json:"earningData"`
FastRedemptionDailyLimit decimal.Decimal `json:"fastRedemptionDailyLimit"`
ProjectDisplayName string `json:"projectDisplayName"`
RedeemPeriod []string `json:"redeemPeriod"`
}
StakingOffer is a single on-chain earn offer.
type StakingOfferState ¶
type StakingOfferState string
StakingOfferState is the purchasability state of an on-chain earn offer.
const ( StakingOfferStatePurchasable StakingOfferState = "purchasable" StakingOfferStateSoldOut StakingOfferState = "sold_out" StakingOfferStateStop StakingOfferState = "stop" )
type StakingOrderAck ¶
StakingOrderAck is the acknowledgement returned by purchase/redeem/cancel.
type StakingOrderEarn ¶
type StakingOrderEarn struct {
Currency string `json:"ccy"`
Earnings decimal.Decimal `json:"earnings"`
EarningType string `json:"earningType"`
RealizedEarnings decimal.Decimal `json:"realizedEarnings"`
}
StakingOrderEarn is one earned-asset line of an on-chain earn order.
type StakingOrderInvest ¶
StakingOrderInvest is one invested currency line of an on-chain earn order.
type StakingOrderState ¶
type StakingOrderState string
StakingOrderState is the lifecycle state of an on-chain earn order.
const ( StakingOrderState8 StakingOrderState = "8" // pending StakingOrderState13 StakingOrderState = "13" // cancelling StakingOrderState9 StakingOrderState = "9" // onchain StakingOrderState1 StakingOrderState = "1" // earning StakingOrderState2 StakingOrderState = "2" // redeeming StakingOrderState3 StakingOrderState = "3" // expired )
type StakingProtocolType ¶
type StakingProtocolType string
StakingProtocolType is the on-chain earn protocol category (e.g. "defi").
const ( StakingProtocolTypeDefi StakingProtocolType = "defi" StakingProtocolTypeStaking StakingProtocolType = "staking" )
type StakingPurchaseInvest ¶
StakingPurchaseInvest is one currency+amount line of a purchase request.
type StopCopyCopyTradingService ¶
type StopCopyCopyTradingService struct {
// contains filtered or unexported fields
}
StopCopyCopyTradingService -- POST /api/v5/copytrading/stop-copy-trading (Trade)
Stops copying a lead trader and (per subPosCloseType) closes or keeps the mirrored positions.
func (*StopCopyCopyTradingService) Do ¶
func (s *StopCopyCopyTradingService) Do(ctx context.Context) (*CopyResult, error)
func (*StopCopyCopyTradingService) SetInstType ¶
func (s *StopCopyCopyTradingService) SetInstType(instType InstType) *StopCopyCopyTradingService
SetInstType sets the product line (SWAP).
type StopCopyLeadTradingService ¶
type StopCopyLeadTradingService struct {
// contains filtered or unexported fields
}
StopCopyLeadTradingService -- POST /api/v5/copytrading/stop-lead-trading (Trade)
Stops being a lead trader (closes lead positions per platform rules).
func (*StopCopyLeadTradingService) Do ¶
func (s *StopCopyLeadTradingService) Do(ctx context.Context) (*CopyResult, error)
func (*StopCopyLeadTradingService) SetInstType ¶
func (s *StopCopyLeadTradingService) SetInstType(instType InstType) *StopCopyLeadTradingService
SetInstType sets the product line (SWAP).
type StopGridAlgoOrderService ¶
type StopGridAlgoOrderService struct {
// contains filtered or unexported fields
}
StopGridAlgoOrderService -- POST /api/v5/tradingBot/grid/stop-order-algo (Trade)
Stops one or more running grid algo orders. The request body is an ARRAY. IMPLEMENT-ONLY.
func (*StopGridAlgoOrderService) Do ¶
func (s *StopGridAlgoOrderService) Do(ctx context.Context) ([]GridResult, error)
type StopRecurringOrderService ¶
type StopRecurringOrderService struct {
// contains filtered or unexported fields
}
StopRecurringOrderService -- POST /api/v5/tradingBot/recurring/stop-order-algo (Trade)
Stops one or more recurring-buy strategies. The request body is an ARRAY of {algoId} objects (max 10).
func (*StopRecurringOrderService) Do ¶
func (s *StopRecurringOrderService) Do(ctx context.Context) ([]RecurringResult, error)
type SubAccount ¶
type SubAccount struct {
Type subAccountType `json:"type"`
Enable bool `json:"enable"`
SubAccount string `json:"subAcct"`
UID string `json:"uid"`
Label string `json:"label"`
Mobile string `json:"mobile"`
GoogleAuth bool `json:"gAuth"`
Frozen bool `json:"frozen"`
CanTransferOut bool `json:"canTransOut"`
FrozenFunc []string `json:"frozenFunc"`
Timestamp time.Time `json:"ts"`
}
SubAccount is a single sub-account.
type SubAccountApiKey ¶
type SubAccountApiKey struct {
SubAccount string `json:"subAcct"`
Label string `json:"label"`
APIKey string `json:"apiKey"`
SecretKey string `json:"secretKey"`
Perm string `json:"perm"`
IP string `json:"ip"`
Timestamp time.Time `json:"ts"`
}
SubAccountApiKey is a sub-account API key and its permissions.
type SubAccountBill ¶
type SubAccountBill struct {
BillID string `json:"billId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Type string `json:"type"`
SubAccount string `json:"subAcct"`
Timestamp time.Time `json:"ts"`
}
SubAccountBill is one master<->sub funding transfer record.
type SubAccountFundingBalance ¶
type SubAccountFundingBalance struct {
Currency string `json:"ccy"`
Balance decimal.Decimal `json:"bal"`
FrozenBalance decimal.Decimal `json:"frozenBal"`
AvailableBalance decimal.Decimal `json:"availBal"`
}
SubAccountFundingBalance is one currency's funding-account balance within a sub-account.
type SubAccountMaxWithdrawal ¶
type SubAccountMaxWithdrawal struct {
Currency string `json:"ccy"`
MaxWithdrawal decimal.Decimal `json:"maxWd"`
MaxWdEx decimal.Decimal `json:"maxWdEx"`
SpotOffsetMaxWithdrawal decimal.Decimal `json:"spotOffsetMaxWd"`
SpotOffsetMaxWdEx decimal.Decimal `json:"spotOffsetMaxWdEx"`
}
SubAccountMaxWithdrawal is a currency's maximum withdrawal amounts for a sub-account.
type SubAccountTradingBalance ¶
type SubAccountTradingBalance struct {
AdjustedEquity decimal.Decimal `json:"adjEq"`
BorrowFrozen decimal.Decimal `json:"borrowFroz"`
IMR decimal.Decimal `json:"imr"`
IsolatedEquity decimal.Decimal `json:"isoEq"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
MMR decimal.Decimal `json:"mmr"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
OrderFrozen decimal.Decimal `json:"ordFroz"`
TotalEquity decimal.Decimal `json:"totalEq"`
UpdateTime time.Time `json:"uTime"`
Details []SubAccountTradingBalanceCcy `json:"details"`
}
SubAccountTradingBalance is a sub-account's trading-account balance summary.
type SubAccountTradingBalanceCcy ¶
type SubAccountTradingBalanceCcy struct {
Currency string `json:"ccy"`
Equity decimal.Decimal `json:"eq"`
CashBalance decimal.Decimal `json:"cashBal"`
UpdateTime time.Time `json:"uTime"`
IsolatedEquity decimal.Decimal `json:"isoEq"`
AvailableEquity decimal.Decimal `json:"availEq"`
DiscountEquity decimal.Decimal `json:"disEq"`
AvailableBalance decimal.Decimal `json:"availBal"`
FrozenBalance decimal.Decimal `json:"frozenBal"`
OrderFrozen decimal.Decimal `json:"ordFrozen"`
Liability decimal.Decimal `json:"liab"`
UPL decimal.Decimal `json:"upl"`
UPLLiability decimal.Decimal `json:"uplLiab"`
CrossLiability decimal.Decimal `json:"crossLiab"`
IsolatedLiability decimal.Decimal `json:"isoLiab"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
Interest decimal.Decimal `json:"interest"`
TWAP decimal.Decimal `json:"twap"`
MaxLoan decimal.Decimal `json:"maxLoan"`
EquityUSD decimal.Decimal `json:"eqUsd"`
NotionalLeverage decimal.Decimal `json:"notionalLever"`
StrategyEquity decimal.Decimal `json:"stgyEq"`
IsolatedUPL decimal.Decimal `json:"isoUpl"`
SpotInUseAmount decimal.Decimal `json:"spotInUseAmt"`
SpotIsolatedBalance decimal.Decimal `json:"spotIsoBal"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
SmtSyncEquity decimal.Decimal `json:"smtSyncEq"`
}
SubAccountTradingBalanceCcy is one currency's balance within a sub-account's trading account.
type SubAccountTransfer ¶
type SubAccountTransfer struct {
TransferID string `json:"transId"`
}
SubAccountTransfer is the sub-account transfer acknowledgement.
type SubAccountTransferOut ¶
type SubAccountTransferOut struct {
SubAccount string `json:"subAcct"`
CanTransferOut bool `json:"canTransOut"`
}
SubAccountTransferOut is the set-transfer-out acknowledgement.
type SubAccountTransferService ¶
type SubAccountTransferService struct {
// contains filtered or unexported fields
}
SubAccountTransferService -- POST /api/v5/asset/subaccount/transfer (Trade)
Transfers funds between the master account and a sub-account, or between two sub-accounts (master account). Implement-only: never executed by the live test suite.
func (*SubAccountTransferService) Do ¶
func (s *SubAccountTransferService) Do(ctx context.Context) (*SubAccountTransfer, error)
func (*SubAccountTransferService) SetLoanTrans ¶
func (s *SubAccountTransferService) SetLoanTrans(loanTrans bool) *SubAccountTransferService
SetLoanTrans sets whether borrowing/repayment is allowed during the transfer.
func (*SubAccountTransferService) SetOmitPosRisk ¶
func (s *SubAccountTransferService) SetOmitPosRisk(omitPosRisk string) *SubAccountTransferService
SetOmitPosRisk sets whether to ignore position risk ("true"/"false").
type SubscribeAccountGreeksService ¶
type SubscribeAccountGreeksService struct {
// contains filtered or unexported fields
}
SubscribeAccountGreeksService -- "account-greeks" channel (private; login).
Pushes the account's per-currency option greeks on change. Activity-driven (empty when the account holds no options).
func (*SubscribeAccountGreeksService) Do ¶
func (s *SubscribeAccountGreeksService) Do(ctx context.Context, cb WsHandler[WsAccountGreeks]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeAccountGreeksService) SetCcy ¶
func (s *SubscribeAccountGreeksService) SetCcy(ccy string) *SubscribeAccountGreeksService
SetCcy limits the push to a single currency.
type SubscribeAccountService ¶
type SubscribeAccountService struct {
// contains filtered or unexported fields
}
SubscribeAccountService -- "account" channel (private; login).
Pushes the trading-account equity snapshot on login, then on balance change.
func (*SubscribeAccountService) SetCcy ¶
func (s *SubscribeAccountService) SetCcy(ccy string) *SubscribeAccountService
SetCcy limits the push to a single settlement currency.
func (*SubscribeAccountService) SetExtraParams ¶
func (s *SubscribeAccountService) SetExtraParams(extraParams string) *SubscribeAccountService
SetExtraParams sets the channel's extraParams JSON (e.g. `{"updateInterval":"0"}` to push on every change rather than on the default interval).
type SubscribeAlgoAdvanceService ¶
type SubscribeAlgoAdvanceService struct {
// contains filtered or unexported fields
}
SubscribeAlgoAdvanceService -- "algo-advance" channel (business; login).
Streams the account's advanced algo (iceberg / twap) orders for a product line. InstId narrows the subscription.
func (*SubscribeAlgoAdvanceService) Do ¶
func (s *SubscribeAlgoAdvanceService) Do(ctx context.Context, cb WsHandler[WsAdvanceAlgoOrder]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeAlgoAdvanceService) SetInstId ¶
func (s *SubscribeAlgoAdvanceService) SetInstId(instId string) *SubscribeAlgoAdvanceService
SetInstId narrows the subscription to a single instrument.
type SubscribeBalanceAndPositionService ¶
type SubscribeBalanceAndPositionService struct {
// contains filtered or unexported fields
}
SubscribeBalanceAndPositionService -- "balance_and_position" channel (private; login).
Pushes a combined balance + position snapshot on login, then incremental updates (with the originating trades) on every balance/position change.
func (*SubscribeBalanceAndPositionService) Do ¶
func (s *SubscribeBalanceAndPositionService) Do(ctx context.Context, cb WsHandler[WsBalanceAndPosition]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeBboTbtService ¶
type SubscribeBboTbtService struct {
// contains filtered or unexported fields
}
SubscribeBboTbtService -- "bbo-tbt" channel (public; no login). Tick-by-tick best bid/offer (1-level book), pushed at ~10ms.
func (*SubscribeBboTbtService) Do ¶
func (s *SubscribeBboTbtService) Do(ctx context.Context, cb WsHandler[WsOrderBook]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeBooks5Service ¶
type SubscribeBooks5Service struct {
// contains filtered or unexported fields
}
SubscribeBooks5Service -- "books5" channel (public; no login). 5-level snapshots pushed at ~100ms.
func (*SubscribeBooks5Service) Do ¶
func (s *SubscribeBooks5Service) Do(ctx context.Context, cb WsHandler[WsOrderBook]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeBooks50L2TbtService ¶
type SubscribeBooks50L2TbtService struct {
// contains filtered or unexported fields
}
SubscribeBooks50L2TbtService -- "books50-l2-tbt" channel (public gateway; login required). Tick-by-tick 50-level book, gated behind a VIP fee tier; without it the subscribe returns code 64003. Action is "snapshot"/"update".
func (*SubscribeBooks50L2TbtService) Do ¶
func (s *SubscribeBooks50L2TbtService) Do(ctx context.Context, cb WsHandler[WsOrderBook]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeBooksL2TbtService ¶
type SubscribeBooksL2TbtService struct {
// contains filtered or unexported fields
}
SubscribeBooksL2TbtService -- "books-l2-tbt" channel (public gateway; login required). Tick-by-tick 400-level book, gated behind a VIP fee tier; without it the subscribe returns code 64003. Action is "snapshot"/"update".
func (*SubscribeBooksL2TbtService) Do ¶
func (s *SubscribeBooksL2TbtService) Do(ctx context.Context, cb WsHandler[WsOrderBook]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeBooksService ¶
type SubscribeBooksService struct {
// contains filtered or unexported fields
}
SubscribeBooksService -- "books" channel (public; no login). 400-level book: the first push is a "snapshot" (push.Action), subsequent pushes are "update".
func (*SubscribeBooksService) Do ¶
func (s *SubscribeBooksService) Do(ctx context.Context, cb WsHandler[WsOrderBook]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeCandleService ¶
type SubscribeCandleService struct {
// contains filtered or unexported fields
}
SubscribeCandleService -- "candle{bar}" channel (business; public).
Streams the instrument's candlesticks at the given bar (e.g. "1m", "1H", "1D", "1Dutc"). The channel name is "candle"+bar; the payload is an array-of-arrays, delivered as parsed WsCandle rows.
func (*SubscribeCandleService) Do ¶
func (s *SubscribeCandleService) Do(ctx context.Context, cb WsCandleHandler) (chan<- struct{}, <-chan struct{}, error)
type SubscribeEconomicCalendarService ¶
type SubscribeEconomicCalendarService struct {
// contains filtered or unexported fields
}
SubscribeEconomicCalendarService -- "economic-calendar" channel (business; login).
Streams macro-economic calendar event updates. Access requires a sufficient trading-fee tier (OKX rejects lower tiers with code 64003).
func (*SubscribeEconomicCalendarService) Do ¶
func (s *SubscribeEconomicCalendarService) Do(ctx context.Context, cb WsHandler[WsEconomicCalendar]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeFundingRateService ¶
type SubscribeFundingRateService struct {
// contains filtered or unexported fields
}
SubscribeFundingRateService -- "funding-rate" channel (public; no login).
func (*SubscribeFundingRateService) Do ¶
func (s *SubscribeFundingRateService) Do(ctx context.Context, cb WsHandler[WsFundingRate]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeGridOrdersContractService ¶
type SubscribeGridOrdersContractService struct {
// contains filtered or unexported fields
}
SubscribeGridOrdersContractService -- "grid-orders-contract" channel (business; login).
Streams the account's contract grid algo orders for a product line. InstId narrows the subscription.
func (*SubscribeGridOrdersContractService) Do ¶
func (s *SubscribeGridOrdersContractService) Do(ctx context.Context, cb WsHandler[WsGridOrder]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeGridOrdersContractService) SetInstId ¶
func (s *SubscribeGridOrdersContractService) SetInstId(instId string) *SubscribeGridOrdersContractService
SetInstId narrows the subscription to a single instrument.
type SubscribeGridOrdersMoonService ¶
type SubscribeGridOrdersMoonService struct {
// contains filtered or unexported fields
}
SubscribeGridOrdersMoonService -- "grid-orders-moon" channel (business; login).
Streams the account's moon grid algo orders for a product line. InstId narrows the subscription.
func (*SubscribeGridOrdersMoonService) Do ¶
func (s *SubscribeGridOrdersMoonService) Do(ctx context.Context, cb WsHandler[WsGridOrder]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeGridOrdersMoonService) SetInstId ¶
func (s *SubscribeGridOrdersMoonService) SetInstId(instId string) *SubscribeGridOrdersMoonService
SetInstId narrows the subscription to a single instrument.
type SubscribeGridOrdersSpotService ¶
type SubscribeGridOrdersSpotService struct {
// contains filtered or unexported fields
}
SubscribeGridOrdersSpotService -- "grid-orders-spot" channel (business; login).
Streams the account's spot grid algo orders for a product line. InstId narrows the subscription.
func (*SubscribeGridOrdersSpotService) Do ¶
func (s *SubscribeGridOrdersSpotService) Do(ctx context.Context, cb WsHandler[WsGridOrder]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeGridOrdersSpotService) SetInstId ¶
func (s *SubscribeGridOrdersSpotService) SetInstId(instId string) *SubscribeGridOrdersSpotService
SetInstId narrows the subscription to a single instrument.
type SubscribeGridPositionsService ¶
type SubscribeGridPositionsService struct {
// contains filtered or unexported fields
}
SubscribeGridPositionsService -- "grid-positions" channel (business; login).
Streams the open positions of a contract grid algo order, keyed by algoId.
func (*SubscribeGridPositionsService) Do ¶
func (s *SubscribeGridPositionsService) Do(ctx context.Context, cb WsHandler[WsGridPosition]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeGridSubOrdersService ¶
type SubscribeGridSubOrdersService struct {
// contains filtered or unexported fields
}
SubscribeGridSubOrdersService -- "grid-sub-orders" channel (business; login).
Streams the sub-orders (working legs) of a grid algo order, keyed by algoId.
func (*SubscribeGridSubOrdersService) Do ¶
func (s *SubscribeGridSubOrdersService) Do(ctx context.Context, cb WsHandler[WsGridSubOrder]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeIndexCandleService ¶
type SubscribeIndexCandleService struct {
// contains filtered or unexported fields
}
SubscribeIndexCandleService -- "index-candle{bar}" channel (business; public).
Streams the index's candlesticks at the given bar. The channel name is "index-candle"+bar; the payload is a 6-column array-of-arrays, delivered as parsed WsIndexCandle rows.
func (*SubscribeIndexCandleService) Do ¶
func (s *SubscribeIndexCandleService) Do(ctx context.Context, cb WsIndexCandleHandler) (chan<- struct{}, <-chan struct{}, error)
type SubscribeIndexTickersService ¶
type SubscribeIndexTickersService struct {
// contains filtered or unexported fields
}
SubscribeIndexTickersService -- "index-tickers" channel (public; no login).
func (*SubscribeIndexTickersService) Do ¶
func (s *SubscribeIndexTickersService) Do(ctx context.Context, cb WsHandler[WsIndexTicker]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeInstrumentsService ¶
type SubscribeInstrumentsService struct {
// contains filtered or unexported fields
}
SubscribeInstrumentsService -- "instruments" channel (public; no login).
func (*SubscribeInstrumentsService) Do ¶
func (s *SubscribeInstrumentsService) Do(ctx context.Context, cb WsHandler[WsInstrument]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeLiquidationOrdersService ¶
type SubscribeLiquidationOrdersService struct {
// contains filtered or unexported fields
}
SubscribeLiquidationOrdersService -- "liquidation-orders" channel (public; no login). Forced-liquidation fills for a product line; infrequent.
func (*SubscribeLiquidationOrdersService) Do ¶
func (s *SubscribeLiquidationOrdersService) Do(ctx context.Context, cb WsHandler[WsLiquidationOrder]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeLiquidationWarningService ¶
type SubscribeLiquidationWarningService struct {
// contains filtered or unexported fields
}
SubscribeLiquidationWarningService -- "liquidation-warning" channel (private; login).
Pushes when a position approaches liquidation. instType is required. Activity-driven (no snapshot unless a position is at risk).
func (*SubscribeLiquidationWarningService) Do ¶
func (s *SubscribeLiquidationWarningService) Do(ctx context.Context, cb WsHandler[WsLiquidationWarning]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeLiquidationWarningService) SetInstFamily ¶
func (s *SubscribeLiquidationWarningService) SetInstFamily(instFamily string) *SubscribeLiquidationWarningService
SetInstFamily narrows the push to one instrument family.
func (*SubscribeLiquidationWarningService) SetInstId ¶
func (s *SubscribeLiquidationWarningService) SetInstId(instId string) *SubscribeLiquidationWarningService
SetInstId narrows the push to one instrument.
type SubscribeMarkPriceCandleService ¶
type SubscribeMarkPriceCandleService struct {
// contains filtered or unexported fields
}
SubscribeMarkPriceCandleService -- "mark-price-candle{bar}" channel (business; public).
Streams the instrument's mark-price candlesticks at the given bar. The channel name is "mark-price-candle"+bar; the payload is a 6-column array-of-arrays, delivered as parsed WsIndexCandle rows.
func (*SubscribeMarkPriceCandleService) Do ¶
func (s *SubscribeMarkPriceCandleService) Do(ctx context.Context, cb WsIndexCandleHandler) (chan<- struct{}, <-chan struct{}, error)
type SubscribeMarkPriceService ¶
type SubscribeMarkPriceService struct {
// contains filtered or unexported fields
}
SubscribeMarkPriceService -- "mark-price" channel (public; no login).
func (*SubscribeMarkPriceService) Do ¶
func (s *SubscribeMarkPriceService) Do(ctx context.Context, cb WsHandler[WsMarkPrice]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeOpenInterestService ¶
type SubscribeOpenInterestService struct {
// contains filtered or unexported fields
}
SubscribeOpenInterestService -- "open-interest" channel (public; no login).
func (*SubscribeOpenInterestService) Do ¶
func (s *SubscribeOpenInterestService) Do(ctx context.Context, cb WsHandler[WsOpenInterest]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeOrdersAlgoService ¶
type SubscribeOrdersAlgoService struct {
// contains filtered or unexported fields
}
SubscribeOrdersAlgoService -- "orders-algo" channel (business; login).
Streams the account's conditional / oco / trigger / move_order_stop algo orders for a product line. InstFamily/InstId narrow the subscription.
func (*SubscribeOrdersAlgoService) Do ¶
func (s *SubscribeOrdersAlgoService) Do(ctx context.Context, cb WsHandler[WsAlgoOrder]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribeOrdersAlgoService) SetInstFamily ¶
func (s *SubscribeOrdersAlgoService) SetInstFamily(instFamily string) *SubscribeOrdersAlgoService
SetInstFamily narrows the subscription to an instrument family.
func (*SubscribeOrdersAlgoService) SetInstId ¶
func (s *SubscribeOrdersAlgoService) SetInstId(instId string) *SubscribeOrdersAlgoService
SetInstId narrows the subscription to a single instrument.
type SubscribeOrdersService ¶
type SubscribeOrdersService struct {
// contains filtered or unexported fields
}
SubscribeOrdersService -- "orders" channel (private; login).
Pushes on order create / amend / fill / cancel. Activity-driven (no snapshot).
func (*SubscribeOrdersService) SetInstFamily ¶
func (s *SubscribeOrdersService) SetInstFamily(instFamily string) *SubscribeOrdersService
SetInstFamily narrows the push to one instrument family.
func (*SubscribeOrdersService) SetInstId ¶
func (s *SubscribeOrdersService) SetInstId(instId string) *SubscribeOrdersService
SetInstId narrows the push to one instrument.
type SubscribePositionsService ¶
type SubscribePositionsService struct {
// contains filtered or unexported fields
}
SubscribePositionsService -- "positions" channel (private; login).
Pushes the open-positions snapshot on login (empty array when none), then on every position change. instType is required; pass InstTypeAny for all.
func (*SubscribePositionsService) Do ¶
func (s *SubscribePositionsService) Do(ctx context.Context, cb WsHandler[WsPosition]) (chan<- struct{}, <-chan struct{}, error)
func (*SubscribePositionsService) SetInstFamily ¶
func (s *SubscribePositionsService) SetInstFamily(instFamily string) *SubscribePositionsService
SetInstFamily narrows the push to one instrument family.
func (*SubscribePositionsService) SetInstId ¶
func (s *SubscribePositionsService) SetInstId(instId string) *SubscribePositionsService
SetInstId narrows the push to one instrument.
type SubscribePriceLimitService ¶
type SubscribePriceLimitService struct {
// contains filtered or unexported fields
}
SubscribePriceLimitService -- "price-limit" channel (public; no login).
func (*SubscribePriceLimitService) Do ¶
func (s *SubscribePriceLimitService) Do(ctx context.Context, cb WsHandler[WsPriceLimit]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeSprdBooks5Service ¶
type SubscribeSprdBooks5Service struct {
// contains filtered or unexported fields
}
SubscribeSprdBooks5Service -- "sprd-books5" channel (business; public).
func (*SubscribeSprdBooks5Service) Do ¶
func (s *SubscribeSprdBooks5Service) Do(ctx context.Context, cb WsHandler[WsSprdBooks]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeSprdCandleService ¶
type SubscribeSprdCandleService struct {
// contains filtered or unexported fields
}
SubscribeSprdCandleService -- "sprd-candle{bar}" channel (business; public).
Streams a spread's candlesticks at the given bar. The channel name is "sprd-candle"+bar; the payload is a 7-column array-of-arrays, delivered as parsed WsSprdCandle rows.
func (*SubscribeSprdCandleService) Do ¶
func (s *SubscribeSprdCandleService) Do(ctx context.Context, cb WsSprdCandleHandler) (chan<- struct{}, <-chan struct{}, error)
type SubscribeSprdPublicTradesService ¶
type SubscribeSprdPublicTradesService struct {
// contains filtered or unexported fields
}
SubscribeSprdPublicTradesService -- "sprd-public-trades" channel (business; public).
func (*SubscribeSprdPublicTradesService) Do ¶
func (s *SubscribeSprdPublicTradesService) Do(ctx context.Context, cb WsHandler[WsSprdPublicTrade]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeSprdTickersService ¶
type SubscribeSprdTickersService struct {
// contains filtered or unexported fields
}
SubscribeSprdTickersService -- "sprd-tickers" channel (business; public).
func (*SubscribeSprdTickersService) Do ¶
func (s *SubscribeSprdTickersService) Do(ctx context.Context, cb WsHandler[WsSprdTicker]) (chan<- struct{}, <-chan struct{}, error)
type SubscribeStatusService ¶
type SubscribeStatusService struct {
// contains filtered or unexported fields
}
SubscribeStatusService -- "status" channel (public; no login). System maintenance announcements; pushes only around maintenance windows.
type SubscribeTickersService ¶
type SubscribeTickersService struct {
// contains filtered or unexported fields
}
SubscribeTickersService -- "tickers" channel (public; no login).
type SubscribeTradesService ¶
type SubscribeTradesService struct {
// contains filtered or unexported fields
}
SubscribeTradesService -- "trades" channel (public; no login).
type SurplusLmtDetails ¶
type SurplusLmtDetails struct {
AllAccountRemainingQuota decimal.Decimal `json:"allAcctRemainingQuota"`
CurrentAccountRemainingQuota decimal.Decimal `json:"curAcctRemainingQuota"`
PlatformRemainingQuota decimal.Decimal `json:"platRemainingQuota"`
}
SurplusLmtDetails breaks the surplus borrowing limit down by its binding constraint. OKX returns it as an empty object when no limit is currently constraining the currency.
type SystemStatus ¶
type SystemStatus struct {
Title string `json:"title"`
State SystemStatusState `json:"state"`
Begin time.Time `json:"begin"`
End time.Time `json:"end"`
PreOpenBegin time.Time `json:"preOpenBegin"`
Href string `json:"href"`
ServiceType string `json:"serviceType"`
System string `json:"system"`
ScheduleDescription string `json:"scheDesc"`
MaintenanceType string `json:"maintType"`
Env string `json:"env"`
}
SystemStatus is one OKX system maintenance window.
type SystemStatusState ¶
type SystemStatusState string
SystemStatusState is the lifecycle state of a system maintenance window.
const ( SystemStatusStateScheduled SystemStatusState = "scheduled" SystemStatusStateOngoing SystemStatusState = "ongoing" SystemStatusStatePreOpen SystemStatusState = "pre_open" SystemStatusStateCompleted SystemStatusState = "completed" SystemStatusStateCanceled SystemStatusState = "canceled" )
type SystemTime ¶
SystemTime is the OKX server time.
type TgtCcy ¶
type TgtCcy string
TgtCcy selects whether a spot market order's size is denominated in the base or the quote currency.
type TickBand ¶
type TickBand struct {
MinPrice decimal.Decimal `json:"minPx"`
MaxPrice decimal.Decimal `json:"maxPx"`
TickSize decimal.Decimal `json:"tickSz"`
}
TickBand is one price range and its applicable tick size.
type Ticker ¶
type Ticker struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Last decimal.Decimal `json:"last"`
LastSize decimal.Decimal `json:"lastSz"`
AskPrice decimal.Decimal `json:"askPx"`
AskSize decimal.Decimal `json:"askSz"`
BidPrice decimal.Decimal `json:"bidPx"`
BidSize decimal.Decimal `json:"bidSz"`
Open24h decimal.Decimal `json:"open24h"`
High24h decimal.Decimal `json:"high24h"`
Low24h decimal.Decimal `json:"low24h"`
VolumeCurrency24h decimal.Decimal `json:"volCcy24h"`
Volume24h decimal.Decimal `json:"vol24h"`
StartOfDayUTC0 decimal.Decimal `json:"sodUtc0"`
StartOfDayUTC8 decimal.Decimal `json:"sodUtc8"`
Timestamp time.Time `json:"ts"`
}
Ticker is the latest market snapshot for an instrument.
type Trade ¶
type Trade struct {
InstrumentID string `json:"instId"`
TradeID string `json:"tradeId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
// Source is the trade source. "1": RPI (Retail Price Improvement) order —
// previously documented as ELP order; the returned value itself is
// unchanged by the ELP->RPI rebranding.
Source string `json:"source"`
Timestamp time.Time `json:"ts"`
}
Trade is a single public trade (taker fill) on an instrument.
type TradeFee ¶
type TradeFee struct {
InstrumentType InstType `json:"instType"`
Level string `json:"level"`
Taker decimal.Decimal `json:"taker"`
Maker decimal.Decimal `json:"maker"`
TakerUSDT decimal.Decimal `json:"takerU"`
MakerUSDT decimal.Decimal `json:"makerU"`
TakerUSDC decimal.Decimal `json:"takerUSDC"`
MakerUSDC decimal.Decimal `json:"makerUSDC"`
Delivery decimal.Decimal `json:"delivery"`
Exercise decimal.Decimal `json:"exercise"`
Settle decimal.Decimal `json:"settle"`
Category string `json:"category"`
RuleType string `json:"ruleType"`
FeeGroup []TradeFeeGroup `json:"feeGroup"`
Fiat []TradeFeeFiat `json:"fiat"`
Timestamp time.Time `json:"ts"`
}
TradeFee is the account's fee schedule for a product line.
type TradeFeeFiat ¶
type TradeFeeFiat struct {
Currency string `json:"ccy"`
Maker decimal.Decimal `json:"maker"`
Taker decimal.Decimal `json:"taker"`
}
TradeFeeFiat is one fiat currency's maker/taker rates.
type TradeFeeGroup ¶
type TradeFeeGroup struct {
GroupID string `json:"groupId"`
Maker decimal.Decimal `json:"maker"`
Taker decimal.Decimal `json:"taker"`
// ElpMaker is the ELP (Enhanced Liquidity Program) maker fee rate. OKX is
// rebranding ELP to RPI (Retail Price Improvement); the json key stays
// "elpMaker" until the old names retire on 2026-10-31, when it becomes
// "rpiMaker".
ElpMaker decimal.Decimal `json:"elpMaker"`
}
TradeFeeGroup is one fee group's maker/taker rates.
type TradeOneClickRepayService ¶
type TradeOneClickRepayService struct {
// contains filtered or unexported fields
}
TradeOneClickRepayService -- POST /api/v5/trade/one-click-repay (Trade)
Repays up to five debt currencies using a single repay currency. State-changing: implemented but never executed by tests.
func (*TradeOneClickRepayService) Do ¶
func (s *TradeOneClickRepayService) Do(ctx context.Context) ([]OneClickRepayResult, error)
type TradeOneClickRepayV2Service ¶
type TradeOneClickRepayV2Service struct {
// contains filtered or unexported fields
}
TradeOneClickRepayV2Service -- POST /api/v5/trade/one-click-repay-v2 (Trade)
Repays a single debt currency using a prioritized list of repay currencies. State-changing: implemented but never executed by tests.
func (*TradeOneClickRepayV2Service) Do ¶
func (s *TradeOneClickRepayV2Service) Do(ctx context.Context) ([]OneClickRepayResultV2, error)
type TransferState ¶
type TransferState struct {
TransferID string `json:"transId"`
ClientID string `json:"clientId"`
Currency string `json:"ccy"`
Amount decimal.Decimal `json:"amt"`
Type AssetTransferType `json:"type"`
From AssetAcctType `json:"from"`
To AssetAcctType `json:"to"`
SubAccount string `json:"subAcct"`
InstrumentID string `json:"instId"`
ToInstrumentID string `json:"toInstId"`
State string `json:"state"`
}
TransferState is the status of a funds transfer.
type VipInterestAccrued ¶
type VipInterestAccrued struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
Interest decimal.Decimal `json:"interest"`
InterestRate decimal.Decimal `json:"interestRate"`
Liability decimal.Decimal `json:"liab"`
Timestamp time.Time `json:"ts"`
}
VipInterestAccrued is one VIP-loan accrued-interest record.
type VipInterestDeducted ¶
type VipInterestDeducted struct {
OrderID string `json:"ordId"`
Currency string `json:"ccy"`
Interest decimal.Decimal `json:"interest"`
InterestRate decimal.Decimal `json:"interestRate"`
Liability decimal.Decimal `json:"liab"`
Timestamp time.Time `json:"ts"`
}
VipInterestDeducted is one VIP-loan interest-deduction record.
type VipLoanOrder ¶
type VipLoanOrder struct {
OrderID string `json:"ordId"`
State VipLoanState `json:"state"`
Currency string `json:"ccy"`
BorrowAmount decimal.Decimal `json:"borrowAmt"`
CurrentRate decimal.Decimal `json:"curRate"`
DueAmount decimal.Decimal `json:"dueAmt"`
RepayAmount decimal.Decimal `json:"repayAmt"`
Interest decimal.Decimal `json:"interest"`
Timestamp time.Time `json:"ts"`
}
VipLoanOrder is one VIP loan order summary.
type VipLoanOrderDetail ¶
type VipLoanOrderDetail struct {
Currency string `json:"ccy"`
CurrentRate decimal.Decimal `json:"curRate"`
DueAmount decimal.Decimal `json:"dueAmt"`
TotalRepayAmount decimal.Decimal `json:"totalRepayAmt"`
TotalInterest decimal.Decimal `json:"totalInterest"`
Timestamp time.Time `json:"ts"`
BorrowAmount decimal.Decimal `json:"borrowAmt"`
RepayAmount decimal.Decimal `json:"repayAmt"`
List []VipLoanOrderDetailEvent `json:"list"`
}
VipLoanOrderDetail is the per-event detail of a VIP loan order.
type VipLoanOrderDetailEvent ¶
type VipLoanOrderDetailEvent struct {
Type BorrowRepayType `json:"type"`
Amount decimal.Decimal `json:"amt"`
Currency string `json:"ccy"`
Timestamp time.Time `json:"ts"`
}
VipLoanOrderDetailEvent is one borrow/repay/interest event within a VIP loan order's history.
type VipLoanState ¶
type VipLoanState string
VipLoanState is the lifecycle state of a VIP loan order.
const ( VipLoanStateBorrowing VipLoanState = "1" VipLoanStateBorrowed VipLoanState = "2" VipLoanStatePartiallyRepaid VipLoanState = "3" VipLoanStateRepaid VipLoanState = "4" VipLoanStateRepaying VipLoanState = "5" )
type WebSocketClient ¶
type WebSocketClient struct {
*client.WebSocketClient
}
WebSocketClient streams OKX v5 public, private and business channels. Public channels need no credentials; private and (private) business channels require WithWebSocketAuth and log in automatically.
func NewWebSocketClient ¶
func NewWebSocketClient(options ...client.WebSocketOptions) *WebSocketClient
NewWebSocketClient constructs an OKX v5 WebSocket client.
func (*WebSocketClient) DialTrade ¶
func (c *WebSocketClient) DialTrade(ctx context.Context) (*WsTradeConn, error)
DialTrade dials the private gateway, logs in, and returns a ready order-entry connection. The caller must Close it.
func (*WebSocketClient) NewSubscribeAccountGreeksService ¶
func (c *WebSocketClient) NewSubscribeAccountGreeksService() *SubscribeAccountGreeksService
func (*WebSocketClient) NewSubscribeAccountService ¶
func (c *WebSocketClient) NewSubscribeAccountService() *SubscribeAccountService
func (*WebSocketClient) NewSubscribeAlgoAdvanceService ¶
func (c *WebSocketClient) NewSubscribeAlgoAdvanceService(instType InstType) *SubscribeAlgoAdvanceService
func (*WebSocketClient) NewSubscribeBalanceAndPositionService ¶
func (c *WebSocketClient) NewSubscribeBalanceAndPositionService() *SubscribeBalanceAndPositionService
func (*WebSocketClient) NewSubscribeBboTbtService ¶
func (c *WebSocketClient) NewSubscribeBboTbtService(instId string) *SubscribeBboTbtService
func (*WebSocketClient) NewSubscribeBooks5Service ¶
func (c *WebSocketClient) NewSubscribeBooks5Service(instId string) *SubscribeBooks5Service
func (*WebSocketClient) NewSubscribeBooks50L2TbtService ¶
func (c *WebSocketClient) NewSubscribeBooks50L2TbtService(instId string) *SubscribeBooks50L2TbtService
func (*WebSocketClient) NewSubscribeBooksL2TbtService ¶
func (c *WebSocketClient) NewSubscribeBooksL2TbtService(instId string) *SubscribeBooksL2TbtService
func (*WebSocketClient) NewSubscribeBooksService ¶
func (c *WebSocketClient) NewSubscribeBooksService(instId string) *SubscribeBooksService
func (*WebSocketClient) NewSubscribeCandleService ¶
func (c *WebSocketClient) NewSubscribeCandleService(instId, bar string) *SubscribeCandleService
func (*WebSocketClient) NewSubscribeEconomicCalendarService ¶
func (c *WebSocketClient) NewSubscribeEconomicCalendarService() *SubscribeEconomicCalendarService
func (*WebSocketClient) NewSubscribeFundingRateService ¶
func (c *WebSocketClient) NewSubscribeFundingRateService(instId string) *SubscribeFundingRateService
func (*WebSocketClient) NewSubscribeGridOrdersContractService ¶
func (c *WebSocketClient) NewSubscribeGridOrdersContractService(instType InstType) *SubscribeGridOrdersContractService
func (*WebSocketClient) NewSubscribeGridOrdersMoonService ¶
func (c *WebSocketClient) NewSubscribeGridOrdersMoonService(instType InstType) *SubscribeGridOrdersMoonService
func (*WebSocketClient) NewSubscribeGridOrdersSpotService ¶
func (c *WebSocketClient) NewSubscribeGridOrdersSpotService(instType InstType) *SubscribeGridOrdersSpotService
func (*WebSocketClient) NewSubscribeGridPositionsService ¶
func (c *WebSocketClient) NewSubscribeGridPositionsService(algoId string) *SubscribeGridPositionsService
func (*WebSocketClient) NewSubscribeGridSubOrdersService ¶
func (c *WebSocketClient) NewSubscribeGridSubOrdersService(algoId string) *SubscribeGridSubOrdersService
func (*WebSocketClient) NewSubscribeIndexCandleService ¶
func (c *WebSocketClient) NewSubscribeIndexCandleService(instId, bar string) *SubscribeIndexCandleService
func (*WebSocketClient) NewSubscribeIndexTickersService ¶
func (c *WebSocketClient) NewSubscribeIndexTickersService(instId string) *SubscribeIndexTickersService
func (*WebSocketClient) NewSubscribeInstrumentsService ¶
func (c *WebSocketClient) NewSubscribeInstrumentsService(instType InstType) *SubscribeInstrumentsService
func (*WebSocketClient) NewSubscribeLiquidationOrdersService ¶
func (c *WebSocketClient) NewSubscribeLiquidationOrdersService(instType InstType) *SubscribeLiquidationOrdersService
func (*WebSocketClient) NewSubscribeLiquidationWarningService ¶
func (c *WebSocketClient) NewSubscribeLiquidationWarningService(instType InstType) *SubscribeLiquidationWarningService
func (*WebSocketClient) NewSubscribeMarkPriceCandleService ¶
func (c *WebSocketClient) NewSubscribeMarkPriceCandleService(instId, bar string) *SubscribeMarkPriceCandleService
func (*WebSocketClient) NewSubscribeMarkPriceService ¶
func (c *WebSocketClient) NewSubscribeMarkPriceService(instId string) *SubscribeMarkPriceService
func (*WebSocketClient) NewSubscribeOpenInterestService ¶
func (c *WebSocketClient) NewSubscribeOpenInterestService(instId string) *SubscribeOpenInterestService
func (*WebSocketClient) NewSubscribeOrdersAlgoService ¶
func (c *WebSocketClient) NewSubscribeOrdersAlgoService(instType InstType) *SubscribeOrdersAlgoService
func (*WebSocketClient) NewSubscribeOrdersService ¶
func (c *WebSocketClient) NewSubscribeOrdersService(instType InstType) *SubscribeOrdersService
func (*WebSocketClient) NewSubscribePositionsService ¶
func (c *WebSocketClient) NewSubscribePositionsService(instType InstType) *SubscribePositionsService
func (*WebSocketClient) NewSubscribePriceLimitService ¶
func (c *WebSocketClient) NewSubscribePriceLimitService(instId string) *SubscribePriceLimitService
func (*WebSocketClient) NewSubscribeSprdBooks5Service ¶
func (c *WebSocketClient) NewSubscribeSprdBooks5Service(sprdId string) *SubscribeSprdBooks5Service
func (*WebSocketClient) NewSubscribeSprdCandleService ¶
func (c *WebSocketClient) NewSubscribeSprdCandleService(sprdId, bar string) *SubscribeSprdCandleService
func (*WebSocketClient) NewSubscribeSprdPublicTradesService ¶
func (c *WebSocketClient) NewSubscribeSprdPublicTradesService(sprdId string) *SubscribeSprdPublicTradesService
func (*WebSocketClient) NewSubscribeSprdTickersService ¶
func (c *WebSocketClient) NewSubscribeSprdTickersService(sprdId string) *SubscribeSprdTickersService
func (*WebSocketClient) NewSubscribeStatusService ¶
func (c *WebSocketClient) NewSubscribeStatusService() *SubscribeStatusService
func (*WebSocketClient) NewSubscribeTickersService ¶
func (c *WebSocketClient) NewSubscribeTickersService(instId string) *SubscribeTickersService
func (*WebSocketClient) NewSubscribeTradesService ¶
func (c *WebSocketClient) NewSubscribeTradesService(instId string) *SubscribeTradesService
func (*WebSocketClient) Subscribe ¶
func (c *WebSocketClient) Subscribe(ctx context.Context, gateway request.Gateway, private bool, arg request.WsArg, cb func([]byte, error)) (chan<- struct{}, <-chan struct{}, error)
Subscribe is the low-level escape hatch: it subscribes to an arbitrary channel on the given gateway (request.GatewayPublic / GatewayPrivate / GatewayBusiness) and delivers each data push's raw bytes. Prefer the typed NewSubscribe* services; use this for channels the SDK does not yet wrap.
type WithdrawGridIncomeService ¶
type WithdrawGridIncomeService struct {
// contains filtered or unexported fields
}
WithdrawGridIncomeService -- POST /api/v5/tradingBot/grid/withdraw-income (Trade)
Withdraws the realized grid profit of a spot grid to the trading account. IMPLEMENT-ONLY.
func (*WithdrawGridIncomeService) Do ¶
func (s *WithdrawGridIncomeService) Do(ctx context.Context) (*GridWithdrawIncomeResult, error)
type Withdrawal ¶
type Withdrawal struct {
Currency string `json:"ccy"`
Chain string `json:"chain"`
Amount decimal.Decimal `json:"amt"`
WithdrawalID string `json:"wdId"`
ClientID string `json:"clientId"`
}
Withdrawal is the acknowledgement of a submitted withdrawal.
type WithdrawalHistory ¶
type WithdrawalHistory struct {
Currency string `json:"ccy"`
Chain string `json:"chain"`
NonTradableAsset bool `json:"nonTradableAsset"`
Amount decimal.Decimal `json:"amt"`
Timestamp time.Time `json:"ts"`
From string `json:"from"`
AreaCodeFrom string `json:"areaCodeFrom"`
To string `json:"to"`
AreaCodeTo string `json:"areaCodeTo"`
Memo string `json:"memo"`
ToAddressType string `json:"toAddrType"`
TransactionID string `json:"txId"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
State string `json:"state"`
WithdrawalID string `json:"wdId"`
ClientID string `json:"clientId"`
Note string `json:"note"`
}
WithdrawalHistory is one withdrawal record.
type WithdrawalService ¶
type WithdrawalService struct {
// contains filtered or unexported fields
}
WithdrawalService -- POST /api/v5/asset/withdrawal (private)
Submits a withdrawal (on-chain or internal). IMPLEMENT-ONLY: this withdraws real funds and must NEVER be executed.
func (*WithdrawalService) Do ¶
func (s *WithdrawalService) Do(ctx context.Context) (*Withdrawal, error)
func (*WithdrawalService) SetAreaCode ¶
func (s *WithdrawalService) SetAreaCode(areaCode string) *WithdrawalService
SetAreaCode sets the mobile area code (required for some internal withdrawals).
func (*WithdrawalService) SetChain ¶
func (s *WithdrawalService) SetChain(chain string) *WithdrawalService
SetChain sets the chain (e.g. "USDT-ERC20"); required for on-chain withdrawals of multi-chain currencies.
func (*WithdrawalService) SetClientId ¶
func (s *WithdrawalService) SetClientId(clientId string) *WithdrawalService
SetClientId sets a client-supplied withdrawal id.
func (*WithdrawalService) SetFee ¶
func (s *WithdrawalService) SetFee(fee decimal.Decimal) *WithdrawalService
SetFee sets the network fee (on-chain only).
func (*WithdrawalService) SetRcvrInfo ¶
func (s *WithdrawalService) SetRcvrInfo(rcvrInfo any) *WithdrawalService
SetRcvrInfo sets the recipient information (required by some jurisdictions).
type WsAccount ¶
type WsAccount struct {
UpdateTime time.Time `json:"uTime"`
TotalEquity decimal.Decimal `json:"totalEq"`
IsolatedEquity decimal.Decimal `json:"isoEq"`
AdjustedEquity decimal.Decimal `json:"adjEq"`
AvailableEquity decimal.Decimal `json:"availEq"`
OrderFrozen decimal.Decimal `json:"ordFroz"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
BorrowFrozen decimal.Decimal `json:"borrowFroz"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
NotionalUSDForBorrow decimal.Decimal `json:"notionalUsdForBorrow"`
NotionalUSDForSwap decimal.Decimal `json:"notionalUsdForSwap"`
NotionalUSDForFutures decimal.Decimal `json:"notionalUsdForFutures"`
NotionalUSDForOption decimal.Decimal `json:"notionalUsdForOption"`
UPL decimal.Decimal `json:"upl"`
Delta decimal.Decimal `json:"delta"`
DeltaLeverage decimal.Decimal `json:"deltaLever"`
DeltaNeutralStatus string `json:"deltaNeutralStatus"`
Details []WsAccountDetail `json:"details"`
}
WsAccount is one "account" channel push: account-level equity plus per-currency details. It mirrors the REST Balance but is the WebSocket variant (it adds coinUsdPrice/frpType per detail and omits some REST-only fields).
type WsAccountDetail ¶
type WsAccountDetail struct {
Currency string `json:"ccy"`
Equity decimal.Decimal `json:"eq"`
CashBalance decimal.Decimal `json:"cashBal"`
UpdateTime time.Time `json:"uTime"`
IsolatedEquity decimal.Decimal `json:"isoEq"`
AvailableEquity decimal.Decimal `json:"availEq"`
DiscountEquity decimal.Decimal `json:"disEq"`
FixedBalance decimal.Decimal `json:"fixedBal"`
AvailableBalance decimal.Decimal `json:"availBal"`
FrozenBalance decimal.Decimal `json:"frozenBal"`
OrderFrozen decimal.Decimal `json:"ordFrozen"`
Liability decimal.Decimal `json:"liab"`
UPL decimal.Decimal `json:"upl"`
UPLLiability decimal.Decimal `json:"uplLiab"`
CrossLiability decimal.Decimal `json:"crossLiab"`
IsolatedLiability decimal.Decimal `json:"isoLiab"`
RewardBalance decimal.Decimal `json:"rewardBal"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
Interest decimal.Decimal `json:"interest"`
TWAP decimal.Decimal `json:"twap"`
MaxLoan decimal.Decimal `json:"maxLoan"`
EquityUSD decimal.Decimal `json:"eqUsd"`
CoinUSDPrice decimal.Decimal `json:"coinUsdPrice"`
BorrowFrozen decimal.Decimal `json:"borrowFroz"`
NotionalLeverage decimal.Decimal `json:"notionalLever"`
StrategyEquity decimal.Decimal `json:"stgyEq"`
IsolatedUPL decimal.Decimal `json:"isoUpl"`
SpotInUseAmount decimal.Decimal `json:"spotInUseAmt"`
ClientSpotInUseAmount decimal.Decimal `json:"clSpotInUseAmt"`
MaxSpotInUseAmount decimal.Decimal `json:"maxSpotInUseAmt"`
SpotIsolatedBalance decimal.Decimal `json:"spotIsoBal"`
SmtSyncEquity decimal.Decimal `json:"smtSyncEq"`
SpotCopyTradingEquity decimal.Decimal `json:"spotCopyTradingEq"`
SpotBalance decimal.Decimal `json:"spotBal"`
OpenAveragePrice decimal.Decimal `json:"openAvgPx"`
AccumulatedAveragePrice decimal.Decimal `json:"accAvgPx"`
SpotUPL decimal.Decimal `json:"spotUpl"`
SpotUPLRatio decimal.Decimal `json:"spotUplRatio"`
TotalPnl decimal.Decimal `json:"totalPnl"`
TotalPnlRatio decimal.Decimal `json:"totalPnlRatio"`
CollateralEnabled bool `json:"collateralEnabled"`
CollateralRestrict bool `json:"collateralRestrict"`
CollateralBorrowAutoConversion decimal.Decimal `json:"colBorrAutoConversion"`
ColRes string `json:"colRes"`
AutoLendStatus string `json:"autoLendStatus"`
AutoLendAmount decimal.Decimal `json:"autoLendAmt"`
AutoLendMatchedAmount decimal.Decimal `json:"autoLendMtAmt"`
AutoStakingStatus string `json:"autoStakingStatus"`
FrpType string `json:"frpType"`
}
WsAccountDetail is one currency's balance within an "account" push.
type WsAccountGreeks ¶
type WsAccountGreeks struct {
Currency string `json:"ccy"`
DeltaBS decimal.Decimal `json:"deltaBS"`
DeltaPA decimal.Decimal `json:"deltaPA"`
GammaBS decimal.Decimal `json:"gammaBS"`
GammaPA decimal.Decimal `json:"gammaPA"`
ThetaBS decimal.Decimal `json:"thetaBS"`
ThetaPA decimal.Decimal `json:"thetaPA"`
VegaBS decimal.Decimal `json:"vegaBS"`
VegaPA decimal.Decimal `json:"vegaPA"`
Timestamp time.Time `json:"ts"`
}
WsAccountGreeks is one currency's aggregated option greeks from the "account-greeks" channel. The validating account held no options, so the field set is modeled from the OKX channel field table.
type WsAdvanceAlgoOrder ¶
type WsAdvanceAlgoOrder struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
OrderID string `json:"ordId"`
AlgoID string `json:"algoId"`
ClientOrderID string `json:"clOrdId"`
AlgoClientOrderID string `json:"algoClOrdId"`
Size decimal.Decimal `json:"sz"`
OrderType AlgoOrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
TargetCurrency TgtCcy `json:"tgtCcy"`
State AlgoState `json:"state"`
Leverage decimal.Decimal `json:"lever"`
PriceVariation decimal.Decimal `json:"pxVar"`
PriceSpread decimal.Decimal `json:"pxSpread"`
PriceLimit decimal.Decimal `json:"pxLimit"`
SizeLimit decimal.Decimal `json:"szLimit"`
TimeInterval string `json:"timeInterval"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
OrderPrice decimal.Decimal `json:"ordPx"`
ActualSize decimal.Decimal `json:"actualSz"`
ActualPrice decimal.Decimal `json:"actualPx"`
ActualSide string `json:"actualSide"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
TriggerTime time.Time `json:"triggerTime"`
Tag string `json:"tag"`
Count string `json:"count"`
Last decimal.Decimal `json:"last"`
FailCode string `json:"failCode"`
AmendResult string `json:"amendResult"`
RequestID string `json:"reqId"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
WsAdvanceAlgoOrder is a single advanced algo (iceberg / twap / grid) order pushed by the "algo-advance" channel. The validating account had no advanced algo orders, so the field set is modeled from the OKX WS doc field table for the algo-advance channel.
type WsAlgoOrder ¶
type WsAlgoOrder struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
OrderID string `json:"ordId"`
AlgoID string `json:"algoId"`
ClientOrderID string `json:"clOrdId"`
AlgoClientOrderID string `json:"algoClOrdId"`
Size decimal.Decimal `json:"sz"`
OrderType AlgoOrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
TargetCurrency TgtCcy `json:"tgtCcy"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
OrderPrice decimal.Decimal `json:"ordPx"`
Price decimal.Decimal `json:"px"`
State AlgoState `json:"state"`
Leverage decimal.Decimal `json:"lever"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
StopLossTriggerPriceType string `json:"slTriggerPxType"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
TriggerPriceType string `json:"triggerPxType"`
OrderPriceType string `json:"ordPxType"`
ActualSize decimal.Decimal `json:"actualSz"`
ActualPrice decimal.Decimal `json:"actualPx"`
ActualSide string `json:"actualSide"`
TriggerTime time.Time `json:"triggerTime"`
Tag string `json:"tag"`
ReduceOnly string `json:"reduceOnly"`
Last decimal.Decimal `json:"last"`
FailCode string `json:"failCode"`
AmendResult string `json:"amendResult"`
RequestID string `json:"reqId"`
AmendPriceOnTriggerType string `json:"amendPxOnTriggerType"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
WsAlgoOrder is a single algo (conditional / oco / trigger / move_order_stop) order pushed by the "orders-algo" channel. The validating account had no algo orders, so the field set is a union modeled from the OKX WS doc field table for the orders-algo channel.
type WsBalData ¶
type WsBalData struct {
Currency string `json:"ccy"`
CashBalance decimal.Decimal `json:"cashBal"`
UpdateTime time.Time `json:"uTime"`
}
WsBalData is one currency's balance change within a "balance_and_position" push.
type WsBalPosTrade ¶
WsBalPosTrade is one trade that triggered a "balance_and_position" update. The validating account had no live trades, so the field set is modeled from the OKX channel field table.
type WsBalanceAndPosition ¶
type WsBalanceAndPosition struct {
PushTime time.Time `json:"pTime"`
EventType string `json:"eventType"`
BalanceData []WsBalData `json:"balData"`
PositionData []WsPosition `json:"posData"`
Trades []WsBalPosTrade `json:"trades"`
}
WsBalanceAndPosition is one "balance_and_position" push: the publish time, the event type ("snapshot"/"delivered"/"exercised"/"transferred"/"filled"/...), the changed balances, the changed positions and the triggering trades.
type WsCandle ¶
type WsCandle struct {
Timestamp time.Time
Open decimal.Decimal
High decimal.Decimal
Low decimal.Decimal
Close decimal.Decimal
Volume decimal.Decimal
VolumeCurrency decimal.Decimal
VolumeCurrencyQuote decimal.Decimal
Confirm string
}
WsCandle is one OHLCV candlestick pushed by the "candle{bar}" channel. The raw data frame is an array-of-arrays with 9 columns: [ts, o, h, l, c, vol, volCcy, volCcyQuote, confirm].
type WsCandleHandler ¶
WsCandleHandler is invoked for every "candle{bar}" push (or error). The push's data array is parsed into typed WsCandle rows.
type WsEconomicCalendar ¶
type WsEconomicCalendar struct {
CalendarID string `json:"calendarId"`
Date time.Time `json:"date"`
Region string `json:"region"`
Category string `json:"category"`
Event string `json:"event"`
ReferenceDate time.Time `json:"refDate"`
Actual string `json:"actual"`
Previous string `json:"previous"`
Forecast string `json:"forecast"`
DateSpan string `json:"dateSpan"`
Importance EconomicCalendarImportance `json:"importance"`
UpdateTime time.Time `json:"uTime"`
PreviousInitial string `json:"prevInitial"`
Currency string `json:"ccy"`
Unit string `json:"unit"`
}
WsEconomicCalendar is one macro-economic calendar event pushed by the "economic-calendar" channel. Access requires a sufficient trading-fee tier; the field set matches the REST economic-calendar response.
type WsFundingRate ¶
type WsFundingRate struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Method string `json:"method"`
FormulaType string `json:"formulaType"`
FundingRate decimal.Decimal `json:"fundingRate"`
NextFundingRate decimal.Decimal `json:"nextFundingRate"`
FundingTime time.Time `json:"fundingTime"`
NextFundingTime time.Time `json:"nextFundingTime"`
MinFundingRate decimal.Decimal `json:"minFundingRate"`
MaxFundingRate decimal.Decimal `json:"maxFundingRate"`
InterestRate decimal.Decimal `json:"interestRate"`
ImpactValue decimal.Decimal `json:"impactValue"`
SettlementState string `json:"settState"`
SettlementFundingRate decimal.Decimal `json:"settFundingRate"`
Premium decimal.Decimal `json:"premium"`
PreviousFundingTime time.Time `json:"prevFundingTime"`
Timestamp time.Time `json:"ts"`
}
WsFundingRate is a perpetual swap's funding rate pushed on the "funding-rate" channel.
type WsGridOrder ¶
type WsGridOrder struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
AlgoOrderType GridAlgoOrdType `json:"algoOrdType"`
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
CancelType string `json:"cancelType"`
State string `json:"state"`
RunType GridRunType `json:"runType"`
GridNumber decimal.Decimal `json:"gridNum"`
MaxPrice decimal.Decimal `json:"maxPx"`
MinPrice decimal.Decimal `json:"minPx"`
GridProfit decimal.Decimal `json:"gridProfit"`
TotalPnl decimal.Decimal `json:"totalPnl"`
PnlRatio decimal.Decimal `json:"pnlRatio"`
FloatProfit decimal.Decimal `json:"floatProfit"`
TotalAnnualizedRate decimal.Decimal `json:"totalAnnualizedRate"`
AnnualizedRate decimal.Decimal `json:"annualizedRate"`
Investment decimal.Decimal `json:"investment"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
TriggerPrice decimal.Decimal `json:"triggerPx"`
StopType string `json:"stopType"`
StopResult string `json:"stopResult"`
ActiveOrderNumber decimal.Decimal `json:"activeOrdNum"`
Tag string `json:"tag"`
ProfitSharingRatio decimal.Decimal `json:"profitSharingRatio"`
CopyType string `json:"copyType"`
Fee decimal.Decimal `json:"fee"`
FundingFee decimal.Decimal `json:"fundingFee"`
RebateTransfer []GridRebateTrans `json:"rebateTrans"`
TriggerParams []GridTriggerParam `json:"triggerParams"`
TriggerTime time.Time `json:"triggerTime"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
// --- spot/moon grid ("grid"/"moon_grid") ---
BaseSize decimal.Decimal `json:"baseSz"`
QuoteSize decimal.Decimal `json:"quoteSz"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
TradeMode TdMode `json:"tdMode"`
ProfitAndLoss decimal.Decimal `json:"profitAndLoss"`
GridArithmeticGeometric string `json:"gridArithGeo"`
MinTradeFeeRate decimal.Decimal `json:"minTradeFeeRate"`
// --- contract grid ("contract_grid") ---
Direction GridDirection `json:"direction"`
BasePosition bool `json:"basePos"`
Size decimal.Decimal `json:"sz"`
Currency string `json:"ccy"`
Equity decimal.Decimal `json:"eq"`
Underlying string `json:"uly"`
InstrumentFamily string `json:"instFamily"`
Leverage decimal.Decimal `json:"lever"`
TakeProfitRatio decimal.Decimal `json:"tpRatio"`
StopLossRatio decimal.Decimal `json:"slRatio"`
AvailableEquity decimal.Decimal `json:"availEq"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
UPLRatio decimal.Decimal `json:"uplRatio"`
UPL decimal.Decimal `json:"upl"`
TotalInvestment decimal.Decimal `json:"totalInvestment"`
GridInvestment decimal.Decimal `json:"gridInvestment"`
MarginRatio decimal.Decimal `json:"marginRatio"`
Arbitrage decimal.Decimal `json:"arbitrage"`
SingleAmount decimal.Decimal `json:"singleAmt"`
PerMaxProfitRate decimal.Decimal `json:"perMaxProfitRate"`
PerMinProfitRate decimal.Decimal `json:"perMinProfitRate"`
OrderFrozen decimal.Decimal `json:"ordFrozen"`
ActualLeverage decimal.Decimal `json:"actualLever"`
InvestmentCurrency string `json:"investmentCcy"`
}
WsGridOrder is a single grid algo order pushed by the "grid-orders-spot", "grid-orders-contract" and "grid-orders-moon" channels. The validating account had no grid orders, so the field set is a union modeled from the OKX WS doc field tables for those channels (spot / contract / moon grid).
type WsGridPosition ¶
type WsGridPosition struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Currency string `json:"ccy"`
PositionSide PosSide `json:"posSide"`
MarginMode MgnMode `json:"mgnMode"`
Position decimal.Decimal `json:"pos"`
AveragePrice decimal.Decimal `json:"avgPx"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
MarkPrice decimal.Decimal `json:"markPx"`
Leverage decimal.Decimal `json:"lever"`
IMR decimal.Decimal `json:"imr"`
MMR decimal.Decimal `json:"mmr"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
Margin decimal.Decimal `json:"margin"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
Last decimal.Decimal `json:"last"`
UPL decimal.Decimal `json:"upl"`
UPLRatio decimal.Decimal `json:"uplRatio"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
WsGridPosition is the position held by a contract grid algo order pushed by the "grid-positions" channel. The validating account had no grid orders, so the field set is modeled from the OKX WS doc field table.
type WsGridSubOrder ¶
type WsGridSubOrder struct {
AlgoID string `json:"algoId"`
AlgoClientOrderID string `json:"algoClOrdId"`
AlgoOrderType GridAlgoOrdType `json:"algoOrdType"`
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
GroupID string `json:"groupId"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
OrderType OrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
Currency string `json:"ccy"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
State OrdState `json:"state"`
AccumulatedFillSize decimal.Decimal `json:"accFillSz"`
AveragePrice decimal.Decimal `json:"avgPx"`
Leverage decimal.Decimal `json:"lever"`
Fee decimal.Decimal `json:"fee"`
FeeCurrency string `json:"feeCcy"`
Rebate decimal.Decimal `json:"rebate"`
RebateCurrency string `json:"rebateCcy"`
Pnl decimal.Decimal `json:"pnl"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
}
WsGridSubOrder is one sub-order (working leg) of a grid algo order pushed by the "grid-sub-orders" channel. The validating account had no grid orders, so the field set is modeled from the OKX WS doc field table.
type WsHandler ¶
WsHandler is invoked for every push (or error) on a subscription. The push's Data field is already decoded into the channel's typed slice.
type WsIndexCandle ¶
type WsIndexCandle struct {
Timestamp time.Time
Open decimal.Decimal
High decimal.Decimal
Low decimal.Decimal
Close decimal.Decimal
Confirm string
}
WsIndexCandle is one OHLC candlestick pushed by the "mark-price-candle{bar}" and "index-candle{bar}" channels. The raw data frame is an array-of-arrays with 6 columns: [ts, o, h, l, c, confirm] (no volume).
type WsIndexCandleHandler ¶
type WsIndexCandleHandler func([]WsIndexCandle, error)
WsIndexCandleHandler is invoked for every mark-price-candle / index-candle push (or error).
type WsIndexTicker ¶
type WsIndexTicker struct {
InstrumentID string `json:"instId"`
IndexPrice decimal.Decimal `json:"idxPx"`
Open24h decimal.Decimal `json:"open24h"`
High24h decimal.Decimal `json:"high24h"`
Low24h decimal.Decimal `json:"low24h"`
StartOfDayUTC0 decimal.Decimal `json:"sodUtc0"`
StartOfDayUTC8 decimal.Decimal `json:"sodUtc8"`
Timestamp time.Time `json:"ts"`
}
WsIndexTicker is an index's latest snapshot pushed on the "index-tickers" channel. idxPx is the index price; there is no last-trade or volume.
type WsInstrument ¶
type WsInstrument struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
InstrumentIDCode int64 `json:"instIdCode"`
Underlying string `json:"uly"`
InstrumentFamily string `json:"instFamily"`
InstrumentCategory string `json:"instCategory"`
BaseCurrency string `json:"baseCcy"`
QuoteCurrency string `json:"quoteCcy"`
SettleCurrency string `json:"settleCcy"`
ContractValue decimal.Decimal `json:"ctVal"`
ContractMultiplier decimal.Decimal `json:"ctMult"`
ContractValueCurrency string `json:"ctValCcy"`
OptionType OptType `json:"optType"`
Strike decimal.Decimal `json:"stk"`
ListTime time.Time `json:"listTime"`
AuctionEndTime time.Time `json:"auctionEndTime"`
ContinuousTradeSwitchTime time.Time `json:"contTdSwTime"`
OpenType string `json:"openType"`
ExpiryTime time.Time `json:"expTime"`
Leverage decimal.Decimal `json:"lever"`
TickSize decimal.Decimal `json:"tickSz"`
LotSize decimal.Decimal `json:"lotSz"`
MinSize decimal.Decimal `json:"minSz"`
ContractType CtType `json:"ctType"`
Alias string `json:"alias"`
State InstState `json:"state"`
// RuleType is the trading rule type: "normal", "pre_market" (including
// pre-market X-Perp FUTURES), "rebase_contract" and "xperp" (a pre-market
// X-Perp changes from "pre_market" to "xperp" after converting to a normal
// X-Perp).
RuleType string `json:"ruleType"`
MaxLimitSize decimal.Decimal `json:"maxLmtSz"`
MaxMarketSize decimal.Decimal `json:"maxMktSz"`
MaxLimitAmount decimal.Decimal `json:"maxLmtAmt"`
MaxMarketAmount decimal.Decimal `json:"maxMktAmt"`
MaxTWAPSize decimal.Decimal `json:"maxTwapSz"`
MaxIcebergSize decimal.Decimal `json:"maxIcebergSz"`
MaxTriggerSize decimal.Decimal `json:"maxTriggerSz"`
MaxStopSize decimal.Decimal `json:"maxStopSz"`
MaxPlatformOpenInterestLimit decimal.Decimal `json:"maxPlatOILmt"`
MaxPlatformOpenInterestCoinLimit decimal.Decimal `json:"maxPlatOICoinLmt"`
FutureSettlement bool `json:"futureSettlement"`
TradeQuoteCurrencyList []string `json:"tradeQuoteCcyList"`
GroupID string `json:"groupId"`
PositionLimitAmount decimal.Decimal `json:"posLmtAmt"`
PositionLimitPercent decimal.Decimal `json:"posLmtPct"`
// PreMarketSwitchTime is the time a pre-market instrument switched to normal
// trading. Applicable to pre-market SWAP and pre-market X-Perp FUTURES.
PreMarketSwitchTime time.Time `json:"preMktSwTime"`
// Elp is the ELP (Enhanced Liquidity Program) maker permission (values
// "0"/"1"/"2"; see Instrument.Elp). OKX is rebranding ELP to RPI (Retail
// Price Improvement); the json key stays "elp" until the old names retire on
// 2026-10-31, after which it becomes "rpi".
Elp string `json:"elp"`
}
WsInstrument is an instrument definition pushed on the "instruments" channel (on a listing/rule change). It mirrors the REST Instrument's pushed subset.
type WsLiquidationOrder ¶
type WsLiquidationOrder struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
InstrumentFamily string `json:"instFamily"`
Underlying string `json:"uly"`
Details []WsLiquidationOrderDetail `json:"details"`
}
WsLiquidationOrder groups an instrument's recent forced-liquidation fills pushed on the "liquidation-orders" channel.
type WsLiquidationOrderDetail ¶
type WsLiquidationOrderDetail struct {
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
BankruptcyPrice decimal.Decimal `json:"bkPx"`
Size decimal.Decimal `json:"sz"`
BankruptcyLoss decimal.Decimal `json:"bkLoss"`
Currency string `json:"ccy"`
Timestamp time.Time `json:"ts"`
}
WsLiquidationOrderDetail is one forced-liquidation fill.
type WsLiquidationWarning ¶
type WsLiquidationWarning = WsPosition
WsLiquidationWarning is one at-risk position from the "liquidation-warning" channel. It carries the same per-position fields as the positions channel; the validating account had no at-risk positions, so the field set is modeled from the OKX channel field table.
type WsMarkPrice ¶
type WsMarkPrice struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
MarkPrice decimal.Decimal `json:"markPx"`
Timestamp time.Time `json:"ts"`
}
WsMarkPrice is an instrument's mark price pushed on the "mark-price" channel.
type WsOpenInterest ¶
type WsOpenInterest struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
OpenInterest decimal.Decimal `json:"oi"`
OpenInterestCurrency decimal.Decimal `json:"oiCcy"`
OpenInterestUSD decimal.Decimal `json:"oiUsd"`
Timestamp time.Time `json:"ts"`
}
WsOpenInterest is an instrument's open interest pushed on the "open-interest" channel.
type WsOrder ¶
type WsOrder struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
TargetCurrency TgtCcy `json:"tgtCcy"`
Currency string `json:"ccy"`
OrderID string `json:"ordId"`
ClientOrderID string `json:"clOrdId"`
Tag string `json:"tag"`
Price decimal.Decimal `json:"px"`
PriceUSD decimal.Decimal `json:"pxUsd"`
PriceVolatility decimal.Decimal `json:"pxVol"`
PriceType string `json:"pxType"`
Size decimal.Decimal `json:"sz"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
OrderType OrdType `json:"ordType"`
Side Side `json:"side"`
PositionSide PosSide `json:"posSide"`
TradeMode TdMode `json:"tdMode"`
FillPrice decimal.Decimal `json:"fillPx"`
TradeID string `json:"tradeId"`
FillSize decimal.Decimal `json:"fillSz"`
FillPnl decimal.Decimal `json:"fillPnl"`
FillTime time.Time `json:"fillTime"`
FillFee decimal.Decimal `json:"fillFee"`
FillFeeCurrency string `json:"fillFeeCcy"`
FillPriceVolatility decimal.Decimal `json:"fillPxVol"`
FillPriceUSD decimal.Decimal `json:"fillPxUsd"`
FillMarkVolatility decimal.Decimal `json:"fillMarkVol"`
FillForwardPrice decimal.Decimal `json:"fillFwdPx"`
FillMarkPrice decimal.Decimal `json:"fillMarkPx"`
ExecutionType ExecType `json:"execType"`
AccumulatedFillSize decimal.Decimal `json:"accFillSz"`
FillNotionalUSD decimal.Decimal `json:"fillNotionalUsd"`
AveragePrice decimal.Decimal `json:"avgPx"`
State OrdState `json:"state"`
Leverage decimal.Decimal `json:"lever"`
AttachAlgoClientOrderID string `json:"attachAlgoClOrdId"`
TakeProfitTriggerPrice decimal.Decimal `json:"tpTriggerPx"`
TakeProfitTriggerPriceType string `json:"tpTriggerPxType"`
TakeProfitOrderPrice decimal.Decimal `json:"tpOrdPx"`
StopLossTriggerPrice decimal.Decimal `json:"slTriggerPx"`
StopLossTriggerPriceType string `json:"slTriggerPxType"`
StopLossOrderPrice decimal.Decimal `json:"slOrdPx"`
AttachAlgoOrders []AttachAlgoOrd `json:"attachAlgoOrds"`
STPID string `json:"stpId"`
STPMode string `json:"stpMode"`
FeeCurrency string `json:"feeCcy"`
Fee decimal.Decimal `json:"fee"`
RebateCurrency string `json:"rebateCcy"`
Rebate decimal.Decimal `json:"rebate"`
Pnl decimal.Decimal `json:"pnl"`
Source string `json:"source"`
Category string `json:"category"`
ReduceOnly string `json:"reduceOnly"` // OKX sends a quoted "true"/"false"
CancelSource string `json:"cancelSource"`
CancelSourceReason string `json:"cancelSourceReason"`
QuickMarginType string `json:"quickMgnType"`
AlgoClientOrderID string `json:"algoClOrdId"`
AlgoID string `json:"algoId"`
IsTakeProfitLimit string `json:"isTpLimit"`
LastPrice decimal.Decimal `json:"lastPx"`
UpdateTime time.Time `json:"uTime"`
CreationTime time.Time `json:"cTime"`
RequestID string `json:"reqId"`
AmendResult string `json:"amendResult"`
// AmendSource gains value "6" with the ELP->RPI rebranding rollout: order
// price adjusted (rounded) by the system to satisfy the RPI maker spacing
// rule.
AmendSource string `json:"amendSource"`
Code string `json:"code"`
Message string `json:"msg"`
TradeQuoteCurrency string `json:"tradeQuoteCcy"`
}
WsOrder is one order update from the "orders" channel. The validating account had no order activity, so the field set is modeled from the OKX "orders" channel field table (it mirrors the REST Order shape plus the WS-only fill / notify fields).
type WsOrderBook ¶
type WsOrderBook struct {
Asks [][]string `json:"asks"`
Bids [][]string `json:"bids"`
InstrumentID string `json:"instId,omitempty"`
Timestamp time.Time `json:"ts"`
Checksum int64 `json:"checksum,omitempty"`
PreviousSequenceID int64 `json:"prevSeqId,omitempty"`
SequenceID int64 `json:"seqId"`
}
WsOrderBook is an order-book frame. It is the superset shape across the order-book channels: "books" carries asks/bids/ts/checksum/seqId/prevSeqId (with Action "snapshot"/"update" on the push); "books5" carries asks/bids/instId/ts/seqId; "bbo-tbt" carries asks/bids/ts/seqId; the VIP "*-l2-tbt" channels carry the same as "books". Each level is [price, size, deprecated("0"), numOrders] as strings.
type WsPosition ¶
type WsPosition struct {
InstrumentType InstType `json:"instType"`
MarginMode MgnMode `json:"mgnMode"`
PositionID string `json:"posId"`
PositionSide PosSide `json:"posSide"`
Position decimal.Decimal `json:"pos"`
BaseBalance decimal.Decimal `json:"baseBal"`
QuoteBalance decimal.Decimal `json:"quoteBal"`
BaseBorrowed decimal.Decimal `json:"baseBorrowed"`
BaseInterest decimal.Decimal `json:"baseInterest"`
QuoteBorrowed decimal.Decimal `json:"quoteBorrowed"`
QuoteInterest decimal.Decimal `json:"quoteInterest"`
PositionCurrency string `json:"posCcy"`
AvailablePosition decimal.Decimal `json:"availPos"`
AveragePrice decimal.Decimal `json:"avgPx"`
NonSettleAveragePrice decimal.Decimal `json:"nonSettleAvgPx"`
MarkPrice decimal.Decimal `json:"markPx"`
UPL decimal.Decimal `json:"upl"`
UPLRatio decimal.Decimal `json:"uplRatio"`
UPLLastPrice decimal.Decimal `json:"uplLastPx"`
UPLRatioLastPrice decimal.Decimal `json:"uplRatioLastPx"`
InstrumentID string `json:"instId"`
Leverage decimal.Decimal `json:"lever"`
LiquidationPrice decimal.Decimal `json:"liqPx"`
IMR decimal.Decimal `json:"imr"`
Margin decimal.Decimal `json:"margin"`
MarginRatio decimal.Decimal `json:"mgnRatio"`
MMR decimal.Decimal `json:"mmr"`
Liability decimal.Decimal `json:"liab"`
LiabilityCurrency string `json:"liabCcy"`
Interest decimal.Decimal `json:"interest"`
TradeID string `json:"tradeId"`
OptionValue decimal.Decimal `json:"optVal"`
PendingCloseOrderLiabilityValue decimal.Decimal `json:"pendingCloseOrdLiabVal"`
NotionalUSD decimal.Decimal `json:"notionalUsd"`
ADL decimal.Decimal `json:"adl"`
Currency string `json:"ccy"`
Last decimal.Decimal `json:"last"`
IndexPrice decimal.Decimal `json:"idxPx"`
USDPrice decimal.Decimal `json:"usdPx"`
BreakEvenPrice decimal.Decimal `json:"bePx"`
DeltaBS decimal.Decimal `json:"deltaBS"`
DeltaPA decimal.Decimal `json:"deltaPA"`
GammaBS decimal.Decimal `json:"gammaBS"`
GammaPA decimal.Decimal `json:"gammaPA"`
ThetaBS decimal.Decimal `json:"thetaBS"`
ThetaPA decimal.Decimal `json:"thetaPA"`
VegaBS decimal.Decimal `json:"vegaBS"`
VegaPA decimal.Decimal `json:"vegaPA"`
SpotInUseAmount decimal.Decimal `json:"spotInUseAmt"`
SpotInUseCurrency string `json:"spotInUseCcy"`
ClientSpotInUseAmount decimal.Decimal `json:"clSpotInUseAmt"`
MaxSpotInUseAmount decimal.Decimal `json:"maxSpotInUseAmt"`
RealizedPnl decimal.Decimal `json:"realizedPnl"`
SettledPnl decimal.Decimal `json:"settledPnl"`
Pnl decimal.Decimal `json:"pnl"`
Fee decimal.Decimal `json:"fee"`
FundingFee decimal.Decimal `json:"fundingFee"`
LiquidationPenalty decimal.Decimal `json:"liqPenalty"`
CloseOrderAlgo []PositionCloseOrderAlgo `json:"closeOrderAlgo"`
CreationTime time.Time `json:"cTime"`
UpdateTime time.Time `json:"uTime"`
PushTime time.Time `json:"pTime"`
BusinessReferenceID string `json:"bizRefId"`
BusinessReferenceType string `json:"bizRefType"`
}
WsPosition is one open position from the "positions" channel. The validating account had no open positions, so the field set is modeled from the OKX "positions" channel field table (it mirrors the REST Position shape).
type WsPriceLimit ¶
type WsPriceLimit struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
BuyLimit decimal.Decimal `json:"buyLmt"`
SellLimit decimal.Decimal `json:"sellLmt"`
Enabled bool `json:"enabled"`
Timestamp time.Time `json:"ts"`
}
WsPriceLimit is an instrument's buy/sell price limits pushed on the "price-limit" channel.
type WsSprdBooks ¶
type WsSprdBooks struct {
Asks [][]string `json:"asks"`
Bids [][]string `json:"bids"`
Timestamp time.Time `json:"ts"`
SequenceID int64 `json:"seqId"`
}
WsSprdBooks is a spread's 5-level order book snapshot/update pushed by the "sprd-books5" channel. Each ask/bid level is [price, size, numOrders].
type WsSprdCandle ¶
type WsSprdCandle struct {
Timestamp time.Time
Open decimal.Decimal
High decimal.Decimal
Low decimal.Decimal
Close decimal.Decimal
Volume decimal.Decimal
Confirm string
}
WsSprdCandle is one OHLCV candlestick pushed by the "sprd-candle{bar}" channel. The raw data frame is an array-of-arrays with 7 columns: [ts, o, h, l, c, vol, confirm].
type WsSprdCandleHandler ¶
type WsSprdCandleHandler func([]WsSprdCandle, error)
WsSprdCandleHandler is invoked for every "sprd-candle{bar}" push (or error).
type WsSprdPublicTrade ¶
type WsSprdPublicTrade struct {
SpreadID string `json:"sprdId"`
TradeID string `json:"tradeId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
Timestamp time.Time `json:"ts"`
}
WsSprdPublicTrade is a single public trade (taker fill) on a spread pushed by the "sprd-public-trades" channel.
type WsSprdTicker ¶
type WsSprdTicker struct {
SpreadID string `json:"sprdId"`
Last decimal.Decimal `json:"last"`
LastSize decimal.Decimal `json:"lastSz"`
AskPrice decimal.Decimal `json:"askPx"`
AskSize decimal.Decimal `json:"askSz"`
BidPrice decimal.Decimal `json:"bidPx"`
BidSize decimal.Decimal `json:"bidSz"`
Open24h decimal.Decimal `json:"open24h"`
High24h decimal.Decimal `json:"high24h"`
Low24h decimal.Decimal `json:"low24h"`
Volume24h decimal.Decimal `json:"vol24h"`
Timestamp time.Time `json:"ts"`
}
WsSprdTicker is the latest market snapshot for a spread pushed by the "sprd-tickers" channel.
type WsStatus ¶
type WsStatus struct {
Title string `json:"title"`
State string `json:"state"`
Begin time.Time `json:"begin"`
End time.Time `json:"end"`
PreOpenBegin time.Time `json:"preOpenBegin"`
Href string `json:"href"`
ServiceType string `json:"serviceType"`
System string `json:"system"`
ScheduleDescription string `json:"scheDesc"`
MaintenanceType string `json:"maintType"`
Env string `json:"env"`
Timestamp time.Time `json:"ts"`
}
WsStatus is a system maintenance event pushed on the "status" channel.
type WsTicker ¶
type WsTicker struct {
InstrumentType InstType `json:"instType"`
InstrumentID string `json:"instId"`
Last decimal.Decimal `json:"last"`
LastSize decimal.Decimal `json:"lastSz"`
AskPrice decimal.Decimal `json:"askPx"`
AskSize decimal.Decimal `json:"askSz"`
BidPrice decimal.Decimal `json:"bidPx"`
BidSize decimal.Decimal `json:"bidSz"`
Open24h decimal.Decimal `json:"open24h"`
High24h decimal.Decimal `json:"high24h"`
Low24h decimal.Decimal `json:"low24h"`
VolumeCurrency24h decimal.Decimal `json:"volCcy24h"`
Volume24h decimal.Decimal `json:"vol24h"`
StartOfDayUTC0 decimal.Decimal `json:"sodUtc0"`
StartOfDayUTC8 decimal.Decimal `json:"sodUtc8"`
Timestamp time.Time `json:"ts"`
}
WsTicker is the latest market snapshot pushed on the "tickers" channel. It is a subset of the REST Ticker (no SodUtc fields differ, but it omits the REST-only extras).
type WsTrade ¶
type WsTrade struct {
InstrumentID string `json:"instId"`
TradeID string `json:"tradeId"`
Price decimal.Decimal `json:"px"`
Size decimal.Decimal `json:"sz"`
Side Side `json:"side"`
Count string `json:"count"`
// Source is the trade source ("1": RPI order, previously ELP order; see
// Trade.Source).
Source string `json:"source"`
SequenceID int64 `json:"seqId"`
Timestamp time.Time `json:"ts"`
}
WsTrade is a single public taker fill pushed on the "trades" channel.
type WsTradeConn ¶
type WsTradeConn struct {
// contains filtered or unexported fields
}
WsTradeConn is a persistent, logged-in WebSocket connection for order entry — a low-latency alternative to the REST trade endpoints. OKX correlates each request with its response by a client-supplied "id"; this type assigns ids, matches responses, and exposes one method per order operation.
Obtain one via (*WebSocketClient).DialTrade and Close it when done. All methods are safe for concurrent use.
func (*WsTradeConn) AmendOrder ¶
func (tc *WsTradeConn) AmendOrder(ctx context.Context, arg AmendOrderArg) (*AmendResult, error)
AmendOrder amends a single order.
func (*WsTradeConn) BatchAmendOrders ¶
func (tc *WsTradeConn) BatchAmendOrders(ctx context.Context, args []AmendOrderArg) ([]AmendResult, error)
BatchAmendOrders amends up to 20 orders in one request.
func (*WsTradeConn) BatchCancelOrders ¶
func (tc *WsTradeConn) BatchCancelOrders(ctx context.Context, args []CancelOrderArg) ([]OrderResult, error)
BatchCancelOrders cancels up to 20 orders in one request.
func (*WsTradeConn) BatchPlaceOrders ¶
func (tc *WsTradeConn) BatchPlaceOrders(ctx context.Context, args []OrderArg) ([]OrderResult, error)
BatchPlaceOrders places up to 20 orders in one request.
func (*WsTradeConn) CancelOrder ¶
func (tc *WsTradeConn) CancelOrder(ctx context.Context, arg CancelOrderArg) (*OrderResult, error)
CancelOrder cancels a single order.
func (*WsTradeConn) Close ¶
func (tc *WsTradeConn) Close() error
Close terminates the connection and fails any in-flight requests.
func (*WsTradeConn) MassCancel ¶
func (tc *WsTradeConn) MassCancel(ctx context.Context, instType InstType, instFamily string) (*MassCancelResult, error)
MassCancel cancels all pending orders for an option instrument family.
func (*WsTradeConn) PlaceOrder ¶
func (tc *WsTradeConn) PlaceOrder(ctx context.Context, arg OrderArg) (*OrderResult, error)
PlaceOrder places a single order over the trade connection. The per-order result carries sCode/sMsg for the order-level outcome.
Source Files
¶
- account.go
- account_bills.go
- account_borrow.go
- account_config.go
- affiliate.go
- algo.go
- asset.go
- client.go
- convert.go
- copytrading.go
- finance_loan.go
- finance_okusd.go
- finance_savings.go
- finance_staking.go
- grid.go
- market.go
- market_index.go
- public_data.go
- recurring.go
- results_err.go
- rfq.go
- rubik.go
- sprd.go
- status.go
- subaccount.go
- system.go
- trade_convert.go
- trade_fills.go
- trade_order.go
- types.go
- users_glp.go
- websocket.go
- ws_business.go
- ws_private.go
- ws_public.go
- ws_trade.go