{"id":21347091,"url":"https://github.com/kybernetwork/binance_fix_api","last_synced_at":"2025-04-15T04:33:33.305Z","repository":{"id":253745191,"uuid":"844385227","full_name":"KyberNetwork/binance_fix_api","owner":"KyberNetwork","description":"Implement Fix client support for Binance spot order fix endpoints. ","archived":false,"fork":false,"pushed_at":"2024-08-20T10:28:18.000Z","size":17,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T16:04:21.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KyberNetwork.png","metadata":{"files":{"readme":"READme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-19T06:36:35.000Z","updated_at":"2025-02-17T01:54:01.000Z","dependencies_parsed_at":"2024-11-28T00:36:00.425Z","dependency_job_id":null,"html_url":"https://github.com/KyberNetwork/binance_fix_api","commit_stats":null,"previous_names":["kybernetwork/binance_fix_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fbinance_fix_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fbinance_fix_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fbinance_fix_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fbinance_fix_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KyberNetwork","download_url":"https://codeload.github.com/KyberNetwork/binance_fix_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249006829,"owners_count":21197350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T02:12:38.087Z","updated_at":"2025-04-15T04:33:33.275Z","avatar_url":"https://github.com/KyberNetwork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Binance FIX API\n\nPrepare those environment variables:\n\n- configFilePath: FIX protocol config (see file path `sample/fix.conf`)\n- apiKey: Binance FIX API KEY\n- privateKeyFilePath: Binance Ed25519 pem file.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\tfix \"github.com/KyberNetwork/binance_fix_api\"\n\t\"go.uber.org/zap\"\n\t\"go.uber.org/zap/zapcore\"\n)\n\nfunc SetupLogger() *zap.SugaredLogger {\n\tpConf := zap.NewProductionEncoderConfig()\n\tpConf.EncodeTime = zapcore.ISO8601TimeEncoder\n\tencoder := zapcore.NewConsoleEncoder(pConf)\n\tlevel := zap.NewAtomicLevelAt(zap.DebugLevel)\n\tl := zap.New(zapcore.NewCore(encoder, zapcore.AddSync(os.Stdout), level), zap.AddCaller())\n\tzap.ReplaceGlobals(l)\n\treturn zap.S()\n}\n\nconst (\n\tconfigFilePath     = \"./sample/fix.conf\"\n\tapiKey             = \"your_api_key\"\n\tprivateKeyFilePath = \"your_ed25519_key_pem\"\n)\n\nfunc main() {\n\tlogger := SetupLogger()\n\tlogger.Infow(\"This is an fix-client example\")\n\tsettings, err := fix.LoadQuickfixSettings(configFilePath)\n\tif err != nil {\n\t\tlogger.Panicw(\"Failed to LoadQuickfixSettings\", \"err\", err)\n\t}\n\n\tconf := fix.Config{\n\t\tAPIKey:             apiKey,\n\t\tPrivateKeyFilePath: privateKeyFilePath,\n\t\tSettings:           settings,\n\t}\n\tclient, err := fix.NewClient(\n\t\tcontext.Background(),\n\t\tlogger, conf, fix.WithZapLogFactory(logger),\n\t)\n\tif err != nil {\n\t\tlogger.Panicw(\"Failed to init client\", \"err\", err)\n\t}\n\n\tlogger.Info(\"Everything is ready!\")\n\n\t// GET LIMIT MESSAGE\n\tlimit, err := client.NewGetLimitService().Do(context.Background())\n\tif err != nil {\n\t\tlogger.Panicw(\"Failed to get LimitMessages\", \"err\", err)\n\t}\n\tlogger.Infow(\"Get limit message\", \"data\", limit)\n\n\t// SUBSCRIBE TO EXECUTION REPORT\n\tclient.SubscribeToExecutionReport(func(o *fix.Order) {\n\t\tlogger.Infow(\"Received data from subscription\", \"order\", o)\n\t})\n\n\tlogger.Info(\"Subscribed to execution report!\")\n\n\t// TRY TO PLACE ORDER\n\ttime.Sleep(time.Second)\n\torder, err := client.NewOrderSingleService().\n\t\tSymbol(\"BNBUSDT\").\n\t\tSide(enum.Side_BUY).\n\t\tType(enum.OrdType_LIMIT).\n\t\tTimeInForce(enum.TimeInForce_GOOD_TILL_CANCEL).\n\t\tQuantity(0.01).\n\t\tPrice(502).\n\t\tDo(context.Background())\n\n\tlogger.Infow(\"NewOrderSingleService resp\", \"order\", order, \"err\", err)\n\n\ttime.Sleep(3 * time.Second)\n}\n\n```\n\n## Order Entry Messages\n\n1. ✅ `NewOrderSingle\u003cD\u003e`\n   - Sent by the client to submit a new order for execution.\n2. 🚫 `NewOrderList\u003cE\u003e`\n   - Sent by the client to submit a list of orders for execution.\n3. 🚫 `OrderCancelRequest\u003cF\u003e`\n   - Sent by the client to cancel an order or an order list.\n4. 🚫 `OrderCancelRequestAndNewOrderSingle\u003cXCN\u003e`\n   - Sent by the client to cancel an order and submit a new one for execution.\n5. 🚫 `OrderMassCancelRequest\u003cq\u003e`\n   - Sent by the client to cancel all open orders on a symbol.\n6. ✅ `ExecutionReport\u003c8\u003e`\n   - Sent by the server whenever an order state changes.\n7. 🚫 `OrderCancelReject\u003c9\u003e`\n   - Sent by the server when OrderCancelRequest\u003cF\u003e has failed.\n8. 🚫 `OrderMassCancelReport\u003cr\u003e`\n   - Sent by the server in response to OrderMassCancelRequest\u003cq\u003e.\n9. 🚫 `ListStatus\u003cN\u003e`\n   - Sent by the server whenever an order list state changes.\n\n## Limit message\n\n- ✅ Sent by the client to query current limits.\n- ✅ Sent by the server in response to LimitQuery\u003cXLQ\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkybernetwork%2Fbinance_fix_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkybernetwork%2Fbinance_fix_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkybernetwork%2Fbinance_fix_api/lists"}