Getting Value Functions
This guide explains how to retrieve value functions. This is particularly useful for algorithmic traders who need to see what pricing models are available.
Get All Value Functions
Retrieves all value functions available to the authenticated user.
Endpoint
GET /value-function/value-functions
Description
Return an array of value functions (code, name, and id) available to your account.
Example Request
curl -X GET "https://api.opteverything.com/value-function/value-functions" \
-H "Authorization: Bearer <YOUR_TOKEN>"
Example Response
The response will be an array of value function objects. Here is an example of a single object in the array:
{
"id": 1,
"code": "def value_function(params):\\n return params['distance_km'] * 2.5 + 5.0",
"name": "Standard Distance Pricing"
}
Field | Type | Description |
---|---|---|
id | integer | The unique identifier for the value function. |
code | string | The Python code that defines the value function's logic. |
name | string | The name of the value function. |