@typus/typus-perp-sdk 1.1.32-codegen-exp26 → 1.1.32-codegen-exp27
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/src/api/sentio.js
CHANGED
|
@@ -355,7 +355,7 @@ async function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
|
|
|
355
355
|
{
|
|
356
356
|
metricsQuery: {
|
|
357
357
|
query: "trading_volume_usd",
|
|
358
|
-
alias: "
|
|
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: "
|
|
378
|
+
alias: "0",
|
|
379
379
|
id: "main",
|
|
380
380
|
disabled: false,
|
|
381
381
|
functions: [],
|
package/dist/src/user/history.js
CHANGED
|
@@ -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
|
}
|