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

[WIP] Shadow Exchange V3 integration #36

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

echovl
Copy link

@echovl echovl commented Jan 22, 2025

⚠️ IMPORTANT

Pull Requests are only allowed to modify files in the /projects directory.
Any changes outside of this directory will be rejected automatically.

This PR is work in progress (WIP)

  • Swap exact input
  • Swap exact output
  • Mint new position
  • Increase liquidity
  • Decrease liquidity
  • Collect rewards
  • Get LP positions
  • Get LP rewards
  • Quote swap

name: 'exactInputSingle',
description:
'Swap a specific amount of token A for token B, ensuring a minimum amount of token B is received. Optionally, send the output to another recipient.',
required: ['chainName', 'account', 'tokenIn', 'tokenOut', 'amountIn'],
Copy link
Contributor

Choose a reason for hiding this comment

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

image
image
You can't omit recipient, amountOutMin in required due strict mode of AI. If you want logic for optional arg use method from my code

Copy link
Contributor

Choose a reason for hiding this comment

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

Be aware that if user not provide info that it will be null in your function

Copy link
Author

Choose a reason for hiding this comment

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

thanks, updated all optional args at 7c54fa2

{
name: 'slippageTolerance',
type: 'number',
description: 'Slippage tolerance in percentage (e.g., 5.0).',
Copy link
Contributor

Choose a reason for hiding this comment

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

image
image
Suggest this working logic for slippage

Copy link
Author

Choose a reason for hiding this comment

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

using similar logic at 7c54fa2

amountA: string;
amountB: string;
tokenId?: number;
slippageTolerance?: number;
Copy link
Contributor

@OoXooOx OoXooOx Jan 30, 2025

Choose a reason for hiding this comment

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

watch comment in tools file. This problem about optional args through all your code

Copy link
Author

Choose a reason for hiding this comment

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

fixed, updated all optional args at 7c54fa2

export interface Props {
chainName: string;
account: Address;
tokenA: Address;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest tokenA > tokenA_Address

Copy link
Author

Choose a reason for hiding this comment

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

updated at b7ff06f

@OoXooOx OoXooOx mentioned this pull request Feb 4, 2025
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