yieldefi

1.1.8 • Public • Published

YielDefi

Automate the Harvesting of Crypto Capital Gains

Pipeline Pipeline Pipeline Pipeline Pipeline

Purpose

Yieldefi is a crypto tool designed to automate the process of collecting benefits generated from lent capital on the Ethereum blockchain.

By integrating with key blockchain services and smart contracts, this tool simplifies the management of balances, withdrawals, and notifications, making it an essential utility for cryptocurrency investors and managers.

Exemple

  • 0xaa...aaaa is my Capital Address
    • I have 100 aUSDC on 0xaa...aaaa
    • The balance is compounding through the lending mechanism
  • 0xbb...bbbb is my Benefice Address
    • I have 0 USDC on 0xbb...bbbb
  • I have configured Yieldefi as following:
    • xprv = the private key controling my Capital Address
    • limit = 100 aUSDC
    • threshold = 110 aUSDC
    • run every monday
  • Next monday the balance shows 105 aUSD
    • The threshold is not match and nothing happen
  • Next monday the balance shows 110 aUSD
    • The threshold is match
    • Yieldefi convert 10 aUSDC to 10 USDC and send it to 0xbb...bbbb
    • The balance of 0xaa...aaaa is now 100 aUSDC
    • The balance of 0xbb...bbbb is now 10 USDC

Disclaimer

This tool handles sensitive information such as your wallet's mnemonic phrase and passphrase. Improper use or exposure of these credentials can result in the irreversible loss of funds. It is your responsibility to ensure that this data is stored securely and never shared with unauthorized parties.

By using this tool, you acknowledge and accept the risks associated with managing cryptocurrency wallets and transactions. The developers are not liable for any loss of funds or data breaches resulting from the use of this tool. Always exercise caution and use the tool in a secure environment.

Usage

As NPM module

Install globally in a Node environment and use it as any app

 npm install -g yieldefi
 yieldefi --help

Directly from sources

The best alternative if you want to inspect the source code

 git clone git@gitlab.com:yug-damon/yieldefi.git
 npm install
 node ./src/entrypoint.js --help

Standalone

Download the bundled version for more flexibility

 curl --location --output yieldefi.cjs https://gitlab.com/api/v4/projects/65279236/jobs/artifacts/main/raw/artifacts/build/standalone/yieldefi.cjs?job=bundle:standalone
 node yieldefi.cjs --help

Docker container

Use preconfigured Docker images to deploy easily

# If your contract is a AAVE-Ethereum-USDC (aUSDC)
 docker run registry.gitlab.com/yug-damon/yieldefi/ausdc
 
 # If your contract is a AAVE-Gnosis-USDC (aGnoUSDC)
 docker run registry.gitlab.com/yug-damon/yieldefi/agnousdc
 
 # If your contract is a AAVE-Gnosis-XDAI (aGnoXDAI)
 docker run registry.gitlab.com/yug-damon/yieldefi/agnoxdai

Find all the available images here : https://gitlab.com/yug-damon/yieldefi/container_registry

Docker Compose

Use Docker Compose to orchestrate multiple containers

docker-compose.yml:

version: '3.8'

services:
  aGnoUSDC:
    image: registry.gitlab.com/yug-damon/yieldefi/agnousd
    restart: always
    env_file:
      - secrets.env
    environment:
      - YIELDEFI_TARGET_VALUE=50000          # Define your capital as 50 000 USDC
      - YIELDEFI_THRESHOLD_VALUE=50100       # Trigger the benefice distribution from 50 100 USDC
      - YIELDEFI_CRON_SCHEDULE="0 0 1 * *"   # Trigger the routine every first day of the month at 12 AM

secrets.env:

YIELDEFI_MNEMONIC="protect private life ...." # Your mnemonic (BIP39) 
YIELDEFI_PASSPHRASE="test"                    # The associated passphrase (BIP44)
YIELDEFI_BENEFITS_EVM_ADDRESS="0xaa...aaaa"   # Your address the benefices will be delivered on
docker compose up 

