PortfolioService
Describes github.com/stxapp/stx-go v0.3.1, the current release.
PortfolioService
Section titled “PortfolioService”type PortfolioService struct { // contains filtered or unexported fields}PortfolioService reads fills, settlements, per-market stats and money movements. Use it through Client.Portfolio.
Adjustments
Section titled “Adjustments”func (s *PortfolioService) Adjustments(ctx context.Context, q *PageQuery) (*Page[PaymentTransaction], error)Adjustments returns one page of manual balance adjustments (GET /api/v1/portfolio/adjustments).
AllAdjustments
Section titled “AllAdjustments”func (s *PortfolioService) AllAdjustments(ctx context.Context, q *PageQuery) iter.Seq2[PaymentTransaction, error]AllAdjustments returns every adjustment, following the cursor.
AllDeposits
Section titled “AllDeposits”func (s *PortfolioService) AllDeposits(ctx context.Context, q *PageQuery) iter.Seq2[PaymentTransaction, error]AllDeposits returns every deposit, following the cursor.
AllFees
Section titled “AllFees”func (s *PortfolioService) AllFees(ctx context.Context, q *PageQuery) iter.Seq2[FeeTransaction, error]AllFees returns every fee entry, following the cursor.
AllFills
Section titled “AllFills”func (s *PortfolioService) AllFills(ctx context.Context, q *FillsQuery) iter.Seq2[Fill, error]AllFills returns every fill matching q, following the cursor.
AllLoyalty
Section titled “AllLoyalty”func (s *PortfolioService) AllLoyalty(ctx context.Context, q *PageQuery) iter.Seq2[Transaction, error]AllLoyalty returns every loyalty entry, following the cursor.
AllMarketStats
Section titled “AllMarketStats”func (s *PortfolioService) AllMarketStats(ctx context.Context, q *MarketStatsQuery) iter.Seq2[MarketStat, error]AllMarketStats returns every per-market stat row matching q, following the cursor.
AllSettlements
Section titled “AllSettlements”func (s *PortfolioService) AllSettlements(ctx context.Context, q *SettlementsQuery) iter.Seq2[Settlement, error]AllSettlements returns every settlement matching q, following the cursor.
AllWithdrawals
Section titled “AllWithdrawals”func (s *PortfolioService) AllWithdrawals(ctx context.Context, q *PageQuery) iter.Seq2[PaymentTransaction, error]AllWithdrawals returns every withdrawal, following the cursor.
Deposits
Section titled “Deposits”func (s *PortfolioService) Deposits(ctx context.Context, q *PageQuery) (*Page[PaymentTransaction], error)Deposits returns one page of deposits (GET /api/v1/portfolio/deposits).
func (s *PortfolioService) Fees(ctx context.Context, q *PageQuery) (*Page[FeeTransaction], error)Fees returns one page of fee and fee-refund entries (GET /api/v1/portfolio/fees).
func (s *PortfolioService) Fills(ctx context.Context, q *FillsQuery) (*Page[Fill], error)Fills returns one page of your executions (GET /api/v1/fills).
Loyalty
Section titled “Loyalty”func (s *PortfolioService) Loyalty(ctx context.Context, q *PageQuery) (*Page[Transaction], error)Loyalty returns one page of loyalty entries (GET /api/v1/portfolio/loyalty). Where the exchange has no loyalty program it returns an error matching ErrNotAvailable.
MarketStats
Section titled “MarketStats”func (s *PortfolioService) MarketStats(ctx context.Context, q *MarketStatsQuery) (*Page[MarketStat], error)MarketStats returns one page of your exposure and P&L per market (GET /api/v1/account/market_stats). This is not the market_stats channel, which carries price history.
Settlements
Section titled “Settlements”func (s *PortfolioService) Settlements(ctx context.Context, q *SettlementsQuery) (*Page[Settlement], error)Settlements returns one page of settlements on your account (GET /api/v1/portfolio/settlements).
Withdrawals
Section titled “Withdrawals”func (s *PortfolioService) Withdrawals(ctx context.Context, q *PageQuery) (*Page[PaymentTransaction], error)Withdrawals returns one page of withdrawals (GET /api/v1/portfolio/withdrawals).

