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