Skip to content

Add basic binance based loans as a new strategy #277

@posix4e

Description

@posix4e

Here's a draft for creating a GitHub issue requesting support for integrating Binance lending as a strategy in Mr. Market:


Title: Add Support for Binance Lending as a Strategy

Description:
I would like to request a new feature for Mr. Market: support for Binance Lending as a trading/investment strategy. This feature would enable users to automatically lend their assets through Binance's Flexible Savings, Locked Savings, or other lending products to earn passive income.


Feature Details:

  1. Objective:

    • Automate the process of lending assets on Binance to generate interest.
    • Allow users to configure their preferred lending options, such as asset type, lending amount, and product type (e.g., Flexible Savings or Locked Savings).
    • Handle deposits and track amounts deposited by the user from an external wallet.
  2. API Integration:

    • Utilize the Binance API endpoints for lending:

      • /sapi/v1/lending/daily/product/list: To fetch available lending products.
      • /sapi/v1/lending/daily/position: To manage Flexible Savings.
      • /sapi/v1/lending/project/list: To manage Locked Savings.
    • Use CCXT to handle deposits and save the data to a new table in the database.

  3. User Input/Configuration:

    • Add a configuration option in the strategy file or UI (if applicable) where users can specify:
      • The asset they want to lend (e.g., BTC, ETH, USDT).
      • The amount to lend.
      • Whether to use Flexible Savings or Locked Savings.
      • A target interest rate or auto-renew preference (if applicable).
  4. Behavior:

    • Periodically check for available lending opportunities using Binance's API.
    • Lend the specified amount of the selected asset automatically.
    • Notify the user of successful lending transactions or issues.
  5. Example Workflow:

    • User selects BTC and specifies an amount of 0.01 to be lent using Flexible Savings.
    • The strategy uses the Binance API to check available products.
    • The script subscribes the amount and logs the transaction details.

Technical Requirements:

  • Ensure proper handling of Binance API keys and secrets (use environment variables or secure storage).
  • Implement robust error handling to manage API errors, rate limits, or asset unavailability.
  • Comply with Binance's API documentation and terms of service.

References:


Additional Notes:
This feature would expand Mr. Market's functionality by adding a low-risk, income-generating strategy that complements existing trading strategies. Let me know if you need more details or assistance with testing!


This issue request should provide a clear, actionable framework for the repository maintainers or contributors to implement the feature. It must include docs and tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions