@bulletxyz/bullet-sdk 0.17.6-rc.2 → 0.17.7

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.
@@ -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 calculate_force_close_risk_percentage(user_account: any, margin_context: any): string;
31
- static calculate_max_borrow_amount(asset_id: number, user_account: any, margin_context: any): string;
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;
@@ -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 calculateForceCloseRiskPercentage(userAccount: UserAccount, marginContext: MarginContext): Decimal;
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;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/zetamarkets/bullet-sdk.git"
6
6
  },
7
- "version": "0.17.6-rc.2",
7
+ "version": "0.17.7",
8
8
  "description": "Bullet SDK",
9
9
  "author": "@bulletxyz",
10
10
  "license": "Apache-2.0",