|
|
@@ -84,7 +84,7 @@ async function fetchTradePair() {
|
|
|
/**
|
|
|
* 发送消息到 Discord
|
|
|
*/
|
|
|
-async function sendToDiscord(position, symbol, tokenList) {
|
|
|
+async function sendToDiscord(position, symbol, tokenList, maxUsdValue) {
|
|
|
try {
|
|
|
const ageMinutes = Math.floor(position.positionAgeMs / 1000 / 60)
|
|
|
const ageSeconds = Math.floor((position.positionAgeMs / 1000) % 60)
|
|
|
@@ -175,8 +175,8 @@ async function sendToDiscord(position, symbol, tokenList) {
|
|
|
|
|
|
console.log(`✅ 已发送到 Discord: ${position.positionAddress}`)
|
|
|
|
|
|
- if (Number(position.liquidityUsd) > 200) {
|
|
|
- await addLiquidity(position, symbol)
|
|
|
+ if (Number(position.liquidityUsd) > 100) {
|
|
|
+ await addLiquidity(position, symbol, maxUsdValue)
|
|
|
console.log(`✅ 已复制流动性: ${position.positionAddress}`)
|
|
|
} else {
|
|
|
console.log(`❌ 未复制流动性: ${position.positionAddress}`)
|
|
|
@@ -239,7 +239,7 @@ function calculateAPR(position) {
|
|
|
/**
|
|
|
* 处理新仓位
|
|
|
*/
|
|
|
-async function processPositions(token_symbol) {
|
|
|
+async function processPositions(token_symbol, maxUsdValue) {
|
|
|
console.log(`\n[${new Date().toLocaleString('zh-CN')}] 开始检查新仓位...`)
|
|
|
|
|
|
const { records, symbol, tokenList } = await fetchTopPositions(token_symbol)
|
|
|
@@ -269,7 +269,7 @@ async function processPositions(token_symbol) {
|
|
|
for (const position of unsentPositions) {
|
|
|
const address = position.positionAddress
|
|
|
if (address) {
|
|
|
- const success = await sendToDiscord(position, symbol, tokenList)
|
|
|
+ const success = await sendToDiscord(position, symbol, tokenList, maxUsdValue)
|
|
|
if (success) {
|
|
|
sentPositions.add(address)
|
|
|
}
|
|
|
@@ -333,9 +333,10 @@ processTradePair()
|
|
|
|
|
|
// 每5分钟执行一次
|
|
|
setInterval(() => {
|
|
|
- processPositions('MON')
|
|
|
+ // processPositions('MON')
|
|
|
// processPositions('WET')
|
|
|
processPositions('WhiteWhale')
|
|
|
+ processPositions('fish', 1)
|
|
|
}, INTERVAL_MS)
|
|
|
|
|
|
setInterval(processTradePair, MAX_AGE_MS)
|