Skip to content

Commit

Permalink
Make sure to use most recent provider in case of duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Redm4x committed Apr 8, 2024
1 parent d926339 commit f724730
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/src/routes/internal/gpuPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async function getGpuPrices(debug: boolean) {

const pricingBotAddress = "akash1pas6v0905jgyznpvnjhg7tsthuyqek60gkz7uf";
const bidsFromPricingBot = providerBids.filter((x) => x.deployment.owner === pricingBotAddress && x.deployment.cpuUnits === 100);

if (bidsFromPricingBot.length > 0) return bidsFromPricingBot.sort((a, b) => b.height - a.height)[0];

return findBestProviderBid(providerBidsLast14d, x) ?? findBestProviderBid(providerBids, x);
Expand Down Expand Up @@ -326,6 +326,7 @@ async function getGpus() {
FROM provider p
INNER JOIN "providerSnapshot" ps ON ps.id=p."lastSnapshotId"
WHERE p."isOnline" IS TRUE
ORDER BY p."hostUri", p."createdHeight" DESC
)
SELECT s."hostUri", s."owner", n."name", n."gpuAllocatable" AS allocatable, n."gpuAllocated" AS allocated, gpu."modelId", gpu.vendor, gpu.name AS "modelName", gpu.interface, gpu."memorySize"
FROM snapshots s
Expand Down

0 comments on commit f724730

Please sign in to comment.