@bulletxyz/bullet-sdk 0.22.0-rc.0 → 0.22.1-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 +8 -5
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +8 -5
- package/dist/node/index.js.map +2 -2
- package/dist/types/bullet-wasm/index.d.ts +1 -1
- package/dist/types/calc.d.ts +2 -2
- package/dist/types/zod-types/rest.d.ts +24 -10
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ export class BulletWasm {
|
|
|
25
25
|
*/
|
|
26
26
|
static calculate_max_borrow_amount(asset_id: number, initial_liability_weight: string, user_account: any, margin_calculation_state: any): string;
|
|
27
27
|
static calculate_max_order_size(asset_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
|
-
static simulate_used_margin_on_borrow(asset_id: number, borrow_amount: string, user_account: any, margin_type: MarginType, margin_calculation_state: any): any;
|
|
28
|
+
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
29
|
static simulate_used_margin_on_order(place_order_args: any, user_account: any, margin_calculation_state: any, orderbook: any): any;
|
|
30
30
|
static simulate_estimated_liquidation_price_on_order(place_order_args: any, user_account: any, margin_calculation_state: any, orderbook: any): any;
|
|
31
31
|
static calculate_positions_additional_metadata(user_account: any, margin_calculation_state: any, funding_parameters: any): any;
|
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
3
|
import type { Asset, AssetId, OrderType, PlaceOrderArgs, Side } from "./types";
|
|
4
|
-
import type { BorrowLendMarket, MarginConfig, OraclePrices, OrderbookL2, PerpMarket, PerpPrices, UserAccount } from "./zod-types/rest";
|
|
4
|
+
import type { BorrowLendMarket, 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 {
|
|
@@ -20,7 +20,7 @@ export declare function calculateLiquidationRiskPercentage(userAccount: UserAcco
|
|
|
20
20
|
export declare function calculateForceCancelRiskPercentage(userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
21
21
|
export declare function calculateMaxBorrowAmount(asset_id: AssetId, initialLiabilityWeight: Decimal, userAccount: UserAccount, MarginCalculationState: MarginCalculationState): Decimal;
|
|
22
22
|
export declare function calculateMaxOrderSize(asset: Asset, price: Decimal, side: Side, order_type: OrderType, reduce_only: boolean, userAccount: UserAccount, MarginCalculationState: MarginCalculationState, orderbook: OrderbookL2, n_iterations?: number, error_tolerance?: Decimal): Decimal;
|
|
23
|
-
export declare function simulateUsedMarginOnBorrow(asset_id: AssetId, borrowAmount: Decimal, userAccount: UserAccount, marginType: MarginType, MarginCalculationState: MarginCalculationState): {
|
|
23
|
+
export declare function simulateUsedMarginOnBorrow(asset_id: AssetId, borrowAmount: Decimal, borrowLendRiskWeights: BorrowLendRiskWeights, userAccount: UserAccount, marginType: MarginType, MarginCalculationState: MarginCalculationState): {
|
|
24
24
|
current: Decimal;
|
|
25
25
|
updated: Decimal;
|
|
26
26
|
};
|
|
@@ -363,6 +363,19 @@ export declare const BaseResponseSchemas: {
|
|
|
363
363
|
}>;
|
|
364
364
|
};
|
|
365
365
|
declare const PriceLevel: z.ZodTuple<[z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>], null>;
|
|
366
|
+
declare const BorrowLendRiskWeights: z.ZodObject<{
|
|
367
|
+
asset_weight: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
368
|
+
initial_liability_weight: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
369
|
+
maintenance_liability_weight: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
370
|
+
}, "strip", z.ZodTypeAny, {
|
|
371
|
+
asset_weight: import("decimal.js").Decimal;
|
|
372
|
+
initial_liability_weight: import("decimal.js").Decimal;
|
|
373
|
+
maintenance_liability_weight: import("decimal.js").Decimal;
|
|
374
|
+
}, {
|
|
375
|
+
asset_weight: string | number;
|
|
376
|
+
initial_liability_weight: string | number;
|
|
377
|
+
maintenance_liability_weight: string | number;
|
|
378
|
+
}>;
|
|
366
379
|
declare const Order: z.ZodObject<{
|
|
367
380
|
side: z.ZodEnum<["Bid", "Ask"]>;
|
|
368
381
|
asset_id: z.ZodNumber;
|
|
@@ -466,15 +479,15 @@ export declare const Schemas: {
|
|
|
466
479
|
external_deposits: Record<string, string | number>;
|
|
467
480
|
}>;
|
|
468
481
|
readonly UsdcInsuranceFund: z.ZodObject<{
|
|
469
|
-
|
|
482
|
+
amount: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
470
483
|
external_deposits: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>>, Map<string, import("decimal.js").Decimal>, Record<string, string | number>>;
|
|
471
484
|
minimum_usdc_token_amount: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
472
485
|
}, "strip", z.ZodTypeAny, {
|
|
473
|
-
|
|
486
|
+
amount: import("decimal.js").Decimal;
|
|
474
487
|
external_deposits: Map<string, import("decimal.js").Decimal>;
|
|
475
488
|
minimum_usdc_token_amount: import("decimal.js").Decimal;
|
|
476
489
|
}, {
|
|
477
|
-
|
|
490
|
+
amount: string | number;
|
|
478
491
|
external_deposits: Record<string, string | number>;
|
|
479
492
|
minimum_usdc_token_amount: string | number;
|
|
480
493
|
}>;
|
|
@@ -1665,27 +1678,27 @@ export declare const ResponseSchemas: {
|
|
|
1665
1678
|
readonly UsdcInsuranceFund: z.ZodObject<{
|
|
1666
1679
|
data: z.ZodObject<{
|
|
1667
1680
|
value: z.ZodNullable<z.ZodObject<{
|
|
1668
|
-
|
|
1681
|
+
amount: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
1669
1682
|
external_deposits: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>>, Map<string, import("decimal.js").Decimal>, Record<string, string | number>>;
|
|
1670
1683
|
minimum_usdc_token_amount: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
1671
1684
|
}, "strip", z.ZodTypeAny, {
|
|
1672
|
-
|
|
1685
|
+
amount: import("decimal.js").Decimal;
|
|
1673
1686
|
external_deposits: Map<string, import("decimal.js").Decimal>;
|
|
1674
1687
|
minimum_usdc_token_amount: import("decimal.js").Decimal;
|
|
1675
1688
|
}, {
|
|
1676
|
-
|
|
1689
|
+
amount: string | number;
|
|
1677
1690
|
external_deposits: Record<string, string | number>;
|
|
1678
1691
|
minimum_usdc_token_amount: string | number;
|
|
1679
1692
|
}>>;
|
|
1680
1693
|
}, "strip", z.ZodTypeAny, {
|
|
1681
1694
|
value: {
|
|
1682
|
-
|
|
1695
|
+
amount: import("decimal.js").Decimal;
|
|
1683
1696
|
external_deposits: Map<string, import("decimal.js").Decimal>;
|
|
1684
1697
|
minimum_usdc_token_amount: import("decimal.js").Decimal;
|
|
1685
1698
|
} | null;
|
|
1686
1699
|
}, {
|
|
1687
1700
|
value: {
|
|
1688
|
-
|
|
1701
|
+
amount: string | number;
|
|
1689
1702
|
external_deposits: Record<string, string | number>;
|
|
1690
1703
|
minimum_usdc_token_amount: string | number;
|
|
1691
1704
|
} | null;
|
|
@@ -1694,7 +1707,7 @@ export declare const ResponseSchemas: {
|
|
|
1694
1707
|
}, "strip", z.ZodTypeAny, {
|
|
1695
1708
|
data: {
|
|
1696
1709
|
value: {
|
|
1697
|
-
|
|
1710
|
+
amount: import("decimal.js").Decimal;
|
|
1698
1711
|
external_deposits: Map<string, import("decimal.js").Decimal>;
|
|
1699
1712
|
minimum_usdc_token_amount: import("decimal.js").Decimal;
|
|
1700
1713
|
} | null;
|
|
@@ -1703,7 +1716,7 @@ export declare const ResponseSchemas: {
|
|
|
1703
1716
|
}, {
|
|
1704
1717
|
data: {
|
|
1705
1718
|
value: {
|
|
1706
|
-
|
|
1719
|
+
amount: string | number;
|
|
1707
1720
|
external_deposits: Record<string, string | number>;
|
|
1708
1721
|
minimum_usdc_token_amount: string | number;
|
|
1709
1722
|
} | null;
|
|
@@ -4653,4 +4666,5 @@ export type MarginConfig = z.infer<typeof Schemas.MarginConfig>;
|
|
|
4653
4666
|
export type Assets = z.infer<typeof Schemas.Assets>;
|
|
4654
4667
|
export type Tpsl = z.infer<typeof Tpsl>;
|
|
4655
4668
|
export type AccountAddresses = z.infer<typeof Schemas.AccountAddresses>;
|
|
4669
|
+
export type BorrowLendRiskWeights = z.infer<typeof BorrowLendRiskWeights>;
|
|
4656
4670
|
export {};
|