@exponent-labs/adrena-idl 0.9.24 → 0.9.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +8 -167
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
1
3
|
import { BorshCoder, IdlAccounts, IdlTypes, web3 } from "@coral-xyz/anchor";
|
|
2
4
|
import BN from "bn.js";
|
|
3
5
|
import { Adrena } from "./adrena";
|
|
@@ -8,177 +10,16 @@ export type CustodyState = AdrenaAccounts["custody"];
|
|
|
8
10
|
export type FeesStats = AdrenaTypes["FeesStats"];
|
|
9
11
|
export declare const ADRENA_CODER: BorshCoder<string, string>;
|
|
10
12
|
export declare const fetchPoolAccount: (connection: web3.Connection, accountPubkey: web3.PublicKey) => Promise<PoolState>;
|
|
11
|
-
export declare const decodePoolAccount: (data: Buffer) =>
|
|
12
|
-
export declare const encodePoolAccount: (accountBuffer:
|
|
13
|
+
export declare const decodePoolAccount: (data: Buffer) => any;
|
|
14
|
+
export declare const encodePoolAccount: (accountBuffer: any) => Promise<Buffer>;
|
|
13
15
|
export declare const fetchCustodyAccount: (connection: web3.Connection, accountPubkey: web3.PublicKey) => Promise<CustodyState>;
|
|
14
|
-
export declare const decodeCustodyAccount: (data: Buffer) =>
|
|
15
|
-
export declare const encodeCustodyAccount: (custody:
|
|
16
|
+
export declare const decodeCustodyAccount: (data: Buffer) => any;
|
|
17
|
+
export declare const encodeCustodyAccount: (custody: any) => Promise<Buffer>;
|
|
16
18
|
export declare const decodePoolAndCustodyAccounts: (accountInfos: {
|
|
17
19
|
data: Buffer;
|
|
18
20
|
}[]) => {
|
|
19
|
-
poolAccount:
|
|
20
|
-
|
|
21
|
-
lpTokenBump: number;
|
|
22
|
-
nbStableCustody: number;
|
|
23
|
-
initialized: number;
|
|
24
|
-
allowTrade: number;
|
|
25
|
-
allowSwap: number;
|
|
26
|
-
liquidityState: number;
|
|
27
|
-
registeredCustodyCount: number;
|
|
28
|
-
name: {
|
|
29
|
-
value: number[];
|
|
30
|
-
length: number;
|
|
31
|
-
};
|
|
32
|
-
custodies: web3.PublicKey[];
|
|
33
|
-
feesDebtUsd: BN;
|
|
34
|
-
referrersFeeDebtUsd: BN;
|
|
35
|
-
cumulativeReferrerFeeUsd: BN;
|
|
36
|
-
lpTokenPriceUsd: BN;
|
|
37
|
-
whitelistedSwapper: web3.PublicKey;
|
|
38
|
-
ratios: {
|
|
39
|
-
target: number;
|
|
40
|
-
min: number;
|
|
41
|
-
max: number;
|
|
42
|
-
padding: number[];
|
|
43
|
-
}[];
|
|
44
|
-
lastAumAndLpTokenPriceUsdUpdate: BN;
|
|
45
|
-
uniqueLimitOrderIdCounter: BN;
|
|
46
|
-
aumUsd: {
|
|
47
|
-
high: BN;
|
|
48
|
-
low: BN;
|
|
49
|
-
};
|
|
50
|
-
inceptionTime: BN;
|
|
51
|
-
aumSoftCapUsd: BN;
|
|
52
|
-
};
|
|
53
|
-
custodyAccounts: {
|
|
54
|
-
bump: number;
|
|
55
|
-
tokenAccountBump: number;
|
|
56
|
-
allowTrade: number;
|
|
57
|
-
allowSwap: number;
|
|
58
|
-
decimals: number;
|
|
59
|
-
isStable: number;
|
|
60
|
-
padding: number[];
|
|
61
|
-
pool: web3.PublicKey;
|
|
62
|
-
mint: web3.PublicKey;
|
|
63
|
-
tokenAccount: web3.PublicKey;
|
|
64
|
-
oracle: {
|
|
65
|
-
value: number[];
|
|
66
|
-
length: number;
|
|
67
|
-
};
|
|
68
|
-
tradeOracle: {
|
|
69
|
-
value: number[];
|
|
70
|
-
length: number;
|
|
71
|
-
};
|
|
72
|
-
pricing: {
|
|
73
|
-
maxInitialLeverage: number;
|
|
74
|
-
maxLeverage: number;
|
|
75
|
-
maxPositionLockedUsd: BN;
|
|
76
|
-
maxCumulativeShortPositionSizeUsd: BN;
|
|
77
|
-
};
|
|
78
|
-
fees: {
|
|
79
|
-
swapIn: number;
|
|
80
|
-
swapOut: number;
|
|
81
|
-
stableSwapIn: number;
|
|
82
|
-
stableSwapOut: number;
|
|
83
|
-
addLiquidity: number;
|
|
84
|
-
removeLiquidity: number;
|
|
85
|
-
closePosition: number;
|
|
86
|
-
liquidation: number;
|
|
87
|
-
feeMax: number;
|
|
88
|
-
padding: number[];
|
|
89
|
-
padding2: BN;
|
|
90
|
-
};
|
|
91
|
-
borrowRate: {
|
|
92
|
-
maxHourlyBorrowInterestRate: BN;
|
|
93
|
-
};
|
|
94
|
-
collectedFees: {
|
|
95
|
-
swapUsd: BN;
|
|
96
|
-
addLiquidityUsd: BN;
|
|
97
|
-
removeLiquidityUsd: BN;
|
|
98
|
-
closePositionUsd: BN;
|
|
99
|
-
liquidationUsd: BN;
|
|
100
|
-
borrowUsd: BN;
|
|
101
|
-
};
|
|
102
|
-
volumeStats: {
|
|
103
|
-
swapUsd: BN;
|
|
104
|
-
addLiquidityUsd: BN;
|
|
105
|
-
removeLiquidityUsd: BN;
|
|
106
|
-
openPositionUsd: BN;
|
|
107
|
-
closePositionUsd: BN;
|
|
108
|
-
liquidationUsd: BN;
|
|
109
|
-
};
|
|
110
|
-
tradeStats: {
|
|
111
|
-
profitUsd: BN;
|
|
112
|
-
lossUsd: BN;
|
|
113
|
-
oiLongUsd: BN;
|
|
114
|
-
oiShortUsd: BN;
|
|
115
|
-
};
|
|
116
|
-
assets: {
|
|
117
|
-
collateral: BN;
|
|
118
|
-
owned: BN;
|
|
119
|
-
locked: BN;
|
|
120
|
-
};
|
|
121
|
-
longPositions: {
|
|
122
|
-
openPositions: BN;
|
|
123
|
-
sizeUsd: BN;
|
|
124
|
-
borrowSizeUsd: BN;
|
|
125
|
-
lockedAmount: BN;
|
|
126
|
-
weightedPrice: {
|
|
127
|
-
high: BN;
|
|
128
|
-
low: BN;
|
|
129
|
-
};
|
|
130
|
-
totalQuantity: {
|
|
131
|
-
high: BN;
|
|
132
|
-
low: BN;
|
|
133
|
-
};
|
|
134
|
-
cumulativeInterestUsd: BN;
|
|
135
|
-
padding: number[];
|
|
136
|
-
cumulativeInterestSnapshot: {
|
|
137
|
-
high: BN;
|
|
138
|
-
low: BN;
|
|
139
|
-
};
|
|
140
|
-
exitFeeUsd: BN;
|
|
141
|
-
stableLockedAmount: {
|
|
142
|
-
custody: web3.PublicKey;
|
|
143
|
-
lockedAmount: BN;
|
|
144
|
-
padding: number[];
|
|
145
|
-
}[];
|
|
146
|
-
};
|
|
147
|
-
shortPositions: {
|
|
148
|
-
openPositions: BN;
|
|
149
|
-
sizeUsd: BN;
|
|
150
|
-
borrowSizeUsd: BN;
|
|
151
|
-
lockedAmount: BN;
|
|
152
|
-
weightedPrice: {
|
|
153
|
-
high: BN;
|
|
154
|
-
low: BN;
|
|
155
|
-
};
|
|
156
|
-
totalQuantity: {
|
|
157
|
-
high: BN;
|
|
158
|
-
low: BN;
|
|
159
|
-
};
|
|
160
|
-
cumulativeInterestUsd: BN;
|
|
161
|
-
padding: number[];
|
|
162
|
-
cumulativeInterestSnapshot: {
|
|
163
|
-
high: BN;
|
|
164
|
-
low: BN;
|
|
165
|
-
};
|
|
166
|
-
exitFeeUsd: BN;
|
|
167
|
-
stableLockedAmount: {
|
|
168
|
-
custody: web3.PublicKey;
|
|
169
|
-
lockedAmount: BN;
|
|
170
|
-
padding: number[];
|
|
171
|
-
}[];
|
|
172
|
-
};
|
|
173
|
-
borrowRateState: {
|
|
174
|
-
currentRate: BN;
|
|
175
|
-
lastUpdate: BN;
|
|
176
|
-
cumulativeInterest: {
|
|
177
|
-
high: BN;
|
|
178
|
-
low: BN;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
}[];
|
|
21
|
+
poolAccount: any;
|
|
22
|
+
custodyAccounts: any[];
|
|
182
23
|
};
|
|
183
24
|
export declare const calculateTotalFeesFromCustodies: (custodyAccounts: CustodyState[]) => BN;
|
|
184
25
|
export {};
|