Skip to content

Commit

Permalink
refactor: remove example
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Jan 25, 2024
1 parent e90c377 commit 1ae581a
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions src/converter-bot/tokenConverterBot.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Address, parseAbi, parseUnits } from "viem";
import { Address, parseAbi } from "viem";

import TokenConverterOperator from "../config/abis/TokenConverterOperator";
import addresses from "../config/addresses";
import type { SUPPORTED_CHAINS } from "../config/chains";
import { chains } from "../config/chains";
import { getPublicClient, getWalletClient } from "../config/clients";
import { Path, parsePath } from "./path";
import { Path } from "./path";

type SupportedConverters =
| "BTCBPrimeConverter"
Expand Down Expand Up @@ -88,28 +88,4 @@ class Bot {
}
}

const main = async () => {
const bot = new Bot("bsctestnet");
await bot.sanityCheck();

// Imagine the converter has LTC and wants USDT
// tokenToSendToConverter: USDT
// tokenToReceiveFromConverter: LTC
// We're swapping LTC to USDT on PCS, so
// the PCS reversed path should start with
// USDT (tokenToSendToConverter) and end
// with LTC (tokenToReceiveFromConverter)
//
// The income is paid out in LTC (if any)
await bot.arbitrage(
"RiskFundConverter",
parsePath([addresses.bsctestnet.USDT as Address, 500, addresses.bsctestnet.LTC as Address]),
parseUnits("1", 18), // 1 LTC
parseUnits("-0.1", 18), // We're ok with paying 0.1 LTC for this conversion
);
};

main().catch(error => {
console.error(error);
process.exit(1);
});
export default Bot;

0 comments on commit 1ae581a

Please sign in to comment.