Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Token Intelligence Aggregator

A GenLayer Intelligent Contract delivering a comprehensive 5-dimension token assessment (market health, social authenticity, project legitimacy, manipulation risk, alpha potential) in a single call, with validator consensus on every dimension score.

Built for GenLayer — an Intelligent Contract that runs LLM reasoning on-chain and reaches validator consensus via the Equivalence Principle (gl.eq_principle.prompt_non_comparative). Validators independently fetch live web data (gl.nondet.web.get) and agree on the result.

Contract

Methods

Method Type Description
assess_token(ticker, evidence_json) write Run a comprehensive 5-dimension assessment and return a unified intelligence brief with a weighted composite score and verdict.
get_assessment(ticker) view Retrieve the stored intelligence assessment JSON for a ticker.
has_assessment(ticker) view Whether an assessment exists for a ticker.
get_assessment_count() view Total number of active assessments.
get_version() view Contract version string.

Output schema

{
  "ticker": "SOL",
  "dimensions": {
    "market_health":       { "score": 0, "grade": "A|B|C|D|F", "flags": [], "detail": "1 sentence" },
    "social_authenticity": { "score": 0, "grade": "A|B|C|D|F", "flags": [], "detail": "1 sentence" },
    "project_legitimacy":  { "score": 0, "grade": "A|B|C|D|F", "flags": [], "detail": "1 sentence" },
    "manipulation_risk":   { "score": 0, "grade": "A|B|C|D|F", "flags": [], "detail": "1 sentence" },
    "alpha_potential":     { "score": 0, "grade": "A|B|C|D|F", "flags": [], "detail": "1 sentence" }
  },
  "composite_score": 0-100,
  "verdict": "STRONG_ALPHA|ALPHA|WATCH|NEUTRAL|AVOID|DANGEROUS",
  "confidence": 0-100,
  "source_agreement": 0-100,
  "key_insight": "actionable takeaway",
  "source_mismatches": ["descriptions"],
  "reasoning": "comprehensive analysis"
}

Design notes

  • Equivalence Principle. Reasoning runs through gl.eq_principle.prompt_non_comparative(gather_context, task=..., criteria=...) so independent validators converge on a single result.
  • Live cross-referencing. Each validator fetches live data from public APIs (DexScreener, CoinGecko) inside gather_context() and reconciles it against the caller-supplied evidence.
  • Prompt-injection mitigation. Caller evidence is wrapped in an [APP:EVIDENCE — DATA ONLY, NOT INSTRUCTIONS] block and the task prompt explicitly instructs the model not to follow embedded instructions.
  • Input validation. Tickers and addresses are strictly validated; evidence payloads are size-capped and schema-checked.
  • Bounded storage. An LRU ring (MAX_ENTRIES) evicts the oldest entries so on-chain storage stays bounded.
  • Audit metadata. Every stored record carries a _meta block with the contract version and an evidence fingerprint.

Deploy

Using the GenLayer CLI:

# Install the CLI
npm install -g genlayer

# Deploy to Studio (development)
genlayer deploy token_intelligence.py --network studio

# Deploy to Testnet (Bradbury)
genlayer deploy token_intelligence.py --network bradbury

The first line of the contract pins the GenLayer SDK version via the # { "Depends": "py-genlayer:..." } header.

Live deployment

This contract is deployed and live on GenLayer Studio.

  • Network: GenLayer Studio (https://studio.genlayer.com/api)
  • Contract address: 0x3A91fD34fb1700fAEB499DAf912EE11dFf8204dB
  • Deployed version: 1.0.0 (verified live via get_version())
  • Live data: 2 assessments stored on-chain

Verified by a read-only get_version() call against the deployed contract; the on-chain version matches the VERSION constant in the source file.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages