configure max staleness slots

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2023-02-08 10:29:11 +01:00
parent 0dba464a28
commit 0639681c33
1 changed files with 38 additions and 0 deletions

View File

@ -533,6 +533,43 @@ async function makeTokenReduceonly() {
);
}
async function changeMaxStalenessSlots() {
const result = await buildAdminClient();
const client = result[0];
const admin = result[1];
const creator = result[2];
const group = await client.getGroupForCreator(creator.publicKey, GROUP_NUM);
for (const bank of Array.from(group.banksMapByTokenIndex.values()).flat()) {
await client.tokenEdit(
group,
bank.mint,
Builder(NullTokenEditParams)
.oracleConfig({
confFilter: 0.1,
maxStalenessSlots: 120,
})
.build(),
);
}
for (const perpMarket of Array.from(
group.perpMarketsMapByMarketIndex.values(),
)) {
await client.perpEditMarket(
group,
perpMarket.perpMarketIndex,
Builder(NullPerpEditParams)
.oracleConfig({
confFilter: 0.1,
maxStalenessSlots: 120,
})
.build(),
);
}
}
async function makePerpMarketReduceOnly() {
const result = await buildAdminClient();
const client = result[0];
@ -699,6 +736,7 @@ async function main() {
// await registerTokens();
// await changeTokenOracle();
// await makeTokenReduceonly();
// await changeMaxStalenessSlots();
} catch (error) {
console.log(error);
}