|
|
@@ -48,6 +48,7 @@ async function fetchTopPositions(token_symbol) {
|
|
|
return {
|
|
|
records: result.result.data.records,
|
|
|
symbol: `${poolMap.mintA.symbol}/${poolMap.mintB.symbol}`,
|
|
|
+ tokenList: [poolMap.mintA.address, poolMap.mintB.address],
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('获取数据失败:', error)
|
|
|
@@ -82,7 +83,7 @@ async function fetchTradePair() {
|
|
|
/**
|
|
|
* 发送消息到 Discord
|
|
|
*/
|
|
|
-async function sendToDiscord(position, symbol) {
|
|
|
+async function sendToDiscord(position, symbol, tokenList) {
|
|
|
try {
|
|
|
const ageMinutes = Math.floor(position.positionAgeMs / 1000 / 60)
|
|
|
const ageSeconds = Math.floor((position.positionAgeMs / 1000) % 60)
|
|
|
@@ -103,7 +104,7 @@ async function sendToDiscord(position, symbol) {
|
|
|
},
|
|
|
{
|
|
|
name: '地址',
|
|
|
- value: `https://www.byreal.io/en/portfolio?userAddress=${position.walletAddress}&tab=current&positionAddress=${position.positionAddress}`,
|
|
|
+ value: `https://www.byreal.io/en/portfolio?userAddress=${position.walletAddress}&tab=current&positionAddress=${position.positionAddress}&tokenAddress=${tokenList[0]}&tokenAddress=${tokenList[1]}`,
|
|
|
inline: false,
|
|
|
},
|
|
|
{
|
|
|
@@ -233,7 +234,7 @@ function calculateAPR(position) {
|
|
|
async function processPositions(token_symbol) {
|
|
|
console.log(`\n[${new Date().toLocaleString('zh-CN')}] 开始检查新仓位...`)
|
|
|
|
|
|
- const { records, symbol } = await fetchTopPositions(token_symbol)
|
|
|
+ const { records, symbol, tokenList } = await fetchTopPositions(token_symbol)
|
|
|
|
|
|
if (!records) {
|
|
|
console.log('获取数据失败')
|
|
|
@@ -260,7 +261,7 @@ async function processPositions(token_symbol) {
|
|
|
for (const position of unsentPositions) {
|
|
|
const address = position.positionAddress
|
|
|
if (address) {
|
|
|
- const success = await sendToDiscord(position, symbol)
|
|
|
+ const success = await sendToDiscord(position, symbol, tokenList)
|
|
|
if (success) {
|
|
|
sentPositions.add(address)
|
|
|
}
|