Skip to content

wl stacc's transfer hook for cpi #259

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

Closed
wants to merge 1 commit into from

Conversation

staccDOTsol
Copy link

it builds

@jgur-psyops
Copy link
Contributor

We don't see a reason to call a flash loan inside a CPI, typically you would build a tx like <flashloan start, your ixes, flashloan end>, what's the motivation to flash loan inside an instruction?

@staccDOTsol
Copy link
Author

We don't see a reason to call a flash loan inside a CPI, typically you would build a tx like <flashloan start, your ixes, flashloan end>, what's the motivation to flash loan inside an instruction?

transfer hooks

@jgur-psyops
Copy link
Contributor

What's the application where you need a flashloan on a transfer hook? You need to react atomically and perform a flashloan after an incoming or outgoing transfer to do some re-balancing or similar?

@staccDOTsol
Copy link
Author

no it's just to create volume thru a roundtrip tokena -> tokenb -> tokena trade, then repay flashloan.

tldr it's a lot easier to have these execute thru a transfer hook than it is to do all the logic offchain

cuz offchain is silly

so this is an offchain example:

https://solscan.io/tx/59CdtrgD5kr4eMPnSDEeDoJEMbcEu8K9i1M7AodGsTeFwsHy4Smpcvdci7mKjtCmT563oiWWAQD3y5uuR9PNfa2b

here's one enabled by transfer hook, with a unique and real signer pushing value around:

https://solscan.io/tx/4ddLf1yqdJc7fxKrWEyeSz71M9daH4TNx6pVz6YPi2JQR4H7sJh9Ty6KtzMJJxRRTLD3z46ezoLDtaDpoGvcJqem

but the pitch is immeasurably better should we be able to flashloan with mrgnfi

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