Hackathon Submission: GastroBenchmark microservice for Cuqui on Cardano#117
Open
pjcdz wants to merge 15 commits intopyth-network:mainfrom
Open
Hackathon Submission: GastroBenchmark microservice for Cuqui on Cardano#117pjcdz wants to merge 15 commits intopyth-network:mainfrom
pjcdz wants to merge 15 commits intopyth-network:mainfrom
Conversation
…lo Cardozo, Nashira Oropeza)
- Added gastro_benchmark validator with Pyth price validation logic - Max markup: 30% over Pyth commodity prices - TODO: Build plutus.json locally (aiken build) Team Cuqui - Pablo Cardozo, Nashira Oropeza
- Clean build with 0 errors, 0 warnings - Validator: gastro_benchmark (spend handler) - Blueprint includes datum, redeemer, and validator address Team Cuqui - Pablo Cardozo, Nashira Oropeza
- contract.ts: Load plutus.json and derive validator address - demo.ts: lock and redeem purchase orders with Pyth validation - .env: Template for API keys and wallet seed - Scripts: npm run lock, npm run redeem Team Cuqui - Pablo Cardozo, Nashira Oropeza
- Compares supplier prices vs Pyth Network benchmarks - Color-coded markup indicators (🟢🟡🔴) - Shows fair/acceptable/expensive suppliers - Team Cuqui: Pablo Cardozo, Nashira Oropeza Run: npm run dashboard
- Complete project description - Demo command and output - Team Cuqui members listed - Future work section Ready for PR submission
- Fetches live BTC/ETH prices from CoinGecko API - Shows comparison between exchange prices and market - Premium calculation: overpaying exchanges flagged in red - Architecture documentation for Pyth integration Team Cuqui: Pablo Cardozo, Nashira Oropeza
- Document CoinGecko API integration - Show actual live price output - Team Cuqui listed Ready for PR submission
- Food commodities: Harina, Aceite Soja, Carne Vacuna - Suppliers: Molinos, La Serenísima, Frigoríficos, etc. - Pyth feeds: WHEAT, SOYBEAN_OIL, LIVE_CATTLE - Business value: Restaurants pay fair prices Team Cuqui: Pablo Cardozo, Nashira Oropeza
- Food commodities: Harina, Aceite Soja, Carne Vacuna - Suppliers: Molinos, La Serenísima, Frigoríficos - Business value: Restaurants pay fair prices - Team Cuqui: Pablo Cardozo, Nashira Oropeza Ready for PR
Add @pythnetwork/pyth-lazer-sdk and refactor the gastro-benchmark tool to use live Pyth feeds. Introduces src/pyth.ts which encapsulates PythLazerClient creation, feed definitions, latest snapshot retrieval, historical fallback logic, value scaling/normalization, and client shutdown. Update src/dashboard.ts to consume the new API: pretty-printed benchmark table, supplier quote comparisons with markup classification, notes, improved formatting, error handling, and graceful shutdown. Also update package.json and package-lock.json to include the new SDK dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pyth Examples Contribution
Type of Contribution
Project Information
Project/Example Name: GastroBenchmark for Cuqui
Pyth Product Used:
Blockchain/Platform:
Description
What does this contribution do?
This contribution turns
lazer/cardano/gastro-benchmarkinto a hackathon-ready example project forCuqui, a buyer platform for supplier catalogs.The example now presents
GastroBenchmarkas a backend microservice that receives normalized supplier offers and returns:It also preserves the Cardano-oriented foundation of the original example by keeping the on-chain/off-chain Cardano files in place while reorganizing the project around a clean microservice layer.
How does it integrate with Pyth?
The project uses Pyth Lazer price feeds as the market reference layer.
Specifically, it:
CuquiWhat problem does it solve or demonstrate?
Restaurants and merchants usually compare one supplier against another, but they do not know how far those offers are from the international market price of the underlying commodity.
This example demonstrates how a buyer platform can go beyond supplier-vs-supplier comparison and answer questions like:
This is especially useful for hackathon reviewers because it shows a practical real-world use case for Pyth price feeds on Cardano in procurement software.
Directory Structure (for new examples)
Testing & Verification
How to Test This Contribution
Prerequisites
npm installPYTH_API_KEYSetup & Run Instructions
Optional dashboard demo:
cd lazer/cardano/gastro-benchmark npm run dashboardDeployment Information (if applicable)
Network: Cardano-oriented example with Pyth Lazer market data and Cardano integration scaffolding
Contract Address(es): Not deployed as part of this submission
Demo URL: N/A
Checklist
Code Quality
Testing
Additional Context
Related Issues
Fixes #N/A
Screenshots/Demo (if applicable)
No live hosted demo URL in this PR. The included REST service and CLI dashboard are the local demo surfaces.
Notes for Reviewers
This submission should be read together with the
Cuquiplatform concept:Cuquihandles ingestion, parsing, normalization and buyer-facing UIGastroBenchmarkis the backend microservice that adds international market comparison using Pyth on CardanoThe project intentionally makes partial market coverage explicit. Many gastronomy products still do not have a direct benchmark in Pyth/Cardano, and the service returns those cases as coverage gaps or future mapping candidates instead of inventing prices.