My position in a token
get_my_positionThe user's position in ONE token: how much they hold, what they paid, and their unrealised profit or loss. Use this for 'am I up on X'. Amounts are in token units and USD; profit figures are USD.
HOW MUCH THE USER HOLDS comes from the CHAIN and is reported by get_my_balances, get_my_token_balance and get_my_position (balance_source: "chain"). WHAT IT COST — cost basis, average entry, realised PnL, trade history — comes from Moby's swap ledger, which only sees swaps Moby executed. Never quote a ledger quantity as the amount held: on live accounts it runs several times high AND several times low against the chain, and a sell sized from it fails on-chain.
Reading the numbers — they are NOT all measured over the same quantity, and the response names which is which:
balance_token_amount/balance_usd— what the user holds ON CHAIN right now, and what all of it is worth. This is the answer to 'how much do I have'.cost_basis_usd/current_pnl_usd/current_pnl_pct— UNREALISED, measured overbasis_known_token_amountonly: the part of the holding Moby has a cost for. If that is smaller thanbalance_token_amount, the rest arrived by transfer or airdrop and has no known basis — say so rather than implying the PnL covers everything.invested_usd/sold_usd— LIFETIME totals ever spent and ever received, including tokens long since sold. A DIFFERENT denominator fromcost_basis_usd, which covers only the tokens still held.balance_usd + sold_usd - invested_usdis net LIFETIME cash flow and will NOT equalcurrent_pnl_usd— both are correct at their own scope, so never present one as a check on the other.realized_total_usd— realised PnL to date, including partial sells on a position still open (realized_open_cycle_usd) as well as completed round trips (realized_closed_cycles_usd).closed_trades_countcounts only the completed round trips, so it is legitimately 0 while realised PnL is non-zero.ledger_present: falsemeans Moby has NO swap history for this token (it arrived by transfer or airdrop), so EVERY money field above is unknown rather than zero, whatever number it carries, andledger_balance_token_amountis null.
A null profit field means UNKNOWN — no cost information — never zero and never break-even.
take_profit_orders_count / stop_loss_set INCLUDE the TP/SL legs you placed with create_order; get_my_orders lists them.
closed_cycles — the last 5 fully closed buy→sell cycles on this token, newest first (when, avg entry/exit, size, PnL); closed_cycles_count is the total. Tx hashes and per-fill legs: get_my_closed_trades(token_address). rationale is the thesis you gave on the open cycle's latest buy, null when none. This returns the CURRENT USER's own data, resolved from their API key. There is no way to ask about someone else's wallet with this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | solana | |
| token_address | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||