Skip to content

Portfolio

Describes @stxapp/stx-typescript 0.12.1, the current release.

These calls read your own account. The fields are described in the API reference. To keep these figures current without polling, use the live account view.

import { STX } from "@stxapp/stx-typescript";
const client = new STX();
const balance = await client.balance();
console.log(balance.available_balance); // 746.8600
for (const p of await client.positions()) {
console.log(p.market_id, p.position); // e00651a3-10cb-4bc1-9e1f-c5ea1796c83b 40.00
}
for await (const fill of client.iterFills({ marketIds: [marketId] })) {
console.log(fill.trade_id, fill.action, fill.filled, "@", fill.price);
// a7469e3a-b608-483d-b12f-1c1534793274 buy 40.00 @ 0.5800
}
const settlements = await client.settlements({ limit: 50 });
for (const s of settlements) console.log(s.market_id, s.type, s.quantity, s.gross_pnl);
// fd6a5668-ffda-4f97-b8fe-7aa6d79d9c5f expired_long 50.00 32.0000
Method Filters
balance() none
positions() marketIds
fills() marketIds, orderIds, status
settlements() marketIds, type
accountMarketStats() marketIds, eventIds, sports, competitions, fromTime, toTime, excludeZeroSettlements
deposits(), withdrawals(), adjustments(), fees(), loyalty() limit, cursor

Every list method returns one page and has an iter* twin (iterFills, iterSettlements, iterDeposits, …) that walks all pages. See pagination.

STX is operated by XV Exchange, LLC, a Designated Contract Market regulated by the U.S. Commodity Futures Trading Commission (CFTC). Contracts traded on STX are cleared by XV Clearing, LLC, a CFTC-registered Derivatives Clearing Organization. Trading involves substantial risk of loss and may not be appropriate for everyone. Members risk losing the cost to enter any transaction, including fees. Consider whether trading is appropriate for you in light of your experience and financial resources. Nothing on this site is investment advice or a recommendation to trade. Past performance is not indicative of future results.

© 2026 STX. All rights reserved.llms.txtllms-full.txtView as Markdown
Docs version v1.10.5