Demo code of MetaRank, a Semantics-based Prediction Model for up- and coming NFTs. Pseudo Code created via AI from a prompt generated by Solana IDE's Anchor Model.
Detailed Description and Report Submission of MetaRank
Prompt created using Solana IDE's Anchor Model
Detailed Architexture of Program
This is only for conceptual understanding of a tool that can be used on and with Solana's ecosystem, and is not a functional tool.
The code is purposesly generated solely using AI to illustrate the potentials of AI applications on Solana's IDE for Anchoring. Please do not try to compile this code.
Corrections and Edits to commence from 6th of December 2024
src/
├── accounts/
│ ├── mod.rs # Imports all account-related code
│ └── state.rs # Stores the account-related logic (NFT data structure)
├── instructions/
│ ├── mod.rs # Imports all instruction files
│ ├── analyse_data.rs # Instruction to analyse NFT data
│ ├── knn_peers.rs # Instruction to find similar NFTs (KNN)
│ ├── pct_change_in_price.rs # Instruction to predict price change
│ ├── ranking_accuracy_backtest.rs # Instruction to backtest ranking accuracy
│ └── semantics_accuracy_backtest.rs # Instruction to backtest semantics accuracy
├── lib.rs # Entry point of the program, importing instructions
tests/
├── mod.ts # Imports all tests
├── analyse_data.test.ts # Test case for the analyse_data instruction
├── knn_peers.test.ts # Test case for the knn_peers instruction
├── pct_change_in_price.test.ts # Test case for the pct_change_in_price instruction
├── ranking_accuracy_backtest.test.ts # Test case for the ranking_accuracy_backtest instruction
└── semantics_accuracy_backtest.test.ts # Test case for the semantics_accuracy_backtest instruction
ts_sdk/
├── mod.ts # Main SDK entry point
├── nft_program.ts # Functions to interact with the NFT program
└── filters.ts # Functions to get accounts with filters
Here's a structured approach to organizing this Solana program using the Anchor framework, TypeScript SDK, and test cases.
Solana Program Structure (Anchor Framework)
We will break down the program into several components:
- State (Accounts): Store data for NFTs.
- Instructions: Each instruction for manipulating or predicting NFT behavior (like analyse_data, knn_peers, etc.) will be in its own file.
- Tests: TypeScript-based tests for each instruction.
- SDK: A TypeScript SDK to interact with the Anchor program.
Conclusion With this structure:
Accounts are defined in state.rs.
Instructions are modularized in separate files within the instructions folder.
Tests are organized into TypeScript files in the tests folder.
SDK code provides functions to interact with the Solana program from TypeScript.