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

updated flash privilege settings and improved token support #151

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

UjjwalGupta49
Copy link
Contributor

updated privilege settings for flash.trade

Changes Made

This PR adds the following changes:

  • updated the open and close positions to read privilege from .env and default to NONE
  • added support for supported Token update based on flash-idk

Implementation Details

  • updated /tools/flash_open_order and /tools/flash_close_order
  • updated /utils/flashUItils to return the privilege set in .env

Transaction executed by agent

Example transaction:
open trade: https://explorer.solana.com/tx/RQh483VqoB8cwekPvpqNjQMydR1E9wwev3xiVXEJJfRdE2ozg3TjYTHQHJrjMB1EUhpbYhmX3dzfKuqdMMDdz61

close trade:
https://explorer.solana.com/tx/3a4XfP67qF5vqhKf2DrEVQgAqVNko6kfta9UZW35jZWf5Y8voM3emTjJZ7XGjD5u8A9TQJRTrbozDBq15D3B4w5x

Prompt Used

open trade: open a 10x leveraged trade on flash trade with 10 USD of collateral using SOL long
close trade: close the existing SOL long trade with 10x leverage on flash trade

Additional Notes

Checklist

  • [✅] I have tested these changes locally
  • [✅ ] I have updated the documentation
  • [✅] I have added a transaction link
  • [✅] I have added the prompt used to test it

@@ -278,3 +284,16 @@ export function createPerpClient(
{},
);
}

const FLASH_PRIVILEGE = process.env.FLASH_PRIVILEGE || "None";
Copy link
Member

Choose a reason for hiding this comment

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

instead of taking it from env here, can we shift this to config object present here

public config: Config;

so people know how to explicitly pass it

@thearyanag thearyanag merged commit 1073b67 into sendaifun:main Jan 7, 2025
1 check passed
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