Created
November 4, 2021 11:12
-
-
Save rawfalafel/3e166a0b95d91a83dde7937c7b757c31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pool = orca.getPool(OrcaPoolConfig.SOL_mSOL); | |
const solToken = pool.getTokenA(); | |
const amount = new Decimal(0.1); | |
const quote = await pool.getQuote(solToken, amount); | |
const expectedOutput = quote.getExpectedOutputAmount(); | |
const owner = await getOwnerAccount(); | |
const payload = await pool.swap(owner, solToken, amount, quote.getMinOutputAmount()); | |
await payload.execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment