In house datasets

Getting Started

To interact with these cubes, ensure you have the following setup:

  1. Cube.js Client Setup: Ensure that your frontend application is correctly set up with Cube.js and has access to the Cube.js API endpoint.

  2. Data Sources: The cubes are connected to different data sources (bitcoin, stacks, stellar, dapps, pricing). Ensure that these data sources are correctly configured in your Cube.js backend.

  3. Permissions: Get a JWT token from the Ortege team.

Querying the Cubes

Developers can use Cube.js's query language to fetch data from these cubes. Below are some general guidelines and best practices:

  • Selecting Measures and Dimensions: Choose relevant measures and dimensions based on the insights you aim to derive.

  • Filtering Data: Utilize filters to narrow down the data to specific criteria, such as date ranges, specific accounts, or asset types.

  • Time Dimensions: Leverage time dimensions to analyze trends over time, such as hourly, daily, or monthly aggregations.

  • Combining Cubes: Use joins and other advanced Cube.js features to combine data from multiple cubes if necessary.

Example Queries

Here are some example queries for different use cases:

  1. Total Supplied STX in a Specific Cycle

    jsonCopy code{
      "measures": ["stacks_lending_zest.total_supplied"],
      "dimensions": ["stacks_lending_zest.sender_address"],
      "filters": [
        {
          "dimension": "stacks_lending_zest.cycle",
          "operator": "equals",
          "values": [10]
        }
      ],
      "timeDimensions": []
    }
  2. Average Price of Assets Over the Last Week

    jsonCopy code{
      "measures": ["prices.avg_price"],
      "dimensions": ["prices.symbol"],
      "filters": [],
      "timeDimensions": [
        {
          "dimension": "prices.timedate",
          "granularity": "day",
          "dateRange": "Last 7 days"
        }
      ]
    }
  3. Stellar Transactions with Average Fee

    jsonCopy code{
      "measures": ["stellar_tx.avg_fee"],
      "dimensions": ["stellar_tx.account", "stellar_tx.block_height"],
      "filters": [],
      "timeDimensions": [
        {
          "dimension": "stellar_tx.timestamp",
          "granularity": "day",
          "dateRange": "Last 30 days"
        }
      ]
    }

Best Practices

  • Optimize Queries: Only request necessary measures and dimensions to optimize performance and reduce payload sizes.

  • Use Aggregations Wisely: Leverage Cube.js's powerful aggregation capabilities to perform complex calculations server-side.

  • Handle Time Zones: Ensure that time dimensions account for time zone differences if your data spans multiple regions.

  • Monitor Performance: Regularly monitor query performance and adjust cube configurations as needed to maintain responsiveness.

Troubleshooting

If you encounter issues while querying the cubes:

  • Check Cube Definitions: Ensure that the cube definitions are correctly configured and match the underlying database schemas.

  • Verify Data Sources: Confirm that all data sources are operational and correctly connected to Cube.js.

  • Review Filters and Parameters: Double-check the filters and parameters used in your queries to ensure they align with the cube's dimensions and measures.

  • Consult Logs: Check Cube.js and backend logs for any error messages or warnings that can provide insights into the issue.

Contributing

If you plan to add new cubes or modify existing ones:

  1. Update Schema Files: Ensure that any new cube definitions are added to the ConfigMap as shown in the provided configurations.

  2. Test Queries: Validate new or modified cubes by running test queries to ensure they return the expected data.

  3. Document Changes: Update this documentation accordingly to reflect any additions or modifications to the cubes.

Contact

For further assistance or to report issues, please contact the development team at dev-team@example.com.

Last updated