Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions lazer/cardano/lemon-pyth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --- DEPENDENCIAS ---
node_modules/
.pnp
.pnp.js

# --- PRODUCCIÓN / BUILDS ---
dist/
dist-ssr/
build/

# --- LOGS ---
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# --- VARIABLES DE ENTORNO (Seguridad) ---
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
*.local

# --- ARCHIVOS TEMPORALES Y CACHÉ ---
.eslintcache
.stylelintcache
.vite
.cache/

# --- EDITOR (VS Code / JetBrains) ---
.vscode/*
!.vscode/extensions.json
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# --- SISTEMA ---
.DS_Store
Thumbs.db

# --- ESPECÍFICO DEL PROYECTO ---
backup_sryle/
temp/
58 changes: 58 additions & 0 deletions lazer/cardano/lemon-pyth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
🍋 LemonPyth - Arbitrage & Predictive Price Oracle
LemonPyth is a technical tool developed for Pythathon 2026. The project consists of a predictive price oracle and a real-time arbitrage scanner that uses the Pyth Network infrastructure to anticipate trends, detect opportunities, and mitigate volatility risks in the Cardano ecosystem.

👥 Team
Captain: Matthew Suarez — matt@szoficial.com

Member: Moises Ezequiel Schvarzman Robles — archivosparticularez@gmail.com

Member: Nasar Hernan — hnasar@gmail.com

🛠️ Project Description
The project is designed to address the need for accurate, predictive, and low-latency data in Cardano.

Predictive Oracle: Uses statistical models on Pyth data to project short-term trends, allowing protocols to react before sharp market movements occur.

Arbitrage Screener: Compares Pyth institutional prices with external market feeds to identify profitable gaps in real time.

Alert Terminal: Instant notifications based on the deviation analysis between the current and predicted prices.

🔮 Pyth Network Usage
In this project, Pyth is the engine for predictive analytics and security:

Predictive Trend Analysis: Pyth price feeds and confidence intervals are used as input variables for volatility prediction algorithms, enabling a "post-predictive" approach that identifies market direction.

On-chain Verification: (Cardano Integration) Implementation of Pyth signature validation to ensure that predictive data is anchored to real, legitimate, and tamper-resistant prices.

Low Latency Efficiency: We leverage high-frequency updates to feed the predictive model, ensuring that arbitrage signals are generated with a millisecond competitive advantage.


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

🍋 LemonPyth - Arbitraje & Oráculo de Precios Predictivo
LemonPyth es una herramienta técnica desarrollada para la Pythathon 2026. El proyecto consiste en un oráculo de precios predictivo y un escáner de arbitraje en tiempo real que utiliza la infraestructura de Pyth Network para anticipar tendencias, detectar oportunidades y mitigar riesgos de volatilidad en el ecosistema de Cardano.

👥 Equipo (Team)
Capitán: Matthew Suarez — matt@szoficial.com

Integrante: Moises Ezequiel Schvarzman Robles — archivosparticularez@gmail.com

Integrante: Nasar Hernan — hnasar@gmail.com

🛠️ Descripción del Proyecto
El proyecto está diseñado para resolver la necesidad de datos precisos, predictivos y de baja latencia en Cardano.

Oráculo Predictivo: Utiliza modelos estadísticos sobre los datos de Pyth para proyectar tendencias de corto plazo, permitiendo a los protocolos reaccionar antes de que ocurran movimientos bruscos de mercado.

Screener de Arbitraje: Compara los precios institucionales de Pyth con feeds de mercados externos para identificar brechas rentables en tiempo real.

Terminal de Alertas: Notificaciones instantáneas basadas en el análisis de desviación entre el precio actual y el predictivo.

🔮 Uso de Pyth Network
En este proyecto, Pyth es el motor del análisis predictivo y la seguridad:

Análisis Predictivo de Tendencias: Se consumen los Price Feeds y los intervalos de confianza de Pyth como variables de entrada para algoritmos de predicción de volatilidad, permitiendo un enfoque "post-predictivo" que identifica la dirección del mercado.

Verificación on-chain: (Cardano Integration) Implementación de la validación de firmas de Pyth para asegurar que los datos predictivos estén anclados a precios reales, legítimos y resistentes a la manipulación.

Eficiencia de Baja Latencia: Aprovechamos las actualizaciones de alta frecuencia para alimentar el modelo predictivo, asegurando que las señales de arbitraje se generen con una ventaja competitiva de milisegundos.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Continuous Integration

on:
push:
branches: ["main"]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: aiken-lang/setup-aiken@v1
with:
version: v1.1.21
- run: aiken fmt --check
- run: aiken check -D
- run: aiken build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Aiken compilation artifacts
artifacts/
# Aiken's project working directory
build/
# Aiken's default documentation export
docs/
65 changes: 65 additions & 0 deletions lazer/cardano/lemon-pyth/aiken-contracts/validators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# validators

Write validators in the `validators` folder, and supporting functions in the `lib` folder using `.ak` as a file extension.

```aiken
validator my_first_validator {
spend(_datum: Option<Data>, _redeemer: Data, _output_reference: Data, _context: Data) {
True
}
}
```

## Building

```sh
aiken build
```

## Configuring

**aiken.toml**
```toml
[config.default]
network_id = 41
```

Or, alternatively, write conditional environment modules under `env`.

## Testing

You can write tests in any module using the `test` keyword. For example:

```aiken
use config

test foo() {
config.network_id + 1 == 42
}
```

To run all tests, simply do:

```sh
aiken check
```

To run only tests matching the string `foo`, do:

```sh
aiken check -m foo
```

## Documentation

If you're writing a library, you might want to generate an HTML documentation for it.

Use:

```sh
aiken docs
```

## Resources

Find more on the [Aiken's user manual](https://aiken-lang.org).
15 changes: 15 additions & 0 deletions lazer/cardano/lemon-pyth/aiken-contracts/validators/aiken.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Aiken
# You typically do not need to edit this file

[[requirements]]
name = "aiken-lang/stdlib"
version = "v3.0.0"
source = "github"

[[packages]]
name = "aiken-lang/stdlib"
version = "v3.0.0"
requirements = []
source = "github"

[etags]
18 changes: 18 additions & 0 deletions lazer/cardano/lemon-pyth/aiken-contracts/validators/aiken.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name = "lemon-pyth/validators"
version = "0.0.0"
compiler = "v1.1.21"
plutus = "v3"
license = "Apache-2.0"
description = "Aiken contracts for project 'lemon-pyth/validators'"

[repository]
user = "lemon-pyth"
project = "validators"
platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "v3.0.0"
source = "github"

[config]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use cardano/transaction.{Transaction}
use aiken/interval.{Finite}

// Agregamos 'pub' para que no haya "leak"
pub type Datum {
owner: ByteArray,
lock_until: Int,
}

// También el Redeemer debe ser público
pub type Redeemer {
Cancel
Confirm
}

validator peg_defense {
spend(datum: Option<Datum>, redeemer: Redeemer, _utxo: Data, self: Transaction) {
// 1. Verificamos que el Datum exista
expect Some(d) = datum

// 2. Accedemos al tiempo directamente
expect Finite(current_time) = self.validity_range.lower_bound.bound_type

when redeemer is {
// Regla de Reversibilidad (30s): Solo si el tiempo actual es menor al límite
Cancel ->
current_time <= d.lock_until

// Regla de Confirmación: Solo si el tiempo ya pasó
Confirm ->
current_time > d.lock_until
}
}
}
16 changes: 16 additions & 0 deletions lazer/cardano/lemon-pyth/check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { LazerClient } from "@pythnetwork/pyth-lazer-cardano-js";
import 'dotenv/config';

async function test() {
console.log("🚀 Iniciando prueba de fuego LemonPyth...");
try {
const client = new LazerClient({
token: process.env.VITE_PYTH_API_KEY || "F03Bq9mHJBobUHqLbwY5mXceMSxqYVpWEeE-cardano",
endpoint: "wss://lazer.pyth.network/ws"
});
console.log("✅ Conexión con Lazer exitosa.");
} catch (e) {
console.error("❌ Falló la conexión:", e.message);
}
}
test();
Loading