@drift-labs/sdk 0.2.0-master.27 → 0.2.0-master.29
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/lib/admin.d.ts +3 -3
- package/lib/admin.js +5 -5
- package/lib/clearingHouse.d.ts +6 -0
- package/lib/clearingHouse.js +51 -13
- package/lib/clearingHouseConfig.d.ts +1 -0
- package/lib/clearingHouseUser.js +5 -5
- package/lib/config.js +1 -1
- package/lib/idl/clearing_house.json +123 -95
- package/lib/math/insurance.js +1 -1
- package/lib/math/market.d.ts +2 -1
- package/lib/math/market.js +16 -11
- package/lib/math/position.d.ts +3 -3
- package/lib/math/position.js +23 -16
- package/lib/math/repeg.js +8 -0
- package/lib/types.d.ts +22 -39
- package/package.json +1 -1
- package/src/admin.ts +14 -20
- package/src/clearingHouse.ts +81 -8
- package/src/clearingHouseConfig.ts +1 -0
- package/src/clearingHouseUser.ts +6 -6
- package/src/config.ts +1 -1
- package/src/idl/clearing_house.json +123 -95
- package/src/math/insurance.ts +2 -2
- package/src/math/market.ts +21 -12
- package/src/math/position.ts +36 -22
- package/src/math/repeg.ts +9 -0
- package/src/types.ts +24 -40
- package/tests/dlob/helpers.ts +1 -1
- package/lib/math/state.d.ts +0 -8
- package/lib/math/state.js +0 -15
- package/src/math/state.ts +0 -14
package/src/math/state.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { StateAccount } from '../types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Get the clearing house percent fee charged on notional of taking trades
|
|
5
|
-
*
|
|
6
|
-
* @param state
|
|
7
|
-
* @returns Precision : basis points (bps)
|
|
8
|
-
*/
|
|
9
|
-
export function getExchangeFee(state: StateAccount): number {
|
|
10
|
-
const exchangeFee =
|
|
11
|
-
state.perpFeeStructure.feeNumerator.toNumber() /
|
|
12
|
-
state.perpFeeStructure.feeDenominator.toNumber();
|
|
13
|
-
return exchangeFee;
|
|
14
|
-
}
|