small updates to debug scripts, also log vault balance in ui and native, filter mango accounts by name instead of pubkeys
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
7fbf2b592a
commit
177770c580
|
@ -5,6 +5,7 @@ import fs from 'fs';
|
||||||
import { I80F48, ZERO_I80F48 } from '../accounts/I80F48';
|
import { I80F48, ZERO_I80F48 } from '../accounts/I80F48';
|
||||||
import { MangoClient } from '../client';
|
import { MangoClient } from '../client';
|
||||||
import { MANGO_V4_ID } from '../constants';
|
import { MANGO_V4_ID } from '../constants';
|
||||||
|
import { toUiDecimals } from '../utils';
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const options = AnchorProvider.defaultOptions();
|
const options = AnchorProvider.defaultOptions();
|
||||||
|
@ -132,14 +133,10 @@ async function main() {
|
||||||
`\n ${'borrowRate'.padEnd(40)} ${(
|
`\n ${'borrowRate'.padEnd(40)} ${(
|
||||||
100 * bank.getBorrowRate().toNumber()
|
100 * bank.getBorrowRate().toNumber()
|
||||||
).toFixed(2)}%` +
|
).toFixed(2)}%` +
|
||||||
`\n ${'vault balance'.padEnd(40)} ${coder()
|
`\n ${'vault balance'.padEnd(40)} ${toUiDecimals(
|
||||||
.accounts.decode(
|
vault,
|
||||||
'token',
|
bank.mintDecimals,
|
||||||
await (
|
)}, ${vault} native` +
|
||||||
await client.program.provider.connection.getAccountInfo(bank.vault)
|
|
||||||
).data,
|
|
||||||
)
|
|
||||||
.amount.toNumber()}` +
|
|
||||||
`\n ${'last index update'.padEnd(40)} ${new Date(
|
`\n ${'last index update'.padEnd(40)} ${new Date(
|
||||||
1000 * bank.indexLastUpdated.toNumber(),
|
1000 * bank.indexLastUpdated.toNumber(),
|
||||||
)}` +
|
)}` +
|
||||||
|
|
|
@ -173,13 +173,7 @@ async function main() {
|
||||||
|
|
||||||
for (const mangoAccount of mangoAccounts) {
|
for (const mangoAccount of mangoAccounts) {
|
||||||
console.log(`MangoAccount ${mangoAccount.publicKey}`);
|
console.log(`MangoAccount ${mangoAccount.publicKey}`);
|
||||||
// if (
|
if (mangoAccount.name === '2nd Account') {
|
||||||
// 'etVgrWPAQe3aUMiuZT32tEMnbtuD2yRxip6eEkSRrLV' ===
|
|
||||||
// '2UWD1ZBiYdusXgXputE68MBL4Kz47nZptzMn6rLnzn1K' ===
|
|
||||||
// '9B8uwqH8FJqLn9kvGPVb5GEksLvmyXb3B8UKCFtRs5cq' ===
|
|
||||||
// mangoAccount.publicKey.toBase58()
|
|
||||||
// )
|
|
||||||
{
|
|
||||||
await debugUser(client, group, mangoAccount);
|
await debugUser(client, group, mangoAccount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue