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 description of how to use the yield router in README.md file #16

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

gigileungyingchi
Copy link
Contributor

No description provided.

README.md Outdated

## Usage (latest version -- Yield Router)
There is a state account owned by the yield controller program which stores the following data:
- `sunrise_state`: public key of the input yield account which holds funds to be sent to PDAs that will transfer fund to various climate projects (e.g. the offset bridge)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think sunrise_state is not the public key of the input yield account but a pda that holds data about sunrise stake state.

README.md Outdated
- `total_spent`: total amount of fund sent to various climate projects

This state account needs to be first registered on chain, this only needs to be performed once for a yield controller program. To do so, one can use the `register_state` instruction by calling the `packages/yield-router/registerState.ts` script as follow:
```ANCHOR_PROVIDER_URL=[anchor_provide_url] STATE_ADDRESS=[state_address] OUTPUT_YIELD_ADDRESS=[output_yield_address] yarn ts-node packages/yield-router/registerState.ts```
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is more common to use curly braces { } or angle brackets < > instead of square brackets [ ] to indicate variables, e.g. ANCHOR_PROVIDER_URL=<anchor_provider_url>

There is a typo for all "anchor_provideR_url"

README.md Outdated

This state account needs to be first registered on chain, this only needs to be performed once for a yield controller program. To do so, one can use the `register_state` instruction by calling the `packages/yield-router/registerState.ts` script as follow:
```ANCHOR_PROVIDER_URL=[anchor_provide_url] STATE_ADDRESS=[state_address] OUTPUT_YIELD_ADDRESS=[output_yield_address] yarn ts-node packages/yield-router/registerState.ts```
where `state_address` is the public key of the input yield account and `output_yield_address` is the address of the public key of the first PDA of a climate project.
Copy link
Contributor

Choose a reason for hiding this comment

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

state_address is not the address of the input yield account but of sunrise state

README.md Outdated
- `total_spent`: total amount of fund sent to various climate projects

This state account needs to be first registered on chain, this only needs to be performed once for a yield controller program. To do so, one can use the `register_state` instruction by calling the `packages/yield-router/registerState.ts` script as follow:
```ANCHOR_PROVIDER_URL=<anchor_provider_url> STATE_ADDRESS=<state_address> OUTPUT_YIELD_ADDRESS=[output_yield_address] yarn ts-node packages/yield-router/registerState.ts```
Copy link
Contributor

Choose a reason for hiding this comment

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

<output_yield_address> instead of [output_yield_address]

README.md Outdated

This state account needs to be first registered on chain, this only needs to be performed once for a yield controller program. To do so, one can use the `register_state` instruction by calling the `packages/yield-router/registerState.ts` script as follow:
```ANCHOR_PROVIDER_URL=<anchor_provider_url> STATE_ADDRESS=<state_address> OUTPUT_YIELD_ADDRESS=[output_yield_address] yarn ts-node packages/yield-router/registerState.ts```
where `state_address` is the public key of the state account from which the input yield account can ebe derived and `output_yield_address` is the address of the public key of the first PDA of a climate project.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: ebe -> be

s6thgehr
s6thgehr previously approved these changes Oct 12, 2023
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.

2 participants