{"id":13612632,"url":"https://github.com/askmike/deribit-v2-ws","last_synced_at":"2025-04-13T12:50:18.824Z","repository":{"id":47606923,"uuid":"176464797","full_name":"askmike/deribit-v2-ws","owner":"askmike","description":"deribit v2 ws api wrapper","archived":false,"fork":false,"pushed_at":"2021-08-22T08:29:52.000Z","size":32,"stargazers_count":23,"open_issues_count":0,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-25T06:43:05.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/askmike.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}},"created_at":"2019-03-19T08:39:45.000Z","updated_at":"2022-11-05T20:11:23.000Z","dependencies_parsed_at":"2022-09-06T10:30:22.667Z","dependency_job_id":null,"html_url":"https://github.com/askmike/deribit-v2-ws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fderibit-v2-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fderibit-v2-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fderibit-v2-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fderibit-v2-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/askmike","download_url":"https://codeload.github.com/askmike/deribit-v2-ws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717252,"owners_count":21150388,"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-08-01T20:00:32.569Z","updated_at":"2025-04-13T12:50:18.804Z","avatar_url":"https://github.com/askmike.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# deribit-v2-ws\n\nDeribit V2 API WS RPC wrapper.\n\n[Docs are here](https://docs.deribit.com/v2/?javascript#deribit-api-v2-0-0).\n\nThis module is designed to be used with nodejs, it doesn't support browser usage.\n\n## Features\n\n- Connect to WS api\n- Authenticate\n- Reconnect on disconnect\n- Resubscribe subscriptions on disconnect\n\n## Example usage\n\nSee more examples in `example.js`.\n\n    const Deribit = require('deribit-v2-ws');\n\n    const key = 'x';\n    const secret = 'y';\n\n    const db = new Deribit({key, secret})\n    await db.connect();\n    const position = await db.request(\n      'private/get_position',\n      {instrument_name: 'BTC-PERPETUAL'}\n    );\n\n    console.log(position);\n\nresult:\n\n    {\n      requestedAt: 1552992953360, // added by this lib\n      usIn: 1552992953479560,\n      usOut: 1552992953482218,\n      receivedAt: 1552992953601, // added by this lib\n      jsonrpc: '2.0',\n      id: 404,\n      result:\n       { total_profit_loss: 0,\n         size_currency: 0,\n         size: 0,\n         settlement_price: 3959.67,\n         realized_profit_loss: 0,\n         open_orders_margin: 0,\n         mark_price: 3971.85,\n         maintenance_margin: 0,\n         kind: 'future',\n         instrument_name: 'BTC-PERPETUAL',\n         initial_margin: 0,\n         index_price: 3972.04,\n         floating_profit_loss: 0,\n         estimated_liquidation_price: 0,\n         direction: 'zero',\n         delta: 0,\n         average_price: 0 },\n      usDiff: 2658,\n      testnet: false\n    }","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskmike%2Fderibit-v2-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faskmike%2Fderibit-v2-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskmike%2Fderibit-v2-ws/lists"}