@triadxyz/triad-protocol 2.6.2-beta → 2.6.4-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 +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -827,10 +827,12 @@ class TriadProtocolClient {
|
|
|
827
827
|
.div(new bn_js_1.default(1000000));
|
|
828
828
|
adjustedPrice = orderPrice.add(fee);
|
|
829
829
|
}
|
|
830
|
+
console.log('remainingUSDC', remainingUSDC.toString());
|
|
830
831
|
const maxSharesForPrice = remainingUSDC
|
|
831
832
|
.mul(new bn_js_1.default(Math.pow(10, this.decimals)))
|
|
832
833
|
.div(adjustedPrice);
|
|
833
834
|
const sharesToBuy = bn_js_1.default.min(maxSharesForPrice, availableShares);
|
|
835
|
+
console.log('sharesToBuy', sharesToBuy.toString());
|
|
834
836
|
if (sharesToBuy.lte(new bn_js_1.default(0)))
|
|
835
837
|
continue;
|
|
836
838
|
const usdcAmount = sharesToBuy
|
|
@@ -860,6 +862,7 @@ class TriadProtocolClient {
|
|
|
860
862
|
if (userTradeIxs.length > 0) {
|
|
861
863
|
ixs.unshift(...userTradeIxs);
|
|
862
864
|
}
|
|
865
|
+
console.log('ixs', ixs.length);
|
|
863
866
|
if (ixs.length === 0) {
|
|
864
867
|
throw new Error('No matching orders found to fill the requested amount');
|
|
865
868
|
}
|