One of the biggest hurdles for new Injective users is the concept of bank and subaccount. Specifically, once a new Injective retail user landed on an Exchange dApp such as Helix, the user may drop off because he/she does not realise the requirement of transferring funds into subaccount before placing his/her first order.
In the upcoming chain upgrade (v1.10), changes will be made so that bank balances can be used to trade. This means that the user does not have to manage the default subaccount deposits anymore. Note that the concept of subaccount has not changed - orders and positions will still be associated with the user’s default or non-default subaccount.
https://embed.notionlytics.com/wt/ZXlKd1lXZGxTV1FpT2lJNFlqUXlNbVkzWW1Wak5tTTBZMkZqT1RZME5UbGtOVFU0WlRreE4ySTJaQ0lzSW5kdmNtdHpjR0ZqWlZSeVlXTnJaWEpKWkNJNkluRnNSVmRWZUhCNWNFRktZM2htY1dkaWVWUlVJbjA9
Key concepts:
Bank balances can be drawn by the default subaccount to place orders
Deposits to the default subaccount will be automatically credited to the bank balance
Implications:
subaccountBalance
or streamSubaccountBalance
endpoints) still work.accountPortfolio
endpoint) and stream gPRC call (through streamAccountPortfolio
) which users can use to get both the bank and subaccount balances in one go.accountPortfolio
endpoint paramsStreamAccountPortfolio
endpoint paramsPackages:
v0.6.0.7
v1.45.5
IndexerGrpcAccountPortfolioApi
- https://github.com/InjectiveLabs/injective-ts/blob/master/packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcPortfolioApi.tsIndexerGrpcAccountPortfolioStream
- https://github.com/InjectiveLabs/injective-ts/blob/master/packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcAccountPortfolioStream.tsdev
branch has been updated with changes required to use the new account portfolio endpoints to fetch balancesmaster
branch will be updated tooDuring the v1.10 mainnet upgrade, all of the available balances in the default subaccount will be transferred to the bank balance. Margin held will remain in default subaccount.