@depthhq/maker-sdk 0.0.0-stage → 0.1.2
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/automation/automation.d.ts +24 -0
- package/dist/automation/types.d.ts +40 -0
- package/dist/backstop/backstop.d.ts +35 -0
- package/dist/bot/bot.d.ts +42 -0
- package/dist/bot/policy.d.ts +41 -0
- package/dist/bot/store.d.ts +32 -0
- package/dist/chain/arcium.d.ts +18 -0
- package/dist/chain/random.d.ts +1 -0
- package/dist/client/client.d.ts +181 -0
- package/dist/client/types.d.ts +100 -0
- package/dist/fill/browser.d.ts +8 -0
- package/dist/fill/cursor.d.ts +8 -0
- package/dist/fill/history.d.ts +25 -0
- package/dist/fill/store.d.ts +2 -0
- package/dist/hedge/access.d.ts +40 -0
- package/dist/hedge/amount.d.ts +2 -0
- package/dist/hedge/engine.d.ts +9 -0
- package/dist/hedge/hyperliquid.d.ts +35 -0
- package/dist/hedge/policy.d.ts +4 -0
- package/dist/hedge/schema.d.ts +2 -0
- package/dist/hedge/setup.d.ts +22 -0
- package/dist/hedge/types.d.ts +89 -0
- package/dist/hedge/wallet.d.ts +8 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +28208 -0
- package/dist/index.node.js +26729 -0
- package/dist/node.d.ts +11 -0
- package/dist/node.js +1195 -0
- package/dist/quote/quote.d.ts +38 -0
- package/dist/quote/replacement.d.ts +23 -0
- package/package.json +37 -3
- package/README.md +0 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type AbstractWallet } from "@nktkas/hyperliquid/signing";
|
|
2
|
+
export declare function verify_hyperliquid(options: {
|
|
3
|
+
account: `0x${string}`;
|
|
4
|
+
agent: `0x${string}`;
|
|
5
|
+
network: "testnet" | "mainnet";
|
|
6
|
+
maxLeverage: number;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function setup_hyperliquid(options: {
|
|
9
|
+
wallet?: AbstractWallet;
|
|
10
|
+
accountKey?: `0x${string}`;
|
|
11
|
+
account?: `0x${string}`;
|
|
12
|
+
agent?: `0x${string}`;
|
|
13
|
+
agentKey?: `0x${string}`;
|
|
14
|
+
network?: "testnet" | "mainnet";
|
|
15
|
+
leverage: number;
|
|
16
|
+
agentName?: string;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
account: `0x${string}`;
|
|
19
|
+
agent: `0x${string}`;
|
|
20
|
+
network: "testnet" | "mainnet";
|
|
21
|
+
leverage: number;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export type HedgePolicy = {
|
|
2
|
+
ratioBps: number;
|
|
3
|
+
thresholdNotional: bigint;
|
|
4
|
+
maxUnhedgedNotional: bigint;
|
|
5
|
+
maxOrderNotional: bigint;
|
|
6
|
+
batchMs: number;
|
|
7
|
+
maxUnhedgedMs: number;
|
|
8
|
+
maxSlippageBps: number;
|
|
9
|
+
maxPriceAgeMs: number;
|
|
10
|
+
orderTtlMs: number;
|
|
11
|
+
maxLeverage: number;
|
|
12
|
+
};
|
|
13
|
+
export type HedgeLevel = {
|
|
14
|
+
priceE8: bigint;
|
|
15
|
+
size: bigint;
|
|
16
|
+
};
|
|
17
|
+
export type HedgeBook = {
|
|
18
|
+
timestamp: number;
|
|
19
|
+
bids: HedgeLevel[];
|
|
20
|
+
asks: HedgeLevel[];
|
|
21
|
+
};
|
|
22
|
+
export type HedgeAccount = {
|
|
23
|
+
timestamp: number;
|
|
24
|
+
position: bigint;
|
|
25
|
+
availableMargin: bigint;
|
|
26
|
+
leverage: number;
|
|
27
|
+
openOrders: string[];
|
|
28
|
+
};
|
|
29
|
+
export type HedgeOrder = {
|
|
30
|
+
cloid: string;
|
|
31
|
+
nonce: number;
|
|
32
|
+
expiresAt: number;
|
|
33
|
+
buy: boolean;
|
|
34
|
+
size: bigint;
|
|
35
|
+
limitPriceE8: bigint;
|
|
36
|
+
reduceOnly: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type HedgeReceipt = {
|
|
39
|
+
status: "filled" | "cancelled" | "rejected" | "open" | "unknown";
|
|
40
|
+
orderId?: number;
|
|
41
|
+
filledSize: bigint;
|
|
42
|
+
averagePriceE8?: bigint;
|
|
43
|
+
fee?: bigint;
|
|
44
|
+
hashes?: string[];
|
|
45
|
+
reason?: string;
|
|
46
|
+
};
|
|
47
|
+
export type HedgeRecord = HedgeOrder & HedgeReceipt & {
|
|
48
|
+
completedAt: number;
|
|
49
|
+
};
|
|
50
|
+
export type HedgeState = {
|
|
51
|
+
identity: string;
|
|
52
|
+
depthAccount?: string;
|
|
53
|
+
nonce: number;
|
|
54
|
+
unhedgedSince?: number;
|
|
55
|
+
pending?: HedgeOrder;
|
|
56
|
+
history: HedgeRecord[];
|
|
57
|
+
};
|
|
58
|
+
export type HedgeSnapshot = {
|
|
59
|
+
venue: "hyperliquid";
|
|
60
|
+
network: "testnet" | "mainnet";
|
|
61
|
+
account: string;
|
|
62
|
+
updatedAt: number;
|
|
63
|
+
phase: "balanced" | "waiting" | "pending" | "blocked";
|
|
64
|
+
reason?: string;
|
|
65
|
+
depthPosition?: bigint;
|
|
66
|
+
externalPosition?: bigint;
|
|
67
|
+
unhedgedPosition?: bigint;
|
|
68
|
+
pending?: HedgeOrder;
|
|
69
|
+
history: HedgeRecord[];
|
|
70
|
+
};
|
|
71
|
+
export interface HedgeAdapter {
|
|
72
|
+
readonly identity: string;
|
|
73
|
+
readonly network: "testnet" | "mainnet";
|
|
74
|
+
readonly address: string;
|
|
75
|
+
readonly sizeStep: bigint;
|
|
76
|
+
readonly minNotional: bigint;
|
|
77
|
+
book(): Promise<HedgeBook>;
|
|
78
|
+
costs(): Promise<{
|
|
79
|
+
takerFeeBps: number;
|
|
80
|
+
hourlyFundingBps: number;
|
|
81
|
+
}>;
|
|
82
|
+
account(): Promise<HedgeAccount>;
|
|
83
|
+
price(value: bigint, buy: boolean): bigint;
|
|
84
|
+
submit(order: HedgeOrder): Promise<HedgeReceipt>;
|
|
85
|
+
receipt(order: HedgeOrder): Promise<HedgeReceipt>;
|
|
86
|
+
cancel(order: HedgeOrder, nonce: number): Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
export declare const abs: (value: bigint) => bigint;
|
|
89
|
+
export declare const notional: (size: bigint, priceE8: bigint) => bigint;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AbstractViemJsonRpcAccount } from "@nktkas/hyperliquid/signing";
|
|
2
|
+
export type EthereumProvider = {
|
|
3
|
+
request(input: {
|
|
4
|
+
method: string;
|
|
5
|
+
params?: unknown[];
|
|
6
|
+
}): Promise<unknown>;
|
|
7
|
+
};
|
|
8
|
+
export declare function connect_hyperliquid(provider: EthereumProvider): Promise<AbstractViemJsonRpcAccount>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { createDepthMaker, createDepthMaker as create_depth_maker, MakerClient, } from "./client/client.js";
|
|
2
|
+
export { QuoteHandle } from "./quote/quote.js";
|
|
3
|
+
export { QuoteReplacement } from "./quote/replacement.js";
|
|
4
|
+
export type { ReplacementSnapshot } from "./quote/replacement.js";
|
|
5
|
+
export { BackstopHandle, BackstopRelease } from "./backstop/backstop.js";
|
|
6
|
+
export type { BackstopSnapshot } from "./backstop/backstop.js";
|
|
7
|
+
export type { QuoteSnapshot } from "./quote/quote.js";
|
|
8
|
+
export type { FlatQuoteInput, BackstopInput, MakerOptions, QuoteInput, QuoteRequest, QuoteTier, } from "./client/types.js";
|
|
9
|
+
export type { FillPage } from "./fill/history.js";
|
|
10
|
+
export { MakerAccess } from "./hedge/access.js";
|
|
11
|
+
export type { MakerHedgeView } from "./hedge/access.js";
|
|
12
|
+
export { MakerAutomation } from "./automation/automation.js";
|
|
13
|
+
export { automationConfig, automationWire, automationView, } from "./automation/types.js";
|
|
14
|
+
export type { AutomationConfig, AutomationView } from "./automation/types.js";
|
|
15
|
+
export { setup_hyperliquid } from "./hedge/setup.js";
|
|
16
|
+
export { connect_hyperliquid } from "./hedge/wallet.js";
|
|
17
|
+
export type { EthereumProvider } from "./hedge/wallet.js";
|