Skip to content

Instantly share code, notes, and snippets.

@rawfalafel
Created November 4, 2021 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawfalafel/3e166a0b95d91a83dde7937c7b757c31 to your computer and use it in GitHub Desktop.
Save rawfalafel/3e166a0b95d91a83dde7937c7b757c31 to your computer and use it in GitHub Desktop.
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