const initialIncreaseThreshold = 30; // 30% increase from starting price to begin selling
const dropPercentage = 5; // 5% decrease to trigger a sell
const usdcPercentageToBuy = 10; // 10% USDC percentage to buy
async function checkSolPriceAndTrade() {
const currentPrice= await price(solAddress);
const lastPrice = await lastSolPrice(memLastPrice);
const startingPrice = await startingPrice(memStartingPrice);
if (startingPrice === 0) {
DAIN Trader Copilot is your AI Assistant that empowers you to trade and create bots by turning natural language prompts into executable DeFi actions and automations.
import dain.trader.defi;
function swap(token_in, token_out) {
set.value(“token_in“)
set.value(“token_out“)
run.simulate()
set.execution(schedule)
swap(token_in, token_out, slippage = slippage)
DAIN Trader Alerts will notify you when important market events, trades, and automation take place.
DAIN Trader Mobilefits DeFi in your pocket, so you never miss a trade while on the go.
Our platform democratizes algorithmic trading, making it accessible to both beginners and experienced traders. We just made DeFi Easy.