@bulletxyz/bullet-sdk 0.22.0-rc.0 → 0.22.1-rc.0
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 +7 -4
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +7 -4
- 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 +14 -0
- 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;
|
|
@@ -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 {};
|