@pear-protocol/core-sdk 0.0.20 → 0.0.22
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/core/index.d.ts +223 -183
- package/package.json +3 -3
package/dist/core/index.d.ts
CHANGED
|
@@ -276,6 +276,7 @@ declare class Core {
|
|
|
276
276
|
fills: {
|
|
277
277
|
id: string;
|
|
278
278
|
positionId: string;
|
|
279
|
+
symbol: string;
|
|
279
280
|
status: "PROVISIONAL";
|
|
280
281
|
cloid?: string | undefined;
|
|
281
282
|
}[];
|
|
@@ -1040,35 +1041,24 @@ declare class Core {
|
|
|
1040
1041
|
intent: "OPEN";
|
|
1041
1042
|
type: "MARKET";
|
|
1042
1043
|
condition: {
|
|
1043
|
-
type: "
|
|
1044
|
+
type: "ratio";
|
|
1044
1045
|
data: {
|
|
1045
1046
|
priceSource: "mark" | "mid";
|
|
1046
1047
|
symbol_a: string;
|
|
1047
1048
|
symbol_b: string;
|
|
1048
|
-
|
|
1049
|
+
track: "PEAK" | "TROUGH";
|
|
1049
1050
|
threshold: number;
|
|
1050
1051
|
};
|
|
1051
1052
|
} | {
|
|
1052
|
-
type: "
|
|
1053
|
+
type: "price";
|
|
1053
1054
|
data: {
|
|
1054
1055
|
priceSource: "mark" | "mid";
|
|
1055
1056
|
symbol: string;
|
|
1056
|
-
|
|
1057
|
-
threshold: number;
|
|
1058
|
-
};
|
|
1059
|
-
} | {
|
|
1060
|
-
type: "index_v1";
|
|
1061
|
-
data: {
|
|
1062
|
-
priceSource: "mark" | "mid";
|
|
1063
|
-
basket: {
|
|
1064
|
-
symbol: string;
|
|
1065
|
-
weight: number;
|
|
1066
|
-
}[];
|
|
1067
|
-
direction: "ABOVE" | "BELOW";
|
|
1057
|
+
track: "PEAK" | "TROUGH";
|
|
1068
1058
|
threshold: number;
|
|
1069
1059
|
};
|
|
1070
1060
|
} | {
|
|
1071
|
-
type: "
|
|
1061
|
+
type: "weighted_ratio";
|
|
1072
1062
|
data: {
|
|
1073
1063
|
priceSource: "mark" | "mid";
|
|
1074
1064
|
basket: {
|
|
@@ -1076,7 +1066,7 @@ declare class Core {
|
|
|
1076
1066
|
side: "BUY" | "SELL";
|
|
1077
1067
|
weight: number;
|
|
1078
1068
|
}[];
|
|
1079
|
-
|
|
1069
|
+
track: "PEAK" | "TROUGH";
|
|
1080
1070
|
threshold: number;
|
|
1081
1071
|
};
|
|
1082
1072
|
};
|
|
@@ -1131,35 +1121,24 @@ declare class Core {
|
|
|
1131
1121
|
intent: "ADJUST";
|
|
1132
1122
|
type: "MARKET";
|
|
1133
1123
|
condition: {
|
|
1134
|
-
type: "
|
|
1124
|
+
type: "ratio";
|
|
1135
1125
|
data: {
|
|
1136
1126
|
priceSource: "mark" | "mid";
|
|
1137
1127
|
symbol_a: string;
|
|
1138
1128
|
symbol_b: string;
|
|
1139
|
-
|
|
1129
|
+
track: "PEAK" | "TROUGH";
|
|
1140
1130
|
threshold: number;
|
|
1141
1131
|
};
|
|
1142
1132
|
} | {
|
|
1143
|
-
type: "
|
|
1133
|
+
type: "price";
|
|
1144
1134
|
data: {
|
|
1145
1135
|
priceSource: "mark" | "mid";
|
|
1146
1136
|
symbol: string;
|
|
1147
|
-
|
|
1148
|
-
threshold: number;
|
|
1149
|
-
};
|
|
1150
|
-
} | {
|
|
1151
|
-
type: "index_v1";
|
|
1152
|
-
data: {
|
|
1153
|
-
priceSource: "mark" | "mid";
|
|
1154
|
-
basket: {
|
|
1155
|
-
symbol: string;
|
|
1156
|
-
weight: number;
|
|
1157
|
-
}[];
|
|
1158
|
-
direction: "ABOVE" | "BELOW";
|
|
1137
|
+
track: "PEAK" | "TROUGH";
|
|
1159
1138
|
threshold: number;
|
|
1160
1139
|
};
|
|
1161
1140
|
} | {
|
|
1162
|
-
type: "
|
|
1141
|
+
type: "weighted_ratio";
|
|
1163
1142
|
data: {
|
|
1164
1143
|
priceSource: "mark" | "mid";
|
|
1165
1144
|
basket: {
|
|
@@ -1167,29 +1146,29 @@ declare class Core {
|
|
|
1167
1146
|
side: "BUY" | "SELL";
|
|
1168
1147
|
weight: number;
|
|
1169
1148
|
}[];
|
|
1170
|
-
|
|
1149
|
+
track: "PEAK" | "TROUGH";
|
|
1171
1150
|
threshold: number;
|
|
1172
1151
|
};
|
|
1173
1152
|
} | {
|
|
1174
|
-
type: "
|
|
1153
|
+
type: "notional";
|
|
1175
1154
|
data: {
|
|
1176
1155
|
priceSource: "mark" | "mid";
|
|
1177
|
-
|
|
1156
|
+
track: "PEAK" | "TROUGH";
|
|
1178
1157
|
threshold: number;
|
|
1179
1158
|
};
|
|
1180
1159
|
} | {
|
|
1181
|
-
type: "
|
|
1160
|
+
type: "upnl";
|
|
1182
1161
|
data: {
|
|
1183
1162
|
priceSource: "mark" | "mid";
|
|
1184
|
-
|
|
1163
|
+
track: "PEAK" | "TROUGH";
|
|
1185
1164
|
threshold: number;
|
|
1186
1165
|
};
|
|
1187
1166
|
} | {
|
|
1188
|
-
type: "
|
|
1167
|
+
type: "upnl_bps";
|
|
1189
1168
|
data: {
|
|
1190
1169
|
priceSource: "mark" | "mid";
|
|
1191
|
-
|
|
1192
|
-
|
|
1170
|
+
track: "PEAK" | "TROUGH";
|
|
1171
|
+
threshold: number;
|
|
1193
1172
|
};
|
|
1194
1173
|
};
|
|
1195
1174
|
context: {
|
|
@@ -1239,8 +1218,12 @@ declare class Core {
|
|
|
1239
1218
|
} | undefined;
|
|
1240
1219
|
}[] | undefined;
|
|
1241
1220
|
trailing?: {
|
|
1221
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1242
1222
|
deltaValue: number;
|
|
1243
|
-
activationValue
|
|
1223
|
+
activationValue?: number | undefined;
|
|
1224
|
+
bestMetricSeen?: number | undefined;
|
|
1225
|
+
currentStopValue?: number | undefined;
|
|
1226
|
+
stopBreachedAt?: number | undefined;
|
|
1244
1227
|
} | undefined;
|
|
1245
1228
|
} | {
|
|
1246
1229
|
id: string;
|
|
@@ -1253,35 +1236,70 @@ declare class Core {
|
|
|
1253
1236
|
intent: "CLOSE";
|
|
1254
1237
|
type: "MARKET";
|
|
1255
1238
|
condition: {
|
|
1256
|
-
type: "
|
|
1239
|
+
type: "ratio";
|
|
1257
1240
|
data: {
|
|
1258
1241
|
priceSource: "mark" | "mid";
|
|
1259
1242
|
symbol_a: string;
|
|
1260
1243
|
symbol_b: string;
|
|
1261
|
-
|
|
1244
|
+
track: "PEAK" | "TROUGH";
|
|
1262
1245
|
threshold: number;
|
|
1263
1246
|
};
|
|
1264
1247
|
} | {
|
|
1265
|
-
type: "
|
|
1248
|
+
type: "price";
|
|
1266
1249
|
data: {
|
|
1267
1250
|
priceSource: "mark" | "mid";
|
|
1268
1251
|
symbol: string;
|
|
1269
|
-
|
|
1252
|
+
track: "PEAK" | "TROUGH";
|
|
1270
1253
|
threshold: number;
|
|
1271
1254
|
};
|
|
1272
1255
|
} | {
|
|
1273
|
-
type: "
|
|
1256
|
+
type: "weighted_ratio";
|
|
1274
1257
|
data: {
|
|
1275
1258
|
priceSource: "mark" | "mid";
|
|
1276
1259
|
basket: {
|
|
1277
1260
|
symbol: string;
|
|
1261
|
+
side: "BUY" | "SELL";
|
|
1278
1262
|
weight: number;
|
|
1279
1263
|
}[];
|
|
1280
|
-
|
|
1264
|
+
track: "PEAK" | "TROUGH";
|
|
1265
|
+
threshold: number;
|
|
1266
|
+
};
|
|
1267
|
+
} | {
|
|
1268
|
+
type: "notional";
|
|
1269
|
+
data: {
|
|
1270
|
+
priceSource: "mark" | "mid";
|
|
1271
|
+
track: "PEAK" | "TROUGH";
|
|
1272
|
+
threshold: number;
|
|
1273
|
+
};
|
|
1274
|
+
} | {
|
|
1275
|
+
type: "upnl";
|
|
1276
|
+
data: {
|
|
1277
|
+
priceSource: "mark" | "mid";
|
|
1278
|
+
track: "PEAK" | "TROUGH";
|
|
1281
1279
|
threshold: number;
|
|
1282
1280
|
};
|
|
1283
1281
|
} | {
|
|
1284
|
-
type: "
|
|
1282
|
+
type: "upnl_bps";
|
|
1283
|
+
data: {
|
|
1284
|
+
priceSource: "mark" | "mid";
|
|
1285
|
+
track: "PEAK" | "TROUGH";
|
|
1286
|
+
threshold: number;
|
|
1287
|
+
};
|
|
1288
|
+
} | {
|
|
1289
|
+
type: "ratio_trailing";
|
|
1290
|
+
data: {
|
|
1291
|
+
priceSource: "mark" | "mid";
|
|
1292
|
+
symbol_a: string;
|
|
1293
|
+
symbol_b: string;
|
|
1294
|
+
};
|
|
1295
|
+
} | {
|
|
1296
|
+
type: "price_trailing";
|
|
1297
|
+
data: {
|
|
1298
|
+
priceSource: "mark" | "mid";
|
|
1299
|
+
symbol: string;
|
|
1300
|
+
};
|
|
1301
|
+
} | {
|
|
1302
|
+
type: "weighted_ratio_trailing";
|
|
1285
1303
|
data: {
|
|
1286
1304
|
priceSource: "mark" | "mid";
|
|
1287
1305
|
basket: {
|
|
@@ -1289,29 +1307,21 @@ declare class Core {
|
|
|
1289
1307
|
side: "BUY" | "SELL";
|
|
1290
1308
|
weight: number;
|
|
1291
1309
|
}[];
|
|
1292
|
-
direction: "ABOVE" | "BELOW";
|
|
1293
|
-
threshold: number;
|
|
1294
1310
|
};
|
|
1295
1311
|
} | {
|
|
1296
|
-
type: "
|
|
1312
|
+
type: "notional_trailing";
|
|
1297
1313
|
data: {
|
|
1298
1314
|
priceSource: "mark" | "mid";
|
|
1299
|
-
direction: "ABOVE" | "BELOW";
|
|
1300
|
-
threshold: number;
|
|
1301
1315
|
};
|
|
1302
1316
|
} | {
|
|
1303
|
-
type: "
|
|
1317
|
+
type: "upnl_trailing";
|
|
1304
1318
|
data: {
|
|
1305
1319
|
priceSource: "mark" | "mid";
|
|
1306
|
-
direction: "ABOVE" | "BELOW";
|
|
1307
|
-
threshold: number;
|
|
1308
1320
|
};
|
|
1309
1321
|
} | {
|
|
1310
|
-
type: "
|
|
1322
|
+
type: "upnl_bps_trailing";
|
|
1311
1323
|
data: {
|
|
1312
1324
|
priceSource: "mark" | "mid";
|
|
1313
|
-
direction: "ABOVE" | "BELOW";
|
|
1314
|
-
threshold_bps: number;
|
|
1315
1325
|
};
|
|
1316
1326
|
};
|
|
1317
1327
|
context: {
|
|
@@ -1348,8 +1358,12 @@ declare class Core {
|
|
|
1348
1358
|
} | undefined;
|
|
1349
1359
|
}[] | undefined;
|
|
1350
1360
|
trailing?: {
|
|
1361
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1351
1362
|
deltaValue: number;
|
|
1352
|
-
activationValue
|
|
1363
|
+
activationValue?: number | undefined;
|
|
1364
|
+
bestMetricSeen?: number | undefined;
|
|
1365
|
+
currentStopValue?: number | undefined;
|
|
1366
|
+
stopBreachedAt?: number | undefined;
|
|
1353
1367
|
} | undefined;
|
|
1354
1368
|
})[];
|
|
1355
1369
|
}>;
|
|
@@ -1365,35 +1379,24 @@ declare class Core {
|
|
|
1365
1379
|
intent: "OPEN";
|
|
1366
1380
|
type: "MARKET";
|
|
1367
1381
|
condition: {
|
|
1368
|
-
type: "
|
|
1382
|
+
type: "ratio";
|
|
1369
1383
|
data: {
|
|
1370
1384
|
priceSource: "mark" | "mid";
|
|
1371
1385
|
symbol_a: string;
|
|
1372
1386
|
symbol_b: string;
|
|
1373
|
-
|
|
1387
|
+
track: "PEAK" | "TROUGH";
|
|
1374
1388
|
threshold: number;
|
|
1375
1389
|
};
|
|
1376
1390
|
} | {
|
|
1377
|
-
type: "
|
|
1391
|
+
type: "price";
|
|
1378
1392
|
data: {
|
|
1379
1393
|
priceSource: "mark" | "mid";
|
|
1380
1394
|
symbol: string;
|
|
1381
|
-
|
|
1395
|
+
track: "PEAK" | "TROUGH";
|
|
1382
1396
|
threshold: number;
|
|
1383
1397
|
};
|
|
1384
1398
|
} | {
|
|
1385
|
-
type: "
|
|
1386
|
-
data: {
|
|
1387
|
-
priceSource: "mark" | "mid";
|
|
1388
|
-
basket: {
|
|
1389
|
-
symbol: string;
|
|
1390
|
-
weight: number;
|
|
1391
|
-
}[];
|
|
1392
|
-
direction: "ABOVE" | "BELOW";
|
|
1393
|
-
threshold: number;
|
|
1394
|
-
};
|
|
1395
|
-
} | {
|
|
1396
|
-
type: "weighted_ratio_v1";
|
|
1399
|
+
type: "weighted_ratio";
|
|
1397
1400
|
data: {
|
|
1398
1401
|
priceSource: "mark" | "mid";
|
|
1399
1402
|
basket: {
|
|
@@ -1401,7 +1404,7 @@ declare class Core {
|
|
|
1401
1404
|
side: "BUY" | "SELL";
|
|
1402
1405
|
weight: number;
|
|
1403
1406
|
}[];
|
|
1404
|
-
|
|
1407
|
+
track: "PEAK" | "TROUGH";
|
|
1405
1408
|
threshold: number;
|
|
1406
1409
|
};
|
|
1407
1410
|
};
|
|
@@ -1456,35 +1459,24 @@ declare class Core {
|
|
|
1456
1459
|
intent: "ADJUST";
|
|
1457
1460
|
type: "MARKET";
|
|
1458
1461
|
condition: {
|
|
1459
|
-
type: "
|
|
1462
|
+
type: "ratio";
|
|
1460
1463
|
data: {
|
|
1461
1464
|
priceSource: "mark" | "mid";
|
|
1462
1465
|
symbol_a: string;
|
|
1463
1466
|
symbol_b: string;
|
|
1464
|
-
|
|
1467
|
+
track: "PEAK" | "TROUGH";
|
|
1465
1468
|
threshold: number;
|
|
1466
1469
|
};
|
|
1467
1470
|
} | {
|
|
1468
|
-
type: "
|
|
1471
|
+
type: "price";
|
|
1469
1472
|
data: {
|
|
1470
1473
|
priceSource: "mark" | "mid";
|
|
1471
1474
|
symbol: string;
|
|
1472
|
-
|
|
1473
|
-
threshold: number;
|
|
1474
|
-
};
|
|
1475
|
-
} | {
|
|
1476
|
-
type: "index_v1";
|
|
1477
|
-
data: {
|
|
1478
|
-
priceSource: "mark" | "mid";
|
|
1479
|
-
basket: {
|
|
1480
|
-
symbol: string;
|
|
1481
|
-
weight: number;
|
|
1482
|
-
}[];
|
|
1483
|
-
direction: "ABOVE" | "BELOW";
|
|
1475
|
+
track: "PEAK" | "TROUGH";
|
|
1484
1476
|
threshold: number;
|
|
1485
1477
|
};
|
|
1486
1478
|
} | {
|
|
1487
|
-
type: "
|
|
1479
|
+
type: "weighted_ratio";
|
|
1488
1480
|
data: {
|
|
1489
1481
|
priceSource: "mark" | "mid";
|
|
1490
1482
|
basket: {
|
|
@@ -1492,29 +1484,29 @@ declare class Core {
|
|
|
1492
1484
|
side: "BUY" | "SELL";
|
|
1493
1485
|
weight: number;
|
|
1494
1486
|
}[];
|
|
1495
|
-
|
|
1487
|
+
track: "PEAK" | "TROUGH";
|
|
1496
1488
|
threshold: number;
|
|
1497
1489
|
};
|
|
1498
1490
|
} | {
|
|
1499
|
-
type: "
|
|
1491
|
+
type: "notional";
|
|
1500
1492
|
data: {
|
|
1501
1493
|
priceSource: "mark" | "mid";
|
|
1502
|
-
|
|
1494
|
+
track: "PEAK" | "TROUGH";
|
|
1503
1495
|
threshold: number;
|
|
1504
1496
|
};
|
|
1505
1497
|
} | {
|
|
1506
|
-
type: "
|
|
1498
|
+
type: "upnl";
|
|
1507
1499
|
data: {
|
|
1508
1500
|
priceSource: "mark" | "mid";
|
|
1509
|
-
|
|
1501
|
+
track: "PEAK" | "TROUGH";
|
|
1510
1502
|
threshold: number;
|
|
1511
1503
|
};
|
|
1512
1504
|
} | {
|
|
1513
|
-
type: "
|
|
1505
|
+
type: "upnl_bps";
|
|
1514
1506
|
data: {
|
|
1515
1507
|
priceSource: "mark" | "mid";
|
|
1516
|
-
|
|
1517
|
-
|
|
1508
|
+
track: "PEAK" | "TROUGH";
|
|
1509
|
+
threshold: number;
|
|
1518
1510
|
};
|
|
1519
1511
|
};
|
|
1520
1512
|
context: {
|
|
@@ -1564,8 +1556,12 @@ declare class Core {
|
|
|
1564
1556
|
} | undefined;
|
|
1565
1557
|
}[] | undefined;
|
|
1566
1558
|
trailing?: {
|
|
1559
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1567
1560
|
deltaValue: number;
|
|
1568
|
-
activationValue
|
|
1561
|
+
activationValue?: number | undefined;
|
|
1562
|
+
bestMetricSeen?: number | undefined;
|
|
1563
|
+
currentStopValue?: number | undefined;
|
|
1564
|
+
stopBreachedAt?: number | undefined;
|
|
1569
1565
|
} | undefined;
|
|
1570
1566
|
} | {
|
|
1571
1567
|
id: string;
|
|
@@ -1578,35 +1574,70 @@ declare class Core {
|
|
|
1578
1574
|
intent: "CLOSE";
|
|
1579
1575
|
type: "MARKET";
|
|
1580
1576
|
condition: {
|
|
1581
|
-
type: "
|
|
1577
|
+
type: "ratio";
|
|
1582
1578
|
data: {
|
|
1583
1579
|
priceSource: "mark" | "mid";
|
|
1584
1580
|
symbol_a: string;
|
|
1585
1581
|
symbol_b: string;
|
|
1586
|
-
|
|
1582
|
+
track: "PEAK" | "TROUGH";
|
|
1587
1583
|
threshold: number;
|
|
1588
1584
|
};
|
|
1589
1585
|
} | {
|
|
1590
|
-
type: "
|
|
1586
|
+
type: "price";
|
|
1591
1587
|
data: {
|
|
1592
1588
|
priceSource: "mark" | "mid";
|
|
1593
1589
|
symbol: string;
|
|
1594
|
-
|
|
1590
|
+
track: "PEAK" | "TROUGH";
|
|
1595
1591
|
threshold: number;
|
|
1596
1592
|
};
|
|
1597
1593
|
} | {
|
|
1598
|
-
type: "
|
|
1594
|
+
type: "weighted_ratio";
|
|
1599
1595
|
data: {
|
|
1600
1596
|
priceSource: "mark" | "mid";
|
|
1601
1597
|
basket: {
|
|
1602
1598
|
symbol: string;
|
|
1599
|
+
side: "BUY" | "SELL";
|
|
1603
1600
|
weight: number;
|
|
1604
1601
|
}[];
|
|
1605
|
-
|
|
1602
|
+
track: "PEAK" | "TROUGH";
|
|
1603
|
+
threshold: number;
|
|
1604
|
+
};
|
|
1605
|
+
} | {
|
|
1606
|
+
type: "notional";
|
|
1607
|
+
data: {
|
|
1608
|
+
priceSource: "mark" | "mid";
|
|
1609
|
+
track: "PEAK" | "TROUGH";
|
|
1610
|
+
threshold: number;
|
|
1611
|
+
};
|
|
1612
|
+
} | {
|
|
1613
|
+
type: "upnl";
|
|
1614
|
+
data: {
|
|
1615
|
+
priceSource: "mark" | "mid";
|
|
1616
|
+
track: "PEAK" | "TROUGH";
|
|
1606
1617
|
threshold: number;
|
|
1607
1618
|
};
|
|
1608
1619
|
} | {
|
|
1609
|
-
type: "
|
|
1620
|
+
type: "upnl_bps";
|
|
1621
|
+
data: {
|
|
1622
|
+
priceSource: "mark" | "mid";
|
|
1623
|
+
track: "PEAK" | "TROUGH";
|
|
1624
|
+
threshold: number;
|
|
1625
|
+
};
|
|
1626
|
+
} | {
|
|
1627
|
+
type: "ratio_trailing";
|
|
1628
|
+
data: {
|
|
1629
|
+
priceSource: "mark" | "mid";
|
|
1630
|
+
symbol_a: string;
|
|
1631
|
+
symbol_b: string;
|
|
1632
|
+
};
|
|
1633
|
+
} | {
|
|
1634
|
+
type: "price_trailing";
|
|
1635
|
+
data: {
|
|
1636
|
+
priceSource: "mark" | "mid";
|
|
1637
|
+
symbol: string;
|
|
1638
|
+
};
|
|
1639
|
+
} | {
|
|
1640
|
+
type: "weighted_ratio_trailing";
|
|
1610
1641
|
data: {
|
|
1611
1642
|
priceSource: "mark" | "mid";
|
|
1612
1643
|
basket: {
|
|
@@ -1614,29 +1645,21 @@ declare class Core {
|
|
|
1614
1645
|
side: "BUY" | "SELL";
|
|
1615
1646
|
weight: number;
|
|
1616
1647
|
}[];
|
|
1617
|
-
direction: "ABOVE" | "BELOW";
|
|
1618
|
-
threshold: number;
|
|
1619
1648
|
};
|
|
1620
1649
|
} | {
|
|
1621
|
-
type: "
|
|
1650
|
+
type: "notional_trailing";
|
|
1622
1651
|
data: {
|
|
1623
1652
|
priceSource: "mark" | "mid";
|
|
1624
|
-
direction: "ABOVE" | "BELOW";
|
|
1625
|
-
threshold: number;
|
|
1626
1653
|
};
|
|
1627
1654
|
} | {
|
|
1628
|
-
type: "
|
|
1655
|
+
type: "upnl_trailing";
|
|
1629
1656
|
data: {
|
|
1630
1657
|
priceSource: "mark" | "mid";
|
|
1631
|
-
direction: "ABOVE" | "BELOW";
|
|
1632
|
-
threshold: number;
|
|
1633
1658
|
};
|
|
1634
1659
|
} | {
|
|
1635
|
-
type: "
|
|
1660
|
+
type: "upnl_bps_trailing";
|
|
1636
1661
|
data: {
|
|
1637
1662
|
priceSource: "mark" | "mid";
|
|
1638
|
-
direction: "ABOVE" | "BELOW";
|
|
1639
|
-
threshold_bps: number;
|
|
1640
1663
|
};
|
|
1641
1664
|
};
|
|
1642
1665
|
context: {
|
|
@@ -1673,8 +1696,12 @@ declare class Core {
|
|
|
1673
1696
|
} | undefined;
|
|
1674
1697
|
}[] | undefined;
|
|
1675
1698
|
trailing?: {
|
|
1699
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1676
1700
|
deltaValue: number;
|
|
1677
|
-
activationValue
|
|
1701
|
+
activationValue?: number | undefined;
|
|
1702
|
+
bestMetricSeen?: number | undefined;
|
|
1703
|
+
currentStopValue?: number | undefined;
|
|
1704
|
+
stopBreachedAt?: number | undefined;
|
|
1678
1705
|
} | undefined;
|
|
1679
1706
|
};
|
|
1680
1707
|
}>;
|
|
@@ -1690,35 +1717,24 @@ declare class Core {
|
|
|
1690
1717
|
intent: "OPEN";
|
|
1691
1718
|
type: "MARKET";
|
|
1692
1719
|
condition: {
|
|
1693
|
-
type: "
|
|
1720
|
+
type: "ratio";
|
|
1694
1721
|
data: {
|
|
1695
1722
|
priceSource: "mark" | "mid";
|
|
1696
1723
|
symbol_a: string;
|
|
1697
1724
|
symbol_b: string;
|
|
1698
|
-
|
|
1725
|
+
track: "PEAK" | "TROUGH";
|
|
1699
1726
|
threshold: number;
|
|
1700
1727
|
};
|
|
1701
1728
|
} | {
|
|
1702
|
-
type: "
|
|
1729
|
+
type: "price";
|
|
1703
1730
|
data: {
|
|
1704
1731
|
priceSource: "mark" | "mid";
|
|
1705
1732
|
symbol: string;
|
|
1706
|
-
|
|
1707
|
-
threshold: number;
|
|
1708
|
-
};
|
|
1709
|
-
} | {
|
|
1710
|
-
type: "index_v1";
|
|
1711
|
-
data: {
|
|
1712
|
-
priceSource: "mark" | "mid";
|
|
1713
|
-
basket: {
|
|
1714
|
-
symbol: string;
|
|
1715
|
-
weight: number;
|
|
1716
|
-
}[];
|
|
1717
|
-
direction: "ABOVE" | "BELOW";
|
|
1733
|
+
track: "PEAK" | "TROUGH";
|
|
1718
1734
|
threshold: number;
|
|
1719
1735
|
};
|
|
1720
1736
|
} | {
|
|
1721
|
-
type: "
|
|
1737
|
+
type: "weighted_ratio";
|
|
1722
1738
|
data: {
|
|
1723
1739
|
priceSource: "mark" | "mid";
|
|
1724
1740
|
basket: {
|
|
@@ -1726,7 +1742,7 @@ declare class Core {
|
|
|
1726
1742
|
side: "BUY" | "SELL";
|
|
1727
1743
|
weight: number;
|
|
1728
1744
|
}[];
|
|
1729
|
-
|
|
1745
|
+
track: "PEAK" | "TROUGH";
|
|
1730
1746
|
threshold: number;
|
|
1731
1747
|
};
|
|
1732
1748
|
};
|
|
@@ -1781,35 +1797,24 @@ declare class Core {
|
|
|
1781
1797
|
intent: "ADJUST";
|
|
1782
1798
|
type: "MARKET";
|
|
1783
1799
|
condition: {
|
|
1784
|
-
type: "
|
|
1800
|
+
type: "ratio";
|
|
1785
1801
|
data: {
|
|
1786
1802
|
priceSource: "mark" | "mid";
|
|
1787
1803
|
symbol_a: string;
|
|
1788
1804
|
symbol_b: string;
|
|
1789
|
-
|
|
1805
|
+
track: "PEAK" | "TROUGH";
|
|
1790
1806
|
threshold: number;
|
|
1791
1807
|
};
|
|
1792
1808
|
} | {
|
|
1793
|
-
type: "
|
|
1809
|
+
type: "price";
|
|
1794
1810
|
data: {
|
|
1795
1811
|
priceSource: "mark" | "mid";
|
|
1796
1812
|
symbol: string;
|
|
1797
|
-
|
|
1798
|
-
threshold: number;
|
|
1799
|
-
};
|
|
1800
|
-
} | {
|
|
1801
|
-
type: "index_v1";
|
|
1802
|
-
data: {
|
|
1803
|
-
priceSource: "mark" | "mid";
|
|
1804
|
-
basket: {
|
|
1805
|
-
symbol: string;
|
|
1806
|
-
weight: number;
|
|
1807
|
-
}[];
|
|
1808
|
-
direction: "ABOVE" | "BELOW";
|
|
1813
|
+
track: "PEAK" | "TROUGH";
|
|
1809
1814
|
threshold: number;
|
|
1810
1815
|
};
|
|
1811
1816
|
} | {
|
|
1812
|
-
type: "
|
|
1817
|
+
type: "weighted_ratio";
|
|
1813
1818
|
data: {
|
|
1814
1819
|
priceSource: "mark" | "mid";
|
|
1815
1820
|
basket: {
|
|
@@ -1817,29 +1822,29 @@ declare class Core {
|
|
|
1817
1822
|
side: "BUY" | "SELL";
|
|
1818
1823
|
weight: number;
|
|
1819
1824
|
}[];
|
|
1820
|
-
|
|
1825
|
+
track: "PEAK" | "TROUGH";
|
|
1821
1826
|
threshold: number;
|
|
1822
1827
|
};
|
|
1823
1828
|
} | {
|
|
1824
|
-
type: "
|
|
1829
|
+
type: "notional";
|
|
1825
1830
|
data: {
|
|
1826
1831
|
priceSource: "mark" | "mid";
|
|
1827
|
-
|
|
1832
|
+
track: "PEAK" | "TROUGH";
|
|
1828
1833
|
threshold: number;
|
|
1829
1834
|
};
|
|
1830
1835
|
} | {
|
|
1831
|
-
type: "
|
|
1836
|
+
type: "upnl";
|
|
1832
1837
|
data: {
|
|
1833
1838
|
priceSource: "mark" | "mid";
|
|
1834
|
-
|
|
1839
|
+
track: "PEAK" | "TROUGH";
|
|
1835
1840
|
threshold: number;
|
|
1836
1841
|
};
|
|
1837
1842
|
} | {
|
|
1838
|
-
type: "
|
|
1843
|
+
type: "upnl_bps";
|
|
1839
1844
|
data: {
|
|
1840
1845
|
priceSource: "mark" | "mid";
|
|
1841
|
-
|
|
1842
|
-
|
|
1846
|
+
track: "PEAK" | "TROUGH";
|
|
1847
|
+
threshold: number;
|
|
1843
1848
|
};
|
|
1844
1849
|
};
|
|
1845
1850
|
context: {
|
|
@@ -1889,8 +1894,12 @@ declare class Core {
|
|
|
1889
1894
|
} | undefined;
|
|
1890
1895
|
}[] | undefined;
|
|
1891
1896
|
trailing?: {
|
|
1897
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
1892
1898
|
deltaValue: number;
|
|
1893
|
-
activationValue
|
|
1899
|
+
activationValue?: number | undefined;
|
|
1900
|
+
bestMetricSeen?: number | undefined;
|
|
1901
|
+
currentStopValue?: number | undefined;
|
|
1902
|
+
stopBreachedAt?: number | undefined;
|
|
1894
1903
|
} | undefined;
|
|
1895
1904
|
} | {
|
|
1896
1905
|
id: string;
|
|
@@ -1903,35 +1912,70 @@ declare class Core {
|
|
|
1903
1912
|
intent: "CLOSE";
|
|
1904
1913
|
type: "MARKET";
|
|
1905
1914
|
condition: {
|
|
1906
|
-
type: "
|
|
1915
|
+
type: "ratio";
|
|
1907
1916
|
data: {
|
|
1908
1917
|
priceSource: "mark" | "mid";
|
|
1909
1918
|
symbol_a: string;
|
|
1910
1919
|
symbol_b: string;
|
|
1911
|
-
|
|
1920
|
+
track: "PEAK" | "TROUGH";
|
|
1912
1921
|
threshold: number;
|
|
1913
1922
|
};
|
|
1914
1923
|
} | {
|
|
1915
|
-
type: "
|
|
1924
|
+
type: "price";
|
|
1916
1925
|
data: {
|
|
1917
1926
|
priceSource: "mark" | "mid";
|
|
1918
1927
|
symbol: string;
|
|
1919
|
-
|
|
1928
|
+
track: "PEAK" | "TROUGH";
|
|
1920
1929
|
threshold: number;
|
|
1921
1930
|
};
|
|
1922
1931
|
} | {
|
|
1923
|
-
type: "
|
|
1932
|
+
type: "weighted_ratio";
|
|
1924
1933
|
data: {
|
|
1925
1934
|
priceSource: "mark" | "mid";
|
|
1926
1935
|
basket: {
|
|
1927
1936
|
symbol: string;
|
|
1937
|
+
side: "BUY" | "SELL";
|
|
1928
1938
|
weight: number;
|
|
1929
1939
|
}[];
|
|
1930
|
-
|
|
1940
|
+
track: "PEAK" | "TROUGH";
|
|
1931
1941
|
threshold: number;
|
|
1932
1942
|
};
|
|
1933
1943
|
} | {
|
|
1934
|
-
type: "
|
|
1944
|
+
type: "notional";
|
|
1945
|
+
data: {
|
|
1946
|
+
priceSource: "mark" | "mid";
|
|
1947
|
+
track: "PEAK" | "TROUGH";
|
|
1948
|
+
threshold: number;
|
|
1949
|
+
};
|
|
1950
|
+
} | {
|
|
1951
|
+
type: "upnl";
|
|
1952
|
+
data: {
|
|
1953
|
+
priceSource: "mark" | "mid";
|
|
1954
|
+
track: "PEAK" | "TROUGH";
|
|
1955
|
+
threshold: number;
|
|
1956
|
+
};
|
|
1957
|
+
} | {
|
|
1958
|
+
type: "upnl_bps";
|
|
1959
|
+
data: {
|
|
1960
|
+
priceSource: "mark" | "mid";
|
|
1961
|
+
track: "PEAK" | "TROUGH";
|
|
1962
|
+
threshold: number;
|
|
1963
|
+
};
|
|
1964
|
+
} | {
|
|
1965
|
+
type: "ratio_trailing";
|
|
1966
|
+
data: {
|
|
1967
|
+
priceSource: "mark" | "mid";
|
|
1968
|
+
symbol_a: string;
|
|
1969
|
+
symbol_b: string;
|
|
1970
|
+
};
|
|
1971
|
+
} | {
|
|
1972
|
+
type: "price_trailing";
|
|
1973
|
+
data: {
|
|
1974
|
+
priceSource: "mark" | "mid";
|
|
1975
|
+
symbol: string;
|
|
1976
|
+
};
|
|
1977
|
+
} | {
|
|
1978
|
+
type: "weighted_ratio_trailing";
|
|
1935
1979
|
data: {
|
|
1936
1980
|
priceSource: "mark" | "mid";
|
|
1937
1981
|
basket: {
|
|
@@ -1939,29 +1983,21 @@ declare class Core {
|
|
|
1939
1983
|
side: "BUY" | "SELL";
|
|
1940
1984
|
weight: number;
|
|
1941
1985
|
}[];
|
|
1942
|
-
direction: "ABOVE" | "BELOW";
|
|
1943
|
-
threshold: number;
|
|
1944
1986
|
};
|
|
1945
1987
|
} | {
|
|
1946
|
-
type: "
|
|
1988
|
+
type: "notional_trailing";
|
|
1947
1989
|
data: {
|
|
1948
1990
|
priceSource: "mark" | "mid";
|
|
1949
|
-
direction: "ABOVE" | "BELOW";
|
|
1950
|
-
threshold: number;
|
|
1951
1991
|
};
|
|
1952
1992
|
} | {
|
|
1953
|
-
type: "
|
|
1993
|
+
type: "upnl_trailing";
|
|
1954
1994
|
data: {
|
|
1955
1995
|
priceSource: "mark" | "mid";
|
|
1956
|
-
direction: "ABOVE" | "BELOW";
|
|
1957
|
-
threshold: number;
|
|
1958
1996
|
};
|
|
1959
1997
|
} | {
|
|
1960
|
-
type: "
|
|
1998
|
+
type: "upnl_bps_trailing";
|
|
1961
1999
|
data: {
|
|
1962
2000
|
priceSource: "mark" | "mid";
|
|
1963
|
-
direction: "ABOVE" | "BELOW";
|
|
1964
|
-
threshold_bps: number;
|
|
1965
2001
|
};
|
|
1966
2002
|
};
|
|
1967
2003
|
context: {
|
|
@@ -1998,8 +2034,12 @@ declare class Core {
|
|
|
1998
2034
|
} | undefined;
|
|
1999
2035
|
}[] | undefined;
|
|
2000
2036
|
trailing?: {
|
|
2037
|
+
mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
|
|
2001
2038
|
deltaValue: number;
|
|
2002
|
-
activationValue
|
|
2039
|
+
activationValue?: number | undefined;
|
|
2040
|
+
bestMetricSeen?: number | undefined;
|
|
2041
|
+
currentStopValue?: number | undefined;
|
|
2042
|
+
stopBreachedAt?: number | undefined;
|
|
2003
2043
|
} | undefined;
|
|
2004
2044
|
};
|
|
2005
2045
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@pear-protocol/types": "^0.0.
|
|
29
|
-
"@pear-protocol/utils": "^0.0.
|
|
28
|
+
"@pear-protocol/types": "^0.0.19",
|
|
29
|
+
"@pear-protocol/utils": "^0.0.19",
|
|
30
30
|
"qs": "^6.14.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|