@typus/typus-perp-sdk 1.1.32-codegen-exp26 → 1.1.32-codegen-exp28

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.
@@ -272,7 +272,7 @@ async function getTlpFeeFromSentio(fromTimestamp, toTimestamp) {
272
272
  {
273
273
  metricsQuery: {
274
274
  query: "tlp_fee_usd",
275
- alias: "0",
275
+ alias: "1",
276
276
  id: "isolated_TYPUS",
277
277
  labelSelector: {
278
278
  base_token: "TYPUS",
@@ -292,7 +292,7 @@ async function getTlpFeeFromSentio(fromTimestamp, toTimestamp) {
292
292
  formulas: [
293
293
  {
294
294
  expression: "a-isolated_TYPUS",
295
- alias: "1",
295
+ alias: "0",
296
296
  id: "main",
297
297
  disabled: false,
298
298
  functions: [],
@@ -355,7 +355,7 @@ async function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
355
355
  {
356
356
  metricsQuery: {
357
357
  query: "trading_volume_usd",
358
- alias: "0",
358
+ alias: "1",
359
359
  id: "isolated_TYPUS",
360
360
  labelSelector: {
361
361
  base_token: "TYPUS",
@@ -375,7 +375,7 @@ async function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
375
375
  formulas: [
376
376
  {
377
377
  expression: "a-isolated_TYPUS",
378
- alias: "1",
378
+ alias: "0",
379
379
  id: "main",
380
380
  disabled: false,
381
381
  functions: [],
@@ -45,9 +45,12 @@ async function parseUserHistory(raw_events) {
45
45
  else {
46
46
  collateral = Number(json.collateral_in_deposit_token) / 10 ** (0, constants_1.assetToDecimal)(collateral_token);
47
47
  }
48
+ const marketOrderRation = json.is_long ? 1.02 : 0.9;
49
+ const isMarketOrder = Number(json.trigger_price) / Number(json.trading_pair_oracle_price) <= (marketOrderRation + 0.001)
50
+ && Number(json.trigger_price) / Number(json.trading_pair_oracle_price) >= (marketOrderRation - 0.001);
48
51
  var order_type = "Limit";
49
52
  var price = json.trigger_price;
50
- if (json.filled) {
53
+ if (json.filled || isMarketOrder) {
51
54
  order_type = "Market";
52
55
  price = json.filled_price;
53
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.1.32-codegen-exp26",
3
+ "version": "1.1.32-codegen-exp28",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",