Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aux): yield farming contracts + sdk #321

Merged
merged 8 commits into from
Dec 6, 2022
Merged

feat(aux): yield farming contracts + sdk #321

merged 8 commits into from
Dec 6, 2022

Conversation

leina05
Copy link
Collaborator

@leina05 leina05 commented Dec 5, 2022

Stake pool smart contracts for liquidity incentives.

  • Reward distribution mechanism based on SushiSwap Masterchef smart contract.
  • Permissionless stake pool creation.
  • Supports modification of reward amount and duration by pool authority
  • Supports deletion of stake pools once all stake has been removed and all reward has been collected.
  • Supports one reward pool per stake coin. To "double dip" liquidity incentives (e.g. apply multiple rewards to the same stake coin), stake pools can be created for the wrapped stake coin that is provided as a deposit receipt. E.g., Pool 1 incentivizes coin type LP<X, Y>. Pool 2 incentivizes St<LP<X, Y>> which allows holders of LP<X, Y> to collect rewards from both Pool 1 and Pool 2

@leina05 leina05 marked this pull request as ready for review December 5, 2022 20:56
@leina05 leina05 marked this pull request as draft December 5, 2022 20:56
@leina05 leina05 changed the title Stake pool feat(aux): yield farming contracts + sdk Dec 6, 2022
@leina05 leina05 marked this pull request as ready for review December 6, 2022 23:13
leina05 and others added 8 commits December 6, 2022 18:17
* feat(aux): simple staking contract, modeled after sushiswap masterchef

* chore(aux): reward_debt -> last_acc_reward_per_share

* chore(aux): abort only contract

feat(aux-ts): sdk support for stake pools (#296)

* add timestamps to stake pool events

stake pools sdk

* chore(aux-ts): stake pool tests
feat(aux): add end_reward_early function to stake.move

* fast forward start time in stake tests

* update all tests to use duration instead of end_time in pool creation

* replace endTimeUs with durationUs

Apply suggestions from code review

feat(aux-ts): stake sdk localnet example (#303)

* Initial commit of stake sdk localnet example.

* add examples section to CONTRIBUTING.md

* Added start:localnet-stake-example to package.json.

* Changed the example to staker allocating between two pools (seems more relevant to me) instead of staking in one pool above threshold.

* fix(localnet-stake-allocator.ts): set up other staking account

* Switched to a brute-force method to find optimal staker positions.

* Minor change in comments.

* A little generalization using M in computing x1Optimal.

Co-authored-by: Misung Son <misungs@gmail.com>
Co-authored-by: Leina McDermott <leina05@gmail.com>
@leina05 leina05 merged commit a9113e9 into main Dec 6, 2022
@leina05 leina05 deleted the stake_pool branch December 6, 2022 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants