@bulletxyz/bullet-sdk 0.17.6-rc.1 → 0.17.7-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 +25 -19
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +25 -19
- package/dist/node/index.js.map +2 -2
- package/dist/types/bullet-wasm/index.d.ts +6 -2
- package/dist/types/calc.d.ts +2 -2
- package/package.json +1 -1
|
@@ -27,8 +27,12 @@ export class BulletWasm {
|
|
|
27
27
|
static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_context: any): string;
|
|
28
28
|
static calculate_estimated_liquidation_price(user_account: any, asset_id: number, margin_context: any): string;
|
|
29
29
|
static calculate_liquidation_risk_percentage(user_account: any, margin_context: any): string;
|
|
30
|
-
static
|
|
31
|
-
|
|
30
|
+
static calculate_force_cancel_risk_percentage(user_account: any, margin_context: any): string;
|
|
31
|
+
/**
|
|
32
|
+
* Calculates the maximum amount that can be borrowed for a given asset
|
|
33
|
+
* @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
|
|
34
|
+
*/
|
|
35
|
+
static calculate_max_borrow_amount(asset_id: number, initial_liability_weight: string, user_account: any, margin_context: any): string;
|
|
32
36
|
static calculate_max_order_size(user_account: any, asset_id: number, side: Side, price: string, reduce_only: boolean, margin_context: any, maker_book: any, n_iterations: number, error_tolerance: string): string;
|
|
33
37
|
static simulate_used_margin_on_borrow(asset_id: number, borrow_amount: string, user_account: any, margin_type: MarginType, margin_context: any): any;
|
|
34
38
|
static simulate_used_margin_on_order(asset_id: number, side: Side, price: string, size: string, reduce_only: boolean, user_account: any, margin_context: any): any;
|
package/dist/types/calc.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export declare function calculateUsedMargin(marginType: MarginType, userAccount:
|
|
|
16
16
|
export declare function calculateWithdrawableAmountOfAsset(assetId: AssetId, userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
17
17
|
export declare function calculateEstimatedLiquidationPrice(assetId: AssetId, userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
18
18
|
export declare function calculateLiquidationRiskPercentage(userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function calculateMaxBorrowAmount(assetId: AssetId, userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
19
|
+
export declare function calculateForceCancelRiskPercentage(userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
20
|
+
export declare function calculateMaxBorrowAmount(assetId: AssetId, initialLiabilityWeight: Decimal, userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
21
21
|
export declare function calculateMaxOrderSize(assetId: AssetId, side: Side, price: Decimal, reduceOnly: boolean, userAccount: UserAccount, marginContext: MarginContext, makerBook: OrderbookData, n_iterations?: number, error_tolerance?: Decimal): Decimal;
|
|
22
22
|
export declare function simulateUsedMarginOnBorrow(assetId: AssetId, borrowAmount: Decimal, userAccount: UserAccount, marginType: MarginType, marginContext: MarginContext): {
|
|
23
23
|
current: Decimal;
|