Note: do not keep secrets.env after launch

Configuration

The configuration of the tool is done by environment variables.

Use the --help flag to print more information about it.

Wallets

Variable Description
YIELDEFI_MNEMONIC (Required): The mnemonic phrase for the wallet. [Sensitive]
YIELDEFI_PASSPHRASE (Optional): Additional passphrase for the wallet. [Sensitive]
YIELDEFI_BENEFITS_EVM_ADDRESS (Required): Ethereum address for benefits distribution.
YIELDEFI_API_PORT (Optional): Port for the API server.
YIELDEFI_CRON_SCHEDULE (Optional): Cron schedule for automated triggers.
YIELDEFI_SKIP_INITIAL_CALL (Optional): Skip the initial call to the routine
YIELDEFI_TARGET_VALUE (Required): The target value to preserve the capital (e.g., in ETH or tokens).
YIELDEFI_THRESHOLD_VALUE (Required): The threshold value above which a withdrawal is triggered.
YIELDEFI_POOL_CONTRACT_ADDRESS (Required): Address of the pool contract.
YIELDEFI_BALANCE_CONTRACT_ADDRESS (Required): Address of the balance tracking contract.
YIELDEFI_AYIELDEFI_TOKEN_CONTRACT_ADDRESS (Required): Address of the AToken contract.
YIELDEFI_TOKEN_CONTRACT_ADDRESS (Required): Address of the token contract.
YIELDEFI_TOKEN_DECIMAL (Required): Decimal precision for the token (e.g., 6 for USDC).
YIELDEFI_ALCHEMY_RPC_URL (Optional): RPC URL for Alchemy connection.
YIELDEFI_ALCHEMY_API_TOKEN (Optional): API token for Alchemy. [Sensitive]
YIELDEFI_ETHERSCAN_RPC_URL (Optional): RPC URL for Etherscan.
YIELDEFI_ETHERSCAN_API_TOKEN (Optional): API token for Etherscan.
YIELDEFI_INFURA_RPC_URL (Optional): RPC URL for Infura.
YIELDEFI_INFURA_API_TOKEN (Optional): API token for Infura. [Sensitive]
YIELDEFI_CHAIN_RPC_URL (Optional): RPC URL for the blockchain network.
YIELDEFI_NODEMAILER_TARGET (Optional): Email address for notifications.
YIELDEFI_NODEMAILER_HOST (Optional, Required if NODE_MAILER_TARGET is set): SMTP host for the mailer service.
YIELDEFI_NODEMAILER_PORT (Optional, Required if NODE_MAILER_TARGET is set): SMTP port (e.g., 587).
YIELDEFI_NODEMAILER_USERNAME (Optional, Required if NODE_MAILER_TARGET is set): Email username for SMTP.
YIELDEFI_NODEMAILER_PASSWORD (Optional, Required if NODE_MAILER_TARGET is set): Email password for SMTP. [Sensitive]
YIELDEFI_NODEMAILER_EXPEDITOR (Optional, Required if NODE_MAILER_TARGET is set): Email "from" field.
YIELDEFI_NODEMAILER_SKIP_WITHDRAWAL (Optional): Skip withdrawal notification emails (Yes/No).
YIELDEFI_NODEMAILER_SKIP_DO_NOTHING (Optional): Skip "no action taken" emails (Yes/No).
YIELDEFI_NODEMAILER_SKIP_ERROR (Optional): Skip error notification emails (Yes/No).
YIELDEFI_DISABLE_LOG (Optional): Suppress log output when set.
YIELDEFI_DISABLE_LOG_COLOR (Optional): Suppress log output coloration when set.

Development

Developed with ❤️ by Yug Damon

Here the link to the gitlab of the project if you want to contribute, fork or raise a ticket

https://gitlab.com/yug-damon/yieldefi

Dependents (0)

Package Sidebar

Install

npm i yieldefi

Weekly Downloads

317

Version

1.1.8

License

MIT

Unpacked Size

56.5 kB

Total Files

3

Last publish

Collaborators

  • yug.damon