GithubHelp home page GithubHelp logo

drift-labs / drift-vaults Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 12.0 3.71 MB

a vault program on top of protocol-v2 for delegate-managed trades with customizable terms

TypeScript 59.40% Rust 40.16% JavaScript 0.37% Shell 0.08%

drift-vaults's Introduction

Drift Vaults

soon^TM

did you see the CLI? and the wiki?

Development

  • anchor 0.29.0
  • rust 1.70.0
  • solana 1.16.27
avm use 0.29.0
rustup default 1.70.0
sh -c "$(curl -sSfL https://release.solana.com/v1.16.27/install)"

Run tests

cd ts/sdk
yarn
yarn build

cd ..
export ANCHOR_WALLET=~/.config/solana/id.json
anchor test

drift-vaults's People

Contributors

0xbigz avatar 3thereum avatar chestersim avatar crispheaney avatar github-actions[bot] avatar lukecaan avatar nouralharithi avatar wphan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

drift-vaults's Issues

Delete / Finalize Vaults

sharing thoughts on topic raise by both @dannpl and @wphan

  • easy to support if vault.total_shares = 0 and vault.init_ts - now > MIN_VAULT_LIFETIME, then let anyone close out vault (and associated user account through cpi call)
  • force closure, when these invariants above aren't true, seems more difficult/complex
  • ensuring that vault.total_shares can get to 0 (rather than dust) should be examined during testing

Trust Model between Depositors, Vault Managers, and Delegates

Issue Summary:

Current implementation of the Drift-Vaults program, as described in the wiki, requires significant trust from depositors towards both the vault manager and delegate. In addition, vault managers need to trust the delegate. Although certain incentives and penalties are in place, potential weaknesses and vulnerabilities may still exist. There is a need to explore additional strategies to enhance the robustness of the trust model.

Detailed Description:

Presently, the vault manager earns management fees and profit shares, providing an incentive to attract deposits and maintain good performance. However, this structure relies on the depositor's trust in the manager's ability to deliver sustainable returns. While historical performances provide some degree of assurance, they are insufficient in guaranteeing future outcomes. If the manager and delegate roles were managed via upgradable time-delayed smart contracts, this could improve deterministic properties of the system.

Still some potential vulnerabilities exist that could undermine trust. Some potential enhancements to address these concerns (that I believe are more complex than the guarantees they provide):

  • Mandatory Excessive Manager Collateral: This solution requires the manager to provide substantial collateral as a guarantee. However, it is challenging to enforce and requires the manager to provide large upfront capital, somewhat negating the purpose of the vault program.

  • Delegate Instruction Introspection: This solution involves monitoring and evaluating the delegate's instructions to prevent potentially detrimental actions. However, defining 'bad orders' is non-trivial, and excessive restrictions could inadvertently limit strategies for preventing loss.

  • Custom Approved Counterparty Lists: Allowing users to create a list of approved counterparties for trades could enhance trust. However, the risk of collusion between the manager and an approved counterparty, if not the vAMM, could offset its benefits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.