@triadxyz/triad-protocol 2.6.3-beta → 2.6.5-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.
- package/dist/index.js +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -810,7 +810,7 @@ class TriadProtocolClient {
|
|
|
810
810
|
const sortedOrders = orders.sort((a, b) => Number(a.price) - Number(b.price));
|
|
811
811
|
const tokenProgram = (0, helpers_1.getTokenProgram)(mint);
|
|
812
812
|
for (const order of sortedOrders) {
|
|
813
|
-
if (remainingUSDC.
|
|
813
|
+
if (remainingUSDC.lt(new bn_js_1.default(1000000)))
|
|
814
814
|
break;
|
|
815
815
|
if (order.authority === this.program.provider.publicKey.toBase58()) {
|
|
816
816
|
continue;
|
|
@@ -831,8 +831,7 @@ class TriadProtocolClient {
|
|
|
831
831
|
.mul(new bn_js_1.default(Math.pow(10, this.decimals)))
|
|
832
832
|
.div(adjustedPrice);
|
|
833
833
|
const sharesToBuy = bn_js_1.default.min(maxSharesForPrice, availableShares);
|
|
834
|
-
|
|
835
|
-
if (sharesToBuy.lte(new bn_js_1.default(0)))
|
|
834
|
+
if (sharesToBuy.lt(new bn_js_1.default(1000000)))
|
|
836
835
|
continue;
|
|
837
836
|
const usdcAmount = sharesToBuy
|
|
838
837
|
.mul(adjustedPrice)
|