Optimize strategies (#23)

* Update Tradingbox + set limit price

* Change discord message
This commit is contained in:
Oda
2025-05-30 09:00:27 +02:00
committed by GitHub
parent a31dff3f22
commit faafedbdd9
9 changed files with 695 additions and 59 deletions

View File

@@ -4340,7 +4340,7 @@
},
"node_modules/get-tsconfig": {
"version": "4.10.0",
"dev": true,
"devOptional": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
@@ -6598,7 +6598,7 @@
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"dev": true,
"devOptional": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
@@ -7526,7 +7526,7 @@
},
"node_modules/tsx": {
"version": "4.19.3",
"dev": true,
"devOptional": true,
"license": "MIT",
"dependencies": {
"esbuild": "~0.25.0",
@@ -7646,7 +7646,7 @@
},
"node_modules/typescript": {
"version": "5.8.2",
"dev": true,
"devOptional": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",

View File

@@ -212,13 +212,14 @@ export const openGmxPositionImpl = async (
marketAddress: marketInfo.marketTokenAddress,
payTokenAddress: collateralToken.address,
collateralTokenAddress: collateralToken.address,
allowedSlippageBps: 100, // 0.5% slippage
allowedSlippageBps: 50, // 0.5% slippage
leverage: leverageBps,
skipSimulation: true,
referralCodeForTxn: encodeReferralCode("kaigen_ai"),
stopLossPrice: stopLossPrice ? numberToBigint(stopLossPrice, 30) : undefined,
takeProfitPrice: takeProfitPrice ? numberToBigint(takeProfitPrice, 30) : undefined,
acceptablePriceImpactBuffer: 150,
limitPrice: limitPrice,
};
if (direction === TradeDirection.Long) {