Skip to content

Commit

Permalink
add txSender params to opts
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Jan 20, 2024
1 parent 49a9f08 commit 57d50a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/bots/userLpSettler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ export class UserLpSettlerBot implements Bot {

let shouldSettle = false;
if (freeCollateral.lte(ZERO)) {
console.log(`user ${user.getUserAccountPublicKey()} free collateral is ${freeCollateral.toString()}`);
console.log(
`user ${user.getUserAccountPublicKey()} free collateral is ${freeCollateral.toString()}`
);
shouldSettle = true;
}

Expand All @@ -189,10 +191,8 @@ export class UserLpSettlerBot implements Bot {

const timeTillFunding = timeRemainingUntilUpdate(
nowTs,
perpMarketAccount!.amm
.lastFundingRateTs,
perpMarketAccount!.amm
.fundingPeriod
perpMarketAccount!.amm.lastFundingRateTs,
perpMarketAccount!.amm.fundingPeriod
);

// five min away from funding
Expand Down Expand Up @@ -227,7 +227,9 @@ export class UserLpSettlerBot implements Bot {
}

for (const [marketIndex, settleLpIxs] of marketIxMap.entries()) {
console.log(`Settling ${settleLpIxs.length} LPs for market ${marketIndex}`);
console.log(
`Settling ${settleLpIxs.length} LPs for market ${marketIndex}`
);
for (let i = 0; i < settleLpIxs.length; i += SETTLE_LP_CHUNKS) {
const chunk = settleLpIxs.slice(i, i + SETTLE_LP_CHUNKS);
await this.trySendTxForChunk(chunk);
Expand Down
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export function loadConfigFromOpts(opts: any): Config {
debug: opts.debug ?? false,
subaccounts: loadCommaDelimitToArray(opts.subaccount),
useJito: opts.useJito ?? false,
txRetryTimeoutMs: opts.txRetryTimeoutMs ?? 30000,
txSenderType: opts.txSenderType ?? 'fast',
},
enabledBots: [],
botConfigs: {},
Expand Down

0 comments on commit 57d50a5

Please sign in to comment.