@triadxyz/triad-protocol 3.4.8-beta → 3.4.9-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 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -839,13 +839,14 @@ class TriadProtocol {
|
|
|
839
839
|
.div(new bn_js_1.default(Math.pow(10, constants_1.BASE_DECIMALS)));
|
|
840
840
|
if (usdcAmount.lte(new bn_js_1.default(0)))
|
|
841
841
|
continue;
|
|
842
|
+
const oppositeOrderDirection = (0, helpers_1.getOppositeOrderDirectionEncoded)(orderDirection);
|
|
842
843
|
ixs.push(yield this.program.methods
|
|
843
844
|
.marketBidOrder({
|
|
844
845
|
amount: new bn_js_1.default(usdcAmount),
|
|
845
846
|
marketId: new bn_js_1.default(marketId),
|
|
846
847
|
orderDirection,
|
|
847
848
|
bookOrderAskId: new bn_js_1.default(order.id),
|
|
848
|
-
oppositeOrderDirection
|
|
849
|
+
oppositeOrderDirection
|
|
849
850
|
})
|
|
850
851
|
.accounts({
|
|
851
852
|
signer: this.program.provider.publicKey,
|
|
@@ -854,7 +855,7 @@ class TriadProtocol {
|
|
|
854
855
|
orderBook: (0, pda_1.getOrderBookPDA)(this.program.programId, marketId),
|
|
855
856
|
bookOrderAskAuthority: new web3_js_1.PublicKey(order.authority),
|
|
856
857
|
order: (0, pda_1.getOrderPDA)(this.program.programId, this.program.provider.publicKey, marketId, (0, helpers_1.getOrderDirection)(orderDirection)),
|
|
857
|
-
oppositeOrder: (0, pda_1.getOrderPDA)(this.program.programId, new web3_js_1.PublicKey(order.authority), marketId, (0, helpers_1.getOrderDirection)(
|
|
858
|
+
oppositeOrder: (0, pda_1.getOrderPDA)(this.program.programId, new web3_js_1.PublicKey(order.authority), marketId, (0, helpers_1.getOrderDirection)(oppositeOrderDirection))
|
|
858
859
|
})
|
|
859
860
|
.instruction());
|
|
860
861
|
remainingUSDC = remainingUSDC.sub(usdcAmount);
|