Adapter for Retrieving Current APR

Task details
POSTED
Posted on Jan 4th, 2025
STATUS
Filled
DURATION
1 days
VALUE
$80.00 per project
LOCATION
Remote
TYPE
One Time
APPLICATIONS
3
Skills Required
  • Web Development

1. General Information

  • Component Name: Adapter for Retrieving Current APR in the Aerodrome Project.
  • Programming Language: Python.
  • Purpose: To provide information on the current Annual Percentage Rate (APR) for a specified NFT position based on the emission of the AERO token through direct interaction with the smart contract.

2. Functional Requirements

  • Input Parameters:
    • nft_position_id: A unique identifier for the NFT position for which the current APR is to be retrieved.
  • Output Data:
    • An array containing:
      • nft_position_id: Identifier of the position.
      • apr: Current APR in percentage for the specified position, derived from the emission of the AERO token.
  • Core Functions of the Adapter:
    • Establish a connection with the blockchain via RPC to interact with the Aerodrome smart contract.
    • Retrieve position data directly from the smart contract.
    • Calculate the current APR based on the retrieved data.
    • Handle errors, including cases where data for the provided nft_position_id is unavailable.
  • APR Calculation Methodology:
    • Obtain necessary data from the smart contract related to the AERO token emission for the specified position.
    • Apply the APR calculation formula as provided by the Aerodrome project.
  • Integration with Blockchain via RPC:
    • Utilize the web3.py library to establish an RPC connection with the blockchain.
    • Specify the RPC node and the ABI of the corresponding smart contract.

3. Architectural Requirements

  • Code Structure:
    • Modular design:
      • Module for establishing RPC connections and interacting with the smart contract.
      • Module for processing and calculating APR.
      • Module for handling input and output data.
    • Logging of key operations and errors.
  • Documentation:
    • Comprehensive code documentation adhering to Python's docstring standards (e.g., Google Style).
  • Testing:
    • Provide unit tests for all key functions.
    • Tests should cover:
      • Accurate data retrieval from the smart contract.
      • Error handling (e.g., invalid nft_position_id, connection issues).
      • Correct APR calculation.

4. Development Stages

  • Analysis and Design:
    • Clarify the methodology for retrieving position data and calculating APR with the Aerodrome team.
  • Implementation:
    • Develop core modules and establish RPC connections.
  • Testing:
    • Write and execute unit tests.
  • Documentation:
    • Add a README file detailing installation, execution, and usage of the adapter.
  • Deployment:
    • Prepare the final code for deployment.

5. Expected Outcome

A functional adapter that accepts nft_position_id as input and returns an array containing the nft_position_id and the current APR. The component should be ready for integration with other system modules.

6. Additional Requirements

  • Document all external libraries used in a requirements.txt file.
  • Employ Git for version control; the code should be hosted on GitHub.
  • Ensure the code repository is accessible to the team.

Are you an employer? Post a similar job