Commit Graph

65 Commits

Author SHA1 Message Date
fc4369a008 Add start and enddate when fetching the position history 2025-10-24 18:00:23 +07:00
79f07af899 Fix get Balance 2025-10-20 16:20:36 +07:00
e3f2577db4 Prevent no last candle error 2025-10-11 13:59:09 +07:00
e917edd939 Add more logs, 95%ram alert for GmxMarkets, Proxy retry 2times max 2025-10-11 13:43:32 +07:00
04df72a6bd Fix .First Position update + add more details when position rejected 2025-10-11 12:27:54 +07:00
67065469a6 Fix config update + remove messages + Summary fix for not open position 2025-10-08 02:52:11 +07:00
dac0a9641f Fetch closed position to get last pnl realized 2025-10-05 23:31:17 +07:00
de0d042254 Use usdc balance instead usdc value for ensuring balance check 2025-10-05 01:36:25 +07:00
343b85dada Fix fetch and restart bot 2025-10-04 18:31:50 +07:00
a97b5804a0 Update position saving and update 2025-10-04 17:38:01 +07:00
1e19e29cec Fix get Gas fees + position direction list 2025-09-26 12:02:07 +07:00
bcfeb693ce Update account/position and platform summary 2025-09-26 01:18:59 +07:00
40f3c66694 Add ETH and USDC balance check before start/restart bot and autoswap 2025-09-23 14:03:46 +07:00
931c4661dc Fix get current price 2025-09-20 16:20:47 +07:00
d58672f879 Add retry + idempotency on trading when try + add more tts 2025-09-20 02:28:16 +07:00
Oda
cee3902a4d Update SDK (#35)
* Update SDK for swap

* Fix web3proxy build

* Update types

* Fix swap

* Send token test and BASE transfer

* fix cache and hook

* Fix send

* Update health check with uiFeereceiver

* Fix sdk

* Fix get positions

* Fix timeoutloop

* Fix open position

* Fix closes positions

* Review
2025-09-17 14:28:56 +07:00
a922ae961a Fix datetime 2025-09-14 17:33:45 +07:00
Oda
56b4f14eb3 Price reminder and init approval
* Start price reminder grain

* Add config and init grain at startup

* Save init wallet when already init
2025-09-13 02:29:14 +07:00
7c58e1d7d2 Add missing privy tokens 2025-08-17 01:45:13 +07:00
3464e072d6 Update get balance for token not handle by privy 2025-08-17 01:32:00 +07:00
289fd25dc3 Add agent balance fetch from proxy 2025-08-15 20:52:37 +07:00
Oda
082ae8714b Trading bot grain (#33)
* Trading bot Grain

* Fix a bit more of the trading bot

* Advance on the tradingbot grain

* Fix build

* Fix db script

* Fix user login

* Fix a bit backtest

* Fix cooldown and backtest

* start fixing bot start

* Fix startup

* Setup local db

* Fix build and update candles and scenario

* Add bot registry

* Add reminder

* Updateing the grains

* fix bootstraping

* Save stats on tick

* Save bot data every tick

* Fix serialization

* fix save bot stats

* Fix get candles

* use dict instead of list for position

* Switch hashset to dict

* Fix a bit

* Fix bot launch and bot view

* add migrations

* Remove the tolist

* Add agent grain

* Save agent summary

* clean

* Add save bot

* Update get bots

* Add get bots

* Fix stop/restart

* fix Update config

* Update scanner table on new backtest saved

* Fix backtestRowDetails.tsx

* Fix agentIndex

* Update agentIndex

* Fix more things

* Update user cache

* Fix

* Fix account load/start/restart/run
2025-08-05 04:07:06 +07:00
5fabfbfadd fix backtest credit 2025-07-31 20:58:37 +07:00
36cb672ce4 Update front and config 2025-07-29 03:02:33 +07:00
Oda
422fecea7b Postgres (#30)
* Add postgres

* Migrate users

* Migrate geneticRequest

* Try to fix Concurrent call

* Fix asyncawait

* Fix async and concurrent

* Migrate backtests

* Add cache for user by address

* Fix backtest migration

* Fix not open connection

* Fix backtest command error

* Fix concurrent

* Fix all concurrency

* Migrate TradingRepo

* Fix scenarios

* Migrate statistic repo

* Save botbackup

* Add settings et moneymanagement

* Add bot postgres

* fix a bit more backups

* Fix bot model

* Fix loading backup

* Remove cache market for read positions

* Add workers to postgre

* Fix workers api

* Reduce get Accounts for workers

* Migrate synth to postgre

* Fix backtest saved

* Remove mongodb

* botservice decorrelation

* Fix tradingbot scope call

* fix tradingbot

* fix concurrent

* Fix scope for genetics

* Fix account over requesting

* Fix bundle backtest worker

* fix a lot of things

* fix tab backtest

* Remove optimized moneymanagement

* Add light signal to not use User and too much property

* Make money management lighter

* insert indicators to awaitable

* Migrate add strategies to await

* Refactor scenario and indicator retrieval to use asynchronous methods throughout the application

* add more async await

* Add services

* Fix and clean

* Fix bot a bit

* Fix bot and add message for cooldown

* Remove fees

* Add script to deploy db

* Update dfeeploy script

* fix script

* Add idempotent script and backup

* finish script migration

* Fix did user and agent name on start bot
2025-07-27 20:42:17 +07:00
f6013b8e9d Add encryption for Kaigen server auth 2025-07-17 16:50:54 +07:00
6a634eafaa Update get backtests 2025-07-17 04:40:18 +07:00
e4de01211d Add flag for credit 2025-07-17 02:41:02 +07:00
4b18d43b3f Update payload 2025-07-17 01:59:37 +07:00
3bd22922c7 Update kaigen credit private key 2025-07-17 00:46:30 +07:00
11778aa2a4 Add kaigen debit credit for backtest 2025-07-15 10:31:21 +07:00
f973be2e08 Send tokens 2025-07-06 14:39:01 +07:00
c7dec76809 Swap tokens 2025-07-06 14:00:44 +07:00
3f34c56968 Get fees to claims 2025-06-13 14:22:38 +07:00
7147072836 Fix cache for get candle 2025-06-09 16:37:37 +07:00
456867c352 fix signal and get position during closing 2025-05-14 14:48:01 +07:00
549c4ae746 Add initAddress api 2025-05-10 14:41:17 +07:00
8a3c09809f Fix cache reference 2025-04-30 14:04:37 +07:00
bc1ef78747 Fix worker cancelled on worker + Cache tickers 2025-04-30 13:19:03 +07:00
bc8aa2f2a8 Update tickers 2025-04-29 02:07:02 +07:00
1121a7c6d3 Update healthcheck and display pnl on trades 2025-04-26 14:48:23 +07:00
6579bbc06f Add manual close for bot positions 2025-04-25 17:33:38 +07:00
6c385ea309 Fix position 2025-04-25 01:16:48 +07:00
af89121c40 Add data + fix positions 2025-04-24 23:48:28 +07:00
c22c925087 Add user to position + fix few things 2025-04-24 19:46:21 +07:00
76b8b7ebb6 Fix bots + positions managements 2025-04-23 19:36:26 +02:00
ec442c4dff Fix a bit bots 2025-04-22 21:17:34 +02:00
868c7bdb65 Fix getbalance + fix get orders for bot 2025-04-21 12:15:53 +02:00
Oda
528c62a0a1 Filter everything with users (#16)
* Filter everything with users

* Fix backtests and user management

* Add cursor rules

* Fix backtest and bots

* Update configs names

* Sign until unauth

* Setup delegate

* Setup delegate and sign

* refact

* Enhance Privy signature generation with improved cryptographic methods

* Add Fastify backend

* Add Fastify backend routes for privy

* fix privy signing

* fix privy client

* Fix tests

* add gmx core

* fix merging sdk

* Fix tests

* add gmx core

* add gmx core

* add privy to boilerplate

* clean

* fix

* add fastify

* Remove Managing.Fastify submodule

* Add Managing.Fastify as regular directory instead of submodule

* Update .gitignore to exclude Managing.Fastify dist and node_modules directories

* Add token approval functionality to Privy plugin

- Introduced a new endpoint `/approve-token` for approving ERC20 tokens.
- Added `approveToken` method to the Privy plugin for handling token approvals.
- Updated `signPrivyMessage` to differentiate between message signing and token approval requests.
- Enhanced the plugin with additional schemas for input validation.
- Included new utility functions for token data retrieval and message construction.
- Updated tests to verify the new functionality and ensure proper request decoration.

* Add PrivyApproveTokenResponse model for token approval response

- Created a new class `PrivyApproveTokenResponse` to encapsulate the response structure for token approval requests.
- The class includes properties for `Success` status and a transaction `Hash`.

* Refactor trading commands and enhance API routes

- Updated `OpenPositionCommandHandler` to use asynchronous methods for opening trades and canceling orders.
- Introduced new Fastify routes for opening positions and canceling orders with appropriate request validation.
- Modified `EvmManager` to handle both Privy and non-Privy wallet operations, utilizing the Fastify API for Privy wallets.
- Adjusted test configurations to reflect changes in account types and added helper methods for testing Web3 proxy services.

* Enhance GMX trading functionality and update dependencies

- Updated `dev:start` script in `package.json` to include the `-d` flag for Fastify.
- Upgraded `fastify-cli` dependency to version 7.3.0.
- Added `sourceMap` option to `tsconfig.json`.
- Refactored GMX plugin to improve position opening logic, including enhanced error handling and validation.
- Introduced a new method `getMarketInfoFromTicker` for better market data retrieval.
- Updated account type in `PrivateKeys.cs` to use `Privy`.
- Adjusted `EvmManager` to utilize the `direction` enum directly for trade direction handling.

* Refactor GMX plugin for improved trading logic and market data retrieval

- Enhanced the `openGmxPositionImpl` function to utilize the `TradeDirection` enum for trade direction handling.
- Introduced `getTokenDataFromTicker` and `getMarketByIndexToken` functions for better market and token data retrieval.
- Updated collateral calculation and logging for clarity.
- Adjusted `EvmManager` to ensure proper handling of price values in trade requests.

* Refactor GMX plugin and enhance testing for position opening

- Updated `test:single` script in `package.json` to include TypeScript compilation before running tests.
- Removed `this` context from `getClientForAddress` function and replaced logging with `console.error`.
- Improved collateral calculation in `openGmxPositionImpl` for better precision.
- Adjusted type casting for `direction` in the API route to utilize `TradeDirection` enum.
- Added a new test for opening a long position in GMX, ensuring functionality and correctness.

* Update sdk

* Update

* update fastify

* Refactor start script in package.json to simplify command execution

- Removed the build step from the start script, allowing for a more direct launch of the Fastify server.

* Update package.json for Web3Proxy

- Changed the name from "Web3Proxy" to "web3-proxy".
- Updated version from "0.0.0" to "1.0.0".
- Modified the description to "The official Managing Web3 Proxy".

* Update Dockerfile for Web3Proxy

- Upgraded Node.js base image from 18-alpine to 22.14.0-alpine.
- Added NODE_ENV environment variable set to production.

* Refactor Dockerfile and package.json for Web3Proxy

- Removed the build step from the Dockerfile to streamline the image creation process.
- Updated the start script in package.json to include the build step, ensuring the application is built before starting the server.

* Add fastify-tsconfig as a development dependency in Dockerfile-web3proxy

* Remove fastify-tsconfig extension from tsconfig.json for Web3Proxy

* Add PrivyInitAddressResponse model for handling initialization responses

- Introduced a new class `PrivyInitAddressResponse` to encapsulate the response structure for Privy initialization, including properties for success status, USDC hash, order vault hash, and error message.

* Update

* Update

* Remove fastify-tsconfig installation from Dockerfile-web3proxy

* Add build step to Dockerfile-web3proxy

- Included `npm run build` in the Dockerfile to ensure the application is built during the image creation process.

* Update

* approvals

* Open position from front embedded wallet

* Open position from front embedded wallet

* Open position from front embedded wallet

* Fix call contracts

* Fix limit price

* Close position

* Fix close position

* Fix close position

* add pinky

* Refactor position handling logic

* Update Dockerfile-pinky to copy package.json and source code from the correct directory

* Implement password protection modal and enhance UI with new styles; remove unused audio elements and update package dependencies.

* add cancel orders

* Update callContract function to explicitly cast account address as Address type

* Update callContract function to cast transaction parameters as any type for compatibility

* Cast transaction parameters as any type in approveTokenImpl for compatibility

* Cast wallet address and transaction parameters as Address type in approveTokenImpl for type safety

* Add .env configuration file for production setup including database and server settings

* Refactor home route to update welcome message and remove unused SDK configuration code

* add referral code

* fix referral

* Add sltp

* Fix typo

* Fix typo

* setup sltp on backtend

* get orders

* get positions with slp

* fixes

* fixes close position

* fixes

* Remove MongoDB project references from Dockerfiles for managing and worker APIs

* Comment out BotManagerWorker service registration and remove MongoDB project reference from Dockerfile

* fixes
2025-04-20 22:18:27 +07:00
988cc9eb61 Add Privy type wallet 2025-03-05 10:36:54 +07:00