@predictionvc/prediction-api
Version:
Prediction Enterprise API sdk in Javascript
120 lines (86 loc) • 3.28 kB
Markdown
//enterprise.prediction.vc/api/*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fundTradesGet**](FundApi.md
[**fundTradesTokensGet**](FundApi.md
<a name="fundsSimfundPairsGet"></a>
> fundsSimfundPairsGet(opts)
Prediction Fund trade data
```javascript
const PredictionApi = require('prediction-api')
const defaultClient = PredictionApi.ApiClient.instance
// Configure API key authorization: Authorization
const Authorization = defaultClient.authentications['Authorization']
Authorization.apiKey = "YOUR API KEY"
const api = new PredictionApi.FundApi()
const opts = {
'entry': '2018-09-01', // {Date} entry date for trades
'exit': '2018-09-01', // {Date} exit date for trades
'direction': 'short' // {String} short/long
}
api.fundsSimfundPairsGet(opts)
.then(data => {
console.log('API called successfully. Returned data: ')
console.log(data)
})
.catch(error => {
console.error(error)
})
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**entry** | **Date**| entry date for trades, e.g 2018-09-01.| [optional]
**exit** | **Date**| exit date for trades, e.g 2018-09-01. | [optional]
**direction** | **String**| short/long | [optional]
Object with key `data`
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | tokens traded with | [optional]
**entryDate** | **DateTime** | trade entry datetime | [optional]
**exitDate** | **DateTime** | trade exit datetime | [optional]
**gain** | **Float** | trade gain percentage | [optional]
**notionalTraded** | **Float** | notional amount traded with | [optional]
**direction** | **String** | short/long | [optional]
**entryValue** | **Float** | value of the token when it entered the portfolio | [optional]
**exitValue** | **Float** | value of the token when it left the portfolio | [optional]
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
<a name="fundsSimfundTradesGet"></a>
> fundsSimfundTradesGet()
Traded tokens
```javascript
const PredictionApi = require('prediction_enterprise_api')
const defaultClient = PredictionApi.ApiClient.instance
// Configure API key authorization: Authorization
const Authorization = defaultClient.authentications['Authorization']
Authorization.apiKey = 'YOUR API KEY'
const apiInstance = new PredictionApi.FundApi()
apiInstance.fundsSimfundTradesGet()
.then(data => {
console.log('API called successfully. Returned data: ')
console.log(data)
})
.catch(error => {
console.error(error)
})
```
This endpoint does not need any parameter.
**[&
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
All URIs are relative to *https: