Skip to content

An example script that farms currency pairs on Saddle partner Solidex on FTM

Notifications You must be signed in to change notification settings

saddle-finance/demo-solidex-farming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example FTM Solidex Farming Script

A complete script to automatically yield farm and compound through Solidex using ethersjs

Saddle is partners with Solidex and Solidly on Fantom network. Being active defi participants ourselves, some Saddle staff members are LPing, staking, and/or farming through Solidex. We thought it might be fun to share with the community an example of what one of our personal farming scripts looks like. The script assumes that you are LPing in the USDC/SYN pool. It will harvest your rewards once you have accumulated $500 claimable and will sell to LP in the SOLID/SOLIDsex pool for additional yield while holding $SEX

How it works

This script has 6 Steps that run on a regular internal:

  1. Fetch the pending rewards for your account
  2. Get the USDC price of the reward tokens (SOLID and SEX)

Continue only if you rewards are worth >$500

  1. Claim all of your rewards
  2. Swap 1/2 of your awarded SOLID to SOLIDsex
  3. Add liquidity to the Solidly SOLID/SOLIDsex pool
  4. Deposit Solidly lpToken into Solidex pool

Running the script

  1. Install dependencies npm ci
  2. Create .env file and add your wallet's key PRIVATE_KEY=xxx
  3. Run the script npm run start

Configuring

Set POLLING_INTERVAL_MS, USD_THRESHOLD, and GAS_PRICE to fit your needs

Note that the Solidex contracts use true/false in their routes to denote stable/volatile pools. For example, the following code will give you the exchange rate through the stable pool (sAMM) rather than volatile pool (vAMM)

await routerContract.getAmountsOut(
    amount,
    [
        [TOKENS.SOLID.address, TOKENS.SOLIDSEX.address, true],
    ]
)

Disclaimer

This is not financial advice. This script exists for demonstration purposes only and should not be used with real funds. Don't share your wallet's private key with anyone and don't check it into a git repo. We accept no liability for how anyone chooses to use this script.

About

An example script that farms currency pairs on Saddle partner Solidex on FTM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published