A Cardano project that reads ADA/USD price data from Pyth Lazer on-chain, detects price movement, generates a mood-based meme, and mints it as a CIP-68 NFT — all in one transaction.
- Samples the ADA/USD price twice (3 s apart) via the Pyth Lazer oracle
- Submits the price update on-chain through a Plutus V3 spend validator that verifies the feed
- Determines sentiment — bullish, bearish, or neutral — from the price delta
- Generates a meme matching the mood (30+ templates via memegen.link)
- Mints a CIP-68 NFT whose metadata includes the meme image, price, and sentiment
validators/
pythathon.ak # Spend validator — verifies Pyth Lazer price feed
meme_nft.ak # CIP-68 minting policy for the meme NFT
offchain/
src/
fetch-and-verify.ts # Off-chain logic: price sampling, meme gen, tx building
run.sh # Convenience runner (loads .env and calls the CLI)
.env.example # Environment variable template
- Aiken v1.1.21+
- Node.js 18+
- A funded Cardano wallet (preprod or mainnet)
- A Pyth Lazer access token
aiken buildcd offchain
npm installcp offchain/.env.example offchain/.envFill in the values:
| Variable | Description |
|---|---|
CARDANO_MNEMONIC |
24-word wallet seed phrase |
LAZER_TOKEN |
Pyth Lazer authentication token |
POLICY_ID |
Hex-encoded policy ID of the Cardano Pyth deployment |
NETWORK |
preprod / preview / mainnet |
PROVIDER |
koios / blockfrost / maestro |
PROVIDER_TOKEN |
Required for Blockfrost/Maestro, optional for Koios |
cd offchain
./run.shOr run directly:
cd offchain
npm run verify -- \
--network preprod \
--policy-id <POLICY_ID> \
--lazer-token <LAZER_TOKEN> \
--provider koiosaiken check