{"id":22044745,"url":"https://github.com/f0cii/deribit-api","last_synced_at":"2025-07-05T11:32:51.005Z","repository":{"id":44620804,"uuid":"198645168","full_name":"f0cii/deribit-api","owner":"f0cii","description":"Go library for Deribit's v2 API.","archived":false,"fork":false,"pushed_at":"2024-08-20T03:24:14.000Z","size":61,"stargazers_count":20,"open_issues_count":7,"forks_count":102,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T23:41:31.475Z","etag":null,"topics":["deribit","deribit-api","golang","websocket-api"],"latest_commit_sha":null,"homepage":"","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/f0cii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-07-24T13:51:48.000Z","updated_at":"2025-03-03T11:52:54.000Z","dependencies_parsed_at":"2024-06-21T07:27:59.610Z","dependency_job_id":"e7da7f74-07df-439c-acec-5068ea27b469","html_url":"https://github.com/f0cii/deribit-api","commit_stats":null,"previous_names":["sumorf/deribit-api","f0cii/deribit-api","frankrap/deribit-api"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fderibit-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fderibit-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fderibit-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fderibit-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f0cii","download_url":"https://codeload.github.com/f0cii/deribit-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328463,"owners_count":21085323,"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":["deribit","deribit-api","golang","websocket-api"],"created_at":"2024-11-30T13:07:53.382Z","updated_at":"2025-04-11T02:22:09.963Z","avatar_url":"https://github.com/f0cii.png","language":"Go","readme":"# deribit-api\nGo library for using the Deribit's v2 Websocket API.\n\nV2 API Documentation: https://docs.deribit.com/v2/\n\n### Example\n\n```\npackage main\n\nimport (\n\t\"github.com/frankrap/deribit-api\"\n\t\"github.com/frankrap/deribit-api/models\"\n\t\"log\"\n)\n\nfunc main() {\n\tcfg := \u0026deribit.Configuration{\n\t\tAddr:          deribit.TestBaseURL,\n\t\tApiKey:        \"AsJTU16U\",\n\t\tSecretKey:     \"mM5_K8LVxztN6TjjYpv_cJVGQBvk4jglrEpqkw1b87U\",\n\t\tAutoReconnect: true,\n\t\tDebugMode:     true,\n\t}\n\tclient := deribit.New(cfg)\n\n\tclient.GetTime()\n\tclient.Test()\n\n\tvar err error\n\n\t// GetBookSummaryByCurrency\n\tgetBookSummaryByCurrencyParams := \u0026models.GetBookSummaryByCurrencyParams{\n\t\tCurrency: \"BTC\",\n\t\tKind:     \"future\",\n\t}\n\tvar getBookSummaryByCurrencyResult []models.BookSummary\n\tgetBookSummaryByCurrencyResult, err = client.GetBookSummaryByCurrency(getBookSummaryByCurrencyParams)\n\tif err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"%v\", getBookSummaryByCurrencyResult)\n\n\t// GetOrderBook\n\tgetOrderBookParams := \u0026models.GetOrderBookParams{\n\t\tInstrumentName: \"BTC-PERPETUAL\",\n\t\tDepth:          5,\n\t}\n\tvar getOrderBookResult models.GetOrderBookResponse\n\tgetOrderBookResult, err = client.GetOrderBook(getOrderBookParams)\n\tif err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"%v\", getOrderBookResult)\n\n\t// GetPosition\n\tgetPositionParams := \u0026models.GetPositionParams{\n\t\tInstrumentName: \"BTC-PERPETUAL\",\n\t}\n\tvar getPositionResult models.Position\n\tgetPositionResult, err = client.GetPosition(getPositionParams)\n\tif err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"%v\", getPositionResult)\n\n\t// Buy\n\tguyParams := \u0026models.BuyParams{\n\t\tInstrumentName: \"BTC-PERPETUAL\",\n\t\tAmount:         40,\n\t\tPrice:          6000.0,\n\t\tType:           \"limit\",\n\t}\n\tvar buyResult models.BuyResponse\n\tbuyResult, err = client.Buy(guyParams)\n\tif err != nil {\n\t\tlog.Printf(\"%v\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"%v\", buyResult)\n\n\t// Subscribe\n\tclient.On(\"announcements\", func(e *models.AnnouncementsNotification) {\n    \n    })\n    client.On(\"book.ETH-PERPETUAL.100.1.100ms\", func(e *models.OrderBookGroupNotification) {\n\n    })\n    client.On(\"book.BTC-PERPETUAL.100ms\", func(e *models.OrderBookNotification) {\n\n    })\n    client.On(\"book.BTC-PERPETUAL.raw\", func(e *models.OrderBookRawNotification) {\n\n    })\n    client.On(\"deribit_price_index.btc_usd\", func(e *models.DeribitPriceIndexNotification) {\n\n    })\n    client.On(\"deribit_price_ranking.btc_usd\", func(e *models.DeribitPriceRankingNotification) {\n\n    })\n    client.On(\"estimated_expiration_price.btc_usd\", func(e *models.EstimatedExpirationPriceNotification) {\n\n    })\n    client.On(\"markprice.options.btc_usd\", func(e *models.MarkpriceOptionsNotification) {\n\n    })\n    client.On(\"perpetual.BTC-PERPETUAL.raw\", func(e *models.PerpetualNotification) {\n\n    })\n    client.On(\"quote.BTC-PERPETUAL\", func(e *models.QuoteNotification) {\n\n    })\n    client.On(\"ticker.BTC-PERPETUAL.raw\", func(e *models.TickerNotification) {\n\n    })\n    client.On(\"trades.BTC-PERPETUAL.raw\", func(e *models.TradesNotification) {\n\n    })\n\n    client.On(\"user.changes.BTC-PERPETUAL.raw\", func(e *models.UserChangesNotification) {\n\n    })\n    client.On(\"user.changes.future.BTC.raw\", func(e *models.UserChangesNotification) {\n\n    })\n    client.On(\"user.orders.BTC-PERPETUAL.raw\", func(e *models.UserOrderNotification) {\n\n    })\n    client.On(\"user.orders.future.BTC.100ms\", func(e *models.UserOrderNotification) {\n\n    })\n    client.On(\"user.portfolio.btc\", func(e *models.PortfolioNotification) {\n\n    })\n    client.On(\"user.trades.BTC-PERPETUAL.raw\", func(e *models.UserTradesNotification) {\n\n    })\n    client.On(\"user.trades.future.BTC.100ms\", func(e *models.UserTradesNotification) {\n\n    })\n    \n    client.Subscribe([]string{\n        //\"announcements\",\n        //\"book.BTC-PERPETUAL.none.10.100ms\",\t// none/1,2,5,10,25,100,250\n        //\"book.BTC-PERPETUAL.100ms\",\t// type: snapshot/change\n        \"book.BTC-PERPETUAL.raw\",\n        //\"deribit_price_index.btc_usd\",\n        //\"deribit_price_ranking.btc_usd\",\n        //\"estimated_expiration_price.btc_usd\",\n        //\"markprice.options.btc_usd\",\n        //\"perpetual.BTC-PERPETUAL.raw\",\n        //\"quote.BTC-PERPETUAL\",\n        //\"ticker.BTC-PERPETUAL.raw\",\n        \"trades.BTC-PERPETUAL.raw\",\n        //\"user.changes.BTC-PERPETUAL.raw\",\n        //\"user.changes.future.BTC.raw\",\n        \"user.orders.BTC-PERPETUAL.raw\",\n        //\"user.orders.future.BTC.100ms\",\n        //\"user.portfolio.btc\",\n        //\"user.trades.BTC-PERPETUAL.raw\",\n        //\"user.trades.future.BTC.100ms\",\n    })\n\n\tforever := make(chan bool)\n\t\u003c- forever\n}\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0cii%2Fderibit-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff0cii%2Fderibit-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0cii%2Fderibit-api/lists"}