-
Notifications
You must be signed in to change notification settings - Fork 2
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
Integrate Jupiter adapter #2
Conversation
d5d4e37
to
80c1856
Compare
06833b0
to
d371787
Compare
let mut swap_data = vec![]; | ||
swap_data.append(&mut discriminator.try_to_vec()?); | ||
swap_data.extend( | ||
&mut input_struct.swap_config[start_index..=last_index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wonder: what is start_index and last_index for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For extracting swap config
Jupiter swap's ix data contain 5 props in this order:
a). SwapLeg: (uncertain length)
b) inAmount: u64
c) outAmount: u64
d) slippage: u16
e) platform fee: u8
since we can only set swap_config
a fix u8
array size in SwapInwrapper
,
we need to extract the subarray from this attribute to fit the payload format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
programs/adapter-jupiter/Cargo.toml
Outdated
overflow-checks = true | ||
|
||
[dependencies] | ||
anchor-lang = "0.24.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade to v0.26.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to build with v0.26.0, however, all adapters should also update to v0.26.0 to proceed compile.
Shall I push all updates on Cargo.toml in this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, plz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKay.
let mut swap_data = vec![]; | ||
swap_data.append(&mut discriminator.try_to_vec()?); | ||
swap_data.extend( | ||
&mut input_struct.swap_config[start_index..=last_index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
This update will support Jupiter protocol in Gateway program, so that all the state can be stored on chain and provide better user experience to check the asset flow in
Activity
pages. See more details below.swap_config
to[u8; 30]
for scalability as Jupiter's parameterSwapLeg
might be longer in the future.Will also update these repo to make all functions works:
gateway-programs
gateway