Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add proposal for interest bearing tokens #15927

Closed
wants to merge 15 commits into from

Conversation

joncinque
Copy link
Contributor

Problem

We need interest bearing tokens on Solana

Summary of Changes

Following the CONTRIBUTING.md path, add a proposal for the solution so we can discuss it.

Fixes #

@ryoqun
Copy link
Contributor

ryoqun commented Mar 17, 2021

@joncinque sorry for butting-in. My comments are written in rather hurry. Please ask me if elaboration is needed.

This proposal looks promising for the next-gen of spl-token. Thanks for the write-up.

Ultimately, I want to create very flexible framework for these token juggling play. So that we can attract more advanced/specialized token/nft use cases, considering we can offer larger computational resource to txes for wildest token economics because of being high-performance blockchain by definition. :)

@joncinque
Copy link
Contributor Author

@ryoqun thanks for all of your time and thoughtful comments! You gave me a lot to consider, especially your ABI idea. That might be a better way forward rather than adding all of the Get* instructions.

docs/src/proposals/interest-bearing-tokens.md Outdated Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Outdated Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Outdated Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Show resolved Hide resolved
docs/src/proposals/interest-bearing-tokens.md Outdated Show resolved Hide resolved
Comment on lines 185 to 186
TODO What's the best approach to implement this? For example, does an ephemeral
account even need a public key?
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably just a syscall, create_ephemeral_account(program_id, size), that returns an AccountInfo. No public key required, the lamport balance is 0 (and probably the instruction fails if the lamport balance is !0 when the current instruction exits).

Flesh out more details with @jackcmay though

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's what I had in mind, could add information about the granted ephemeral accounts to InvokeContext so we can track it between calls. Need to flesh out granting memory access to the program, etc...

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jul 23, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Jul 23, 2021
@stale
Copy link

stale bot commented Jul 30, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jul 30, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Jul 30, 2021
@stale
Copy link

stale bot commented Aug 10, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Aug 10, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Aug 10, 2021
docs/src/proposals/interest-bearing-tokens.md Outdated Show resolved Hide resolved
1,000 tokens, the program converts and asks to move 8.33 shares. The same concept
applies to mints and burns.

Following this model, we never have to worry about compounding interest. We
Copy link
Contributor

Choose a reason for hiding this comment

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

Would the interest be compounded periodically by the runtime and stored as a number in the i-token? Or would it need to be computed every time by AmountToUiAmount and not stored?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The runtime would not be involved at all for this, so it would need to be computed every time and not stored anywhere.

@stale
Copy link

stale bot commented Aug 28, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Aug 28, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Aug 30, 2021
@stale
Copy link

stale bot commented Sep 7, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Sep 7, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Sep 7, 2021
### Voting Tokens

Outlined in a [GitHub issue](https://github.com/solana-labs/solana-program-library/issues/131),
voting tokens use additional data about how long a token has been held.
Copy link
Contributor

Choose a reason for hiding this comment

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

The opposite logic would be to make it possible to lock tokens for certain amount of time to know for how long they would be held. This would allow to calculate voting power based on the long term commitment (skin in the game).
Users don't really like to deposit governance tokens to vote. It makes them very uncomfortable especially when the governance tokens they posses have substantial economic value.
A better solution would be to allow the tokens to be locked to gain voting power while still being in user's possession.

@stale
Copy link

stale bot commented Sep 19, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Sep 19, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Sep 20, 2021
@stale
Copy link

stale bot commented Oct 2, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Oct 2, 2021
@joncinque joncinque removed the stale [bot only] Added to stale content; results in auto-close after a week. label Oct 4, 2021
Comment on lines +151 to +153
To convert between amount and UI amount, the wrapper library calls the `AmountToUiAmount`
instruction on the i-token program, or for SPL token accounts, it calls
`spl_token::amount_to_ui_amount` inline.
Copy link
Contributor

Choose a reason for hiding this comment

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

just fyi, I leaned that wstETH (wrapper version of stETH) just exists for the distinction of value-accruing vs re-basing token differences to be used for separately depending on upper defi primitive's token accounting assumption: https://help.lido.fi/en/articles/5231836-what-is-wrapped-steth-wsteth

Also, I think we now have return data runtime mechanism. :)

@stale
Copy link

stale bot commented Jan 9, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jan 9, 2022
@mvines mvines closed this Feb 16, 2022
@ryoqun
Copy link
Contributor

ryoqun commented Apr 10, 2022

tip: there's eth equivalent to this: https://eips.ethereum.org/EIPS/eip-4626

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

Successfully merging this pull request may close these issues.