Yield Farming: Single staking token to earn token

Hello all,

I’ve seen this done around the Yield Farming Defi space. I am looking for some code or information on how to:

Stake a coin X, to earn that coin X over time.

I guess this is considered non Liquidity Pool mining.

Does anyone have some resources on where I can find information on this or code to view?

Thank you.

:computer: Environment


:1234: Code to reproduce

1 Like

I am not sure, but it seems like there are lots of teams using the staking contract form the Synthetix: https://github.com/Synthetixio/synthetix/blob/develop/contracts/StakingRewards.sol Maybe you can have a check.


Thank you @Skyge , I was viewing other projects earlier that forked their code, didn’t even to think to look at theirs.

1 Like

Hello @abcoathup and @Skyge

(Keep in mind I have no coding experience)

When it comes to modifying / forking code… is there a way to identify the line of code that identifies what the % rate of return for staking would be? Other than reading through the comments?

I’ve come to a conclusion that “ uint 256 / uint “ would be the amount of tokens…

Would the string of code have some text in the sense of:

“ uint rate xxxxxxxx “ or “ uint 256 rate xxxxxxx” ?

1 Like

Hi @OgBabaYaga,

You may want to look at a few different projects that have forked the same project to see what changes they have made and then try it out yourself.

Hi @OgBabaYaga ,

did you manage to finish the original requirement. i too am interested in staking myself without going through a website. other than the security benefit, what is your experience with the % increase in allocation?

Is there any pitfalls you have experienced that you give me with regards to a “watch out for this” type of thing.

Thanks in advance

1 Like