@levrbet/shared 0.5.10 → 0.5.12
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.
|
@@ -1,61 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { OrderDirection } from "@prisma/client";
|
|
2
|
+
import type { Bytes32 } from "../../validators";
|
|
2
3
|
import type { Side } from "../blockchain/contract.types";
|
|
3
4
|
import type { LevrGameMarketId } from "../oracle/market/markets.types";
|
|
4
5
|
import type { OrderType } from "./order.types";
|
|
5
|
-
export interface
|
|
6
|
-
posEntryPrice:
|
|
6
|
+
export interface PreviewAskContext {
|
|
7
|
+
posEntryPrice: string;
|
|
7
8
|
posGameProgressAtOpen: number;
|
|
8
|
-
posPositionSize:
|
|
9
|
-
posTokensBought:
|
|
10
|
-
posTokenAmount:
|
|
11
|
-
posCollateral:
|
|
12
|
-
posEffectiveLeverage:
|
|
9
|
+
posPositionSize: string;
|
|
10
|
+
posTokensBought: string;
|
|
11
|
+
posTokenAmount: string;
|
|
12
|
+
posCollateral: string;
|
|
13
|
+
posEffectiveLeverage: string;
|
|
13
14
|
gameProgressBps: number;
|
|
14
15
|
borrowFeeBps: number;
|
|
15
16
|
txFeeBps: number;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
interface PreviewInputBase {
|
|
18
19
|
gameMarketId: LevrGameMarketId;
|
|
19
20
|
side: Side;
|
|
20
|
-
direction: OrderDirection;
|
|
21
21
|
type: OrderType;
|
|
22
|
+
direction: OrderDirection;
|
|
22
23
|
price?: number;
|
|
23
|
-
budget?: string;
|
|
24
|
-
tokenAmount?: string;
|
|
25
|
-
leverage?: number;
|
|
26
|
-
askContext?: AskPositionContext;
|
|
27
24
|
}
|
|
28
|
-
export interface
|
|
25
|
+
export interface PreviewBidInput extends PreviewInputBase {
|
|
26
|
+
direction: typeof OrderDirection.BID;
|
|
27
|
+
budget: string;
|
|
28
|
+
leverage: number;
|
|
29
|
+
}
|
|
30
|
+
export interface PreviewAskInput extends PreviewInputBase {
|
|
31
|
+
direction: typeof OrderDirection.ASK;
|
|
32
|
+
positionId: Bytes32;
|
|
33
|
+
tokenAmount: string;
|
|
34
|
+
askContext: PreviewAskContext;
|
|
35
|
+
}
|
|
36
|
+
export type PreviewOrderInput = PreviewBidInput | PreviewAskInput;
|
|
37
|
+
interface PreviewResultBase {
|
|
29
38
|
fillRatio: number;
|
|
30
39
|
estimatedOutput: string;
|
|
31
40
|
estimatedFees: string | null;
|
|
32
41
|
estimatedAveragePrice: number;
|
|
33
42
|
blockingReason: string | null;
|
|
34
43
|
}
|
|
35
|
-
export interface
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
side: Side;
|
|
39
|
-
direction: OrderDirection;
|
|
40
|
-
type: OrderType;
|
|
41
|
-
price?: number;
|
|
42
|
-
budget?: string;
|
|
43
|
-
tokenAmount?: string;
|
|
44
|
-
leverage?: number;
|
|
45
|
-
posEntryPrice?: string;
|
|
46
|
-
posGameProgressAtOpen?: number;
|
|
47
|
-
posPositionSize?: string;
|
|
48
|
-
posTokensBought?: string;
|
|
49
|
-
posTokenAmount?: string;
|
|
50
|
-
posCollateral?: string;
|
|
51
|
-
posEffectiveLeverage?: string;
|
|
52
|
-
gameProgressBps?: number;
|
|
53
|
-
borrowFeeBps?: number;
|
|
54
|
-
txFeeBps?: number;
|
|
55
|
-
}
|
|
56
|
-
export interface BatchPreviewOrderRequest {
|
|
57
|
-
items: BatchPreviewOrderItem[];
|
|
44
|
+
export interface PreviewBidResult extends PreviewResultBase {
|
|
45
|
+
potentialPayout: string;
|
|
46
|
+
avgLiqPrice: number;
|
|
58
47
|
}
|
|
59
|
-
export interface
|
|
60
|
-
positionId:
|
|
48
|
+
export interface PreviewAskResult extends PreviewResultBase {
|
|
49
|
+
positionId: Bytes32;
|
|
61
50
|
}
|
|
51
|
+
export type PreviewOrderResult = PreviewBidResult | PreviewAskResult;
|
|
52
|
+
export {};
|