# Process

**Process:**&#x20;

```
1. Start
﻿
2. Set API Key
Retrieve the Binance API key from environment variables.
﻿
3. Fetch All Futures Symbols
Use get_futures_symbols() to get a list of all futures symbols available on   Binance.
﻿
4. For Each Symbol, Fetch Funding Rate History
Loop through each symbol.
Use get_funding_rate_history(symbol, 60) to fetch the last 60 days' worth of funding rate data for each symbol.
﻿
5. Data Processing and APR Calculation
For each dataset fetched:
Calculate 3-day, 7-day, and 30-day average funding rates.
Annualize these averages to get APRs by multiplying the average rates by 365 and converting to percentage.
Store these calculations in the DataFrame.
﻿
6. Optimize APR Score
For the funding rate data of each symbol, use optimize_apr_score(group) to compute the optimized APR score based on weighted averages of the 3-day, 7-day, 30-day, and the most recent funding rates.
﻿
7. Collect and Prepare Final Data
Compile all processed and optimized data into a final DataFrame.
Format and sort data based on optimized APR scores.
﻿
8. Output Results
Display the final DataFrame.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kira.trading/trust/human-error-free-with-ai-automation/monitor/process.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
