combined fees and pnl settle tx
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
1d8569b2cd
commit
612595b246
|
@ -2341,6 +2341,32 @@ export class MangoClient {
|
|||
.instruction();
|
||||
}
|
||||
|
||||
async perpSettlePnlAndFees(
|
||||
group: Group,
|
||||
profitableAccount: MangoAccount,
|
||||
unprofitableAccount: MangoAccount,
|
||||
accountToSettleFeesFor: MangoAccount,
|
||||
settler: MangoAccount,
|
||||
perpMarketIndex: PerpMarketIndex,
|
||||
maxSettleAmount?: number,
|
||||
): Promise<TransactionSignature> {
|
||||
return await this.sendAndConfirmTransactionForGroup(group, [
|
||||
await this.perpSettlePnlIx(
|
||||
group,
|
||||
profitableAccount,
|
||||
unprofitableAccount,
|
||||
settler,
|
||||
perpMarketIndex,
|
||||
),
|
||||
await this.perpSettleFeesIx(
|
||||
group,
|
||||
accountToSettleFeesFor,
|
||||
perpMarketIndex,
|
||||
maxSettleAmount,
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
async perpSettlePnl(
|
||||
group: Group,
|
||||
profitableAccount: MangoAccount,
|
||||
|
|
Loading…
Reference in New Issue