-
Notifications
You must be signed in to change notification settings - Fork 188
/
account-portfolio.ts
47 lines (41 loc) · 1.26 KB
/
account-portfolio.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { InjectivePortfolioRpc } from '@injectivelabs/indexer-proto-ts'
import { Coin } from '@injectivelabs/ts-types'
export interface SubaccountDepositV2 {
totalBalance: string
availableBalance: string
}
export interface PortfolioSubaccountBalanceV2 {
subaccountId: string
denom: string
deposit?: SubaccountDepositV2
}
export interface PositionV2 {
ticker: string
marketId: string
subaccountId: string
direction: string
quantity: string
entryPrice: string
margin: string
liquidationPrice: string
markPrice: string
aggregateReduceOnlyQuantity: string
updatedAt: number
createdAt: number
}
export interface PositionsWithUPNL {
position?: PositionV2
unrealizedPnl: string
}
export interface AccountPortfolioV2 {
accountAddress: string
bankBalancesList: Coin[]
subaccountsList: PortfolioSubaccountBalanceV2[]
positionsWithUpnlList: PositionsWithUPNL[]
}
export type GrpcPositionV2 = InjectivePortfolioRpc.DerivativePosition
export type GrpcAccountPortfolioV2 = InjectivePortfolioRpc.Portfolio
export type GrpcSubaccountDepositV2 = InjectivePortfolioRpc.SubaccountDeposit
export type GrpcPositionsWithUPNL = InjectivePortfolioRpc.PositionsWithUPNL
export type GrpcPortfolioSubaccountBalanceV2 =
InjectivePortfolioRpc.SubaccountBalanceV2