Skip to content

✨[DAPP] Create vault and auto invest#751

Merged
chopan123 merged 7 commits intomainfrom
feat/create-and-rebalance
Nov 28, 2025
Merged

✨[DAPP] Create vault and auto invest#751
chopan123 merged 7 commits intomainfrom
feat/create-and-rebalance

Conversation

@MattPoblete
Copy link
Collaborator

This pull request introduces major enhancements to the vault creation flow in the dApp, with a focus on integrating the @defindex/sdk for backend operations and providing a more flexible and user-friendly UI for strategy allocation.
Backend Integration and API Additions:

  • Added new API routes for vault creation, sending transactions, fetching vault info, and retrieving vault balances, all powered by the @defindex/sdk and a shared defindexClient instance. These endpoints validate input, handle errors, and support both mainnet and testnet.
    Vault Creation UI/UX Improvements:

  • Overhauled the strategy allocation UI in CreateVault.tsx:

    • Strategies for each asset are now initialized with equal percentage allocation, with logic to ensure the total always sums to 100%.
    • Introduced interactive sliders for users to adjust individual strategy allocations, with real-time feedback and automatic rebalancing among strategies.
  • Replaced the upgradable/non-upgradable toggle button with a more intuitive checkbox control, improving clarity and accessibility.

Dependency and SDK Updates:

  • Added @defindex/sdk and @creit.tech/stellar-wallets-kit as dependencies, and removed the deprecated stellar-react package, reflecting the migration to the new SDK and wallet integration.
  • Updated the vault creation logic to use hooks and context from the new SDK and user context, phasing out old Soroban-specific hooks.

These changes collectively enable more robust backend support for vault operations and a significantly improved user experience for vault configuration and strategy management.

- Add DefindexSDK client and API routes
- Add UserContext for wallet management
- Add useDefindexSDK hook with createVault and createVaultAutoInvest
- Remove deprecated stellar-react integration files
- Update MainProvider to use new SDK
- Add StrategyAllocationSliders for percentage-based distribution
- Implement auto-invest flow when deposit has strategy allocation
- Add enhanced toast with copy address and external link
- Replace upgradable button with checkbox
- Add Portal and MenuPositioner for proper menu rendering
- Fix menu positioning to dropdown below trigger
- Update AddressToClipboard component
- Update ConnectWallet for new wallet kit
- Update networkName helper
- Update usePublicAddresses and useStrategy hooks
- Update StrategiesProvider
@vercel
Copy link

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
defindex-dapp Ready Ready Preview Comment Nov 28, 2025 4:28pm
defindex-landing Ready Ready Preview Comment Nov 28, 2025 4:28pm
defindex-rust-docs Ready Ready Preview Comment Nov 28, 2025 4:28pm

- VaultConfigSection: Wrapper component
- SelectAssets: Asset selection
- SelectStrategies: Strategy selection
- StrategyAllocationSliders: Percentage distribution sliders
- AddStrategies: Strategies section
- ManagerConfig: Manager addresses config
- FeeConfig: Fee configuration
- CreateVaultButton: Submit button with vault creation logic
- Add index.ts for exports
- Add border-radius 25% to checkbox
- Semi-transparent background
- Light green (#D3FFB4) stroke and text when checked
- Fixed width container to prevent layout shift
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