trigger funding before cancelling all orders
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
6870d2d871
commit
207ad830f4
|
@ -473,6 +473,9 @@ async function makeMarketUpdateInstructions(
|
|||
// await client.healthRegionBeginIx(group, mangoAccount, [], [perpMarket]),
|
||||
//);
|
||||
|
||||
// Update funding
|
||||
instructions.push(await client.perpUpdateFundingIx(group, perpMarket));
|
||||
|
||||
const expiryTimestamp =
|
||||
params.tif !== undefined ? Date.now() / 1000 + params.tif : 0;
|
||||
|
||||
|
|
|
@ -2477,6 +2477,22 @@ export class MangoClient {
|
|||
}
|
||||
}
|
||||
|
||||
public async perpUpdateFundingIx(
|
||||
group: Group,
|
||||
perpMarket: PerpMarket,
|
||||
): Promise<TransactionInstruction> {
|
||||
return await this.program.methods
|
||||
.perpUpdateFunding()
|
||||
.accounts({
|
||||
group: group.publicKey,
|
||||
perpMarket: perpMarket.publicKey,
|
||||
bids: perpMarket.bids,
|
||||
asks: perpMarket.asks,
|
||||
oracle: perpMarket.oracle,
|
||||
})
|
||||
.instruction();
|
||||
}
|
||||
|
||||
public async marginTrade({
|
||||
group,
|
||||
mangoAccount,
|
||||
|
|
Loading…
Reference in New Issue