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

fix: Drift protocol team review implementation #210

Merged
merged 8 commits into from
Jan 17, 2025

Conversation

michaelessiet
Copy link
Collaborator

@michaelessiet michaelessiet commented Jan 15, 2025

Pull Request Description

This PR fixes an issue with validating if a user has a drift account or not. I noticed this while preparing a demo video to showcase how it works. It also fixes the gas fee required to borrow funds from drift.

The PR also contains changes requested by the Drift Protocol team. The changes include:

  1. Addition of actions to stake and unstake from their insurance fund
  2. Addition of actions to swap spot tokens
  3. Addition of actions to get information such as the lend and borrow apy, quote trade price impact and prices, and funding rates.
  4. Addition of an action that gets available spot and perp markets.

Tests and prompts used

Image 16-01-2025 at 20 27
Image 16-01-2025 at 20 25
Image 16-01-2025 at 19 58 (1)
Image 16-01-2025 at 19 58
Image 16-01-2025 at 19 57
Image 16-01-2025 at 19 56 (1)
Image 16-01-2025 at 19 56
Image 16-01-2025 at 19 41

src/tools/drift/drift.ts Outdated Show resolved Hide resolved
test/agent_sdks/vercel_ai.ts Outdated Show resolved Hide resolved
@michaelessiet michaelessiet changed the title fix: Drift account existence validation fix: Drift team review Jan 17, 2025
@michaelessiet michaelessiet changed the title fix: Drift team review fix: Drift protocol team review implementation Jan 17, 2025
@thearyanag thearyanag merged commit 68cb11b into sendaifun:main Jan 17, 2025
1 check failed
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.

3 participants