AugustSubAccounts
SDK Reference / AugustSubAccounts
AugustSubAccounts
The August Sub Accounts Module.
Classes
AugustSubAccounts
Subaccount operation class interacting with August Subaccounts Subaccount is a smart contract wallet that serves as the fundamental infrastructure for August's platform. It functions as a cross-margin account designed for optimal capital efficiency. Most of the operations require a August API key to perform
Extends
AugustBase
Constructors
Constructor
new AugustSubAccounts(
baseConfig):AugustSubAccounts
Parameters
baseConfig
IAugustBase
Returns
Overrides
AugustBase.constructor
Properties
activeNetwork
public
IActiveNetwork
AugustBase.activeNetwork
authorized
public
boolean
AugustBase.authorized
keys
public
IKeys
AugustBase.keys
monitoring
public
IMonitoring
AugustBase.monitoring
providers
public
IProvidersConfig
AugustBase.providers
Methods
clearWallet()
clearWallet():
void
Remove wallet address from SDK state and monitoring headers.
Returns
void
Inherited from
AugustBase.clearWallet
getSubaccountCefiPositions()
getSubaccountCefiPositions(
subaccountAddress):Promise<IWSSubaccountCefi[]>
Retrieves CeFi (Centralized Finance) positions for a subaccount.
Parameters
subaccountAddress
`0x${string}`
The address of the subaccount to query
Returns
Promise<IWSSubaccountCefi[]>
List of CeFi positions held by the subaccount
getSubaccountHealthFactor()
getSubaccountHealthFactor(
subaccountAddress):Promise<{dateTime:string;healthFactor:number;id:`0x${string}`;totalCollateral:number;totalLoan:number; }>
Retrieves the health factor for a subaccount.
Parameters
subaccountAddress
`0x${string}`
The address of the subaccount to query
Returns
Promise<{ dateTime: string; healthFactor: number; id: `0x${string}`; totalCollateral: number; totalLoan: number; }>
The health factor data including collateral value, loan value, and health factor ratio
getSubaccountLoans()
getSubaccountLoans(
subaccountAddress,side,active):Promise<IWSSubaccountLoan[]>
Retrieves loan positions for a subaccount.
Parameters
subaccountAddress
`0x${string}`
The address of the subaccount to query
side
"BORROWER" | "LENDER" | "BOTH"
Filter by loan side: 'BOTH' for all loans, 'LENDER' for lent positions, 'BORROWER' for borrowed positions
active
boolean
When true, returns only active loans; when false, returns all loans including closed ones
Returns
Promise<IWSSubaccountLoan[]>
List of loan positions matching the specified filters
getSubaccountOtcPositions()
getSubaccountOtcPositions(
subaccountAddress):Promise<IOTCPosition[]>
Retrieves OTC (Over-The-Counter) positions for a subaccount.
Parameters
subaccountAddress
`0x${string}`
The address of the subaccount to query
Returns
Promise<IOTCPosition[]>
List of OTC positions held by the subaccount
getSubaccountSummary()
getSubaccountSummary(
subaccountAddress):Promise<{address:`0x${string}`;chains:object[];healthFactor:number;loanbook: {aggregatesByToken:unknown[];loans:object[];totalCredit:number;totalDebt:number; };name:string;netAccountValue:number;portfolio: {cefiPositions:unknown[];collateralBalances:unknown[];defiPositions:unknown[];discountedValue:number;legacyHedgerPositions:unknown[];marginBalances:unknown[];otcPositions:unknown[];strategyContractPositions:unknown[];tokens:object[];totalValue:number;trsPositions:unknown[]; };tokens:object[];totalAccountValue:number;totalCollateralValue:number;totalEquityValue:number;totalLoanValue:number;type:"eoa"|"subaccount"; }>
Retrieves the summary view for a subaccount or EOA operator.
Parameters
subaccountAddress
`0x${string}`
The address of the subaccount to query
Returns
Promise<{ address: `0x${string}`; chains: object[]; healthFactor: number; loanbook: { aggregatesByToken: unknown[]; loans: object[]; totalCredit: number; totalDebt: number; }; name: string; netAccountValue: number; portfolio: { cefiPositions: unknown[]; collateralBalances: unknown[]; defiPositions: unknown[]; discountedValue: number; legacyHedgerPositions: unknown[]; marginBalances: unknown[]; otcPositions: unknown[]; strategyContractPositions: unknown[]; tokens: object[]; totalValue: number; trsPositions: unknown[]; }; tokens: object[]; totalAccountValue: number; totalCollateralValue: number; totalEquityValue: number; totalLoanValue: number; type: "eoa" | "subaccount"; }>
The full summary including portfolio, loanbook, tokens, and account values
init()
init():
Promise<void>
Verify API keys and authorize SDK usage. TODO: initialize class with appropriate keys and verify august key
Returns
Promise<void>
Inherited from
AugustBase.init
switchNetwork()
switchNetwork(
chainId):void
Switch the active blockchain network. Updates both chain ID and RPC URL for subsequent operations.
Parameters
chainId
number
Returns
void
Inherited from
AugustBase.switchNetwork
updateWallet()
updateWallet(
address):void
Set active wallet address and update monitoring headers. Preserves existing environment setting.
Parameters
address
`0x${string}`
Returns
void
Inherited from
AugustBase.updateWallet
Last updated