@triadxyz/triad-protocol 2.9.5-beta → 2.9.7-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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -886,7 +886,7 @@ class TriadProtocolClient {
886
886
  let tempRemainingUSDC = remainingUSDC.clone();
887
887
  if (isTrdPayout) {
888
888
  for (const order of sortedOrders) {
889
- if (tempRemainingUSDC.lt(new bn_js_1.default(1000000)))
889
+ if (tempRemainingUSDC.lte(new bn_js_1.default(0)))
890
890
  break;
891
891
  if (order.authority === this.program.provider.publicKey.toBase58()) {
892
892
  continue;
@@ -935,7 +935,7 @@ class TriadProtocolClient {
935
935
  addressLookupTableAccounts.push(...swapAddressLookupTableAccounts);
936
936
  }
937
937
  for (const order of sortedOrders) {
938
- if (remainingUSDC.lt(new bn_js_1.default(1000000)))
938
+ if (remainingUSDC.lte(new bn_js_1.default(0)))
939
939
  break;
940
940
  if (order.authority === this.program.provider.publicKey.toBase58()) {
941
941
  continue;
@@ -952,7 +952,7 @@ class TriadProtocolClient {
952
952
  .div(new bn_js_1.default(1000000));
953
953
  adjustedPrice = orderPrice.add(fee);
954
954
  }
955
- const maxSharesForPrice = (0, helpers_1.roundUp)(remainingUSDC)
955
+ const maxSharesForPrice = remainingUSDC
956
956
  .mul(new bn_js_1.default(Math.pow(10, this.decimals)))
957
957
  .div(adjustedPrice);
958
958
  const sharesToBuy = bn_js_1.default.min((0, helpers_1.roundUp)(maxSharesForPrice), availableShares);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.9.5-beta",
3
+ "version": "2.9.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",