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

DTF Strategy #47

Merged
merged 53 commits into from
Dec 10, 2024
Merged

DTF Strategy #47

merged 53 commits into from
Dec 10, 2024

Conversation

codinghistorian
Copy link

@codinghistorian codinghistorian commented Dec 6, 2024

Haves:
-Buy assets proportionally as pre-assigned weight: strict restriction so that all the assets in the portfolio needs to be bought
-Sell assets in the similar way(would sell slightly more from the more valued assets): kept not as strict as buying to test rebalancing.
-Rebalanced as pre-assigned weight
-total_assets discount buffer
-total_assets calculation based on portfolio’s asset values (asset price * asset amount)
-updating of each asset Value based on AMM’s sqrt_price
-Vault.direct_deposit->buy assets
-Vault.redeem ->sell assets

Don’t haves:
Changing assigned weight to each asset - need to work on it
Adding or removing asset from the portfolio - need to work on it
Customizing slippage limit - it’s a topic of a discussion. At the moment, swapping on Orca is set in a way that any result would be accepted.

Before the strategy's token account was generated from keyPair account. Tested on devnet.
- amount_withdrawn
- asset_price
- a_to_b_for_purchase
-LUT is a must since the swap iteration requires a lot of accounts.
-Default CU would fail in the second iteration of swap
asset_price & asset_value & current_weight
-assetValue correctly calculated for both WSOL and TMAC
…n invest_tracker.current_weight

-after dividing the amount per swap for each asset, if there is any difference between the requested amount for withdrawal and the sum of amount_per_swap, the asset with the highest current_weight would be have the difference in amount to ensure the swap happens as much as amount from free_fund arg.
codinghistorian and others added 10 commits December 3, 2024 16:20
…for orca flow of process-report

-to keep it up to date with the dev branch
# Conflicts:
#	programs/tokenized_vault/src/utils/strategy.rs
#	tests/integration/vault.ts
-in AMM context, having assetValue of 100, doesn't mean that we can get back 100 from selling all the assets, therefore leave 30 bps of buffer to the assetValue for smooth withdrawing of underlying assets.
@codinghistorian codinghistorian marked this pull request as ready for review December 7, 2024 05:05
Copy link
Contributor

@TonioMacaronio TonioMacaronio left a comment

Choose a reason for hiding this comment

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

I don't see any criticals. Need to do 4 things:

  1. prepare an accurate scope for the next build
  2. appropriately log TODOs
  3. release this build as the pre-alpha
  4. measure costs

pub a_to_b_for_purchase: bool,
pub assigned_weight: u16,
pub current_weight: u16,
//later add last_updated_timestamp so that the actions happen when the price is fresh
Copy link
Contributor

Choose a reason for hiding this comment

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

Transform these comments into TODOs, so they won't get lost

TonioMacaronio
TonioMacaronio previously approved these changes Dec 10, 2024
@codinghistorian codinghistorian dismissed TonioMacaronio’s stale review December 10, 2024 10:10

The merge-base changed after approval.

@TonioMacaronio TonioMacaronio removed the request for review from vito-kovalione December 10, 2024 10:10
TonioMacaronio
TonioMacaronio previously approved these changes Dec 10, 2024
@codinghistorian codinghistorian dismissed TonioMacaronio’s stale review December 10, 2024 10:17

The merge-base changed after approval.

@TonioMacaronio TonioMacaronio merged commit 84bde89 into dev Dec 10, 2024
1 check passed
@TonioMacaronio TonioMacaronio deleted the VLT-230-atomic-deposit branch January 6, 2025 17:31
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.

4 participants