@triadxyz/triad-protocol 3.3.3-beta → 3.3.4-beta
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.
|
@@ -7,11 +7,11 @@ exports.generateFeeCurve = exports.simulateSellOrder = exports.simulateBuyOrder
|
|
|
7
7
|
*/
|
|
8
8
|
function calculateDynamicFeeBps(price) {
|
|
9
9
|
const internalPrice = Math.floor(price * 1000000);
|
|
10
|
-
if (internalPrice <=
|
|
10
|
+
if (internalPrice <= 900000) {
|
|
11
11
|
return 190;
|
|
12
12
|
}
|
|
13
|
-
const priceAbove50 = internalPrice -
|
|
14
|
-
const feeReduction = Math.floor((priceAbove50 * 100) /
|
|
13
|
+
const priceAbove50 = internalPrice - 900000;
|
|
14
|
+
const feeReduction = Math.floor((priceAbove50 * 100) / 80000);
|
|
15
15
|
const calculatedFee = Math.max(0, 190 - feeReduction);
|
|
16
16
|
const maxPossibleFee = internalPrice < 999999
|
|
17
17
|
? Math.floor(((999999 - internalPrice) * 10000) / internalPrice)
|