> For the complete documentation index, see [llms.txt](https://docs.yifi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yifi.io/docs/earn/transactions.md).

# Transactions

Track of actions: wallets transactions interacting with yifi

## Get wallet position events

> Get position summary and deposit/withdrawal events for a wallet and strategy within a time range.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Track of actions: wallets transactions interacting with yifi","name":"Transactions"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"rest.Response":{"type":"object","properties":{"code":{"type":"string"},"data":{},"isError":{"type":"boolean"},"message":{"type":"string"},"success":{"type":"boolean"}}},"core.PositionEventsResponse":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/core.PositionEventView"}},"meta":{"$ref":"#/components/schemas/core.PositionMeta"},"pagination":{"$ref":"#/components/schemas/core.PositionPagination"},"pnl":{"$ref":"#/components/schemas/core.PositionPnL"},"tokens":{"$ref":"#/components/schemas/core.PositionTokens"}}},"core.PositionEventView":{"type":"object","properties":{"apy_snapshot_pct":{"type":"string"},"balance_after":{"$ref":"#/components/schemas/core.EventBalance"},"block_number":{"type":"integer"},"chain":{"type":"string"},"explorer_url":{"type":"string"},"fee":{"$ref":"#/components/schemas/core.EventFee"},"gas":{"$ref":"#/components/schemas/core.EventGas"},"received":{"$ref":"#/components/schemas/core.EventLeg"},"sent":{"$ref":"#/components/schemas/core.EventLeg"},"timestamp":{"description":"unix seconds","type":"integer"},"tx_hash":{"type":"string"},"type":{"description":"deposit | withdraw","type":"string"}}},"core.EventBalance":{"type":"object","properties":{"share_balance":{"type":"string"},"share_balance_usd":{"type":"string"}}},"core.EventFee":{"type":"object","properties":{"amount":{"type":"string"},"amount_usd":{"type":"string"},"pct":{"type":"string"},"token_id":{"type":"string"}}},"core.EventGas":{"type":"object","properties":{"amount":{"description":"native token","type":"string"},"amount_usd":{"type":"string"}}},"core.EventLeg":{"type":"object","properties":{"amount_gross":{"description":"before zap fee","type":"string"},"amount_net":{"description":"after zap fee","type":"string"},"amount_usd":{"description":"historical, at the event's block","type":"string"},"token_id":{"type":"string"}}},"core.PositionMeta":{"type":"object","properties":{"chain_id":{"type":"string"},"closed_at":{"type":"integer"},"from_block":{"type":"integer"},"last_indexed_block":{"type":"integer"},"opened_at":{"type":"integer"},"share_accrual_type":{"description":"ShareAccrualType is how the share token accrues yield and thus which PnL\nbranch was used: \"appreciating\" | \"rebasing\" | \"unknown\" (§4.7). When\n\"unknown\" the PnL block is omitted (we won't risk a wrong sign).","type":"string"},"status":{"description":"active | closed","type":"string"},"strategy_id":{"type":"string"},"to_block":{"type":"integer"},"wallet":{"type":"string"}}},"core.PositionPagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total_events":{"type":"integer"}}},"core.PositionPnL":{"type":"object","properties":{"balance_share":{"description":"Current live balance of the share token.","type":"string"},"balance_share_usd":{"type":"string"},"costs":{"$ref":"#/components/schemas/core.PositionPnLCosts"},"days_held":{"type":"string"},"deposited_settle_gross":{"description":"Reporting totals over the whole range (gross = before zap fee, net = after).","type":"string"},"deposited_settle_net":{"type":"string"},"gross":{"$ref":"#/components/schemas/core.PositionPnLGross"},"n_deposits":{"type":"integer"},"n_withdrawals":{"type":"integer"},"net":{"$ref":"#/components/schemas/core.PositionPnLNet"},"received_share_gross":{"type":"string"},"received_share_net":{"type":"string"},"settle_token":{"$ref":"#/components/schemas/core.SettleToken"},"withdrawn_settle_gross":{"type":"string"},"withdrawn_settle_net":{"type":"string"},"withdrawn_share_gross":{"type":"string"},"withdrawn_share_net":{"type":"string"}}},"core.PositionPnLCosts":{"type":"object","properties":{"gas_native":{"type":"string"},"gas_settle":{"type":"string"},"gas_usd":{"type":"string"},"zap_fees_settle":{"description":"deposit-side zap fees, in settle token","type":"string"},"zap_fees_share":{"description":"withdraw-side zap fees, in share token","type":"string"},"zap_fees_usd":{"type":"string"}}},"core.PositionPnLGross":{"type":"object","properties":{"pnl_settle":{"type":"string"},"pnl_settle_pct":{"type":"string"},"pnl_usd":{"type":"string"},"pnl_usd_pct":{"type":"string"},"realized_pnl_settle":{"type":"string"},"realized_pnl_usd":{"type":"string"},"unrealized_pnl_settle":{"type":"string"},"unrealized_pnl_usd":{"type":"string"}}},"core.PositionPnLNet":{"type":"object","properties":{"pnl_settle":{"type":"string"},"pnl_settle_pct":{"type":"string"},"pnl_usd":{"type":"string"},"pnl_usd_pct":{"type":"string"},"realized_pnl_settle":{"type":"string"},"unrealized_pnl_settle":{"type":"string"}}},"core.SettleToken":{"type":"object","properties":{"symbol":{"type":"string"},"token_id":{"type":"string"}}},"core.PositionTokens":{"type":"object","properties":{"gas":{"type":"array","items":{"$ref":"#/components/schemas/core.PositionToken"}},"reward":{"type":"array","items":{"$ref":"#/components/schemas/core.PositionToken"}},"share":{"type":"array","items":{"$ref":"#/components/schemas/core.PositionToken"}},"underlying":{"type":"array","items":{"$ref":"#/components/schemas/core.PositionToken"}}}},"core.PositionToken":{"type":"object","properties":{"address":{"type":"string"},"decimals":{"type":"integer"},"id":{"description":"\"chain:address\"","type":"string"},"logo_url":{"type":"string"},"name":{"type":"string"},"price_usd":{"type":"string"},"symbol":{"type":"string"}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/positions/{wallet_id}/events/{strategy_id}/{from}/{to}":{"get":{"description":"Get position summary and deposit/withdrawal events for a wallet and strategy within a time range.","tags":["Transactions"],"summary":"Get wallet position events","parameters":[{"schema":{"type":"string"},"description":"Wallet ID","name":"wallet_id","in":"path","required":true},{"schema":{"type":"string"},"description":"Strategy ID","name":"strategy_id","in":"path","required":true},{"schema":{"type":"integer"},"description":"From timestamp","name":"from","in":"path","required":true},{"schema":{"type":"integer"},"description":"To timestamp","name":"to","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/rest.Response"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/core.PositionEventsResponse"}}}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}}}}}}}
```

## Get wallet transactions history

> List wallet transactions for a wallet and strategy within a time range.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Track of actions: wallets transactions interacting with yifi","name":"Transactions"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"rest.Response":{"type":"object","properties":{"code":{"type":"string"},"data":{},"isError":{"type":"boolean"},"message":{"type":"string"},"success":{"type":"boolean"}}},"common.WalletTx":{"type":"object","properties":{"chain_id":{"description":"chain в котором была произведена транза и в котором накопились fees","type":"string"},"created_at":{"description":"millisecond","type":"integer"},"decimals":{"description":"decimals of the fee/input token, so downstream can scale InputAmount/fee from base units to human units","type":"integer"},"input_amount":{"description":"amount транзы прошедшей (чтобы посчитать notional amount) и обновить балансы партнёра","type":"string"},"input_amount_usd":{"type":"string"},"is_deposit":{"description":"deposit/withdrawal","type":"boolean"},"meta":{"description":"full log","allOf":[{"$ref":"#/components/schemas/common.FullTxView"}]},"order_id":{"description":"берём  для  идемпотентности","type":"string"},"output_amount":{"description":"amount транзы прошедшей (чтобы посчитать notional amount) и обновить балансы партнёра","type":"string"},"output_amount_usd":{"type":"string"},"partner_fee":{"description":"BELOW IS NOT FOR FRONTEND\nTotalFee *decimal.Decimal `json:\"total_fee\"`\npartnerFee is attached by gateway service at buildZap","type":"string"},"partner_id":{"description":"партнёр через которого прошла транза","type":"string"},"strategy_id":{"description":"стртегия","type":"string"},"token_id":{"description":"токен в котором партнёр получает fee","type":"string"},"token_id_actual":{"description":"TokenIDActual is the ERC20 that physically settled in the distributor\ncontract. When the zap input is a native coin (e.g. bsc:0x0…0), Portals\nwraps it 1:1 and delivers the fee as the wrapped token (WBNB), so the fee\non-chain is WBNB even though TokenID stays native for analytics/display.\nEmpty when core could not resolve it; downstream falls back to TokenID.","type":"string"},"token_price_usd":{"description":"инфo по транзакции","type":"string"},"tx_hash":{"description":"hash транзакции","type":"string"},"wallet_id":{"description":"юзер который отправляет запросы","type":"string"},"yifi_fee":{"description":"yifi Fee is attached by core service","type":"string"}}},"common.FullTxView":{"type":"object","properties":{"block_hash":{"type":"string"},"block_number":{"type":"integer"},"effective_gas_price":{"type":"string"},"from":{"type":"string"},"gas_limit":{"type":"integer"},"gas_price":{"type":"string"},"gas_used":{"type":"integer"},"nonce":{"type":"integer"},"portal_input":{"$ref":"#/components/schemas/common.PrintablePortalInput"},"status":{"type":"integer"},"to":{"type":"string"},"token_transfers":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenTransfer"}},"transaction_fee":{"type":"string"},"tx_hash":{"type":"string"},"type":{"type":"integer"},"value":{"type":"string"},"zap":{"type":"string"}}},"common.PrintablePortalInput":{"type":"object","properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/common.PrintablePortalCall"}},"input_amount":{"type":"string"},"input_token":{"type":"string"},"min_output_amount":{"type":"string"},"output_token":{"type":"string"},"partner":{"type":"string"},"recipient":{"type":"string"}}},"common.PrintablePortalCall":{"type":"object","properties":{"amount_index":{"type":"string"},"data":{"type":"string"},"input_token":{"type":"string"},"target":{"type":"string"}}},"common.TokenTransfer":{"type":"object","properties":{"amount":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token":{"type":"string"}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/transactions/{wallet_id}/history/{strategy_id}/{from}/{to}":{"get":{"description":"List wallet transactions for a wallet and strategy within a time range.","tags":["Transactions"],"summary":"Get wallet transactions history","parameters":[{"schema":{"type":"string"},"description":"Wallet ID","name":"wallet_id","in":"path","required":true},{"schema":{"type":"string"},"description":"Strategy ID","name":"strategy_id","in":"path","required":true},{"schema":{"type":"integer"},"description":"From timestamp","name":"from","in":"path","required":true},{"schema":{"type":"integer"},"description":"To timestamp","name":"to","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/rest.Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/common.WalletTx"}}}}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}}}}}}}
```

## Get wallet transactions

> List wallet transactions by wallet id.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Track of actions: wallets transactions interacting with yifi","name":"Transactions"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"rest.Response":{"type":"object","properties":{"code":{"type":"string"},"data":{},"isError":{"type":"boolean"},"message":{"type":"string"},"success":{"type":"boolean"}}},"common.WalletTx":{"type":"object","properties":{"chain_id":{"description":"chain в котором была произведена транза и в котором накопились fees","type":"string"},"created_at":{"description":"millisecond","type":"integer"},"decimals":{"description":"decimals of the fee/input token, so downstream can scale InputAmount/fee from base units to human units","type":"integer"},"input_amount":{"description":"amount транзы прошедшей (чтобы посчитать notional amount) и обновить балансы партнёра","type":"string"},"input_amount_usd":{"type":"string"},"is_deposit":{"description":"deposit/withdrawal","type":"boolean"},"meta":{"description":"full log","allOf":[{"$ref":"#/components/schemas/common.FullTxView"}]},"order_id":{"description":"берём  для  идемпотентности","type":"string"},"output_amount":{"description":"amount транзы прошедшей (чтобы посчитать notional amount) и обновить балансы партнёра","type":"string"},"output_amount_usd":{"type":"string"},"partner_fee":{"description":"BELOW IS NOT FOR FRONTEND\nTotalFee *decimal.Decimal `json:\"total_fee\"`\npartnerFee is attached by gateway service at buildZap","type":"string"},"partner_id":{"description":"партнёр через которого прошла транза","type":"string"},"strategy_id":{"description":"стртегия","type":"string"},"token_id":{"description":"токен в котором партнёр получает fee","type":"string"},"token_id_actual":{"description":"TokenIDActual is the ERC20 that physically settled in the distributor\ncontract. When the zap input is a native coin (e.g. bsc:0x0…0), Portals\nwraps it 1:1 and delivers the fee as the wrapped token (WBNB), so the fee\non-chain is WBNB even though TokenID stays native for analytics/display.\nEmpty when core could not resolve it; downstream falls back to TokenID.","type":"string"},"token_price_usd":{"description":"инфo по транзакции","type":"string"},"tx_hash":{"description":"hash транзакции","type":"string"},"wallet_id":{"description":"юзер который отправляет запросы","type":"string"},"yifi_fee":{"description":"yifi Fee is attached by core service","type":"string"}}},"common.FullTxView":{"type":"object","properties":{"block_hash":{"type":"string"},"block_number":{"type":"integer"},"effective_gas_price":{"type":"string"},"from":{"type":"string"},"gas_limit":{"type":"integer"},"gas_price":{"type":"string"},"gas_used":{"type":"integer"},"nonce":{"type":"integer"},"portal_input":{"$ref":"#/components/schemas/common.PrintablePortalInput"},"status":{"type":"integer"},"to":{"type":"string"},"token_transfers":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenTransfer"}},"transaction_fee":{"type":"string"},"tx_hash":{"type":"string"},"type":{"type":"integer"},"value":{"type":"string"},"zap":{"type":"string"}}},"common.PrintablePortalInput":{"type":"object","properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/common.PrintablePortalCall"}},"input_amount":{"type":"string"},"input_token":{"type":"string"},"min_output_amount":{"type":"string"},"output_token":{"type":"string"},"partner":{"type":"string"},"recipient":{"type":"string"}}},"common.PrintablePortalCall":{"type":"object","properties":{"amount_index":{"type":"string"},"data":{"type":"string"},"input_token":{"type":"string"},"target":{"type":"string"}}},"common.TokenTransfer":{"type":"object","properties":{"amount":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token":{"type":"string"}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/transactions/{wallet_id}/stats":{"get":{"description":"List wallet transactions by wallet id.","tags":["Transactions"],"summary":"Get wallet transactions","parameters":[{"schema":{"type":"string"},"description":"wallet id","name":"wallet_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/rest.Response"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/common.WalletTx"}}}}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}}}}}}}
```

## Get wallet transaction

> Get a single wallet transaction by wallet id and order id.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Track of actions: wallets transactions interacting with yifi","name":"Transactions"}],"servers":[{"url":"https://core-dev.yifi.io/api/v1"}],"security":[{"BearerToken":[]},{"PartnerApiKey":[]}],"components":{"securitySchemes":{"BearerToken":{"description":"Admin key for privileged operations (create/edit/delete).","type":"apiKey","name":"Authorization","in":"header"},"PartnerApiKey":{"description":"Partner API key used for B2B attribution (wallets, platforms). Requests authenticated with this key are attributed to the owning partner.","type":"apiKey","name":"X-Partner-Api-Key","in":"header"}},"schemas":{"rest.Response":{"type":"object","properties":{"code":{"type":"string"},"data":{},"isError":{"type":"boolean"},"message":{"type":"string"},"success":{"type":"boolean"}}},"common.WalletTx":{"type":"object","properties":{"chain_id":{"description":"chain в котором была произведена транза и в котором накопились fees","type":"string"},"created_at":{"description":"millisecond","type":"integer"},"decimals":{"description":"decimals of the fee/input token, so downstream can scale InputAmount/fee from base units to human units","type":"integer"},"input_amount":{"description":"amount транзы прошедшей (чтобы посчитать notional amount) и обновить балансы партнёра","type":"string"},"input_amount_usd":{"type":"string"},"is_deposit":{"description":"deposit/withdrawal","type":"boolean"},"meta":{"description":"full log","allOf":[{"$ref":"#/components/schemas/common.FullTxView"}]},"order_id":{"description":"берём  для  идемпотентности","type":"string"},"output_amount":{"description":"amount транзы прошедшей (чтобы посчитать notional amount) и обновить балансы партнёра","type":"string"},"output_amount_usd":{"type":"string"},"partner_fee":{"description":"BELOW IS NOT FOR FRONTEND\nTotalFee *decimal.Decimal `json:\"total_fee\"`\npartnerFee is attached by gateway service at buildZap","type":"string"},"partner_id":{"description":"партнёр через которого прошла транза","type":"string"},"strategy_id":{"description":"стртегия","type":"string"},"token_id":{"description":"токен в котором партнёр получает fee","type":"string"},"token_id_actual":{"description":"TokenIDActual is the ERC20 that physically settled in the distributor\ncontract. When the zap input is a native coin (e.g. bsc:0x0…0), Portals\nwraps it 1:1 and delivers the fee as the wrapped token (WBNB), so the fee\non-chain is WBNB even though TokenID stays native for analytics/display.\nEmpty when core could not resolve it; downstream falls back to TokenID.","type":"string"},"token_price_usd":{"description":"инфo по транзакции","type":"string"},"tx_hash":{"description":"hash транзакции","type":"string"},"wallet_id":{"description":"юзер который отправляет запросы","type":"string"},"yifi_fee":{"description":"yifi Fee is attached by core service","type":"string"}}},"common.FullTxView":{"type":"object","properties":{"block_hash":{"type":"string"},"block_number":{"type":"integer"},"effective_gas_price":{"type":"string"},"from":{"type":"string"},"gas_limit":{"type":"integer"},"gas_price":{"type":"string"},"gas_used":{"type":"integer"},"nonce":{"type":"integer"},"portal_input":{"$ref":"#/components/schemas/common.PrintablePortalInput"},"status":{"type":"integer"},"to":{"type":"string"},"token_transfers":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenTransfer"}},"transaction_fee":{"type":"string"},"tx_hash":{"type":"string"},"type":{"type":"integer"},"value":{"type":"string"},"zap":{"type":"string"}}},"common.PrintablePortalInput":{"type":"object","properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/common.PrintablePortalCall"}},"input_amount":{"type":"string"},"input_token":{"type":"string"},"min_output_amount":{"type":"string"},"output_token":{"type":"string"},"partner":{"type":"string"},"recipient":{"type":"string"}}},"common.PrintablePortalCall":{"type":"object","properties":{"amount_index":{"type":"string"},"data":{"type":"string"},"input_token":{"type":"string"},"target":{"type":"string"}}},"common.TokenTransfer":{"type":"object","properties":{"amount":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token":{"type":"string"}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/transactions/{wallet_id}/stats/{order_id}":{"get":{"description":"Get a single wallet transaction by wallet id and order id.","tags":["Transactions"],"summary":"Get wallet transaction","parameters":[{"schema":{"type":"string"},"description":"Wallet ID","name":"wallet_id","in":"path","required":true},{"schema":{"type":"string"},"description":"Order ID","name":"order_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/rest.Response"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/common.WalletTx"}}}]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.Msg"}}}}}}}}}
```
