@bulletxyz/bullet-sdk 0.23.1 → 0.24.0-rc.1
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/browser/index.js +262 -156
- package/dist/browser/index.js.map +3 -3
- package/dist/node/index.js +262 -156
- package/dist/node/index.js.map +3 -3
- package/dist/types/bullet-wasm/index.d.ts +13 -3
- package/dist/types/calc.d.ts +7 -7
- package/dist/types/client.d.ts +9 -9
- package/dist/types/exchange.d.ts +11 -12
- package/dist/types/orderbook.d.ts +3 -3
- package/dist/types/rollupTypes.d.ts +15 -13
- package/dist/types/types.d.ts +25 -5
- package/dist/types/zod-types/index.d.ts +1 -0
- package/dist/types/zod-types/rest.d.ts +1184 -618
- package/package.json +1 -1
|
@@ -4,6 +4,11 @@ type EquityType = "Unweighted" | "WeightedInitial" | "WeightedMaintenance";
|
|
|
4
4
|
type MarginType = "Initial" | "Maintenance";
|
|
5
5
|
type OrderType = "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
|
|
6
6
|
type Side = "Bid" | "Ask";
|
|
7
|
+
export class AssetId {
|
|
8
|
+
private constructor();
|
|
9
|
+
free(): void;
|
|
10
|
+
0: number;
|
|
11
|
+
}
|
|
7
12
|
export class BulletWasm {
|
|
8
13
|
free(): void;
|
|
9
14
|
constructor();
|
|
@@ -16,7 +21,7 @@ export class BulletWasm {
|
|
|
16
21
|
static calculate_available_margin(user_account: any, conservative: boolean, margin_type: MarginType, margin_calculation_state: any): string;
|
|
17
22
|
static calculate_used_margin(user_account: any, margin_type: MarginType, margin_calculation_state: any): string;
|
|
18
23
|
static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_calculation_state: any): string;
|
|
19
|
-
static calculate_estimated_liquidation_price(user_account: any,
|
|
24
|
+
static calculate_estimated_liquidation_price(user_account: any, market_id: number, base_asset_id: number, margin_calculation_state: any): string;
|
|
20
25
|
static calculate_liquidation_risk_percentage(user_account: any, margin_calculation_state: any): string;
|
|
21
26
|
static calculate_force_cancel_risk_percentage(user_account: any, margin_calculation_state: any): string;
|
|
22
27
|
/**
|
|
@@ -24,11 +29,16 @@ export class BulletWasm {
|
|
|
24
29
|
* @param initial_liability_weight The initial liability weight for the market must be passed in separately since the user may not have a spot ledger for this asset yet
|
|
25
30
|
*/
|
|
26
31
|
static calculate_max_borrow_amount(asset_id: number, initial_liability_weight: string, user_account: any, margin_calculation_state: any): string;
|
|
27
|
-
static calculate_max_order_size(
|
|
32
|
+
static calculate_max_order_size(market_id: number, price: string, side: Side, order_type: OrderType, reduce_only: boolean, user_account: any, margin_calculation_state: any, orderbook: any, n_iterations: number, error_tolerance: string): string;
|
|
28
33
|
static simulate_used_margin_on_borrow(asset_id: number, borrow_amount: string, borrow_lend_risk_weights: any, user_account: any, margin_type: MarginType, margin_calculation_state: any): any;
|
|
29
34
|
static simulate_used_margin_on_order(place_order_args: any, user_account: any, margin_calculation_state: any, orderbook: any): any;
|
|
30
|
-
static simulate_estimated_liquidation_price_on_order(place_order_args: any, user_account: any, margin_calculation_state: any, orderbook: any): any;
|
|
35
|
+
static simulate_estimated_liquidation_price_on_order(place_order_args: any, base_asset: number, user_account: any, margin_calculation_state: any, orderbook: any): any;
|
|
31
36
|
static calculate_positions_additional_metadata(user_account: any, margin_calculation_state: any, funding_parameters: any): any;
|
|
32
37
|
static calculate_borrow_lend_additional_metadata(borrow_lend_market: any): any;
|
|
33
38
|
static calculate_account_summary_batch(user_accounts: any, margin_calculation_state: any): any;
|
|
34
39
|
}
|
|
40
|
+
export class MarketId {
|
|
41
|
+
private constructor();
|
|
42
|
+
free(): void;
|
|
43
|
+
0: number;
|
|
44
|
+
}
|
package/dist/types/calc.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Decimal from "decimal.js";
|
|
2
2
|
import { type EquityType, type MarginType } from "./bullet-wasm";
|
|
3
|
-
import type { Asset, OrderType, PlaceOrderArgs, Side } from "./types";
|
|
4
|
-
import type {
|
|
3
|
+
import type { Asset, Market, OrderType, PlaceOrderArgs, Side } from "./types";
|
|
4
|
+
import type { BorrowLendMarkets, BorrowLendRiskWeights, MarginConfig, OraclePrices, OrderbookL2, PerpMarket, PerpPrices, UserAccount } from "./zod-types/rest";
|
|
5
5
|
export declare function calculateOrderbookMidpoint(orderbook: OrderbookL2): Decimal | undefined;
|
|
6
6
|
export declare function calculateEntryPrice(asset: Asset, userAccount: UserAccount): Decimal;
|
|
7
7
|
export interface MarginCalculationState {
|
|
@@ -15,11 +15,11 @@ export declare function calculateAccountLeverage(userAccount: UserAccount, Margi
|
|
|
15
15
|
export declare function calculateAvailableMargin(marginType: MarginType, conservative: boolean, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
16
16
|
export declare function calculateUsedMargin(marginType: MarginType, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
17
17
|
export declare function calculateWithdrawableAmountOfAsset(asset: Asset, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
18
|
-
export declare function calculateEstimatedLiquidationPrice(asset: Asset, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
18
|
+
export declare function calculateEstimatedLiquidationPrice(market: Market, asset: Asset, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
19
19
|
export declare function calculateLiquidationRiskPercentage(userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
20
20
|
export declare function calculateForceCancelRiskPercentage(userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
21
21
|
export declare function calculateMaxBorrowAmount(asset: Asset, initialLiabilityWeight: Decimal, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
22
|
-
export declare function calculateMaxOrderSize(
|
|
22
|
+
export declare function calculateMaxOrderSize(market: Market, price: Decimal, side: Side, order_type: OrderType, reduce_only: boolean, userAccount: UserAccount, MarginCalculationState: MarginCalculationState, orderbook: OrderbookL2, n_iterations?: number, error_tolerance?: Decimal): Decimal;
|
|
23
23
|
export declare function simulateUsedMarginOnBorrow(asset: Asset, borrowAmount: Decimal, borrowLendRiskWeights: BorrowLendRiskWeights, userAccount: UserAccount, marginType: MarginType, MarginCalculationState: MarginCalculationState): {
|
|
24
24
|
current: Decimal;
|
|
25
25
|
updated: Decimal;
|
|
@@ -28,18 +28,18 @@ export declare function simulateUsedMarginOnOrder(placeOrderArgs: PlaceOrderArgs
|
|
|
28
28
|
current: Decimal;
|
|
29
29
|
updated: Decimal;
|
|
30
30
|
};
|
|
31
|
-
export declare function simulateEstimatedLiquidationPriceOnOrder(placeOrderArgs: PlaceOrderArgs, userAccount: UserAccount, MarginCalculationState: MarginCalculationState, orderbook: OrderbookL2): {
|
|
31
|
+
export declare function simulateEstimatedLiquidationPriceOnOrder(placeOrderArgs: PlaceOrderArgs, baseAsset: Asset, userAccount: UserAccount, MarginCalculationState: MarginCalculationState, orderbook: OrderbookL2): {
|
|
32
32
|
current: Decimal;
|
|
33
33
|
updated: Decimal;
|
|
34
34
|
};
|
|
35
|
-
export declare function calculatePositionsAdditionalMetadata(userAccount: UserAccount, MarginCalculationState: MarginCalculationState, perpMarkets: Map<
|
|
35
|
+
export declare function calculatePositionsAdditionalMetadata(userAccount: UserAccount, MarginCalculationState: MarginCalculationState, perpMarkets: Map<Market, PerpMarket>): Map<number, {
|
|
36
36
|
projected_funding_payment: Decimal;
|
|
37
37
|
unrealized_pnl: Decimal;
|
|
38
38
|
liquidation_price: Decimal;
|
|
39
39
|
liquidation_risk_percentage: Decimal;
|
|
40
40
|
max_leverage_to_use: number;
|
|
41
41
|
}>;
|
|
42
|
-
export declare function calculateBorrowLendMarketAdditionalMetadata(borrowLendMarket:
|
|
42
|
+
export declare function calculateBorrowLendMarketAdditionalMetadata(borrowLendMarket: BorrowLendMarkets): {
|
|
43
43
|
utilisation_rate: Decimal;
|
|
44
44
|
current_deposit_rate: Decimal;
|
|
45
45
|
current_borrow_rate: Decimal;
|
package/dist/types/client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Connection } from "./connection";
|
|
|
4
4
|
import { type Endpoints } from "./constants";
|
|
5
5
|
import { ExchangeConnection } from "./exchange";
|
|
6
6
|
import type { RuntimeCall } from "./rollupTypes";
|
|
7
|
-
import { type Address, type Asset, type MarkPriceUpdateArgs, type Network, type OraclePriceUpdateArgs, type PlaceOrderArgs, type TokenId, type TpslOrder } from "./types";
|
|
7
|
+
import { type Address, type Asset, type MarkPriceUpdateArgs, type Market, type Network, type OraclePriceUpdateArgs, type PlaceOrderArgs, type TokenId, type TpslOrder } from "./types";
|
|
8
8
|
import type { Wallet } from "./wallet";
|
|
9
9
|
export interface TransactionOpts {
|
|
10
10
|
maxPriorityFeeBps: number;
|
|
@@ -54,7 +54,7 @@ export declare class Client {
|
|
|
54
54
|
perp_ledgers: Map<number, {
|
|
55
55
|
orders: Map<bigint, {
|
|
56
56
|
side: "Bid" | "Ask";
|
|
57
|
-
|
|
57
|
+
market_id: number;
|
|
58
58
|
order_id: bigint;
|
|
59
59
|
price: Decimal;
|
|
60
60
|
remaining_size: Decimal;
|
|
@@ -76,7 +76,7 @@ export declare class Client {
|
|
|
76
76
|
user_selected_max_leverage: number;
|
|
77
77
|
tpsls: Map<bigint, {
|
|
78
78
|
side: "Bid" | "Ask";
|
|
79
|
-
|
|
79
|
+
market_id: number;
|
|
80
80
|
owner: string;
|
|
81
81
|
tpsl_order_id: bigint;
|
|
82
82
|
order_price: Decimal;
|
|
@@ -99,21 +99,21 @@ export declare class Client {
|
|
|
99
99
|
withdraw(asset: Asset, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
100
100
|
borrowSpot(asset: Asset, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
101
101
|
placeOrder(placeOrderArgs: PlaceOrderArgs, tpslOrders?: TpslOrder[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
102
|
-
|
|
102
|
+
placeTpslsForMarket(market: Market, tpslOrders: TpslOrder[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
103
103
|
replaceOrder(existingOrderId: bigint, placeOrderArgs: PlaceOrderArgs, tpslOrders?: TpslOrder[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
104
104
|
cancelTpsl(tpslOrderId: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
105
105
|
cancelOrder(orderId: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
106
|
-
|
|
106
|
+
cancelAllOrdersForMarket(market: Market): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
107
107
|
updateOraclePrices(pricesToUpdate: OraclePriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
108
108
|
updateMarkPrices(pricesToUpdate: MarkPriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
109
|
-
|
|
110
|
-
updatePremiumIndexes(
|
|
111
|
-
updateFunding(
|
|
109
|
+
updateMaxLeverageForMarket(market: Market, maxLeverage: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
110
|
+
updatePremiumIndexes(marketIds: Market[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
111
|
+
updateFunding(marketIds: Market[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
112
112
|
applyFunding(addresses: Address[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
113
113
|
forceCancelOrders(address: Address): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
114
114
|
forceClosePositions(address: Address): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
115
115
|
liquidatePerpPositions(address: Address, positions?: {
|
|
116
|
-
|
|
116
|
+
market: Market;
|
|
117
117
|
size: Decimal;
|
|
118
118
|
}[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
119
119
|
liquidateSpotLiability(address: Address, liabilityAssetId: Asset, collateralAssetId: Asset, liabilityAmount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseConnection } from "./connection";
|
|
2
2
|
import { type Endpoints } from "./constants";
|
|
3
3
|
import type { Orderbook } from "./orderbook";
|
|
4
|
-
import type { Address,
|
|
5
|
-
import { type AccountAddresses, type
|
|
4
|
+
import type { Address, Market, Network } from "./types";
|
|
5
|
+
import { type AccountAddresses, type AssetRegistry, type BorrowLendMarkets, type MarginConfig, type MarketRegistry, type OraclePrices, type Order, type OrderbookL2, type PerpMarket, type PerpPrices, type UsdcInsuranceFund, type UsdcPnlPool, type UserAccount } from "./zod-types/rest";
|
|
6
6
|
export declare class ExchangeConnection extends BaseConnection {
|
|
7
7
|
private wsManager?;
|
|
8
8
|
private constructor();
|
|
@@ -11,8 +11,10 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
11
11
|
static fromRestUrl(restUrl: string): ExchangeConnection;
|
|
12
12
|
getValue(): Promise<number | null>;
|
|
13
13
|
getOrder(order_id: bigint): Promise<Order | null>;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
getMarketRegistry(): Promise<MarketRegistry | null>;
|
|
15
|
+
getAssetRegistry(): Promise<AssetRegistry | null>;
|
|
16
|
+
getOrderbookL2(market: Market, levels?: number): Promise<OrderbookL2>;
|
|
17
|
+
getOrderbookL2s(markets: Market[], levels?: number): Promise<Map<Market, OrderbookL2>>;
|
|
16
18
|
getUserAccountAddresses(offset?: number, limit?: number): Promise<AccountAddresses>;
|
|
17
19
|
getUserAccount(address: Address): Promise<UserAccount>;
|
|
18
20
|
getUserAccounts(addresses: Address[]): Promise<Map<string, UserAccount>>;
|
|
@@ -20,14 +22,11 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
20
22
|
getPerpPrices(): Promise<PerpPrices | null>;
|
|
21
23
|
getUsdcPnlPool(): Promise<UsdcPnlPool | null>;
|
|
22
24
|
getUsdcInsuranceFund(): Promise<UsdcInsuranceFund | null>;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getPerpMarkets(assets: Asset[]): Promise<Map<Asset, PerpMarket>>;
|
|
25
|
+
getBorrowLendMarkets(): Promise<BorrowLendMarkets>;
|
|
26
|
+
getPerpMarket(market: Market): Promise<PerpMarket>;
|
|
27
|
+
getPerpMarkets(markets: Market[]): Promise<Map<Market, PerpMarket>>;
|
|
27
28
|
getMarginConfig(): Promise<MarginConfig | null>;
|
|
28
|
-
getPerpAssets(): Promise<Map<Asset, string>>;
|
|
29
|
-
getBorrowLendAssets(): Promise<Map<Asset, string>>;
|
|
30
29
|
private getWebSocketManager;
|
|
31
|
-
subscribeOrderbook(
|
|
32
|
-
unsubscribeOrderbook(
|
|
30
|
+
subscribeOrderbook(marketId: Market): AsyncIterable<Orderbook>;
|
|
31
|
+
unsubscribeOrderbook(marketId: Market): Promise<void>;
|
|
33
32
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Decimal from "decimal.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Market } from "./types";
|
|
3
3
|
import type { OrderbookL2, PriceLevel } from "./zod-types/rest";
|
|
4
4
|
import type { OrderbookUpdate } from "./zod-types/ws";
|
|
5
5
|
type Size = Decimal;
|
|
6
6
|
export declare class Orderbook {
|
|
7
7
|
bids: Map<string, Size>;
|
|
8
8
|
asks: Map<string, Size>;
|
|
9
|
-
|
|
9
|
+
market: Market;
|
|
10
10
|
lastUpdated: number;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(marketId: number, snapshot?: OrderbookUpdate);
|
|
12
12
|
protected updateBid(price: string, size: Size): void;
|
|
13
13
|
protected updateAsk(price: string, size: Size): void;
|
|
14
14
|
applyDelta(delta: OrderbookUpdate): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address, AssetId, TokenId } from "./types";
|
|
1
|
+
import type { Address, AssetId, MarketId, OrderId, TokenId } from "./types";
|
|
2
2
|
type ExactlyOne<T, Keys extends keyof T = keyof T> = {
|
|
3
3
|
[K in Keys]: {
|
|
4
4
|
[P in K]: T[P];
|
|
@@ -46,28 +46,30 @@ type ExchangeCallMessage = {
|
|
|
46
46
|
};
|
|
47
47
|
place_order: {
|
|
48
48
|
order_args: {
|
|
49
|
-
|
|
49
|
+
market_id: MarketId;
|
|
50
50
|
price: number;
|
|
51
51
|
size: number;
|
|
52
52
|
side: string;
|
|
53
53
|
order_type: string;
|
|
54
54
|
reduce_only: boolean;
|
|
55
|
+
tpsl_orders_ids: OrderId[] | null;
|
|
55
56
|
};
|
|
56
57
|
tpsls: Tpsl[];
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
place_tpsls_for_market: {
|
|
60
|
+
market_id: MarketId;
|
|
60
61
|
tpsls: Tpsl[];
|
|
61
62
|
};
|
|
62
63
|
replace_order: {
|
|
63
64
|
existing_order_id: string;
|
|
64
65
|
order_args: {
|
|
65
|
-
|
|
66
|
+
market_id: MarketId;
|
|
66
67
|
price: number;
|
|
67
68
|
size: number;
|
|
68
69
|
side: string;
|
|
69
70
|
order_type: string;
|
|
70
71
|
reduce_only: boolean;
|
|
72
|
+
tpsl_orders_ids: OrderId[] | null;
|
|
71
73
|
};
|
|
72
74
|
tpsls: Tpsl[];
|
|
73
75
|
};
|
|
@@ -77,8 +79,8 @@ type ExchangeCallMessage = {
|
|
|
77
79
|
cancel_order: {
|
|
78
80
|
order_id: string;
|
|
79
81
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
cancel_all_orders_for_market: {
|
|
83
|
+
market_id: MarketId;
|
|
82
84
|
};
|
|
83
85
|
update_oracle_prices: {
|
|
84
86
|
prices_to_update: {
|
|
@@ -89,21 +91,21 @@ type ExchangeCallMessage = {
|
|
|
89
91
|
};
|
|
90
92
|
update_mark_prices: {
|
|
91
93
|
prices_to_update: {
|
|
92
|
-
|
|
94
|
+
market_id: MarketId;
|
|
93
95
|
median_cex_price: number;
|
|
94
96
|
diff_ema: number;
|
|
95
97
|
}[];
|
|
96
98
|
publish_timestamp: number;
|
|
97
99
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
update_max_leverage_for_market: {
|
|
101
|
+
market_id: MarketId;
|
|
100
102
|
max_leverage: number;
|
|
101
103
|
};
|
|
102
104
|
update_premium_indexes: {
|
|
103
|
-
|
|
105
|
+
market_ids: MarketId[];
|
|
104
106
|
};
|
|
105
107
|
update_funding: {
|
|
106
|
-
|
|
108
|
+
market_ids: MarketId[];
|
|
107
109
|
};
|
|
108
110
|
apply_funding: {
|
|
109
111
|
addresses: Address[];
|
|
@@ -117,7 +119,7 @@ type ExchangeCallMessage = {
|
|
|
117
119
|
liquidate_perps_positions: {
|
|
118
120
|
address: Address;
|
|
119
121
|
positions: {
|
|
120
|
-
|
|
122
|
+
market_id: MarketId;
|
|
121
123
|
size: number;
|
|
122
124
|
}[] | null;
|
|
123
125
|
};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type PublicKey = string;
|
|
|
4
4
|
export type Address = string;
|
|
5
5
|
export type TokenId = string;
|
|
6
6
|
export type AssetId = number;
|
|
7
|
+
export type MarketId = number;
|
|
8
|
+
export type OrderId = number;
|
|
7
9
|
export declare enum Asset {
|
|
8
10
|
USDC = 0,
|
|
9
11
|
SOL = 1,
|
|
@@ -21,9 +23,27 @@ export declare enum Asset {
|
|
|
21
23
|
ENA = 13,
|
|
22
24
|
BERA = 14,
|
|
23
25
|
TIA = 15,
|
|
24
|
-
ZEX = 16
|
|
25
|
-
JLP = 17
|
|
26
|
+
ZEX = 16
|
|
26
27
|
}
|
|
28
|
+
export declare enum Market {
|
|
29
|
+
SOL_USD = 0,
|
|
30
|
+
BTC_USD = 1,
|
|
31
|
+
ETH_USD = 2,
|
|
32
|
+
DOGE_USD = 3,
|
|
33
|
+
WIF_USD = 4,
|
|
34
|
+
XRP_USD = 5,
|
|
35
|
+
HYPE_USD = 6,
|
|
36
|
+
ADA_USD = 7,
|
|
37
|
+
TRUMP_USD = 8,
|
|
38
|
+
SUI_USD = 9,
|
|
39
|
+
JUP_USD = 10,
|
|
40
|
+
JTO_USD = 11,
|
|
41
|
+
ENA_USD = 12,
|
|
42
|
+
BERA_USD = 13,
|
|
43
|
+
TIA_USD = 14,
|
|
44
|
+
ZEX_USD = 15
|
|
45
|
+
}
|
|
46
|
+
export type MarketKind = "Perp" | "Spot";
|
|
27
47
|
export type Side = "Bid" | "Ask";
|
|
28
48
|
export type TriggerDirection = "GreaterThanOrEqual" | "LessThanOrEqual";
|
|
29
49
|
export type TpslPriceCondition = "Mark" | "Oracle" | "LastTrade";
|
|
@@ -32,7 +52,7 @@ export type MarginType = "Initial" | "Maintenance";
|
|
|
32
52
|
export type EquityType = "Unweighted" | "WeightedInitial" | "WeightedMaintenance";
|
|
33
53
|
export type Network = "Localnet" | "Staging" | "Testnet" | "Mainnet";
|
|
34
54
|
export type PlaceOrderArgs = {
|
|
35
|
-
|
|
55
|
+
marketId: MarketId;
|
|
36
56
|
price: Decimal;
|
|
37
57
|
size: Decimal;
|
|
38
58
|
side: Side;
|
|
@@ -40,11 +60,11 @@ export type PlaceOrderArgs = {
|
|
|
40
60
|
reduceOnly: boolean;
|
|
41
61
|
};
|
|
42
62
|
export type OraclePriceUpdateArgs = {
|
|
43
|
-
|
|
63
|
+
assetId: AssetId;
|
|
44
64
|
oraclePrice: Decimal;
|
|
45
65
|
};
|
|
46
66
|
export type MarkPriceUpdateArgs = {
|
|
47
|
-
|
|
67
|
+
marketId: MarketId;
|
|
48
68
|
medianCexPrice: Decimal;
|
|
49
69
|
diffEma: Decimal;
|
|
50
70
|
};
|
|
@@ -8,6 +8,7 @@ export declare const U128Schema: z.ZodBigInt;
|
|
|
8
8
|
export declare const DecimalSchema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, Decimal, string | number>;
|
|
9
9
|
export declare const Base58Address: z.ZodString;
|
|
10
10
|
export declare const AssetId: z.ZodNumber;
|
|
11
|
+
export declare const MarketId: z.ZodNumber;
|
|
11
12
|
export declare const OrderId: z.ZodBigInt;
|
|
12
13
|
export declare const Amount: z.ZodBigInt;
|
|
13
14
|
export declare const UnixTimestampMillis: z.ZodBigInt;
|