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

Add rewards field to top-level appconfig #1701

Merged
merged 6 commits into from
Jan 3, 2025
Merged

Conversation

DannyDelott
Copy link
Contributor

Rewards are now a core feature of appconfig, allowing for greater flexibility in assigning rewards. You can now attach rewards to virtually anything, whether it’s a specific hyperdrive position, an entire pool, or any other element—anything can have a reward.

The rewards field in appconfig lets you specify a key that maps to a list of reward resolvers. For instance:
• A reward for adding liquidity to a pool would use a key like hyperdrive-lp/0xabc....
• A reward for opening a short position in a pool would use a key like hyperdrive-short/0xabc....

This approach eliminates the need to store reward details in HyperdriveConfig or YieldSourceConfig. To check if a pool has a reward, simply look up the corresponding key in the rewards object.

Copy link

changeset-bot bot commented Jan 2, 2025

⚠️ No Changeset found

Latest commit: ec5f558

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdrive-mainnet-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 5:04pm
hyperdrive-sepolia-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 5:04pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
hyperdrive-js ⬜️ Ignored (Inspect) Visit Preview Jan 3, 2025 5:04pm
hyperdrive-mainnet-production ⬜️ Ignored (Inspect) Visit Preview Jan 3, 2025 5:04pm
hyperdrive-sepolia-production ⬜️ Ignored (Inspect) Visit Preview Jan 3, 2025 5:04pm
testnet-v1 ⬜️ Ignored (Inspect) Jan 3, 2025 5:04pm
testnet-v1.0.6 ⬜️ Ignored (Inspect) Visit Preview Jan 3, 2025 5:04pm
trading-competition ⬜️ Ignored (Inspect) Visit Preview Jan 3, 2025 5:04pm

@@ -624,6 +614,14 @@ export async function getAppConfig({
tokens.push(sharesTokenConfig);
}

if (rewards) {
console.log("rewards", rewards);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraneous console.log

@@ -624,6 +614,14 @@ export async function getAppConfig({
tokens.push(sharesTokenConfig);
}

if (rewards) {
console.log("rewards", rewards);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stray console.log

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.

3 participants