Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdapper committed Mar 13, 2023
1 parent 2ab176c commit b763be2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
53 changes: 24 additions & 29 deletions odos.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,34 @@
const axios = require("axios");

const getOdosSwapPath = async (tokenIn, amountIn, tokenOut, account) => {
const data = {
chainId: 43114,
gasPrice: 30,
inputTokens: [
{
amount: amountIn,
tokenAddress: tokenIn
}
],
outputTokens: [
{
proportion: 1,
tokenAddress: tokenOut,
}
],
slippageLimitPercent: 0.3,
userAddr: account
};
const res = await axios.post("https://api.odos.xyz/sor/quote", data);
// console.log("quote"); /
// console.log(res.data);
const res2 = await axios.post("https://api.odos.xyz/sor/assemble", { pathId: res.data.pathId, simulate: false, userAddr: account });
return res2.data;
const data = {
chainId: 43114,
gasPrice: 30,
inputTokens: [
{
amount: amountIn,
tokenAddress: tokenIn
}
],
outputTokens: [
{
proportion: 1,
tokenAddress: tokenOut,
}
],
slippageLimitPercent: 0.3,
userAddr: account
};
const res = await axios.post("https://api.odos.xyz/sor/quote", data);
const res2 = await axios.post("https://api.odos.xyz/sor/assemble", { pathId: res.data.pathId, simulate: false, userAddr: account });
return res2.data;
}


const main = async () => {
const [tokenIn, amountIn, tokenOut, account] = process.argv.slice(-4);
// console.log({tokenIn, amountIn, tokenOut, account});

// console.log(res2.data);
const ret = await getOdosSwapPath(tokenIn, amountIn, tokenOut, account);
console.log(JSON.stringify(ret));
const [tokenIn, amountIn, tokenOut, account] = process.argv.slice(-4);
const ret = await getOdosSwapPath(tokenIn, amountIn, tokenOut, account);
console.log(JSON.stringify(ret));
}

main();
1 change: 0 additions & 1 deletion script/Unwind.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ contract UnwindScript is Script, Test {
vm.startBroadcast();
Unwind unwind = new Unwind();
aAvaUSDC.approve(address(unwind), type(uint).max);
// Unwind unwind = Unwind(0xB7DEA8552B2555082fdd65455570f4F2cF669C99);
uint usdtAmount = 15600e6;
uint usdcAmount = 15750e6;

Expand Down

0 comments on commit b763be2

Please sign in to comment.