ZkAGI AiFi Trading Agent is a autonomously executing Python-based agent that fetches Bitcoin market analysis data, analyzes it using a time series transformer inside the ZkAGI network, and executes a swap if the signal is "buy". Trading execution is being done on a TEE machine where the agents wallet is stored and the user cross verifies whether an action is to be taken based on 'buy' signals emanating from the predictions of the time series transformer.
Watch a video demonstration of the ZkAGI AiFi Trading Agent in action: ![Watch the video]
- Fetches Bitcoin market analysis data
- Analyzes the data using ZkAGI Zynapse API embedded with Nixtla Time series transformer.
- Executes a swap using wallet in TEE if the signal is "buy".
- User authenticates actions using Tg double check.
- Python 3.x
requests
libraryZynapse API
keypython-dotenv
librarycolorama
library
-
Clone the repository:
git clone https://github.com/ZkAGI/ZkAGI_Trading_Agent.git cd ZkAGI_Trading_Agent
-
Install the required libraries:
pip install -r requirements.txt
-
Create a
.env
file in the project directory with the following content:ZKAGI_API_KEY=your_zkagi_api_key ZKAGI_API_URL=https://zynapse.zkagi.ai/v1 ANALYSIS_API_URL= SWAP_API_URL= TELEGRAM_ID=your_telegram_id OUTPUT_MINT=your_output_mint
- Run the agent:
python agent.py
- If you want to use ZK Enabled Agent, run:
python agent_with_ZK.py
- The agent will start, fetch the analysis data, analyze it, and execute a swap if the signal is "buy". The output will be colorful and formatted for better readability.
The script will print the following steps with the appropriate colors and symbols:
Agent started ✅
Fetching analysis data...
Analysis Data Received:
followed by the signal.Signal is: buy ✅
orSignal is: hold ❌
depending on the signal.Analyzing response...
Analysis Result:
followed by the detailed analysis result from the Zynapse API.- If the signal is "buy", it will print
Executing swap...
,Swap started ✅
, andSwap executed successfully ✅
orFailed to execute swap: {status_code} ❌
depending on the swap result.