Tink.Investments provides read access to a user's investment accounts, portfolios, and individual holdings across connected brokers and banks.

Listing Investment Accounts

{:ok, accounts} = Tink.Investments.list_accounts(client)

Enum.each(accounts, fn acc ->
  IO.puts("#{acc.name}  #{acc.type}  #{acc.total_value} #{acc.currency}")
end)

Fetching Holdings

{:ok, holdings} = Tink.Investments.get_holdings(client, account_id)

Enum.each(holdings, fn h ->
  IO.puts("""
  #{h.name} (#{h.ticker})
  Quantity: #{h.quantity}
  Value:    #{h.market_value} #{h.currency}
  Return:   #{h.profit_loss_percent}%
  """)
end)

Account Fields

FieldDescription
idTink account identifier
nameAccount display name
type"ISA", "SIPP", "GIA", "PENSION", etc.
total_valueCurrent portfolio value as Decimal
currencyISO 4217 currency code
provider_nameBroker or bank name

Holding Fields

FieldDescription
idHolding identifier
nameSecurity name
tickerTicker symbol
isinISIN code
quantityNumber of units held
purchase_priceAverage purchase price as Decimal
market_valueCurrent market value as Decimal
profit_lossAbsolute profit/loss as Decimal
profit_loss_percentPercentage return

Portfolio Summary

{:ok, accounts} = Tink.Investments.list_accounts(client)

total = accounts
  |> Enum.map(& &1.total_value)
  |> Enum.reduce(Decimal.new(0), &Decimal.add/2)

IO.puts("Total portfolio value: #{total}")