Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl --request GET \
--url https://swap-api.flux.fun/v1/tokens/portfolio/{address}import requests
url = "https://swap-api.flux.fun/v1/tokens/portfolio/{address}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://swap-api.flux.fun/v1/tokens/portfolio/{address}', 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://swap-api.flux.fun/v1/tokens/portfolio/{address}",
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://swap-api.flux.fun/v1/tokens/portfolio/{address}"
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://swap-api.flux.fun/v1/tokens/portfolio/{address}")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/tokens/portfolio/{address}")
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[
{
"portfolioItem": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"chainId": 8453,
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"contractAddress": "0x...",
"tokenId": "0x123...",
"amount": "100",
"averageFillCost": "0.525",
"unrealizedPnL": "12.50",
"updatedAt": "2024-01-12T10:00:00.000Z"
},
"token": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"chainId": 8453,
"contractAddress": "0x...",
"tokenId": "0x123...",
"tokenType": "erc1155",
"decimals": 0,
"tokenRepresentation": "kalshiMarket",
"metadata": {
"marketId": "KXBTC-24DEC31-T100K",
"side": "yes"
}
},
"kalshiMarket": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"tokenId": "0x123...",
"marketId": "KXBTC-24DEC31-T100K",
"side": "yes",
"exchange": "Kalshi",
"name": "Will Bitcoin reach $100,000 by Dec 31?",
"subtitle": "Bitcoin price prediction",
"marketPrice": 45,
"bidPrice": 44,
"askPrice": 46,
"settledAt": "2024-12-31T23:59:59.000Z",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-12T10:00:00.000Z"
}
}
]Retrieve all prediction market tokens held by a wallet address, including current balances and market values.
curl --request GET \
--url https://swap-api.flux.fun/v1/tokens/portfolio/{address}import requests
url = "https://swap-api.flux.fun/v1/tokens/portfolio/{address}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://swap-api.flux.fun/v1/tokens/portfolio/{address}', 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://swap-api.flux.fun/v1/tokens/portfolio/{address}",
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://swap-api.flux.fun/v1/tokens/portfolio/{address}"
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://swap-api.flux.fun/v1/tokens/portfolio/{address}")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/tokens/portfolio/{address}")
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[
{
"portfolioItem": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"chainId": 8453,
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"contractAddress": "0x...",
"tokenId": "0x123...",
"amount": "100",
"averageFillCost": "0.525",
"unrealizedPnL": "12.50",
"updatedAt": "2024-01-12T10:00:00.000Z"
},
"token": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"chainId": 8453,
"contractAddress": "0x...",
"tokenId": "0x123...",
"tokenType": "erc1155",
"decimals": 0,
"tokenRepresentation": "kalshiMarket",
"metadata": {
"marketId": "KXBTC-24DEC31-T100K",
"side": "yes"
}
},
"kalshiMarket": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"tokenId": "0x123...",
"marketId": "KXBTC-24DEC31-T100K",
"side": "yes",
"exchange": "Kalshi",
"name": "Will Bitcoin reach $100,000 by Dec 31?",
"subtitle": "Bitcoin price prediction",
"marketPrice": 45,
"bidPrice": 44,
"askPrice": 46,
"settledAt": "2024-12-31T23:59:59.000Z",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-12T10:00:00.000Z"
}
}
]The wallet address to get portfolio for
Chain ID (default: 8453 for Base)
