Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "3commas-openapi"]
path = 3commas-openapi
url = [email protected]:recomma/3commas-openapi.git
1 change: 1 addition & 0 deletions 3commas-openapi
Submodule 3commas-openapi added at f843ef
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- Local `.env` in the repo is sample data only—treat actual credentials via the vault setup flow.

## External Services
- 3Commas API (SDK: `github.com/terwey/3commas-sdk-go`) powers bot/deal polling.
- 3Commas API (SDK: `github.com/recomma/3commas-sdk-go`) powers bot/deal polling.
- Hyperliquid REST/Websocket (`github.com/sonirico/go-hyperliquid`) handles order submission and fills.
- WebAuthn ceremonies via `github.com/go-webauthn/webauthn`; passkey flows create/consume vault sessions.

Expand Down
2 changes: 1 addition & 1 deletion adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package adapter
import (
"math"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
"github.com/sonirico/go-hyperliquid"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

// ToCreateOrderRequest converts one 3Commas BotEvent + its Deal metadata
Expand Down
2 changes: 1 addition & 1 deletion cmd/recomma/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/go-webauthn/webauthn/webauthn"
"github.com/rs/cors"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/cmd/recomma/internal/config"
"github.com/recomma/recomma/emitter"
"github.com/recomma/recomma/engine"
Expand All @@ -30,7 +31,6 @@ import (
"github.com/recomma/recomma/recomma"
"github.com/recomma/recomma/storage"
"github.com/recomma/recomma/webui"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

func fatal(msg string, err error) {
Expand Down
2 changes: 1 addition & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"math"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/adapter"
"github.com/recomma/recomma/filltracker"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
"github.com/recomma/recomma/storage"
tc "github.com/terwey/3commas-sdk-go/threecommas"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion engine/handle_deal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/adapter"
"github.com/recomma/recomma/filltracker"
"github.com/recomma/recomma/internal/testutil"
Expand All @@ -14,7 +15,6 @@ import (
"github.com/recomma/recomma/storage"
hyperliquid "github.com/sonirico/go-hyperliquid"
"github.com/stretchr/testify/require"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

type capturingEmitter struct {
Expand Down
2 changes: 1 addition & 1 deletion engine/produce_active_deals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/recomma"
"github.com/recomma/recomma/storage"
"github.com/stretchr/testify/require"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

// fakeQueue implements Queue by collecting added keys.
Expand Down
2 changes: 1 addition & 1 deletion filltracker/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"sync"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
"github.com/recomma/recomma/storage"
"github.com/sonirico/go-hyperliquid"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

const floatTolerance = 1e-6
Expand Down
2 changes: 1 addition & 1 deletion filltracker/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"testing"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
"github.com/recomma/recomma/storage"
hyperliquid "github.com/sonirico/go-hyperliquid"
"github.com/stretchr/testify/require"
tc "github.com/terwey/3commas-sdk-go/threecommas"

"log/slog"
)
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ require (
github.com/ethereum/go-ethereum v1.16.4
github.com/go-webauthn/webauthn v0.14.0
github.com/google/go-cmp v0.7.0
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6
github.com/oapi-codegen/nullable v1.1.0
github.com/oapi-codegen/runtime v1.1.2
github.com/recomma/3commas-sdk-go v0.1.0
github.com/rs/cors v1.11.1
github.com/sonirico/go-hyperliquid v0.16.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
github.com/terwey/3commas-sdk-go v0.0.2
github.com/vearutop/statigz v1.5.0
golang.org/x/sync v0.17.0
k8s.io/client-go v0.34.0
modernc.org/sqlite v1.39.0
Expand Down Expand Up @@ -92,7 +92,6 @@ require (
github.com/supranational/blst v0.3.16 // indirect
github.com/tetratelabs/wazero v1.9.0 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
github.com/vearutop/statigz v1.5.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
Expand Down
11 changes: 5 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx
github.com/bits-and-blooms/bitset v1.24.0 h1:H4x4TuulnokZKvHLfzVRTHJfFfnHEeSYJizujEZvmAM=
github.com/bits-and-blooms/bitset v1.24.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/bool64/dev v0.2.39 h1:kP8DnMGlWXhGYJEZE/J0l/gVBdbuhoPGL+MJG4QbofE=
github.com/bool64/dev v0.2.39/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down Expand Up @@ -129,8 +131,6 @@ github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5T
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA=
github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6 h1:IIVxLyDUYErC950b8kecjoqDet8P5S4lcVRUOM6rdkU=
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6/go.mod h1:JslaLRrzGsOKJgFEPBP65Whn+rdwDQSk0I0MCRFe2Zw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
Expand Down Expand Up @@ -231,6 +231,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
github.com/recomma/3commas-sdk-go v0.1.0 h1:Oozn8/3HyU1mz1mxPt1IKT+1Pj3P72310BGIvY+ky9w=
github.com/recomma/3commas-sdk-go v0.1.0/go.mod h1:gRdQ8KeyIuTCTqS+Ue0LftnPeMSUGo/AbHX7Msa/X9U=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
Expand Down Expand Up @@ -280,10 +282,6 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE=
github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
github.com/terwey/3commas-sdk-go v0.0.1 h1:FCZBysJ5Yq6li10CIT5wuSVFTnKBAxiUTIPs8IiNe1w=
github.com/terwey/3commas-sdk-go v0.0.1/go.mod h1:R6WkKWr7REsAh49F3eQX7b1QasBVWxDzwG1T3JIW5T0=
github.com/terwey/3commas-sdk-go v0.0.2 h1:0PU/n3VZPP6/pqkiG5Vwgsp/t+ebZ1H85F0jEHcadvo=
github.com/terwey/3commas-sdk-go v0.0.2/go.mod h1:R6WkKWr7REsAh49F3eQX7b1QasBVWxDzwG1T3JIW5T0=
github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
Expand All @@ -308,6 +306,7 @@ github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 h1:OvLBa8S
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52/go.mod h1:jMeV4Vpbi8osrE/pKUxRZkVaA0EX7NZN0A9/oRzgpgY=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.elastic.co/apm/module/apmzerolog/v2 v2.7.1 h1:C9+KrlqS8F4SZFu+ct0Jmv2YLmzDhWsI8htK6exd3vg=
Expand Down
2 changes: 1 addition & 1 deletion internal/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"sync"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/hl"
"github.com/recomma/recomma/internal/vault"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
hyperliquid "github.com/sonirico/go-hyperliquid"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/api/ops.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

type EventOpt func(*tc.BotEvent)
Expand Down
2 changes: 1 addition & 1 deletion oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ generate:
models: true
embedded-spec: false
import-mapping:
../3commas/openapi.yaml: github.com/terwey/3commas-sdk-go/threecommas
3commas-openapi/3commas/openapi.yaml: github.com/recomma/3commas-sdk-go/threecommas
output: internal/api/ops.gen.go
4 changes: 2 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ components:
type: string
format: date-time
payload:
$ref: ../3commas/openapi.yaml#/components/schemas/Bot
$ref: 3commas-openapi/3commas/openapi.yaml#/components/schemas/Bot
description: Raw 3Commas bot payload exactly as stored.

DealRecord:
Expand All @@ -922,7 +922,7 @@ components:
type: string
format: date-time
payload:
$ref: ../3commas/openapi.yaml#/components/schemas/Deal
$ref: 3commas-openapi/3commas/openapi.yaml#/components/schemas/Deal
description: Raw 3Commas deal payload exactly as stored.

OrderRecord:
Expand Down
2 changes: 1 addition & 1 deletion recomma/recomma.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
"github.com/sonirico/go-hyperliquid"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

type OrderWork struct {
Expand Down
2 changes: 1 addition & 1 deletion storage/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"strings"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
hyperliquid "github.com/sonirico/go-hyperliquid"
tc "github.com/terwey/3commas-sdk-go/threecommas"

api "github.com/recomma/recomma/internal/api"
"github.com/recomma/recomma/metadata"
Expand Down
2 changes: 1 addition & 1 deletion storage/latestHlSafetyStatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"testing"
"time"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
hyperliquid "github.com/sonirico/go-hyperliquid"
"github.com/stretchr/testify/require"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

func TestStorageListLatestHyperliquidSafetyStatuses(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion storage/sqlite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/oapi-codegen/nullable"
tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
hyperliquid "github.com/sonirico/go-hyperliquid"
"github.com/stretchr/testify/require"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

func newTestStorage(t *testing.T) *Storage {
Expand Down
2 changes: 1 addition & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (

_ "modernc.org/sqlite"

tc "github.com/recomma/3commas-sdk-go/threecommas"
"github.com/recomma/recomma/internal/api"
"github.com/recomma/recomma/metadata"
"github.com/recomma/recomma/recomma"
"github.com/recomma/recomma/storage/sqlcgen"
hyperliquid "github.com/sonirico/go-hyperliquid"
tc "github.com/terwey/3commas-sdk-go/threecommas"
)

//go:generate sqlc generate
Expand Down