@nadohq/shared 0.1.0-alpha.5 → 0.1.0-alpha.50
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/dist/abis/index.cjs +12 -12
- package/dist/abis/index.cjs.map +1 -1
- package/dist/abis/index.d.cts +6 -6
- package/dist/abis/index.d.ts +6 -6
- package/dist/abis/index.js +6 -6
- package/dist/abis/index.js.map +1 -1
- package/dist/{chunk-TUJ4HQKF.js → chunk-2GPIH63F.js} +3 -3
- package/dist/chunk-2GPIH63F.js.map +1 -0
- package/dist/consts/chainEnvToChain.cjs +2 -2
- package/dist/consts/chainEnvToChain.cjs.map +1 -1
- package/dist/consts/chainEnvToChain.d.cts +345 -56
- package/dist/consts/chainEnvToChain.d.ts +345 -56
- package/dist/consts/chainEnvToChain.js +3 -3
- package/dist/consts/chainEnvToChain.js.map +1 -1
- package/dist/consts/index.d.cts +0 -1
- package/dist/consts/index.d.ts +0 -1
- package/dist/consts/productIds.cjs +1 -1
- package/dist/consts/productIds.cjs.map +1 -1
- package/dist/consts/productIds.d.cts +1 -1
- package/dist/consts/productIds.d.ts +1 -1
- package/dist/consts/productIds.js +1 -1
- package/dist/consts/productIds.js.map +1 -1
- package/dist/deployments/core/deployment.inkMainnet.json +13 -0
- package/dist/deployments/core/deployment.inkSepolia.json +13 -0
- package/dist/deployments/index.cjs +6 -6
- package/dist/deployments/index.cjs.map +1 -1
- package/dist/deployments/index.js +5 -5
- package/dist/deployments/index.js.map +1 -1
- package/dist/eip712/eip712ValueTypes.d.cts +1 -1
- package/dist/eip712/eip712ValueTypes.d.ts +1 -1
- package/dist/eip712/getNadoEIP712Domain.cjs.map +1 -1
- package/dist/eip712/getNadoEIP712Domain.js.map +1 -1
- package/dist/eip712/index.cjs +13 -13
- package/dist/eip712/index.cjs.map +1 -1
- package/dist/eip712/index.d.cts +9 -9
- package/dist/eip712/index.d.ts +9 -9
- package/dist/eip712/index.js +6 -6
- package/dist/eip712/index.js.map +1 -1
- package/dist/encoding/encoding.cjs +21 -0
- package/dist/encoding/encoding.cjs.map +1 -1
- package/dist/encoding/encoding.d.cts +27 -3
- package/dist/encoding/encoding.d.ts +27 -3
- package/dist/encoding/encoding.js +24 -1
- package/dist/encoding/encoding.js.map +1 -1
- package/dist/encoding/index.d.cts +2 -2
- package/dist/encoding/index.d.ts +2 -2
- package/dist/index.d.cts +35 -35
- package/dist/index.d.ts +35 -35
- package/dist/types/ChainEnv.cjs +1 -1
- package/dist/types/ChainEnv.cjs.map +1 -1
- package/dist/types/ChainEnv.d.cts +2 -2
- package/dist/types/ChainEnv.d.ts +2 -2
- package/dist/types/ChainEnv.js +1 -1
- package/dist/types/ChainEnv.js.map +1 -1
- package/dist/types/balanceTypes.d.cts +1 -1
- package/dist/types/balanceTypes.d.ts +1 -1
- package/dist/types/index.cjs +7 -7
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +3 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/orderAppendixTypes.cjs.map +1 -1
- package/dist/types/orderAppendixTypes.d.cts +25 -1
- package/dist/types/orderAppendixTypes.d.ts +25 -1
- package/dist/types/viemTypes.d.cts +1 -1
- package/dist/types/viemTypes.d.ts +1 -1
- package/dist/utils/balanceValue.d.cts +1 -1
- package/dist/utils/balanceValue.d.ts +1 -1
- package/dist/utils/bytes32.d.cts +1 -1
- package/dist/utils/bytes32.d.ts +1 -1
- package/dist/utils/bytes32.test.cjs +2 -2
- package/dist/utils/bytes32.test.cjs.map +1 -1
- package/dist/utils/bytes32.test.js +1 -1
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.cjs.map +1 -1
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.js.map +1 -1
- package/dist/utils/index.cjs +12 -12
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +21 -21
- package/dist/utils/index.d.ts +21 -21
- package/dist/utils/index.js +6 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/math/bigDecimal.cjs +4 -3
- package/dist/utils/math/bigDecimal.cjs.map +1 -1
- package/dist/utils/math/bigDecimal.js +4 -3
- package/dist/utils/math/bigDecimal.js.map +1 -1
- package/dist/utils/math/index.cjs +8 -8
- package/dist/utils/math/index.cjs.map +1 -1
- package/dist/utils/math/index.d.cts +4 -4
- package/dist/utils/math/index.d.ts +4 -4
- package/dist/utils/math/index.js +4 -4
- package/dist/utils/math/index.js.map +1 -1
- package/dist/utils/orders/appendix/appendixIsolatedValue.cjs +50 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.cjs.map +1 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.d.cts +26 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.d.ts +26 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.js +31 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.js.map +1 -0
- package/dist/utils/orders/appendix/appendixTwapValue.cjs +3 -4
- package/dist/utils/orders/appendix/appendixTwapValue.cjs.map +1 -1
- package/dist/utils/orders/appendix/appendixTwapValue.d.cts +11 -13
- package/dist/utils/orders/appendix/appendixTwapValue.d.ts +11 -13
- package/dist/utils/orders/appendix/appendixTwapValue.js +3 -4
- package/dist/utils/orders/appendix/appendixTwapValue.js.map +1 -1
- package/dist/utils/orders/appendix/index.cjs +4 -4
- package/dist/utils/orders/appendix/index.cjs.map +1 -1
- package/dist/utils/orders/appendix/index.d.cts +2 -2
- package/dist/utils/orders/appendix/index.d.ts +2 -2
- package/dist/utils/orders/appendix/index.js +2 -2
- package/dist/utils/orders/appendix/index.js.map +1 -1
- package/dist/utils/orders/appendix/orderAppendix.test.cjs +67 -14
- package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -1
- package/dist/utils/orders/appendix/orderAppendix.test.js +66 -13
- package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -1
- package/dist/utils/orders/appendix/packOrderAppendix.cjs +9 -5
- package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -1
- package/dist/utils/orders/appendix/packOrderAppendix.js +9 -5
- package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -1
- package/dist/utils/orders/appendix/types.cjs.map +1 -1
- package/dist/utils/orders/appendix/types.d.cts +6 -4
- package/dist/utils/orders/appendix/types.d.ts +6 -4
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +22 -5
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -1
- package/dist/utils/orders/appendix/unpackOrderAppendix.js +22 -5
- package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -1
- package/dist/utils/orders/index.cjs +3 -3
- package/dist/utils/orders/index.cjs.map +1 -1
- package/dist/utils/orders/index.d.cts +4 -4
- package/dist/utils/orders/index.d.ts +4 -4
- package/dist/utils/orders/index.js +1 -1
- package/dist/utils/orders/index.js.map +1 -1
- package/dist/utils/productTypeFilter.cjs.map +1 -1
- package/dist/utils/productTypeFilter.d.cts +2 -2
- package/dist/utils/productTypeFilter.d.ts +2 -2
- package/dist/utils/productTypeFilter.js.map +1 -1
- package/dist/utils/toPrintableObject.cjs +17 -9
- package/dist/utils/toPrintableObject.cjs.map +1 -1
- package/dist/utils/toPrintableObject.d.cts +7 -2
- package/dist/utils/toPrintableObject.d.ts +7 -2
- package/dist/utils/toPrintableObject.js +17 -9
- package/dist/utils/toPrintableObject.js.map +1 -1
- package/package.json +10 -3
- package/src/abis/index.ts +6 -6
- package/src/consts/chainEnvToChain.ts +2 -2
- package/src/consts/productIds.ts +1 -1
- package/src/deployments/core/deployment.inkMainnet.json +13 -0
- package/src/deployments/core/deployment.inkSepolia.json +13 -0
- package/src/deployments/index.ts +5 -5
- package/src/eip712/getNadoEIP712Domain.ts +1 -1
- package/src/eip712/index.ts +6 -6
- package/src/encoding/encoding.ts +43 -1
- package/src/types/ChainEnv.ts +1 -1
- package/src/types/index.ts +3 -3
- package/src/types/orderAppendixTypes.ts +25 -0
- package/src/utils/createDeterministicLinkedSignerPrivateKey.ts +1 -1
- package/src/utils/index.ts +6 -6
- package/src/utils/math/bigDecimal.ts +5 -3
- package/src/utils/math/index.ts +4 -4
- package/src/utils/orders/appendix/appendixIsolatedValue.ts +49 -0
- package/src/utils/orders/appendix/appendixTwapValue.ts +14 -19
- package/src/utils/orders/appendix/index.ts +2 -2
- package/src/utils/orders/appendix/orderAppendix.test.ts +68 -11
- package/src/utils/orders/appendix/packOrderAppendix.ts +10 -6
- package/src/utils/orders/appendix/types.ts +9 -7
- package/src/utils/orders/appendix/unpackOrderAppendix.ts +22 -5
- package/src/utils/orders/index.ts +1 -1
- package/src/utils/productTypeFilter.ts +2 -2
- package/src/utils/toPrintableObject.ts +30 -10
- package/dist/chunk-TUJ4HQKF.js.map +0 -1
- package/dist/deployments/core/deployment.InkSepolia.json +0 -13
- package/dist/deployments/core/deployment.arbitrumOne.json +0 -18
- package/src/deployments/core/deployment.InkSepolia.json +0 -13
- package/src/deployments/core/deployment.arbitrumOne.json +0 -18
package/src/types/ChainEnv.ts
CHANGED
|
@@ -2,7 +2,7 @@ export const LOCAL_CHAIN_ENVS = ['local'] as const satisfies string[];
|
|
|
2
2
|
|
|
3
3
|
export const TESTNET_CHAIN_ENVS = ['inkTestnet'] as const satisfies string[];
|
|
4
4
|
|
|
5
|
-
export const MAINNET_CHAIN_ENVS = ['
|
|
5
|
+
export const MAINNET_CHAIN_ENVS = ['inkMainnet'] as const satisfies string[];
|
|
6
6
|
|
|
7
7
|
export const ALL_CHAIN_ENVS = [
|
|
8
8
|
...LOCAL_CHAIN_ENVS,
|
package/src/types/index.ts
CHANGED
|
@@ -3,9 +3,9 @@ export * from './bytes';
|
|
|
3
3
|
export * from './ChainEnv';
|
|
4
4
|
export * from './healthTypes';
|
|
5
5
|
export * from './marketTypes';
|
|
6
|
+
export * from './nadoContractTypes';
|
|
7
|
+
export * from './orderAppendixTypes';
|
|
8
|
+
export * from './OrderExecutionType';
|
|
6
9
|
export * from './productTypes';
|
|
7
10
|
export * from './subaccountTypes';
|
|
8
|
-
export * from './nadoContractTypes';
|
|
9
11
|
export * from './viemTypes';
|
|
10
|
-
export * from './OrderExecutionType';
|
|
11
|
-
export * from './orderAppendixTypes';
|
|
@@ -31,10 +31,29 @@ export interface OrderAppendixTwapFields {
|
|
|
31
31
|
export interface OrderAppendixIsolatedFields {
|
|
32
32
|
/**
|
|
33
33
|
* Amount of margin to transfer into the isolated position.
|
|
34
|
+
*
|
|
35
|
+
* Implementation Note:
|
|
36
|
+
* Packed appendix uses precision of 6 decimals on backend.
|
|
37
|
+
* SDK automatically converts to/from x18 during packing/unpacking.
|
|
34
38
|
*/
|
|
35
39
|
margin: BigDecimalish;
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Fields for specifying a builder (fee recipient) for the order
|
|
44
|
+
*/
|
|
45
|
+
export interface OrderAppendixBuilderFields {
|
|
46
|
+
/**
|
|
47
|
+
* The builder ID (registered builder identifier)
|
|
48
|
+
*/
|
|
49
|
+
builderId: number;
|
|
50
|
+
/**
|
|
51
|
+
* The builder fee rate. This is a raw 10-bit integer (0-1023) where each unit = 0.1 bps.
|
|
52
|
+
* The actual fee is calculated on notional value: builder_fee = price * amount * rate
|
|
53
|
+
*/
|
|
54
|
+
builderFeeRate: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
38
57
|
/**
|
|
39
58
|
* All the fields encoded by the order appendix
|
|
40
59
|
*/
|
|
@@ -55,4 +74,10 @@ export interface OrderAppendix {
|
|
|
55
74
|
* An order CANNOT be both a TWAP order and an isolated order.
|
|
56
75
|
*/
|
|
57
76
|
twap?: OrderAppendixTwapFields;
|
|
77
|
+
/**
|
|
78
|
+
* Specify the builder for fee sharing.
|
|
79
|
+
* Builder ID is encoded in bits 48-63 (16 bits).
|
|
80
|
+
* Builder fee rate is encoded in bits 38-47 (10 bits).
|
|
81
|
+
*/
|
|
82
|
+
builder?: OrderAppendixBuilderFields;
|
|
58
83
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keccak256 } from 'viem';
|
|
2
|
+
import { getNadoEIP712Domain } from '../eip712/getNadoEIP712Domain';
|
|
2
3
|
import { Subaccount } from '../types/subaccountTypes';
|
|
3
4
|
import { WalletClientWithAccount } from '../types/viemTypes';
|
|
4
|
-
import { getNadoEIP712Domain } from '../eip712/getNadoEIP712Domain';
|
|
5
5
|
import { subaccountToHex } from './bytes32';
|
|
6
6
|
|
|
7
7
|
interface Params extends Subaccount {
|
package/src/utils/index.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './interest';
|
|
3
|
-
export * from './productTypeFilter';
|
|
1
|
+
export * from './asyncResult';
|
|
4
2
|
export * from './balanceValue';
|
|
5
3
|
export * from './bytes32';
|
|
6
4
|
export * from './createDeterministicLinkedSignerPrivateKey';
|
|
7
|
-
export * from './isWriteableContract';
|
|
8
5
|
export * from './errors';
|
|
9
|
-
export * from './math';
|
|
10
|
-
export * from './asyncResult';
|
|
11
6
|
export * from './getValidatedAddress';
|
|
12
7
|
export * from './getValidatedHex';
|
|
8
|
+
export * from './interest';
|
|
9
|
+
export * from './isWriteableContract';
|
|
13
10
|
export * from './mapValues';
|
|
11
|
+
export * from './math';
|
|
12
|
+
export * from './orders';
|
|
13
|
+
export * from './productTypeFilter';
|
|
14
14
|
export * from './time';
|
|
15
15
|
export * from './toPrintableObject';
|
|
@@ -17,10 +17,12 @@ export type BigDecimalish = BigDecimal | BigDecimal.Value | bigint;
|
|
|
17
17
|
* @param val
|
|
18
18
|
*/
|
|
19
19
|
export function toBigDecimal(val: BigDecimalish): BigDecimal {
|
|
20
|
+
if (BigDecimal.isBigNumber(val)) {
|
|
21
|
+
return val;
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
const bnConstructorVal = (() => {
|
|
21
|
-
if (val
|
|
22
|
-
return val;
|
|
23
|
-
} else if (typeof val === 'string' || typeof val === 'number') {
|
|
25
|
+
if (typeof val === 'string' || typeof val === 'number') {
|
|
24
26
|
return val;
|
|
25
27
|
} else if (typeof val === 'bigint') {
|
|
26
28
|
return val.toString();
|
package/src/utils/math/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './bigDecimal';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './toBigInt';
|
|
2
|
+
export * from './BigDecimals';
|
|
4
3
|
export * from './clamp';
|
|
5
|
-
export * from './sumBigDecimalBy';
|
|
6
4
|
export * from './decimalAdjustment';
|
|
7
|
-
export * from './
|
|
5
|
+
export * from './sumBigDecimalBy';
|
|
6
|
+
export * from './toBigInt';
|
|
7
|
+
export * from './toIntegerString';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { OrderAppendixIsolatedFields } from '../../../types';
|
|
2
|
+
import {
|
|
3
|
+
addDecimals,
|
|
4
|
+
NADO_PRODUCT_DECIMALS,
|
|
5
|
+
removeDecimals,
|
|
6
|
+
toBigInt,
|
|
7
|
+
} from '../../math';
|
|
8
|
+
import { bitMaskValue } from './bitMaskValue';
|
|
9
|
+
|
|
10
|
+
const APPENDIX_V1_ISO_MARGIN_DECIMALS = 6;
|
|
11
|
+
|
|
12
|
+
/* Appendix v1 uses x6 precision, so we need to adjust precision to/from SDK's usual precision */
|
|
13
|
+
const MARGIN_DECIMAL_ADJUSTMENT =
|
|
14
|
+
NADO_PRODUCT_DECIMALS - APPENDIX_V1_ISO_MARGIN_DECIMALS;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Packs the provided margin into a single 64-bit bigint.
|
|
18
|
+
*
|
|
19
|
+
* Bit layout (MSB → LSB):
|
|
20
|
+
* | margin_x6 |
|
|
21
|
+
* |-----------|
|
|
22
|
+
* | 63..0 |
|
|
23
|
+
* | 64 bits |
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export function packIsolatedOrderAppendixValue({
|
|
27
|
+
margin,
|
|
28
|
+
}: OrderAppendixIsolatedFields): bigint {
|
|
29
|
+
return bitMaskValue(
|
|
30
|
+
toBigInt(removeDecimals(margin, MARGIN_DECIMAL_ADJUSTMENT)),
|
|
31
|
+
64,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Unpacks a 64-bit bigint into its component fields for Isolated orders.
|
|
37
|
+
*
|
|
38
|
+
* @param value 64-bit bigint to unpack
|
|
39
|
+
* @returns Object with:
|
|
40
|
+
* - margin_x6: bigint, from bits 63..0
|
|
41
|
+
*/
|
|
42
|
+
export function unpackIsolatedOrderAppendixValue(
|
|
43
|
+
value: bigint,
|
|
44
|
+
): OrderAppendixIsolatedFields {
|
|
45
|
+
const margin = bitMaskValue(value, 64);
|
|
46
|
+
return {
|
|
47
|
+
margin: toBigInt(addDecimals(margin, MARGIN_DECIMAL_ADJUSTMENT)),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -2,17 +2,16 @@ import { OrderAppendixTwapFields } from '../../../types/orderAppendixTypes';
|
|
|
2
2
|
import { addDecimals, removeDecimals, toBigInt } from '../../math';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Packs the provided fields into a single
|
|
5
|
+
* Packs the provided fields into a single 64-bit bigint.
|
|
6
6
|
*
|
|
7
7
|
* Bit layout (MSB → LSB):
|
|
8
|
-
* | times | slippage_x6 |
|
|
9
|
-
*
|
|
10
|
-
* |
|
|
11
|
-
* | 32 bits | 32 bits |
|
|
8
|
+
* | times | slippage_x6 |
|
|
9
|
+
* |-----------|-------------|
|
|
10
|
+
* | 63..32 | 31..0 |
|
|
11
|
+
* | 32 bits | 32 bits |
|
|
12
12
|
*
|
|
13
|
-
* - `times` occupies bits
|
|
14
|
-
* - `slippage_x6` occupies bits
|
|
15
|
-
* - `reserved` occupies bits 31..0 (least significant 32 bits)
|
|
13
|
+
* - `times` occupies bits 63..32 (most significant 32 bits)
|
|
14
|
+
* - `slippage_x6` occupies bits 31..0 (least significant 32 bits)
|
|
16
15
|
*/
|
|
17
16
|
export function packTwapOrderAppendixValue({
|
|
18
17
|
numOrders,
|
|
@@ -22,27 +21,23 @@ export function packTwapOrderAppendixValue({
|
|
|
22
21
|
const slippageX6BigInt = toBigInt(addDecimals(slippageFrac, 6));
|
|
23
22
|
|
|
24
23
|
return (
|
|
25
|
-
((numOrdersBigInt & 0xffffffffn) <<
|
|
26
|
-
((slippageX6BigInt & 0xffffffffn) << 32n) |
|
|
27
|
-
// The last reserved 32 bits are set to 0
|
|
28
|
-
(0n & 0xffffffffn)
|
|
24
|
+
((numOrdersBigInt & 0xffffffffn) << 32n) | (slippageX6BigInt & 0xffffffffn)
|
|
29
25
|
);
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
/**
|
|
33
|
-
* Unpacks a
|
|
29
|
+
* Unpacks a 64-bit bigint into its component fields for TWAP orders.
|
|
34
30
|
*
|
|
35
|
-
* @param value
|
|
31
|
+
* @param value 64-bit bigint to unpack
|
|
36
32
|
* @returns Object with:
|
|
37
|
-
* - times: number, from bits
|
|
38
|
-
* - slippage_x6: number, from bits
|
|
39
|
-
* - reserved: number, from bits 31..0
|
|
33
|
+
* - times: number, from bits 63..32
|
|
34
|
+
* - slippage_x6: number, from bits 31..0
|
|
40
35
|
*/
|
|
41
36
|
export function unpackTwapOrderAppendixValue(
|
|
42
37
|
value: bigint,
|
|
43
38
|
): OrderAppendixTwapFields {
|
|
44
|
-
const numOrders = (value >>
|
|
45
|
-
const slippageX6 =
|
|
39
|
+
const numOrders = (value >> 32n) & 0xffffffffn;
|
|
40
|
+
const slippageX6 = value & 0xffffffffn;
|
|
46
41
|
|
|
47
42
|
return {
|
|
48
43
|
numOrders: Number(numOrders),
|
|
@@ -11,7 +11,7 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
11
11
|
};
|
|
12
12
|
const packed = packOrderAppendix(appendix);
|
|
13
13
|
const unpacked = unpackOrderAppendix(packed);
|
|
14
|
-
expect(packed).toBe(
|
|
14
|
+
expect(packed).toBe(4097n);
|
|
15
15
|
expect(unpacked.orderExecutionType).toBe(appendix.orderExecutionType);
|
|
16
16
|
expect(unpacked.triggerType).toBe(appendix.triggerType);
|
|
17
17
|
expect(unpacked.reduceOnly).toBeFalsy();
|
|
@@ -25,7 +25,7 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
25
25
|
};
|
|
26
26
|
const packed = packOrderAppendix(appendix);
|
|
27
27
|
const unpacked = unpackOrderAppendix(packed);
|
|
28
|
-
expect(packed).toBe(
|
|
28
|
+
expect(packed).toBe(6145n);
|
|
29
29
|
expect(unpacked.reduceOnly).toBe(true);
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -60,12 +60,12 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
60
60
|
orderExecutionType: 'default',
|
|
61
61
|
triggerType: 'price',
|
|
62
62
|
|
|
63
|
-
isolated: { margin:
|
|
63
|
+
isolated: { margin: 12345678901000000000000n },
|
|
64
64
|
};
|
|
65
65
|
const packed = packOrderAppendix(appendix);
|
|
66
66
|
const unpacked = unpackOrderAppendix(packed);
|
|
67
|
-
expect(packed).toBe(
|
|
68
|
-
expect(unpacked.isolated?.margin).toBe(
|
|
67
|
+
expect(packed).toBe(227737579102942800187821658369n);
|
|
68
|
+
expect(unpacked.isolated?.margin).toBe(appendix.isolated?.margin);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
it('should handle TWAP fields', () => {
|
|
@@ -77,7 +77,7 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
77
77
|
};
|
|
78
78
|
const packed = packOrderAppendix(appendix);
|
|
79
79
|
const unpacked = unpackOrderAppendix(packed);
|
|
80
|
-
expect(packed).toBe(
|
|
80
|
+
expect(packed).toBe(792281717376363744483197591553n);
|
|
81
81
|
expect(unpacked.twap).toMatchObject({ numOrders: 10, slippageFrac: 0.005 });
|
|
82
82
|
});
|
|
83
83
|
|
|
@@ -86,16 +86,16 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
86
86
|
orderExecutionType: 'post_only',
|
|
87
87
|
triggerType: undefined,
|
|
88
88
|
reduceOnly: true,
|
|
89
|
-
isolated: { margin:
|
|
89
|
+
isolated: { margin: 18446744073709551615n }, // 2^64-1
|
|
90
90
|
};
|
|
91
91
|
const packed = packOrderAppendix(appendix);
|
|
92
92
|
const unpacked = unpackOrderAppendix(packed);
|
|
93
93
|
expect(unpacked.orderExecutionType).toBe(appendix.orderExecutionType);
|
|
94
94
|
expect(unpacked.triggerType).toBe(appendix.triggerType);
|
|
95
95
|
expect(unpacked.reduceOnly).toBe(appendix.reduceOnly);
|
|
96
|
-
expect(unpacked.isolated?.margin).toBe(
|
|
96
|
+
expect(unpacked.isolated?.margin).toBe(18446744000000000000n);
|
|
97
97
|
expect(unpacked.twap).toBe(undefined);
|
|
98
|
-
expect(packed).toBe(
|
|
98
|
+
expect(packed).toBe(340282365561237229015142145n);
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
it('should handle max values for all fields for TWAP orders', () => {
|
|
@@ -104,7 +104,6 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
104
104
|
triggerType: 'twap_custom_amounts',
|
|
105
105
|
reduceOnly: true,
|
|
106
106
|
twap: {
|
|
107
|
-
// max 32-bit unsigned int
|
|
108
107
|
numOrders: 4294967295,
|
|
109
108
|
slippageFrac: 0.000001,
|
|
110
109
|
},
|
|
@@ -116,6 +115,64 @@ describe('OrderAppendix packing/unpacking', () => {
|
|
|
116
115
|
expect(unpacked.reduceOnly).toBe(appendix.reduceOnly);
|
|
117
116
|
expect(unpacked.twap?.slippageFrac).toBe(0.000001);
|
|
118
117
|
expect(unpacked.twap?.numOrders).toBe(4294967295);
|
|
119
|
-
expect(packed).toBe(
|
|
118
|
+
expect(packed).toBe(340282366841710300967557013911933828609n);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('should handle builder fields', () => {
|
|
122
|
+
const appendix: OrderAppendix = {
|
|
123
|
+
orderExecutionType: 'default',
|
|
124
|
+
builder: { builderId: 123, builderFeeRate: 500 },
|
|
125
|
+
};
|
|
126
|
+
const packed = packOrderAppendix(appendix);
|
|
127
|
+
const unpacked = unpackOrderAppendix(packed);
|
|
128
|
+
expect(unpacked.builder?.builderId).toBe(123);
|
|
129
|
+
expect(unpacked.builder?.builderFeeRate).toBe(500);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('should handle builder with zero fee rate', () => {
|
|
133
|
+
const appendix: OrderAppendix = {
|
|
134
|
+
orderExecutionType: 'default',
|
|
135
|
+
builder: { builderId: 42, builderFeeRate: 0 },
|
|
136
|
+
};
|
|
137
|
+
const packed = packOrderAppendix(appendix);
|
|
138
|
+
const unpacked = unpackOrderAppendix(packed);
|
|
139
|
+
expect(unpacked.builder?.builderId).toBe(42);
|
|
140
|
+
expect(unpacked.builder?.builderFeeRate).toBe(0);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('should handle builder with max values', () => {
|
|
144
|
+
const appendix: OrderAppendix = {
|
|
145
|
+
orderExecutionType: 'default',
|
|
146
|
+
builder: { builderId: 65535, builderFeeRate: 1023 }, // 16 bits, 10 bits max
|
|
147
|
+
};
|
|
148
|
+
const packed = packOrderAppendix(appendix);
|
|
149
|
+
const unpacked = unpackOrderAppendix(packed);
|
|
150
|
+
expect(unpacked.builder?.builderId).toBe(65535);
|
|
151
|
+
expect(unpacked.builder?.builderFeeRate).toBe(1023);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('should handle builder combined with other flags', () => {
|
|
155
|
+
const appendix: OrderAppendix = {
|
|
156
|
+
orderExecutionType: 'ioc',
|
|
157
|
+
reduceOnly: true,
|
|
158
|
+
triggerType: 'price',
|
|
159
|
+
builder: { builderId: 5, builderFeeRate: 100 },
|
|
160
|
+
};
|
|
161
|
+
const packed = packOrderAppendix(appendix);
|
|
162
|
+
const unpacked = unpackOrderAppendix(packed);
|
|
163
|
+
expect(unpacked.orderExecutionType).toBe('ioc');
|
|
164
|
+
expect(unpacked.reduceOnly).toBe(true);
|
|
165
|
+
expect(unpacked.triggerType).toBe('price');
|
|
166
|
+
expect(unpacked.builder?.builderId).toBe(5);
|
|
167
|
+
expect(unpacked.builder?.builderFeeRate).toBe(100);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('should not return builder fields when builderId is 0', () => {
|
|
171
|
+
const appendix: OrderAppendix = {
|
|
172
|
+
orderExecutionType: 'default',
|
|
173
|
+
};
|
|
174
|
+
const packed = packOrderAppendix(appendix);
|
|
175
|
+
const unpacked = unpackOrderAppendix(packed);
|
|
176
|
+
expect(unpacked.builder).toBeUndefined();
|
|
120
177
|
});
|
|
121
178
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrderAppendix } from '../../../types/orderAppendixTypes';
|
|
2
|
-
import {
|
|
2
|
+
import { packIsolatedOrderAppendixValue } from './appendixIsolatedValue';
|
|
3
3
|
import { packTwapOrderAppendixValue } from './appendixTwapValue';
|
|
4
4
|
import { bitMaskValue } from './bitMaskValue';
|
|
5
5
|
import { PackedOrderAppendixBits } from './types';
|
|
@@ -12,7 +12,7 @@ function mapOrderAppendixToBitValues(
|
|
|
12
12
|
return packTwapOrderAppendixValue(appendix.twap);
|
|
13
13
|
}
|
|
14
14
|
if (appendix.isolated) {
|
|
15
|
-
return
|
|
15
|
+
return packIsolatedOrderAppendixValue(appendix.isolated);
|
|
16
16
|
}
|
|
17
17
|
return 0n;
|
|
18
18
|
})();
|
|
@@ -43,12 +43,14 @@ function mapOrderAppendixToBitValues(
|
|
|
43
43
|
|
|
44
44
|
return {
|
|
45
45
|
value,
|
|
46
|
+
builderId: appendix.builder?.builderId ?? 0,
|
|
47
|
+
builderFeeRate: appendix.builder?.builderFeeRate ?? 0,
|
|
46
48
|
reserved: 0,
|
|
47
49
|
trigger,
|
|
48
50
|
reduceOnly: appendix.reduceOnly ? 1 : 0,
|
|
49
51
|
orderType,
|
|
50
52
|
isolated: appendix.isolated ? 1 : 0,
|
|
51
|
-
version:
|
|
53
|
+
version: 1,
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -59,9 +61,11 @@ function mapOrderAppendixToBitValues(
|
|
|
59
61
|
export function packOrderAppendix(appendix: OrderAppendix): bigint {
|
|
60
62
|
const bits = mapOrderAppendixToBitValues(appendix);
|
|
61
63
|
|
|
62
|
-
// Ensure value is within
|
|
63
|
-
let packed = bitMaskValue(bits.value,
|
|
64
|
-
packed = (packed <<
|
|
64
|
+
// Ensure value is within 64 bits
|
|
65
|
+
let packed = bitMaskValue(bits.value, 64);
|
|
66
|
+
packed = (packed << 16n) | bitMaskValue(bits.builderId, 16);
|
|
67
|
+
packed = (packed << 10n) | bitMaskValue(bits.builderFeeRate, 10);
|
|
68
|
+
packed = (packed << 24n) | bitMaskValue(bits.reserved, 24);
|
|
65
69
|
packed = (packed << 2n) | bitMaskValue(bits.trigger, 2);
|
|
66
70
|
packed = (packed << 1n) | bitMaskValue(bits.reduceOnly, 1);
|
|
67
71
|
packed = (packed << 2n) | bitMaskValue(bits.orderType, 2);
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bit layout for OrderAppendix packing (MSB → LSB):
|
|
3
3
|
*
|
|
4
|
-
* | value | reserved | trigger | reduceOnly | orderType | isolated | version |
|
|
5
|
-
*
|
|
6
|
-
* | 127..
|
|
7
|
-
* |
|
|
4
|
+
* | value | builderId | builderFeeRate | reserved | trigger | reduceOnly | orderType | isolated | version |
|
|
5
|
+
* |-----------|-----------|----------------|----------|---------|------------|-----------|----------|---------|
|
|
6
|
+
* | 127..64 | 63..48 | 47..38 | 37..14 | 13..12 | 11 | 10..9 | 8 | 7..0 |
|
|
7
|
+
* | 64 bits | 16 bits | 10 bits | 24 bits | 2 bits | 1 bit | 2 bits | 1 bit | 8 bits |
|
|
8
8
|
*/
|
|
9
9
|
export interface PackedOrderAppendixBits {
|
|
10
|
-
value: bigint; //
|
|
11
|
-
|
|
10
|
+
value: bigint; // 64 bits
|
|
11
|
+
builderId: number; // 16 bits
|
|
12
|
+
builderFeeRate: number; // 10 bits
|
|
13
|
+
reserved: number; // 24 bits, set to 0
|
|
12
14
|
trigger: number; // 2 bits
|
|
13
15
|
reduceOnly: number; // 1 bit
|
|
14
16
|
orderType: number; // 2 bits
|
|
15
17
|
isolated: number; // 1 bit
|
|
16
|
-
version: number; // 8 bits, set to
|
|
18
|
+
version: number; // 8 bits, set to 1
|
|
17
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OrderAppendix } from '../../../types/orderAppendixTypes';
|
|
2
2
|
import { BigDecimalish, toBigInt } from '../../math';
|
|
3
|
+
import { unpackIsolatedOrderAppendixValue } from './appendixIsolatedValue';
|
|
3
4
|
import { unpackTwapOrderAppendixValue } from './appendixTwapValue';
|
|
4
5
|
import { bitMaskValue } from './bitMaskValue';
|
|
5
6
|
import { PackedOrderAppendixBits } from './types';
|
|
@@ -35,7 +36,7 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
|
|
|
35
36
|
})();
|
|
36
37
|
const isolatedFields = (() => {
|
|
37
38
|
if (bits.isolated) {
|
|
38
|
-
return
|
|
39
|
+
return unpackIsolatedOrderAppendixValue(bits.value);
|
|
39
40
|
}
|
|
40
41
|
return undefined;
|
|
41
42
|
})();
|
|
@@ -44,6 +45,15 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
|
|
|
44
45
|
return unpackTwapOrderAppendixValue(bits.value);
|
|
45
46
|
}
|
|
46
47
|
})();
|
|
48
|
+
const builderFields = (() => {
|
|
49
|
+
if (bits.builderId) {
|
|
50
|
+
return {
|
|
51
|
+
builderId: bits.builderId,
|
|
52
|
+
builderFeeRate: bits.builderFeeRate,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
})();
|
|
47
57
|
|
|
48
58
|
return {
|
|
49
59
|
reduceOnly: !!bits.reduceOnly,
|
|
@@ -51,6 +61,7 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
|
|
|
51
61
|
triggerType,
|
|
52
62
|
isolated: isolatedFields,
|
|
53
63
|
twap: twapFields,
|
|
64
|
+
builder: builderFields,
|
|
54
65
|
};
|
|
55
66
|
}
|
|
56
67
|
|
|
@@ -73,13 +84,19 @@ export function unpackOrderAppendix(packed: BigDecimalish): OrderAppendix {
|
|
|
73
84
|
temp >>= 1n;
|
|
74
85
|
const trigger = Number(bitMaskValue(temp, 2));
|
|
75
86
|
temp >>= 2n;
|
|
76
|
-
const reserved = Number(bitMaskValue(temp,
|
|
77
|
-
temp >>=
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
const reserved = Number(bitMaskValue(temp, 24));
|
|
88
|
+
temp >>= 24n;
|
|
89
|
+
const builderFeeRate = Number(bitMaskValue(temp, 10));
|
|
90
|
+
temp >>= 10n;
|
|
91
|
+
const builderId = Number(bitMaskValue(temp, 16));
|
|
92
|
+
temp >>= 16n;
|
|
93
|
+
// The remaining bits are the value, which should be 64 bits
|
|
94
|
+
const value = bitMaskValue(temp, 64);
|
|
80
95
|
|
|
81
96
|
return mapBitValuesToAppendix({
|
|
82
97
|
value,
|
|
98
|
+
builderId,
|
|
99
|
+
builderFeeRate,
|
|
83
100
|
reserved,
|
|
84
101
|
trigger,
|
|
85
102
|
reduceOnly,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes';
|
|
2
2
|
import {
|
|
3
|
-
ProductEngineType,
|
|
4
3
|
PerpProduct,
|
|
5
|
-
SpotProduct,
|
|
6
4
|
Product,
|
|
5
|
+
ProductEngineType,
|
|
6
|
+
SpotProduct,
|
|
7
7
|
} from '../types/productTypes';
|
|
8
8
|
|
|
9
9
|
export function isSpotProduct(product: Product): product is SpotProduct {
|
|
@@ -1,25 +1,45 @@
|
|
|
1
1
|
import { BigDecimal } from './math/bigDecimal';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Util for converting any BigDecimal types into a string so that it can be logged nicely
|
|
4
|
+
* Util for converting any BigDecimal types into a string so that it can be logged nicely.
|
|
5
|
+
* Handles cyclic references by returning '[Circular]' for already-visited objects.
|
|
5
6
|
*/
|
|
6
|
-
export function toPrintableObject(
|
|
7
|
-
|
|
7
|
+
export function toPrintableObject(
|
|
8
|
+
obj: null | undefined,
|
|
9
|
+
seen?: WeakSet<object>,
|
|
10
|
+
): null;
|
|
11
|
+
export function toPrintableObject(
|
|
12
|
+
obj: BigDecimal | bigint,
|
|
13
|
+
seen?: WeakSet<object>,
|
|
14
|
+
): string;
|
|
15
|
+
export function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;
|
|
16
|
+
export function toPrintableObject(obj: unknown, seen = new WeakSet()): unknown {
|
|
17
|
+
if (obj === null || obj === undefined) {
|
|
8
18
|
return null;
|
|
9
19
|
}
|
|
10
20
|
if (obj instanceof BigDecimal || typeof obj === 'bigint') {
|
|
11
21
|
return obj.toString();
|
|
12
22
|
}
|
|
13
23
|
if (Array.isArray(obj)) {
|
|
14
|
-
return obj.map(toPrintableObject);
|
|
24
|
+
return obj.map((item) => toPrintableObject(item, seen));
|
|
15
25
|
}
|
|
16
26
|
if (typeof obj === 'object') {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
// Detect cyclic references
|
|
28
|
+
if (seen.has(obj)) {
|
|
29
|
+
return '[Circular]';
|
|
30
|
+
}
|
|
31
|
+
seen.add(obj);
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
return Object.fromEntries(
|
|
35
|
+
Object.entries(obj).map(([key, value]) => [
|
|
36
|
+
key,
|
|
37
|
+
toPrintableObject(value, seen),
|
|
38
|
+
]),
|
|
39
|
+
);
|
|
40
|
+
} catch {
|
|
41
|
+
return { error: '[Unserializable Object]' };
|
|
42
|
+
}
|
|
23
43
|
}
|
|
24
44
|
return obj;
|
|
25
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/@jest/globals/build/index.js"],"sourcesContent":["/*!\n * /**\n * * Copyright (c) Meta Platforms, Inc. and affiliates.\n * *\n * * This source code is licensed under the MIT license found in the\n * * LICENSE file in the root directory of this source tree.\n * * /\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\nvar __webpack_exports__ = {};\n\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\n\nthrow new Error('Do not import `@jest/globals` outside of the Jest test environment');\nmodule.exports = __webpack_exports__;\n/******/ })()\n;"],"mappings":";;;;;AAAA;AAAA;AAAA;AAQS,KAAC,MAAM;AACN;AACV,UAAI,sBAAsB,CAAC;AAY3B,YAAM,IAAI,MAAM,oEAAoE;AACpF,aAAO,UAAU;AAAA,IACR,GAAG;AAAA;AAAA;","names":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"nodeUrl": "https://rpc-gel-sepolia.inkonchain.com",
|
|
3
|
-
"explorerUrl": "https://explorer-sepolia.inkonchain.com",
|
|
4
|
-
"startBlock": 27233833,
|
|
5
|
-
"deployer": "0x8177A1b5bFaAa10A4b1178c6D42aDaa4b75c8146",
|
|
6
|
-
"quote": "0x5F65358d61A9a281ea3BB930d05889ACa21E3f4f",
|
|
7
|
-
"querier": "0x5A62e748b2630560Ffe9E928780cF9Fe0e086A21",
|
|
8
|
-
"clearinghouse": "0x5E9b4336104069467E57E843033e62c79C667F8F",
|
|
9
|
-
"endpoint": "0xf8963f7860aF7DE9b94893EDb9A3b5c155e1Fc0c",
|
|
10
|
-
"spotEngine": "0x61AA7A636df5e72eBe34c70a340eB76ABB3A15bE",
|
|
11
|
-
"perpEngine": "0x3D6Ac7105cA399884739a8CC19cAdB4178844466",
|
|
12
|
-
"withdrawPool": "0xa59613a3e4ce46E20d83b0632E3D857e3f116F66"
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"nodeUrl": "https://arb1.arbitrum.io/rpc",
|
|
3
|
-
"explorerUrl": "https://explorer.arbitrum.io",
|
|
4
|
-
"subgraphCoreUrl": "https://api.thegraph.com/subgraphs/name/nado-protocol/nado-prod-core",
|
|
5
|
-
"subgraphMarketsUrl": "https://api.thegraph.com/subgraphs/name/nado-protocol/nado-prod-markets",
|
|
6
|
-
"subgraphCandleSticksUrl": "https://api.thegraph.com/subgraphs/name/nado-protocol/nado-prod-candlesticks",
|
|
7
|
-
"startBlock": 67108377,
|
|
8
|
-
"deployer": "0xB746472C10f9F128FF9F5029f424cC91bb1D8C3a",
|
|
9
|
-
"quote": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
|
|
10
|
-
"querier": "0x1693273B443699bee277eCbc60e2C8027E91995d",
|
|
11
|
-
"feeCalculator": "0x2259440579447D0625a5E28dfF3E743d207e8890",
|
|
12
|
-
"clearinghouse": "0xAE1ec28d6225dCE2ff787dcb8CE11cF6D3AE064f",
|
|
13
|
-
"clearinghouseLiq": "0xca007C51Fc14eEA88252Cc4FD71e91E44026F020",
|
|
14
|
-
"endpoint": "0xbbEE07B3e8121227AfCFe1E2B82772246226128e",
|
|
15
|
-
"spotEngine": "0x32d91Af2B17054D575A7bF1ACfa7615f41CCEfaB",
|
|
16
|
-
"perpEngine": "0xb74C78cca0FADAFBeE52B2f48A67eE8c834b5fd1",
|
|
17
|
-
"withdrawPool": "0x3567a1f8d79046A7e93Fd76d71104A978cDC6d05"
|
|
18
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"nodeUrl": "https://rpc-gel-sepolia.inkonchain.com",
|
|
3
|
-
"explorerUrl": "https://explorer-sepolia.inkonchain.com",
|
|
4
|
-
"startBlock": 27233833,
|
|
5
|
-
"deployer": "0x8177A1b5bFaAa10A4b1178c6D42aDaa4b75c8146",
|
|
6
|
-
"quote": "0x5F65358d61A9a281ea3BB930d05889ACa21E3f4f",
|
|
7
|
-
"querier": "0x5A62e748b2630560Ffe9E928780cF9Fe0e086A21",
|
|
8
|
-
"clearinghouse": "0x5E9b4336104069467E57E843033e62c79C667F8F",
|
|
9
|
-
"endpoint": "0xf8963f7860aF7DE9b94893EDb9A3b5c155e1Fc0c",
|
|
10
|
-
"spotEngine": "0x61AA7A636df5e72eBe34c70a340eB76ABB3A15bE",
|
|
11
|
-
"perpEngine": "0x3D6Ac7105cA399884739a8CC19cAdB4178844466",
|
|
12
|
-
"withdrawPool": "0xa59613a3e4ce46E20d83b0632E3D857e3f116F66"
|
|
13
|
-
}
|