Skip to content

Commit

Permalink
feat: add volatility and config enpoints for options
Browse files Browse the repository at this point in the history
  • Loading branch information
kibotrel committed Apr 21, 2022
1 parent 1608f0e commit 7b0728c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ These methods are designed to fill the gaps if the API evolves in the future but
- [`withdrawHistory`](#withdrawHistory)
- [`optionsGetPositions`](#optionsGetPositions)
- [`optionsNewPosition`](#optionsNewPosition)
- [`optionsGetConfiguration`](#optionsGetConfiguration)
- [`optionsGetVolatility`](#optionsGetVolatility)


#### futuresGetTicker

Expand Down Expand Up @@ -855,7 +858,7 @@ Example:
})
```

[`GET /options/vanilla`](https://docs.lnmarkets.com/api/v1) documentation for more details.
[`GET /options/vanilla`](https://docs.lnmarkets.com/api/v1/#operation/V1_Options_GetVanillaTrades) documentation for more details.

#### optionsNewPosition

Expand Down Expand Up @@ -895,7 +898,40 @@ Example:
})
```

[`POST /options/vanilla`](https://docs.lnmarkets.com/api/v1) documentation for more details.
[`POST /options/vanilla`](https://docs.lnmarkets.com/api/v1/#operation/V1_Options_newTrade) documentation for more details.

#### optionsGetConfiguration

Get the options current configuration.

```yaml
# No parameters
```

Example:

```JS
await lnm.optionsGetConfiguration()
```

[`GET /options/instrument`](https://docs.lnmarkets.com/api/v1/#operation/V1_Options_Instrument) documentation for more details.

#### optionsGetVolatility

Get the current volatility.

```yaml
# No parameters
```

Example:

```JS
await lnm.optionsGetVolatility()
```

[`GET /options/volatility`](https://docs.lnmarkets.com/api/v1/#operation/V1_Options_getVolatility) documentation for more details.


#### requestAPI

Expand Down
18 changes: 18 additions & 0 deletions src/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,22 @@ module.exports = class LNMarketsRest {

return this.beforeRequestApi(options)
}

optionsGetConfiguration() {
const options = {
method: 'GET',
path: '/options/instrument',
}

return this.beforeRequestApi(options)
}

optionsGetVolatility() {
const options = {
method: 'GET',
path: '/options/volatility',
}

return this.beforeRequestApi(options)
}
}

0 comments on commit 7b0728c

Please sign in to comment.