List Margin Conversions
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversionsimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"conversions": [
{
"conversion_details": [
{
"symbol": "BTC",
"tf_balance": "20000",
"notional_tf_balance": "4000",
"converted_balance": "1000",
"notional_converted_balance": "1000",
"interest_rate": "0.1",
"conversion_rate": "0.1"
}
],
"short_collateral": {
"old_balance": "1000",
"new_balance": "1000",
"loan_interest_rate": "0.1",
"collateral_interest_rate": "0.1"
},
"conversion_datetime": "2023-05-01T12:00:00.000Z",
"portfolio_id": "<string>"
}
]
}Financing
List Margin Conversions
Lists conversions and short collateral requirement between specified date range. This endpoint is deprecated and will be removed in the future. Use /v1/entities//margin_summaries instead.
GET
/
v1
/
portfolios
/
{portfolio_id}
/
margin_conversions
List Margin Conversions
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversionsimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/margin_conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"conversions": [
{
"conversion_details": [
{
"symbol": "BTC",
"tf_balance": "20000",
"notional_tf_balance": "4000",
"converted_balance": "1000",
"notional_converted_balance": "1000",
"interest_rate": "0.1",
"conversion_rate": "0.1"
}
],
"short_collateral": {
"old_balance": "1000",
"new_balance": "1000",
"loan_interest_rate": "0.1",
"collateral_interest_rate": "0.1"
},
"conversion_datetime": "2023-05-01T12:00:00.000Z",
"portfolio_id": "<string>"
}
]
}Supported Products
- Portfolio Margin
Path Parameters
The unique ID of the portfolio
Query Parameters
The start date of the range to query for in RFC3339 format
The end date of the range to query for in RFC3339 format
Response
200 - application/json
A successful response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I