Skip to content

Latest commit

 

History

History
1056 lines (840 loc) · 43.7 KB

LiquidityPoolsApi.md

File metadata and controls

1056 lines (840 loc) · 43.7 KB

Opdex.Client.Api.LiquidityPoolsApi

All URIs are relative to https://v1-test-api.opdex.com/v1

Method HTTP request Description
BuildAddLiquidityQuote POST /liquidity-pools/{pool}/add Build Add Liquidity Transaction Quote
BuildCollectStakingRewardsQuote POST /liquidity-pools/{pool}/staking/collect Build Collect Staking Rewards Transaction Quote
BuildCreateLiquidityPoolQuote POST /liquidity-pools Build Create Liquidity Pool Transaction Quote
BuildRemoveLiquidityQuote POST /liquidity-pools/{pool}/remove Build Remove Liquidity Transaction Quote
BuildSkimQuote POST /liquidity-pools/{pool}/skim Build Skim Transaction Quote
BuildStartStakingQuote POST /liquidity-pools/{pool}/staking/start Build Start Staking Transaction Quote
BuildStopStakingQuote POST /liquidity-pools/{pool}/staking/stop Build Stop Staking Transaction Quote
BuildSyncQuote POST /liquidity-pools/{pool}/sync Build Sync Transaction Quote
GetLiquidityAmountInQuote POST /liquidity-pools/{pool}/add/amount-in Add Liquidity Amount In Quote
GetLiquidityPool GET /liquidity-pools/{pool} Get Liquidity Pool
GetLiquidityPoolHistory GET /liquidity-pools/{pool}/history Get Liquidity Pool History
GetLiquidityPools GET /liquidity-pools Get Liquidity Pools

BuildAddLiquidityQuote

TransactionQuoteResponse BuildAddLiquidityQuote (string pool, QuoteAddLiquidityRequest quoteAddLiquidityRequest)

Build Add Liquidity Transaction Quote

