Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/improve api usdc support #16

Merged
merged 12 commits into from
Sep 13, 2023
Merged

Conversation

Redm4x
Copy link
Contributor

@Redm4x Redm4x commented Sep 12, 2023

  • Added usdc and usd stats to dashboard + graphs
  • Update akt price of previous days
  • Add missing .next cache to .dockerignore for reduced image sizes in Api & Indexer
  • Upgraded @cosmjs to latest version in indexer to remove custom code. Could not update to latest in api because since 0.30.0 the .toJSON() method was removed. We will need to find an alternative for .toJSON() in the api.
  • Improved typing in api and indexer

@@ -164,7 +179,7 @@ async function getDailyRevenue() {
uakt: x.uakt,
akt: uaktToAKT(x.uakt, 6),
uusdc: x.uusdc,
usdc: udenomToDenom(x.uusdc),
usdc: udenomToDenom(x.uusdc, 6),
usd: uaktToAKT(x.uakt, 6) * x.aktPrice + udenomToDenom(x.uusdc),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

udenomToDenom(x.uusdc, 6)?

</>
}
text="AKT spent (24h)"
text="USD spent (24h)"
tooltip="Last 24h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a little description saying that it adds up the value in AKT + the USDC spent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea 👍

</>
}
text="Total spent USDC"
tooltip="This is the total amount of usdc spent to rent computing power on the akash network since the beginning of the network. (March 2021)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could change this to the beginning of the USDC support

scheduler.registerTask("Sync Blocks", syncBlocks, "7 seconds", true, {
id: env.HealthChecks_SyncBlocks
});
// scheduler.registerTask("Sync Blocks", syncBlocks, "7 seconds", true, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, yeah I'll put back all scheduled tasks as before

import { sequelize } from "@src/db/dbConnection";
import { Op } from "sequelize";

export async function updateUsdcSpending() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateUsdSpending?

@Redm4x Redm4x merged commit 6b97bb2 into main Sep 13, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants