Fix logging in liqtest scripts

This commit is contained in:
Christian Kamm 2024-03-14 08:58:04 +01:00
parent 25bf71c646
commit e20052f6e5
3 changed files with 14 additions and 8 deletions

View File

@ -11,9 +11,11 @@ GROUP_NUM=200
### Create tokens and markets
This is one-time setup:
```
yarn ts-node ts/client/scripts/liqtest/liqtest-create-tokens-and-markets.ts
```
It'll emit some MINTS=... and SERUM_MARKETS=.. env vars, set those, all further
commands will use them.
@ -24,6 +26,7 @@ yarn ts-node ts/client/scripts/liqtest/liqtest-create-group.ts
```
Groups can be reused a lot, but sometimes closing them may be necessary
```
yarn ts-node ts/client/scripts/liqtest/liqtest-close-group.ts
```
@ -45,6 +48,7 @@ Run the liquidator on the group with the liqor account.
### Settle and close all open mango accounts
At any point, to reset by closing all accounts:
```
yarn ts-node ts/client/scripts/liqtest/liqtest-settle-and-close-all.ts
```

View File

@ -51,7 +51,7 @@ async function main() {
market.serumMarketExternal,
);
console.log(
`Deregistered serum market ${market.name}, sig https://explorer.solana.com/tx/${sig}`,
`Deregistered serum market ${market.name}, sig https://explorer.solana.com/tx/${sig.signature}`,
);
}
@ -59,7 +59,7 @@ async function main() {
for (const market of group.perpMarketsMapByMarketIndex.values()) {
sig = await client.perpCloseMarket(group, market.perpMarketIndex);
console.log(
`Closed perp market ${market.name}, sig https://explorer.solana.com/tx/${sig}`,
`Closed perp market ${market.name}, sig https://explorer.solana.com/tx/${sig.signature}`,
);
}
@ -67,7 +67,7 @@ async function main() {
for (const banks of group.banksMapByMint.values()) {
sig = await client.tokenDeregister(group, banks[0].mint);
console.log(
`Removed token ${banks[0].name}, sig https://explorer.solana.com/tx/${sig}`,
`Removed token ${banks[0].name}, sig https://explorer.solana.com/tx/${sig.signature}`,
);
}
@ -76,13 +76,15 @@ async function main() {
for (const stubOracle of stubOracles) {
sig = await client.stubOracleClose(group, stubOracle.publicKey);
console.log(
`Closed stub oracle ${stubOracle.publicKey}, sig https://explorer.solana.com/tx/${sig}`,
`Closed stub oracle ${stubOracle.publicKey}, sig https://explorer.solana.com/tx/${sig.signature}`,
);
}
// finally, close the group
sig = await client.groupClose(group);
console.log(`Closed group, sig https://explorer.solana.com/tx/${sig}`);
console.log(
`Closed group, sig https://explorer.solana.com/tx/${sig.signature}`,
);
}
process.exit();

View File

@ -330,12 +330,12 @@ async function createAndPopulateAlt(
});
let sig = await client.sendAndConfirmTransaction([createIx[0]]);
console.log(
`...created ALT ${createIx[1]} https://explorer.solana.com/tx/${sig}`,
`...created ALT ${createIx[1]} https://explorer.solana.com/tx/${sig.signature}`,
);
console.log(`ALT: set at index 0 for group...`);
sig = await client.altSet(group, createIx[1], 0);
console.log(`...https://explorer.solana.com/tx/${sig}`);
console.log(`...https://explorer.solana.com/tx/${sig.signature}`);
group = await client.getGroupForCreator(admin.publicKey, GROUP_NUM);
} catch (error) {
@ -366,7 +366,7 @@ async function createAndPopulateAlt(
addresses,
});
const sig = await client.sendAndConfirmTransaction([extendIx]);
console.log(`https://explorer.solana.com/tx/${sig}`);
console.log(`https://explorer.solana.com/tx/${sig.signature}`);
}
// Extend using mango v4 relevant pub keys