|
|
@@ -52,11 +52,14 @@ export async function sendDiscordMessage(positionDetails: OpenPositionEvent['pos
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 添加价格信息
|
|
|
- if (mintA?.price && mintB?.price) {
|
|
|
+ // 添加区间信息
|
|
|
+ if (positionDetails.lowerTick !== undefined && positionDetails.upperTick !== undefined && mintA && mintB) {
|
|
|
+ const decimalsAdj = Math.pow(10, mintB.decimals - mintA.decimals)
|
|
|
+ const priceLower = Math.pow(1.0001, positionDetails.lowerTick) * decimalsAdj
|
|
|
+ const priceUpper = Math.pow(1.0001, positionDetails.upperTick) * decimalsAdj
|
|
|
embed.fields.push({
|
|
|
- name: '💹 价格信息',
|
|
|
- value: `${mintASymbol}: $${Number(mintA.price).toFixed(6)}\n${mintBSymbol}: $${Number(mintB.price).toFixed(6)}`,
|
|
|
+ name: '📊 区间范围',
|
|
|
+ value: `${priceLower.toPrecision(6)} ~ ${priceUpper.toPrecision(6)} ${mintBSymbol}/${mintASymbol}`,
|
|
|
inline: false
|
|
|
})
|
|
|
}
|