{"id":49638990,"url":"https://github.com/amiwrpremium/go-derive","last_synced_at":"2026-05-26T00:01:04.456Z","repository":{"id":355699180,"uuid":"1228000756","full_name":"amiwrpremium/go-derive","owner":"amiwrpremium","description":"Go SDK for the Derive exchange — REST + WebSocket, EIP-712 signing, typed errors, full JSON-RPC coverage.","archived":false,"fork":false,"pushed_at":"2026-05-25T00:31:01.000Z","size":4065,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-05-25T02:28:57.097Z","etag":null,"topics":["crypto","derivatives","derivatives-trading","derive","derive-xyz","eip712","ethereum","go","golang","jsonrpc","l2","lyra","options","perpetuals","sdk","trading","websocket"],"latest_commit_sha":null,"homepage":"https://docs.derive.xyz","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amiwrpremium.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY-INSIGHTS.yml","support":"SUPPORT.md","governance":"GOVERNANCE.md","roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null},"funding":null},"created_at":"2026-05-03T13:10:08.000Z","updated_at":"2026-05-25T00:30:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/amiwrpremium/go-derive","commit_stats":null,"previous_names":["amiwrpremium/go-derive"],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/amiwrpremium/go-derive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amiwrpremium%2Fgo-derive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amiwrpremium%2Fgo-derive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amiwrpremium%2Fgo-derive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amiwrpremium%2Fgo-derive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amiwrpremium","download_url":"https://codeload.github.com/amiwrpremium/go-derive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amiwrpremium%2Fgo-derive/sbom","scorecard":{"id":1247002,"data":{"date":"2026-05-05T16:13:00Z","repo":{"name":"github.com/amiwrpremium/go-derive","commit":"2d68c3c9707d6f5955bb6ef6811be0565d60c505"},"scorecard":{"version":"v5.3.0","commit":"c22063e786c11f9dd714d777a687ff7c4599b600"},"score":6.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project was created within the last 90 days. Please review its contents carefully","details":["Warn: Repository was created within the last 90 days."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#maintained"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1","Info: detected update tool: RenovateBot: renovate.json:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#dependency-update-tool"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":8,"reason":"dependency not pinned by hash detected -- score normalized to 8","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:141: update your workflow using https://app.stepsecurity.io/secureworkflow/amiwrpremium/go-derive/release.yml/master?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/ci.yml:147","Warn: downloadThenRun not pinned by hash: .github/workflows/ci.yml:130","Warn: goCommand not pinned by hash: .github/workflows/ci.yml:201","Warn: goCommand not pinned by hash: .github/workflows/license-check.yml:44","Warn: goCommand not pinned by hash: .github/workflows/lint.yml:54","Warn: goCommand not pinned by hash: .github/workflows/release.yml:72","Warn: goCommand not pinned by hash: .github/workflows/verify-release.yml:133","Info:  63 out of  63 GitHub-owned GitHubAction dependencies pinned","Info:  62 out of  63 third-party GitHubAction dependencies pinned","Info:   1 out of   7 goCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/osv-scanner.yml:30","Info: jobLevel 'contents' permission set to 'read': .github/workflows/osv-scanner.yml:31","Warn: jobLevel 'security-events' permission set to 'write': .github/workflows/osv-scanner.yml:32","Info: jobLevel 'actions' permission set to 'read': .github/workflows/osv-scanner.yml:43","Info: jobLevel 'contents' permission set to 'read': .github/workflows/osv-scanner.yml:44","Warn: jobLevel 'security-events' permission set to 'write': .github/workflows/osv-scanner.yml:45","Info: jobLevel 'actions' permission set to 'read': .github/workflows/release.yml:130","Info: jobLevel 'contents' permission set to 'read': .github/workflows/scorecard.yml:26","Info: jobLevel 'actions' permission set to 'read': .github/workflows/scorecard.yml:27","Info: topLevel 'contents' permission set to 'read': .github/workflows/auto-assign.yml:12","Warn: topLevel 'contents' permission set to 'write': .github/workflows/auto-merge.yml:26","Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/codacy.yml:12","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/codacy.yml:13","Info: topLevel 'actions' permission set to 'read': .github/workflows/codacy.yml:14","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/codeql.yml:13","Info: topLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:14","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:15","Info: topLevel 'contents' permission set to 'read': .github/workflows/extra-lint.yml:15","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/extra-lint.yml:16","Info: topLevel 'contents' permission set to 'read': .github/workflows/gitleaks.yml:20","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/gitleaks.yml:21","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/gitleaks.yml:22","Info: topLevel 'contents' permission set to 'read': .github/workflows/gosec.yml:10","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/gosec.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/integration.yml:16","Info: topLevel 'contents' permission set to 'read': .github/workflows/labeler.yml:14","Info: topLevel 'contents' permission set to 'read': .github/workflows/license-check.yml:18","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint.yml:10","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/lint.yml:11","Info: topLevel permissions set to 'read-all': .github/workflows/osv-scanner.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/pin-check.yml:20","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/pr-title.yml:13","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release-please.yml:9","Info: topLevel permissions set to 'read-all': .github/workflows/release.yml:23","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:15","Info: topLevel 'contents' permission set to 'read': .github/workflows/semgrep.yml:25","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/semgrep.yml:26","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/semgrep.yml:27","Info: topLevel 'contents' permission set to 'read': .github/workflows/trivy.yml:22","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/trivy.yml:23","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/trivy.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/trufflehog.yml:21","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/trufflehog.yml:22","Info: topLevel 'contents' permission set to 'read': .github/workflows/verify-release.yml:24"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#token-permissions"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#license"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":4,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'master'","Info: 'stale review dismissal' is required to merge on branch 'master'","Warn: branch 'master' does not require approvers","Warn: codeowners review is not required on branch 'master'","Warn: 'last push approval' is disabled on branch 'master'","Info: 'up-to-date branches' is required to merge on branch 'master'","Info: status check found to merge onto on branch 'master'","Info: PRs are required in order to make changes on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":10,"reason":"3 out of the last 3 releases have a total of 3 signed artifacts.","details":["Info: provenance for release artifact: go-derive.intoto.jsonl: https://github.com/amiwrpremium/go-derive/releases/tag/v0.1.2","Info: provenance for release artifact: go-derive.intoto.jsonl: https://github.com/amiwrpremium/go-derive/releases/tag/v0.1.1","Info: provenance for release artifact: go-derive.intoto.jsonl: https://github.com/amiwrpremium/go-derive/releases/tag/v0.1.0"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#signed-releases"}},{"name":"SAST","score":8,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 2 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#sast"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: internal/jsonrpc/marshal_fuzz_test.go:12","Info: GoBuiltInFuzzer integration found: internal/jsonrpc/notification_fuzz_test.go:12","Info: GoBuiltInFuzzer integration found: pkg/auth/local_signer_fuzz_test.go:11","Info: GoBuiltInFuzzer integration found: pkg/errors/api_fuzz_test.go:12","Info: GoBuiltInFuzzer integration found: pkg/types/address_fuzz_test.go:10","Info: GoBuiltInFuzzer integration found: pkg/types/address_fuzz_test.go:27","Info: GoBuiltInFuzzer integration found: pkg/types/decimal_fuzz_test.go:12","Info: GoBuiltInFuzzer integration found: pkg/types/decimal_fuzz_test.go:46","Info: GoBuiltInFuzzer integration found: pkg/types/orderbook_fuzz_test.go:11","Info: GoBuiltInFuzzer integration found: pkg/types/time_fuzz_test.go:11"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#fuzzing"}},{"name":"Contributors","score":3,"reason":"project has 1 contributing companies or organizations -- score normalized to 3","details":["Info: found contributions from: eyeon"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#contributors"}},{"name":"CI-Tests","score":5,"reason":"2 out of 4 merged PRs checked by a CI test -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#ci-tests"}}]},"last_synced_at":"2026-05-05T18:35:55.861Z","repository_id":355699180,"created_at":"2026-05-05T18:35:55.861Z","updated_at":"2026-05-05T18:35:55.861Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33497930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["crypto","derivatives","derivatives-trading","derive","derive-xyz","eip712","ethereum","go","golang","jsonrpc","l2","lyra","options","perpetuals","sdk","trading","websocket"],"created_at":"2026-05-05T18:01:11.887Z","updated_at":"2026-05-26T00:01:04.447Z","avatar_url":"https://github.com/amiwrpremium.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-derive\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./assets/banner-dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"./assets/banner-light.png\"\u003e\n  \u003cimg alt=\"go-derive — Go SDK for the Derive exchange\" src=\"./assets/banner-dark.png\" width=\"1200\"\u003e\n\u003c/picture\u003e\n\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003c!-- CI \u0026 checks (live workflow status) --\u003e\n[![CI](https://github.com/amiwrpremium/go-derive/actions/workflows/ci.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/ci.yml)\n[![Lint](https://github.com/amiwrpremium/go-derive/actions/workflows/lint.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/lint.yml)\n[![CodeQL](https://github.com/amiwrpremium/go-derive/actions/workflows/codeql.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/codeql.yml)\n[![OSV-Scanner](https://github.com/amiwrpremium/go-derive/actions/workflows/osv-scanner.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/osv-scanner.yml)\n[![gosec](https://github.com/amiwrpremium/go-derive/actions/workflows/gosec.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/gosec.yml)\n[![Semgrep](https://github.com/amiwrpremium/go-derive/actions/workflows/semgrep.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/semgrep.yml)\n[![Trivy](https://github.com/amiwrpremium/go-derive/actions/workflows/trivy.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/trivy.yml)\n[![Gitleaks](https://github.com/amiwrpremium/go-derive/actions/workflows/gitleaks.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/gitleaks.yml)\n[![TruffleHog](https://github.com/amiwrpremium/go-derive/actions/workflows/trufflehog.yml/badge.svg)](https://github.com/amiwrpremium/go-derive/actions/workflows/trufflehog.yml)\n\n\u003c!-- Coverage \u0026 code quality --\u003e\n[![codecov](https://codecov.io/gh/amiwrpremium/go-derive/branch/master/graph/badge.svg)](https://codecov.io/gh/amiwrpremium/go-derive)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1cfcd38cd2b043a1bbba2bdc7b188026)](https://app.codacy.com/gh/amiwrpremium/go-derive/dashboard)\n[![Codacy coverage](https://app.codacy.com/project/badge/Coverage/1cfcd38cd2b043a1bbba2bdc7b188026)](https://app.codacy.com/gh/amiwrpremium/go-derive/dashboard)\n[![Go Report Card](https://goreportcard.com/badge/github.com/amiwrpremium/go-derive)](https://goreportcard.com/report/github.com/amiwrpremium/go-derive)\n\n\u003c!-- Security posture \u0026 supply chain --\u003e\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/12775/badge)](https://www.bestpractices.dev/projects/12775)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/amiwrpremium/go-derive/badge)](https://scorecard.dev/viewer/?uri=github.com/amiwrpremium/go-derive)\n[![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev)\n[![Cosign signed](https://img.shields.io/badge/cosign-signed-blueviolet?logo=sigstore)](https://github.com/amiwrpremium/go-derive/releases/latest)\n[![SBOM](https://img.shields.io/badge/SBOM-CycloneDX%20%2B%20SPDX-blue)](https://github.com/amiwrpremium/go-derive/releases/latest)\n[![Security Policy](https://img.shields.io/badge/security-policy-blue.svg)](./SECURITY.md)\n[![govulncheck](https://img.shields.io/badge/security-govulncheck-success)](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck)\n\n\u003c!-- Documentation \u0026 API --\u003e\n[![Go Reference](https://pkg.go.dev/badge/github.com/amiwrpremium/go-derive.svg)](https://pkg.go.dev/github.com/amiwrpremium/go-derive)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/amiwrpremium/go-derive)](https://github.com/amiwrpremium/go-derive/blob/master/go.mod)\n[![Top Language](https://img.shields.io/github/languages/top/amiwrpremium/go-derive)](https://github.com/amiwrpremium/go-derive)\n\n\u003c!-- Release \u0026 versioning --\u003e\n[![Release](https://img.shields.io/github/v/release/amiwrpremium/go-derive?include_prereleases\u0026sort=semver)](https://github.com/amiwrpremium/go-derive/releases)\n[![Commits since latest](https://img.shields.io/github/commits-since/amiwrpremium/go-derive/latest/master)](https://github.com/amiwrpremium/go-derive/commits/master)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![release-please](https://img.shields.io/badge/release-please-blue)](https://github.com/googleapis/release-please)\n\n\u003c!-- Project info \u0026 community --\u003e\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](./CODE_OF_CONDUCT.md)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)\n[![Dependabot enabled](https://img.shields.io/badge/dependabot-enabled-025E8C?logo=dependabot\u0026logoColor=white)](./.github/dependabot.yml)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)\n[![Maintained](https://img.shields.io/badge/maintained-yes-brightgreen.svg)](https://github.com/amiwrpremium/go-derive/commits/master)\n[![Last commit](https://img.shields.io/github/last-commit/amiwrpremium/go-derive/master)](https://github.com/amiwrpremium/go-derive/commits/master)\n[![GitHub stars](https://img.shields.io/github/stars/amiwrpremium/go-derive?style=social)](https://github.com/amiwrpremium/go-derive/stargazers)\n\nA Go SDK for the [Derive](https://docs.derive.xyz/) exchange (formerly Lyra) — a layer-2 derivatives venue with perps, options, and spot.\n\nCovers REST (public + private), WebSocket (public + private + subscriptions), and EIP-712 order signing with session keys.\n\n**Out of scope:** on-chain operations (deposit, withdraw, session-key\nregistration). Those require an EVM toolchain (e.g.\n[`go-ethereum`](https://github.com/ethereum/go-ethereum)) and aren't\nbundled here — this SDK is the JSON-RPC trading surface only. Once\nfunds are deposited via the Derive UI or your own contract calls,\nevery order / RFQ / quote / cancel flow runs through this SDK.\n\n## Status\n\n`v0.x` — pre-1.0; the public API may still change. Track the current\nversion via the [Release](https://github.com/amiwrpremium/go-derive/releases)\nbadge above. Breaking changes between 0.x versions follow Conventional\nCommits' `feat!:` discipline and are listed under \"BREAKING CHANGES\"\nin [CHANGELOG.md](./CHANGELOG.md). For migration prose with\nbefore/after snippets, see [MIGRATING.md](./MIGRATING.md).\n\n## Versioning\n\nThis project follows [Semantic Versioning](https://semver.org/).\nReleases are computed from [Conventional Commits](https://www.conventionalcommits.org/)\nby [release-please](https://github.com/googleapis/release-please);\nthe type→bump mapping lives in\n[docs/release-process.md](./docs/release-process.md).\n\n## Install\n\n```bash\ngo get github.com/amiwrpremium/go-derive\n```\n\nRequires Go 1.25+.\n\n## Compatibility\n\nBuilt and CI-tested against **Go 1.25 and Go 1.26** on Linux, macOS\nand Windows. Tracks the Derive API as documented at\n[docs.derive.xyz](https://docs.derive.xyz/) — see\n[CHANGELOG.md](./CHANGELOG.md) for the API drift addressed in each\nrelease.\n\n## Quick start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \"os\"\n\n    \"github.com/amiwrpremium/go-derive/pkg/auth\"\n    \"github.com/amiwrpremium/go-derive/pkg/derive\"\n    \"github.com/amiwrpremium/go-derive/pkg/enums\"\n    \"github.com/amiwrpremium/go-derive/pkg/types\"\n)\n\nfunc main() {\n    // NewLocalSigner takes a raw hex private key. For production setups,\n    // see pkg/auth.NewSessionKeySigner — registers a hot session key\n    // delegating from a long-lived owner address.\n    signer, err := auth.NewLocalSigner(os.Getenv(\"DERIVE_PRIVATE_KEY\"))\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    c, err := derive.NewClient(\n        derive.WithTestnet(), // start on testnet; switch to derive.WithMainnet() once integration is verified\n        derive.WithSigner(signer),\n        derive.WithSubaccount(123),\n    )\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer c.Close()\n\n    ctx := context.Background()\n\n    instruments, err := c.REST.GetInstruments(ctx, types.InstrumentsQuery{\n        Currency: \"BTC\",\n        Kind:     enums.InstrumentTypePerp,\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Println(len(instruments), \"BTC perps\")\n}\n```\n\nSee [`examples/`](./examples/) for more — and\n[docs/getting-started.md](./docs/getting-started.md) for a step-by-step walkthrough.\n\n## Architecture\n\n```text\npkg/derive               top-level facade (REST + WS)\npkg/rest                 HTTP-backed JSON-RPC client\npkg/ws                   WebSocket-backed JSON-RPC + typed subscriptions\npkg/auth                 EIP-712 signing, session keys\npkg/types, pkg/enums     domain types, named-string enums\npkg/errors               sentinel errors + APIError\n\ninternal/jsonrpc         JSON-RPC 2.0 framing\ninternal/transport       HTTP + WS transports (shared interface)\ninternal/methods         RPC method definitions (shared by REST + WS)\ninternal/netconf         endpoints + EIP-712 domains per network\ninternal/codec           decimal/u256/address encoding\ninternal/retry           exponential backoff\n```\n\nThe Derive API is JSON-RPC 2.0 over both HTTP and WebSocket — same method names, same params. The SDK reflects that: a single `Transport` interface backs both `pkg/rest` and `pkg/ws`, so each method is defined once.\n\n### Which package do I import?\n\n- **`pkg/derive`** — start here. The top-level facade bundles a REST\n  client and a WS client sharing one signer and subaccount, which is\n  what most callers want.\n- **`pkg/rest`** alone — when you only need HTTP RPCs (e.g. periodic\n  history pulls from a non-trading process).\n- **`pkg/ws`** alone — when you only need streaming (e.g. a feed\n  recorder that doesn't place orders).\n\nBoth `pkg/rest` and `pkg/ws` expose the full RPC method surface\nindependently; the facade is a shortcut, not a feature gate.\n\nSee [`docs/architecture.md`](./docs/architecture.md) for the full design.\n\n## Documentation\n\nThe full doc set lives under [`docs/`](./docs/):\n\n| Topic | |\n|---|---|\n| Concepts | [getting-started](./docs/getting-started.md) · [architecture](./docs/architecture.md) · [transports](./docs/transports.md) · [auth](./docs/auth.md) · [subscriptions](./docs/subscriptions.md) · [numerics](./docs/numerics.md) · [error handling](./docs/error-handling.md) · [rate limiting](./docs/rate-limiting.md) · [reconnection](./docs/reconnection.md) |\n| Process | [examples](./docs/examples.md) · [testing](./docs/testing.md) · [ci](./docs/ci.md) · [release process](./docs/release-process.md) · [known tool issues](./docs/known-tool-issues.md) |\n| Security | [security index](./docs/security/README.md) · [repo policy](./docs/security/repo-policy.md) · [threat model](./docs/security/threat-model.md) |\n\n## Continuous integration\n\nEvery push and pull request runs:\n\n| Check | Tool | Workflow |\n|---|---|---|\n| Format | `gofmt -l` | [ci.yml](.github/workflows/ci.yml) |\n| Vet | `go vet` | [ci.yml](.github/workflows/ci.yml) |\n| Build | `go build` on Linux/macOS/Windows × Go 1.25/1.26 | [ci.yml](.github/workflows/ci.yml) |\n| Tests | `go test -race -coverprofile` | [ci.yml](.github/workflows/ci.yml) |\n| Mod tidy | `go mod tidy` diff check | [ci.yml](.github/workflows/ci.yml) |\n| Vulnerabilities | `govulncheck` | [ci.yml](.github/workflows/ci.yml) |\n| Linters | `golangci-lint`, `staticcheck` | [lint.yml](.github/workflows/lint.yml) |\n| Extra linters | markdownlint, yamllint, actionlint, editorconfig-checker, typos | [extra-lint.yml](.github/workflows/extra-lint.yml) |\n| Security (SAST) | CodeQL, gosec, Semgrep (security-audit + golang + secrets), Codacy | [codeql.yml](.github/workflows/codeql.yml), [gosec.yml](.github/workflows/gosec.yml), [semgrep.yml](.github/workflows/semgrep.yml), [codacy.yml](.github/workflows/codacy.yml) |\n| Filesystem / IaC scan | Trivy (filesystem + secret + config) | [trivy.yml](.github/workflows/trivy.yml) |\n| Secret scanning | Gitleaks (git history) + TruffleHog (entropy, verified-only) | [gitleaks.yml](.github/workflows/gitleaks.yml), [trufflehog.yml](.github/workflows/trufflehog.yml) |\n| Dependency review | PR-time license + vulnerability gate | [dependency-review.yml](.github/workflows/dependency-review.yml) |\n| License compliance | `go-licenses` allow-list (Apache-2.0, BSD, ISC, MIT, MPL-2.0, Unlicense) | [license-check.yml](.github/workflows/license-check.yml) |\n| Action SHA pinning | enforces every `uses:` is a 40-char SHA | [pin-check.yml](.github/workflows/pin-check.yml) |\n| Coverage | Codecov + Codacy upload | [ci.yml](.github/workflows/ci.yml) |\n| Releases | release-please (Conventional Commits → CHANGELOG + tag) | [release-please.yml](.github/workflows/release-please.yml) |\n| Dependencies | Renovate (primary), Dependabot (fallback) | [renovate.json](renovate.json), [dependabot.yml](.github/dependabot.yml) |\n| Integration | live testnet smoke tests, manual dispatch only | [integration.yml](.github/workflows/integration.yml) |\n| OpenSSF Scorecard | weekly + on push, publishes public score | [scorecard.yml](.github/workflows/scorecard.yml) |\n| OSV-Scanner | weekly + on push/PR, transitive dep CVE scan | [osv-scanner.yml](.github/workflows/osv-scanner.yml) |\n| SLSA + SBOM | runs on every published release | [release.yml](.github/workflows/release.yml) |\n| Post-release re-verify | cosign + slsa-verifier, weekly + on release | [verify-release.yml](.github/workflows/verify-release.yml) |\n\nAll workflows additionally run `step-security/harden-runner` in `audit`\nmode for egress monitoring.\n\n### Required repository secrets\n\n| Secret | Used by | Required? |\n|---|---|---|\n| `CODECOV_TOKEN` | Codecov upload in `ci.yml` | Yes for private repos; public repos can omit |\n| `CODACY_PROJECT_TOKEN` | Codacy coverage upload in `ci.yml` | Optional — coverage upload silently skipped if missing |\n| `RELEASE_PLEASE_TOKEN` | release-please uses this PAT to publish releases that auto-trigger `release.yml` | Recommended — if missing, falls back to `GITHUB_TOKEN`, but releases won't auto-fire `release.yml` (artefacts need manual `gh workflow run release.yml -f tag=vX.Y.Z`) |\n\n`GITHUB_TOKEN` is provided by Actions automatically. `RELEASE_PLEASE_TOKEN`\nshould be a fine-grained PAT scoped to this repo with **Contents: write**\nand **Pull requests: write** permissions — needed because GitHub's\nanti-loop protection doesn't fire `release.yml` on releases published by\n`GITHUB_TOKEN`.\n\n## Security\n\nThis project follows the [OpenSSF best practices](https://openssf.org/) and\npublishes a public Scorecard at\n[scorecard.dev](https://scorecard.dev/viewer/?uri=github.com/amiwrpremium/go-derive).\n\n| What | Where |\n|---|---|\n| Vulnerability disclosure | [SECURITY.md](./SECURITY.md) — uses GitHub private advisories |\n| Code of conduct | [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) (Contributor Covenant 2.1) |\n| Security metadata | [SECURITY-INSIGHTS.yml](./SECURITY-INSIGHTS.yml) (OpenSSF spec 1.0.0) |\n| Required repo settings | [docs/security/repo-policy.md](./docs/security/repo-policy.md) |\n| Static analysis (SAST) | CodeQL, gosec, Semgrep, staticcheck, Codacy |\n| Filesystem / IaC scanning | Trivy (filesystem + secret + config modes) |\n| Secret scanning | Gitleaks (history) + TruffleHog (verified-only) |\n| Dependency scanning | govulncheck, OSV-Scanner, Trivy filesystem, dependency-review |\n| Dependency updates | Renovate (primary) + Dependabot (fallback) |\n| License compliance | `go-licenses` allow-list enforced in CI |\n| Egress audit | `step-security/harden-runner` on every workflow (audit mode) |\n| Action pinning enforcement | `pin-check` workflow rejects unpinned `uses:` lines |\n| Release integrity | SLSA Level 3 provenance + CycloneDX \u0026 SPDX SBOMs + license inventory, all cosign-signed — [release.yml](.github/workflows/release.yml) |\n| Post-release verification | cosign signatures + SLSA provenance re-checked weekly + on every release — [verify-release.yml](.github/workflows/verify-release.yml) |\n| Fuzzing | Go-native `Fuzz*` tests in `pkg/types`, `pkg/auth`, `pkg/errors`, `internal/jsonrpc` |\n| Pinned actions | every action pinned by SHA with the version as a comment |\n\nTo report a vulnerability or code-of-conduct violation, use [GitHub's\nprivate vulnerability reporting](https://github.com/amiwrpremium/go-derive/security/advisories/new).\nThe same channel handles both so reports go through one triage pipeline.\n\n## Running integration tests\n\nLive-network tests live under [`test/`](./test/) and are gated by the\n`integration` build tag, so the default `go test ./...` is unaffected.\n\n```bash\n# Public-only subset (no creds needed) against testnet.\nmake test-integration\n\n# All tests except live order placement.\nDERIVE_SESSION_KEY=0x... DERIVE_SUBACCOUNT=123 \\\n  go test -tags=integration -count=1 ./test/...\n\n# Add live order placement (testnet only — never against mainnet).\nDERIVE_RUN_LIVE_ORDERS=1 DERIVE_BASE_ASSET=0x... \\\n  DERIVE_SESSION_KEY=0x... DERIVE_SUBACCOUNT=123 \\\n  go test -tags=integration -count=1 -run='^TestPrivate_PlaceAndCancel' ./test/...\n```\n\nSee [test/README.md](./test/README.md) for the full env-var list and what\neach subset covers.\n\n## Project files\n\n| File | Purpose |\n|---|---|\n| [CONTRIBUTING.md](./CONTRIBUTING.md) | how to submit changes; Conventional Commits |\n| [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | Contributor Covenant 2.1 |\n| [SECURITY.md](./SECURITY.md) | vulnerability disclosure |\n| [SUPPORT.md](./SUPPORT.md) | where to ask which kind of question |\n| [GOVERNANCE.md](./GOVERNANCE.md) | how decisions get made |\n| [MAINTAINERS.md](./MAINTAINERS.md) | who reviews and merges |\n| [CHANGELOG.md](./CHANGELOG.md) | every release, generated by release-please |\n| [MIGRATING.md](./MIGRATING.md) | hand-written before/after for every 0.x breaking change |\n| [AUTHORS](./AUTHORS) | contributors in chronological order |\n| [SECURITY-INSIGHTS.yml](./SECURITY-INSIGHTS.yml) | OpenSSF security metadata |\n| [.github/settings.yml](./.github/settings.yml) | declarative repo settings + label palette (Probot Settings) |\n| [.github/rulesets/](./.github/rulesets/) | branch + tag rulesets, importable via `gh api` |\n| Configs | [Makefile](./Makefile) · [lefthook.yml](./lefthook.yml) · [renovate.json](./renovate.json) · [.codacy.yml](./.codacy.yml) · [.markdownlint.json](./.markdownlint.json) · [.remarkrc.yml](./.remarkrc.yml) · [.typos.toml](./.typos.toml) · [.editorconfig](./.editorconfig) |\n\n## Contributing\n\nCommits must follow [Conventional Commits](https://www.conventionalcommits.org/) so release-please can derive the next version and update [CHANGELOG.md](./CHANGELOG.md). See [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## License\n\n[MIT](./LICENSE).\n\n## Acknowledgements\n\nThis SDK exists thanks to:\n\n- **[Derive](https://docs.derive.xyz/)** (formerly Lyra) — the public REST + WebSocket reference underpins every method and sentinel in this module.\n- **Upstream Go libraries** the SDK builds on: [`go-ethereum`](https://github.com/ethereum/go-ethereum) for crypto and EIP-712 hashing, [`gorilla/websocket`](https://github.com/gorilla/websocket) for the WS transport, [`shopspring/decimal`](https://github.com/shopspring/decimal) for fixed-point arithmetic, [`stretchr/testify`](https://github.com/stretchr/testify) for the test helpers.\n- **[OpenSSF](https://openssf.org/)** — the [Scorecard](https://scorecard.dev), [SLSA](https://slsa.dev), [Security Insights](https://github.com/ossf/security-insights-spec), and [best-practices](https://www.bestpractices.dev/) projects shaped most of the security plumbing in this repo.\n- **Tools and standards** — [Sigstore](https://www.sigstore.dev/) for keyless artefact signing, [SPDX](https://spdx.dev/) and [CycloneDX](https://cyclonedx.org/) for SBOM formats, [OWASP](https://owasp.org/) for the Semgrep security-audit rule pack, [Mozilla](https://github.com/mozilla/diversity) for the CoC enforcement-ladder reference.\n\n## Disclaimer\n\n**Use testnet first.** Always validate any integration against the\nDerive testnet (`derive.WithTestnet()`) before pointing at mainnet. Test\norders place real testnet positions but use no real funds; mainnet does\nthe opposite.\n\nThis software is provided **\"as is\"**, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement (see [LICENSE](./LICENSE) for the full terms).\n\nThis is an **independent, unofficial** project. It is **not** affiliated with, endorsed by, or sponsored by Derive, Lyra Finance, the Lyra DAO, the Ethereum Foundation, or any other organisation or person. All product names, logos, and brands referenced are the property of their respective owners; their use here is for identification purposes only.\n\nTrading derivatives carries financial risk. Nothing in this repository is financial advice. You are solely responsible for any orders submitted, keys generated or stored, and integrations built on top of this code. Use at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famiwrpremium%2Fgo-derive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famiwrpremium%2Fgo-derive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famiwrpremium%2Fgo-derive/lists"}