Builds a quote for a transaction to add liquidity to an Opdex liquidity pool. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildAddLiquidityQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var quoteAddLiquidityRequest = new QuoteAddLiquidityRequest(); // QuoteAddLiquidityRequest | 

            try
            {
                // Build Add Liquidity Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildAddLiquidityQuote(pool, quoteAddLiquidityRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildAddLiquidityQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
quoteAddLiquidityRequest QuoteAddLiquidityRequest

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built add liquidity quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildCollectStakingRewardsQuote

TransactionQuoteResponse BuildCollectStakingRewardsQuote (string pool, QuoteCollectStakingRewardsRequest quoteCollectStakingRewardsRequest)

Build Collect Staking Rewards Transaction Quote

Builds a quote for a transaction to collect staking rewards from an Opdex liquidity pool. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildCollectStakingRewardsQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var quoteCollectStakingRewardsRequest = new QuoteCollectStakingRewardsRequest(); // QuoteCollectStakingRewardsRequest | 

            try
            {
                // Build Collect Staking Rewards Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildCollectStakingRewardsQuote(pool, quoteCollectStakingRewardsRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildCollectStakingRewardsQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
quoteCollectStakingRewardsRequest QuoteCollectStakingRewardsRequest

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built collect staking rewards quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildCreateLiquidityPoolQuote

TransactionQuoteResponse BuildCreateLiquidityPoolQuote (QuoteCreateLiquidityPoolRequest quoteCreateLiquidityPoolRequest = null)

Build Create Liquidity Pool Transaction Quote

Builds a quote for a transaction to create an Opdex liquidity pool. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildCreateLiquidityPoolQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var quoteCreateLiquidityPoolRequest = new QuoteCreateLiquidityPoolRequest(); // QuoteCreateLiquidityPoolRequest |  (optional) 

            try
            {
                // Build Create Liquidity Pool Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildCreateLiquidityPoolQuote(quoteCreateLiquidityPoolRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildCreateLiquidityPoolQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
quoteCreateLiquidityPoolRequest QuoteCreateLiquidityPoolRequest [optional]

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built create liquidity pool quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildRemoveLiquidityQuote

TransactionQuoteResponse BuildRemoveLiquidityQuote (string pool, QuoteRemoveLiquidityRequest quoteRemoveLiquidityRequest)

Build Remove Liquidity Transaction Quote

Builds a quote for a transaction to remove liquidity from an Opdex liquidity pool. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildRemoveLiquidityQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var quoteRemoveLiquidityRequest = new QuoteRemoveLiquidityRequest(); // QuoteRemoveLiquidityRequest | 

            try
            {
                // Build Remove Liquidity Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildRemoveLiquidityQuote(pool, quoteRemoveLiquidityRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildRemoveLiquidityQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
quoteRemoveLiquidityRequest QuoteRemoveLiquidityRequest

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built remove liquidity quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildSkimQuote

TransactionQuoteResponse BuildSkimQuote (string pool, QuoteSkimRequest quoteSkimRequest)

Build Skim Transaction Quote

Builds a quote for a transaction to skim an Opdex liquidity pool. This transaction forces the token balances to equal the current reserves. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildSkimQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var quoteSkimRequest = new QuoteSkimRequest(); // QuoteSkimRequest | 

            try
            {
                // Build Skim Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildSkimQuote(pool, quoteSkimRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildSkimQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
quoteSkimRequest QuoteSkimRequest

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built skim quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildStartStakingQuote

TransactionQuoteResponse BuildStartStakingQuote (string pool, QuoteStartStakingRequest quoteStartStakingRequest)

Build Start Staking Transaction Quote

Builds a quote for a transaction to begin staking in an Opdex liquidity pool. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildStartStakingQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var quoteStartStakingRequest = new QuoteStartStakingRequest(); // QuoteStartStakingRequest | 

            try
            {
                // Build Start Staking Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildStartStakingQuote(pool, quoteStartStakingRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildStartStakingQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
quoteStartStakingRequest QuoteStartStakingRequest

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built start staking quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildStopStakingQuote

TransactionQuoteResponse BuildStopStakingQuote (string pool, QuoteStopStakingRequest quoteStopStakingRequest)

Build Stop Staking Transaction Quote

Builds a quote for a transaction to stop staking in an Opdex liquidity pool. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildStopStakingQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var quoteStopStakingRequest = new QuoteStopStakingRequest(); // QuoteStopStakingRequest | 

            try
            {
                // Build Stop Staking Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildStopStakingQuote(pool, quoteStopStakingRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildStopStakingQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
quoteStopStakingRequest QuoteStopStakingRequest

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built stop staking quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

BuildSyncQuote

TransactionQuoteResponse BuildSyncQuote (string pool)

Build Sync Transaction Quote

Builds a quote for a transaction to sync an Opdex liquidity pool. This transaction forces the reserves to equal the current token balances. The quote can be broadcast by a Stratis Transaction Handoff Broadcastor. See the specification for further details.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class BuildSyncQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // Configure Bearer token for authorization: opdexAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool

            try
            {
                // Build Sync Transaction Quote
                TransactionQuoteResponse result = apiInstance.BuildSyncQuote(pool);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.BuildSyncQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool

Return type

TransactionQuoteResponse

Authorization

opdexAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Built sync quote * Cache-Control - Holds directives that control caching
400 The request is not valid -
401 Unauthorized -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLiquidityAmountInQuote

LiquidityAmountInQuoteResponse GetLiquidityAmountInQuote (string pool, LiquidityAmountInQuoteRequest liquidityAmountInQuoteRequest)

Add Liquidity Amount In Quote

Retrieves an estimate for the amount of a token required to be added, give an input amount of the other token in the pair.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class GetLiquidityAmountInQuoteExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var liquidityAmountInQuoteRequest = new LiquidityAmountInQuoteRequest(); // LiquidityAmountInQuoteRequest | 

            try
            {
                // Add Liquidity Amount In Quote
                LiquidityAmountInQuoteResponse result = apiInstance.GetLiquidityAmountInQuote(pool, liquidityAmountInQuoteRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.GetLiquidityAmountInQuote: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
liquidityAmountInQuoteRequest LiquidityAmountInQuoteRequest

Return type

LiquidityAmountInQuoteResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Add liquidity amount in quote retrieved * Cache-Control - Holds directives that control caching
400 The request is not valid -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLiquidityPool

LiquidityPoolResponse GetLiquidityPool (string pool)

Get Liquidity Pool

Retrieve details for an Opdex liquidity pool.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class GetLiquidityPoolExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool

            try
            {
                // Get Liquidity Pool
                LiquidityPoolResponse result = apiInstance.GetLiquidityPool(pool);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.GetLiquidityPool: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool

Return type

LiquidityPoolResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Liquidity pool found * Cache-Control - Holds directives that control caching
400 The request is not valid -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLiquidityPoolHistory

LiquidityPoolSnapshotsResponse GetLiquidityPoolHistory (string pool, Interval? interval = null, DateTime? startDateTime = null, DateTime? endDateTime = null, SortDirection? direction = null, int? limit = null, string cursor = null)

Get Liquidity Pool History

Retrieves historical transactions, reserves, rewards, volume, cost and staking data for an Opdex liquidity pool. This is a paginated endpoint, so a request will retrieve a single page of results. It is recommended to supply filters to your query, to reduce the total number of requests that you may have to make.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class GetLiquidityPoolHistoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var pool = tVFhXcS3gVb49MSTsaDFoqkxLrAUiNEN7n;  // string | Address of a liquidity pool
            var interval = 1D;  // Interval? | Time range between each snapshot (optional) 
            var startDateTime = 2022-01-01T00:00:00Z;  // DateTime? | Start time for which to retrieve snapshots (optional) 
            var endDateTime = 2022-12-31T23:59:59;  // DateTime? | End time for which to retrieve snapshots (optional) 
            var direction = DESC;  // SortDirection? | Order direction of the results (optional) 
            var limit = 100;  // int? | Number of results per page; defaults to 168 for hourly snapshots (1 week), or 28 for daily snapshots (4 weeks) (optional)  (default to 168)
            var cursor = "cursor_example";  // string | Reference of the requested page, returned by a previous call (optional) 

            try
            {
                // Get Liquidity Pool History
                LiquidityPoolSnapshotsResponse result = apiInstance.GetLiquidityPoolHistory(pool, interval, startDateTime, endDateTime, direction, limit, cursor);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.GetLiquidityPoolHistory: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pool string Address of a liquidity pool
interval Interval? Time range between each snapshot [optional]
startDateTime DateTime? Start time for which to retrieve snapshots [optional]
endDateTime DateTime? End time for which to retrieve snapshots [optional]
direction SortDirection? Order direction of the results [optional]
limit int? Number of results per page; defaults to 168 for hourly snapshots (1 week), or 28 for daily snapshots (4 weeks) [optional] [default to 168]
cursor string Reference of the requested page, returned by a previous call [optional]

Return type

LiquidityPoolSnapshotsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Liquidity pool snapshots found * Cache-Control - Holds directives that control caching
400 The request is not valid -
404 Liquidity pool not found -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetLiquidityPools

LiquidityPoolsResponse GetLiquidityPools (string keyword = null, List markets = null, List liquidityPools = null, List tokens = null, StakingStatusFilter? stakingStatus = null, NominationStatusFilter? nominationStatus = null, MiningStatusFilter? miningStatus = null, LiquidityPoolOrderByType? orderBy = null, SortDirection? direction = null, int? limit = null, string cursor = null)

Get Liquidity Pools

Retrieves details for Opdex liquidity pools across one or many markets. This is a paginated endpoint, so a request will retrieve a single page of results. It is recommended to supply filters to your query, to reduce the total number of requests that you may have to make.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Opdex.Client.Api;
using Opdex.Client.Client;
using Opdex.Client.Model;

namespace Example
{
    public class GetLiquidityPoolsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://v1-test-api.opdex.com/v1";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new LiquidityPoolsApi(httpClient, config, httpClientHandler);
            var keyword = BTC;  // string | Keyword search against liquidity pool addresses and names (optional) 
            var markets = new List<string>(); // List<string> | Addresses of markets to search within (optional) 
            var liquidityPools = new List<string>(); // List<string> | Addresses of liquidity pools to fetch (optional) 
            var tokens = new List<string>(); // List<string> | Addresses of SRC tokens paired in pools (optional) 
            var stakingStatus = Enabled;  // StakingStatusFilter? | Staking status filter; default is not to filter (optional) 
            var nominationStatus = Nominated;  // NominationStatusFilter? | Nomination status filter; default is not to filter (optional) 
            var miningStatus = Enabled;  // MiningStatusFilter? | Mining status filter; default is not to filter (optional) 
            var orderBy = Volume;  // LiquidityPoolOrderByType? | Property by which to sort results (optional) 
            var direction = DESC;  // SortDirection? | Order direction of the results (optional) 
            var limit = 10;  // int? | Number of results per page (optional)  (default to 10)
            var cursor = "cursor_example";  // string | Reference of the requested page, returned by a previous call (optional) 

            try
            {
                // Get Liquidity Pools
                LiquidityPoolsResponse result = apiInstance.GetLiquidityPools(keyword, markets, liquidityPools, tokens, stakingStatus, nominationStatus, miningStatus, orderBy, direction, limit, cursor);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiquidityPoolsApi.GetLiquidityPools: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
keyword string Keyword search against liquidity pool addresses and names [optional]
markets List<string> Addresses of markets to search within [optional]
liquidityPools List<string> Addresses of liquidity pools to fetch [optional]
tokens List<string> Addresses of SRC tokens paired in pools [optional]
stakingStatus StakingStatusFilter? Staking status filter; default is not to filter [optional]
nominationStatus NominationStatusFilter? Nomination status filter; default is not to filter [optional]
miningStatus MiningStatusFilter? Mining status filter; default is not to filter [optional]
orderBy LiquidityPoolOrderByType? Property by which to sort results [optional]
direction SortDirection? Order direction of the results [optional]
limit int? Number of results per page [optional] [default to 10]
cursor string Reference of the requested page, returned by a previous call [optional]

Return type

LiquidityPoolsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
200 Liqudidity pool results found * Cache-Control - Holds directives that control caching
400 The request is not valid -
429 Too many requests * Retry-After - Indicates how many seconds to wait before making a follow-up request
500 Unexpected error occurred -
503 Under maintenance -

[Back to top] [Back to API list] [Back to Model list] [Back to README]