> 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/models.md).

# Models

## The common.Address object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Address":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"string"},"decimals":{"type":"integer"}}}}}}
```

## The common.Category object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Category":{"type":"object","properties":{"category_id":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"},"name":{"type":"string"}}}}}}
```

## The common.Chain object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Chain":{"type":"object","properties":{"chain_id":{"description":"e.g.: \"ethereum\"","type":"string"},"ecosystem":{"type":"string"},"explorer_url":{"type":"string"},"image_url":{"type":"string"}}}}}}
```

## The common.Context object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Context":{"type":"object","properties":{"expiry":{"type":"string"},"feeAmount":{"type":"string"},"feeAmountSignedOrder":{"type":"string"},"feeAmountUsd":{"type":"number"},"feeAmountUsdSignedOrder":{"type":"number"},"feeToken":{"type":"string"},"gasLimit":{"type":"string"},"inputAmount":{"type":"string"},"inputAmountUsd":{"type":"number"},"inputToken":{"type":"string"},"isPermit":{"type":"boolean"},"minOutputAmount":{"type":"string"},"minOutputAmountSignedOrder":{"type":"string"},"minOutputAmountUsd":{"type":"number"},"minOutputAmountUsdSignedOrder":{"type":"number"},"orderId":{"type":"string"},"outputAmount":{"type":"string"},"outputAmountSignedOrder":{"type":"string"},"outputAmountUsd":{"type":"number"},"outputAmountUsdSignedOrder":{"type":"number"},"outputToken":{"type":"string"},"partner":{"type":"string"},"rawParams":{"type":"object","additionalProperties":true},"recipient":{"type":"string"},"residualTokens":{"type":"array","items":{"type":"string"}},"route":{"type":"array","items":{"type":"string"}},"routeHash":{"type":"string"},"sender":{"type":"string"},"slippageTolerancePercentage":{"type":"number"},"steps":{"type":"array","items":{"type":"string"}},"stepsSignedOrder":{"type":"array","items":{"type":"string"}},"target":{"type":"string"},"value":{"type":"string"}}}}}}
```

## The common.FullTxView object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The common.GetTokensResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.GetTokensResponse":{"type":"object","properties":{"chain_ids":{"type":"array","items":{"type":"string"}},"image":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"tag_ids":{"type":"array","items":{"type":"string"}},"token_group":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The common.Page object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Page":{"type":"object","properties":{"currentPage":{"description":"page-based pagination","type":"integer"},"id":{"description":"keyset-based pagination","type":"string"},"limit":{"description":"common","type":"integer"},"nextCursor":{"type":"string"},"offset":{"description":"offset-based pagination","type":"integer"},"pageSize":{"type":"integer"},"prevCursor":{"description":"cursor-based pagination","type":"string"},"totalItems":{"type":"integer"},"totalPages":{"type":"integer"},"type":{"type":"string"}}}}}}
```

## The common.Pagination-common\_GetTokensResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Pagination-common_GetTokensResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/common.GetTokensResponse"}},"page":{"$ref":"#/components/schemas/common.Page"}}},"common.GetTokensResponse":{"type":"object","properties":{"chain_ids":{"type":"array","items":{"type":"string"}},"image":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"},"tag_ids":{"type":"array","items":{"type":"string"}},"token_group":{"type":"string"},"token_id":{"type":"string"}}},"common.Page":{"type":"object","properties":{"currentPage":{"description":"page-based pagination","type":"integer"},"id":{"description":"keyset-based pagination","type":"string"},"limit":{"description":"common","type":"integer"},"nextCursor":{"type":"string"},"offset":{"description":"offset-based pagination","type":"integer"},"pageSize":{"type":"integer"},"prevCursor":{"description":"cursor-based pagination","type":"string"},"totalItems":{"type":"integer"},"totalPages":{"type":"integer"},"type":{"type":"string"}}}}}}
```

## The common.Pagination-core\_MarketsResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Pagination-core_MarketsResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/core.MarketsResponse"}},"page":{"$ref":"#/components/schemas/common.Page"}}},"core.MarketsResponse":{"type":"object","properties":{"annual_rate":{"description":"out of meta for effective search","type":"string"},"category":{"type":"string"},"chain":{"type":"string"},"market_id":{"type":"string"},"name":{"type":"string"},"participating_tokens":{"description":"slice of tokenIDs // no need for more for creating a market","type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"platform":{"type":"string"},"rate_format":{"type":"string"},"tvl_usd":{"description":"in usd","type":"string"},"yield_type":{"description":"user inserts","type":"string"}}},"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}},"common.Page":{"type":"object","properties":{"currentPage":{"description":"page-based pagination","type":"integer"},"id":{"description":"keyset-based pagination","type":"string"},"limit":{"description":"common","type":"integer"},"nextCursor":{"type":"string"},"offset":{"description":"offset-based pagination","type":"integer"},"pageSize":{"type":"integer"},"prevCursor":{"description":"cursor-based pagination","type":"string"},"totalItems":{"type":"integer"},"totalPages":{"type":"integer"},"type":{"type":"string"}}}}}}
```

## The common.Pagination-core\_StrategiesResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Pagination-core_StrategiesResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/core.StrategiesResponse"}},"page":{"$ref":"#/components/schemas/common.Page"}}},"core.StrategiesResponse":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string"}},"chain_ids":{"type":"array","items":{"$ref":"#/components/schemas/common.Chain"}},"description":{"type":"string"},"input_tokens":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"metrics":{"$ref":"#/components/schemas/core.Metrics"},"name":{"type":"string"},"output_tokens":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"risk":{"description":"upd (new)","allOf":[{"$ref":"#/components/schemas/common.Risk"}]},"status":{"type":"string"},"strategy_id":{"type":"string"},"updated_at":{"type":"integer"}}},"common.Chain":{"type":"object","properties":{"chain_id":{"description":"e.g.: \"ethereum\"","type":"string"},"ecosystem":{"type":"string"},"explorer_url":{"type":"string"},"image_url":{"type":"string"}}},"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}},"core.Metrics":{"type":"object","properties":{"annual_rate":{"description":"out of meta summin up all []meta metrics","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta,omitempty\"` // временно забиваем // won't be shown on getStrategies()","type":"string"},"tvl_usd":{"type":"string"}}},"common.Risk":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"risk_score":{"type":"integer"}}},"common.Page":{"type":"object","properties":{"currentPage":{"description":"page-based pagination","type":"integer"},"id":{"description":"keyset-based pagination","type":"string"},"limit":{"description":"common","type":"integer"},"nextCursor":{"type":"string"},"offset":{"description":"offset-based pagination","type":"integer"},"pageSize":{"type":"integer"},"prevCursor":{"description":"cursor-based pagination","type":"string"},"totalItems":{"type":"integer"},"totalPages":{"type":"integer"},"type":{"type":"string"}}}}}}
```

## The common.Platform object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Platform":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string"}},"chain_ids":{"description":"\"ethereum\"","type":"array","items":{"type":"string"}},"image":{"type":"string"},"platform_id":{"description":"\"gyroscope\"","type":"string"},"platform_name":{"description":"\"Gyroscope\"","type":"string"}}}}}}
```

## The common.PrintablePortalCall object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.PrintablePortalCall":{"type":"object","properties":{"amount_index":{"type":"string"},"data":{"type":"string"},"input_token":{"type":"string"},"target":{"type":"string"}}}}}}
```

## The common.PrintablePortalInput object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The common.Risk object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Risk":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"risk_score":{"type":"integer"}}}}}}
```

## The common.Signature object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Signature":{"type":"object","properties":{"data":{"type":"string"},"from":{"type":"string"},"orderId":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"}}}}}}
```

## The common.SignedOrder object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.SignedOrder":{"type":"object","properties":{"domain":{"type":"object","additionalProperties":true},"types":{"type":"object","additionalProperties":true},"value":{"type":"object","additionalProperties":true}}}}}}
```

## The common.TokenAddress object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The common.TokenFullCurrent object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenFullCurrent":{"type":"object","properties":{"addresses":{"type":"array","items":{"$ref":"#/components/schemas/common.Address"}},"circulating_supply":{"type":"string"},"fdv":{"type":"string"},"group_description":{"type":"string"},"group_name":{"type":"string"},"holders":{"type":"string"},"image":{"type":"string"},"logo_url":{"type":"string"},"market_cap":{"type":"string"},"name":{"type":"string"},"price_usd":{"type":"string"},"symbol":{"type":"string"},"tag_ids":{"type":"array","items":{"type":"string"}},"token_group":{"description":"TODO: add constraints eth, usd, euro, btc, other","type":"string"},"token_id":{"type":"string"},"volume_24h_usd":{"type":"string"}}},"common.Address":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"string"},"decimals":{"type":"integer"}}}}}}
```

## The common.TokenGroup object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenGroup":{"type":"object","properties":{"group_description":{"type":"string"},"group_name":{"type":"string"},"logo_url":{"type":"string"},"token_group":{"description":"TODO: add constraints eth, usd, euro, btc, other","type":"string"}}}}}}
```

## The common.TokenHistory object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenHistory":{"type":"object","properties":{"metrics":{"$ref":"#/components/schemas/common.TokenStats"},"timestamp":{"type":"string"}}},"common.TokenStats":{"type":"object","properties":{"circulating_supply":{"type":"string"},"fdv":{"type":"string"},"holders":{"type":"string"},"market_cap":{"type":"string"},"price_usd":{"type":"string"},"volume_24h_usd":{"type":"string"}}}}}}
```

## The common.TokenStats object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenStats":{"type":"object","properties":{"circulating_supply":{"type":"string"},"fdv":{"type":"string"},"holders":{"type":"string"},"market_cap":{"type":"string"},"price_usd":{"type":"string"},"volume_24h_usd":{"type":"string"}}}}}}
```

## The common.TokenStatsHistory object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenStatsHistory":{"type":"object","properties":{"history":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenHistory"}},"token_id":{"type":"string"}}},"common.TokenHistory":{"type":"object","properties":{"metrics":{"$ref":"#/components/schemas/common.TokenStats"},"timestamp":{"type":"string"}}},"common.TokenStats":{"type":"object","properties":{"circulating_supply":{"type":"string"},"fdv":{"type":"string"},"holders":{"type":"string"},"market_cap":{"type":"string"},"price_usd":{"type":"string"},"volume_24h_usd":{"type":"string"}}}}}}
```

## The common.TokenTag object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenTag":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"tag_id":{"type":"string"}}}}}}
```

## The common.TokenTransfer object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.TokenTransfer":{"type":"object","properties":{"amount":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token":{"type":"string"}}}}}}
```

## The common.Tx object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.Tx":{"type":"object","properties":{"data":{"type":"string"},"from":{"type":"string"},"gasLimit":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"}}}}}}
```

## The common.WalletTx object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The common.ZapQuoteResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.ZapQuoteResponse":{"type":"object","properties":{"fee_amount":{"type":"string"},"fee_amount_usd":{"type":"number"},"fee_token":{"type":"string"},"min_output_amount":{"type":"string"},"min_output_amount_usd":{"type":"number"},"order_id":{"type":"string"},"output_amount":{"type":"string"},"output_amount_usd":{"type":"number"},"output_token":{"type":"string"},"slippage_tolerance_percentage":{"type":"integer"},"steps":{"type":"array","items":{"type":"string"}}}}}}}
```

## The common.ZapTransaction object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"common.ZapTransaction":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/common.Context"},"signedOrder":{"$ref":"#/components/schemas/common.SignedOrder"},"tx":{"$ref":"#/components/schemas/common.Tx"}}},"common.Context":{"type":"object","properties":{"expiry":{"type":"string"},"feeAmount":{"type":"string"},"feeAmountSignedOrder":{"type":"string"},"feeAmountUsd":{"type":"number"},"feeAmountUsdSignedOrder":{"type":"number"},"feeToken":{"type":"string"},"gasLimit":{"type":"string"},"inputAmount":{"type":"string"},"inputAmountUsd":{"type":"number"},"inputToken":{"type":"string"},"isPermit":{"type":"boolean"},"minOutputAmount":{"type":"string"},"minOutputAmountSignedOrder":{"type":"string"},"minOutputAmountUsd":{"type":"number"},"minOutputAmountUsdSignedOrder":{"type":"number"},"orderId":{"type":"string"},"outputAmount":{"type":"string"},"outputAmountSignedOrder":{"type":"string"},"outputAmountUsd":{"type":"number"},"outputAmountUsdSignedOrder":{"type":"number"},"outputToken":{"type":"string"},"partner":{"type":"string"},"rawParams":{"type":"object","additionalProperties":true},"recipient":{"type":"string"},"residualTokens":{"type":"array","items":{"type":"string"}},"route":{"type":"array","items":{"type":"string"}},"routeHash":{"type":"string"},"sender":{"type":"string"},"slippageTolerancePercentage":{"type":"number"},"steps":{"type":"array","items":{"type":"string"}},"stepsSignedOrder":{"type":"array","items":{"type":"string"}},"target":{"type":"string"},"value":{"type":"string"}}},"common.SignedOrder":{"type":"object","properties":{"domain":{"type":"object","additionalProperties":true},"types":{"type":"object","additionalProperties":true},"value":{"type":"object","additionalProperties":true}}},"common.Tx":{"type":"object","properties":{"data":{"type":"string"},"from":{"type":"string"},"gasLimit":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"}}}}}}
```

## The core.CreateAPIKeyRequest object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.CreateAPIKeyRequest":{"type":"object","properties":{"name":{"type":"string"}}}}}}
```

## The core.Engine object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.Engine":{"type":"object","properties":{"routing_engine":{"type":"string"}}}}}}
```

## The core.ErrorResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}}}
```

## The core.EventBalance object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.EventBalance":{"type":"object","properties":{"share_balance":{"type":"string"},"share_balance_usd":{"type":"string"}}}}}}
```

## The core.EventFee object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.EventFee":{"type":"object","properties":{"amount":{"type":"string"},"amount_usd":{"type":"string"},"pct":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The core.EventGas object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.EventGas":{"type":"object","properties":{"amount":{"description":"native token","type":"string"},"amount_usd":{"type":"string"}}}}}}
```

## The core.EventLeg object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.ExecutionConfig object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.ExecutionConfig":{"type":"object","properties":{"input_token_ids":{"type":"array","items":{"type":"string"}},"output_token_ids":{"type":"array","items":{"type":"string"}}}}}}}
```

## The core.Fees object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.Fees":{"type":"object","properties":{"max_fee":{"description":"maximum possible fee","type":"string"},"partner_fee":{"type":"string"},"total_fee":{"type":"string"},"yifi_fee":{"type":"string"}}}}}}
```

## The core.History object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.History":{"type":"object","properties":{"annual_rate":{"description":"out of meta for effective search. NEED ONLY FOR SEARCH. NOT OUTPUT. META ALREADY CONTAINS ALL INFO","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta\"` // временно забиваем","type":"string"},"tvl_usd":{"description":"in usd","type":"string"}}}}}}
```

## The core.Limits object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.Limits":{"type":"object","properties":{"deposits_paused":{"type":"boolean"},"withdrawals_paused":{"type":"boolean"}}}}}}
```

## The core.MarketCurrentResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.MarketCurrentResponse":{"type":"object","properties":{"annual_rate":{"description":"out of meta for effective search","type":"string"},"category":{"type":"string"},"chain":{"type":"string"},"market_id":{"type":"string"},"meta":{},"name":{"type":"string"},"participating_tokens":{"description":"slice of tokenIDs // no need for more for creating a market","type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"platform":{"type":"string"},"rate_format":{"type":"string"},"tvl_usd":{"description":"in usd","type":"string"},"yield_type":{"description":"user inserts","type":"string"}}},"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The core.MarketHistoryResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.MarketHistoryResponse":{"type":"object","properties":{"history":{"description":"category specific history metrics","type":"array","items":{"$ref":"#/components/schemas/core.History"}},"market_id":{"description":"key in portals","type":"string"},"rate_format":{"type":"string"},"yield_type":{"description":"admin inserts","type":"string"}}},"core.History":{"type":"object","properties":{"annual_rate":{"description":"out of meta for effective search. NEED ONLY FOR SEARCH. NOT OUTPUT. META ALREADY CONTAINS ALL INFO","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta\"` // временно забиваем","type":"string"},"tvl_usd":{"description":"in usd","type":"string"}}}}}}
```

## The core.MarketsResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.MarketsResponse":{"type":"object","properties":{"annual_rate":{"description":"out of meta for effective search","type":"string"},"category":{"type":"string"},"chain":{"type":"string"},"market_id":{"type":"string"},"name":{"type":"string"},"participating_tokens":{"description":"slice of tokenIDs // no need for more for creating a market","type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"platform":{"type":"string"},"rate_format":{"type":"string"},"tvl_usd":{"description":"in usd","type":"string"},"yield_type":{"description":"user inserts","type":"string"}}},"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The core.Metrics object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.Metrics":{"type":"object","properties":{"annual_rate":{"description":"out of meta summin up all []meta metrics","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta,omitempty\"` // временно забиваем // won't be shown on getStrategies()","type":"string"},"tvl_usd":{"type":"string"}}}}}}
```

## The core.Msg object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}}}}}
```

## The core.PositionEventView object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionEventsResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionMeta object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionPagination object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.PositionPagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total_events":{"type":"integer"}}}}}}
```

## The core.PositionPnL object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionPnLCosts object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionPnLGross object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionPnLNet object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionToken object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.PositionTokens object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"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"}}}}}}
```

## The core.SettleToken object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.SettleToken":{"type":"object","properties":{"symbol":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The core.StrategiesResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.StrategiesResponse":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string"}},"chain_ids":{"type":"array","items":{"$ref":"#/components/schemas/common.Chain"}},"description":{"type":"string"},"input_tokens":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"metrics":{"$ref":"#/components/schemas/core.Metrics"},"name":{"type":"string"},"output_tokens":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"risk":{"description":"upd (new)","allOf":[{"$ref":"#/components/schemas/common.Risk"}]},"status":{"type":"string"},"strategy_id":{"type":"string"},"updated_at":{"type":"integer"}}},"common.Chain":{"type":"object","properties":{"chain_id":{"description":"e.g.: \"ethereum\"","type":"string"},"ecosystem":{"type":"string"},"explorer_url":{"type":"string"},"image_url":{"type":"string"}}},"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}},"core.Metrics":{"type":"object","properties":{"annual_rate":{"description":"out of meta summin up all []meta metrics","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta,omitempty\"` // временно забиваем // won't be shown on getStrategies()","type":"string"},"tvl_usd":{"type":"string"}}},"common.Risk":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"risk_score":{"type":"integer"}}}}}}
```

## The core.StrategyHistoryResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.StrategyHistoryResponse":{"type":"object","properties":{"history":{"type":"array","items":{"$ref":"#/components/schemas/core.Metrics"}},"rate_format":{"type":"string"},"strategy_id":{"description":"key in portals","type":"string"},"yield_type":{"type":"string"}}},"core.Metrics":{"type":"object","properties":{"annual_rate":{"description":"out of meta summin up all []meta metrics","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta,omitempty\"` // временно забиваем // won't be shown on getStrategies()","type":"string"},"tvl_usd":{"type":"string"}}}}}}
```

## The core.StrategyResponse object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.StrategyResponse":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string"}},"chain_ids":{"description":"upd","type":"array","items":{"$ref":"#/components/schemas/common.Chain"}},"created_at":{"type":"integer"},"description":{"type":"string"},"execution_config":{"$ref":"#/components/schemas/core.ExecutionConfig"},"fee_breakdown":{"$ref":"#/components/schemas/core.Fees"},"input_tokens":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"limits":{"$ref":"#/components/schemas/core.Limits"},"metrics":{"$ref":"#/components/schemas/core.Metrics"},"name":{"type":"string"},"output_tokens":{"type":"array","items":{"$ref":"#/components/schemas/common.TokenAddress"}},"platforms":{"description":"upd (new)","type":"array","items":{"$ref":"#/components/schemas/common.Platform"}},"rate_format":{"type":"string"},"risk":{"description":"upd (new)","allOf":[{"$ref":"#/components/schemas/common.Risk"}]},"routing_engine":{"type":"string"},"status":{"type":"string"},"strategy_id":{"type":"string"},"updated_at":{"type":"integer"},"yield_type":{"type":"string"}}},"common.Chain":{"type":"object","properties":{"chain_id":{"description":"e.g.: \"ethereum\"","type":"string"},"ecosystem":{"type":"string"},"explorer_url":{"type":"string"},"image_url":{"type":"string"}}},"core.ExecutionConfig":{"type":"object","properties":{"input_token_ids":{"type":"array","items":{"type":"string"}},"output_token_ids":{"type":"array","items":{"type":"string"}}}},"core.Fees":{"type":"object","properties":{"max_fee":{"description":"maximum possible fee","type":"string"},"partner_fee":{"type":"string"},"total_fee":{"type":"string"},"yifi_fee":{"type":"string"}}},"common.TokenAddress":{"type":"object","properties":{"address":{"type":"string"},"chain":{"type":"string"},"decimals":{"type":"integer"},"logo_url":{"description":"new","type":"string"},"price_usd":{"type":"string"},"role":{"type":"string"},"symbol":{"type":"string"},"token_id":{"type":"string"}}},"core.Limits":{"type":"object","properties":{"deposits_paused":{"type":"boolean"},"withdrawals_paused":{"type":"boolean"}}},"core.Metrics":{"type":"object","properties":{"annual_rate":{"description":"out of meta summin up all []meta metrics","type":"string"},"timestamp":{"description":"Meta      common.Meta `json:\"meta,omitempty\"` // временно забиваем // won't be shown on getStrategies()","type":"string"},"tvl_usd":{"type":"string"}}},"common.Platform":{"type":"object","properties":{"category_ids":{"type":"array","items":{"type":"string"}},"chain_ids":{"description":"\"ethereum\"","type":"array","items":{"type":"string"}},"image":{"type":"string"},"platform_id":{"description":"\"gyroscope\"","type":"string"},"platform_name":{"description":"\"Gyroscope\"","type":"string"}}},"common.Risk":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"risk_score":{"type":"integer"}}}}}}
```

## The core.ZapQuoteRequest object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"core.ZapQuoteRequest":{"type":"object","properties":{"input_amount":{"description":"The quantity of inputToken to spend in inputToken base units","type":"string"},"input_token":{"description":"The ERC20 token address to spend (e.g. DAI, USDC, etc.). Use address(0) for the native token. Address must be prepended with the network name. (e.g ethereum:0x6B175474E89094C44Da98b954EedeAC495271d0F for DAI)","type":"string"},"output_token":{"description":"The ERC20 token address to receive (e.g. DAI, USDC, etc.). Use address(0) for the native token. Address must be prepended with the network name. (e.g ethereum:0x6B175474E89094C44Da98b954EedeAC495271d0F for DAI)","type":"string"},"partner_fee":{"description":"if partner has set a policy on this strategy, then its fee will be added to fees","type":"string"},"partner_id":{"description":"needed for gateway service to attach it from partners policy response","type":"string"},"sender":{"description":"The address of the owner of the inputToken.","type":"string"},"slippage_tolerance_percentage":{"description":"The maximum acceptable slippage for the portal. Must be a number between 0.1 and 10 (e.g. 0.25 for 0.25%, 2 for 2%). If not set, auto slippage will be used instead (requires that validate is set to true)","type":"string"},"strategy_id":{"type":"string"}}}}}}
```

## The models.APIKey object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.APIKey":{"type":"object","properties":{"api_key":{"description":"essential key to be used by","type":"string"},"created_at":{"type":"string"},"hash":{"description":"чтобы декриптнуть локально","type":"array","items":{"type":"integer"}},"meta":{},"name":{"type":"string"},"prefix":{"type":"string"},"revoked_at":{"type":"string"},"secret_byte":{"description":"this is his secret token to sign, shown just one time","type":"array","items":{"type":"integer"}},"status":{"type":"boolean"}}}}}}
```

## The models.APIKeyFull object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.APIKeyFull":{"type":"object","properties":{"api_key":{"description":"essential key to be used by","type":"string"},"created_at":{"type":"string"},"hash":{"description":"чтобы декриптнуть локально","type":"array","items":{"type":"integer"}},"meta":{},"name":{"type":"string"},"prefix":{"type":"string"},"revoked_at":{"type":"string"},"secret":{"type":"string"},"secret_byte":{"description":"this is his secret token to sign, shown just one time","type":"array","items":{"type":"integer"}},"status":{"type":"boolean"}}}}}}
```

## The models.Balance object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.Balance":{"type":"object","properties":{"available_usd":{"type":"string"},"partner_id":{"type":"string"},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/models.TokenBalanceView"}},"updated_at":{"type":"string"}}},"models.TokenBalanceView":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/models.TokenAmount"},"chain_id":{"type":"integer"},"token_id":{"type":"string"}}},"models.TokenAmount":{"type":"object","properties":{"free":{"description":"Free is accrued but not yet pushed to the TokenDistributor.","type":"string"},"pending":{"description":"Pending is pushed to the TokenDistributor and claimable on-chain.","type":"string"},"total":{"description":"Total = Free + Pending, the whole fee balance for the token.","type":"string"}}}}}}
```

## The models.Chain object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.Chain":{"type":"object","properties":{"chain_id":{"type":"integer"},"chain_name":{"type":"string"},"distributor":{"description":"Distributor is the TokenDistributor contract address on this chain (empty if not deployed)","type":"string"},"provider":{"type":"string"}}}}}}
```

## The models.ClaimAddress object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.ClaimAddress":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"integer"},"created_at":{"type":"string"},"name":{"type":"string"},"partner_id":{"type":"string"},"status":{"type":"boolean"},"updated_at":{"type":"string"}}}}}}
```

## The models.ClaimAddressPublic object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.ClaimAddressPublic":{"type":"object","properties":{"address":{"type":"string"},"chain_id":{"type":"integer"},"name":{"type":"string"},"partner_id":{"type":"string"}}}}}}
```

## The models.FeePolicy object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.FeePolicy":{"type":"object","properties":{"common_fee":{"description":"правило для всех стратегий если не указано иное ниже","type":"string"},"strategies_fee":{"type":"array","items":{"$ref":"#/components/schemas/models.StrategyFee"}}}},"models.StrategyFee":{"type":"object","properties":{"partner_fee_preference":{"type":"string"},"strategy_id":{"type":"string"}}}}}}
```

## The models.Metric object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.Metric":{"type":"object","properties":{"deposits_usd":{"type":"string"},"fees_earned_usd":{"type":"string"},"strategy_id":{"type":"string"},"users_count":{"type":"integer"},"withdrawals_usd":{"type":"string"}}}}}}
```

## The models.Metrics object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.Metrics":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/models.Metric"}},"partner_id":{"type":"string"},"updated_at":{"description":"last time user updated (or us) his summuary (хранится в кэше, обновлять можно руками, можем сами)","type":"string"}}},"models.Metric":{"type":"object","properties":{"deposits_usd":{"type":"string"},"fees_earned_usd":{"type":"string"},"strategy_id":{"type":"string"},"users_count":{"type":"integer"},"withdrawals_usd":{"type":"string"}}}}}}
```

## The models.PartnerFeeClaimRequest object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.PartnerFeeClaimRequest":{"type":"object","properties":{"chain_id":{"type":"string"},"claim_address":{"type":"string"},"is_token_native":{"type":"boolean"},"partner_id":{"type":"string"},"token_id":{"type":"string"}}}}}}
```

## The models.Policy object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.Policy":{"type":"object","properties":{"allow_strategy_ids":{"type":"array","items":{"type":"string"}},"allowed_category_ids":{"type":"array","items":{"type":"string"}},"allowed_chain_ids":{"type":"array","items":{"type":"string"}},"deny_strategy_ids":{"type":"array","items":{"type":"string"}},"fees_policies":{"$ref":"#/components/schemas/models.FeePolicy"},"max_risk_level":{"type":"string"},"min_rate":{"type":"string"},"min_tvl_usd":{"type":"string"},"rate_type":{"type":"string"},"updated_at":{"type":"string"}}},"models.FeePolicy":{"type":"object","properties":{"common_fee":{"description":"правило для всех стратегий если не указано иное ниже","type":"string"},"strategies_fee":{"type":"array","items":{"$ref":"#/components/schemas/models.StrategyFee"}}}},"models.StrategyFee":{"type":"object","properties":{"partner_fee_preference":{"type":"string"},"strategy_id":{"type":"string"}}}}}}
```

## The models.StrategyFee object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.StrategyFee":{"type":"object","properties":{"partner_fee_preference":{"type":"string"},"strategy_id":{"type":"string"}}}}}}
```

## The models.Summary object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.Summary":{"type":"object","properties":{"deposits_usd":{"type":"string"},"fees_earned_usd":{"type":"string"},"from":{"type":"string"},"partner_id":{"type":"string"},"to":{"type":"string"},"updated_at":{"description":"last time user updated (or us) his summuary (хранится в кэше, обновлять можно руками, можем сами)","type":"string"},"users_count":{"type":"integer"},"withdrawals_usd":{"type":"string"}}}}}}
```

## The models.TokenAmount object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.TokenAmount":{"type":"object","properties":{"free":{"description":"Free is accrued but not yet pushed to the TokenDistributor.","type":"string"},"pending":{"description":"Pending is pushed to the TokenDistributor and claimable on-chain.","type":"string"},"total":{"description":"Total = Free + Pending, the whole fee balance for the token.","type":"string"}}}}}}
```

## The models.TokenBalanceView object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.TokenBalanceView":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/models.TokenAmount"},"chain_id":{"type":"integer"},"token_id":{"type":"string"}}},"models.TokenAmount":{"type":"object","properties":{"free":{"description":"Free is accrued but not yet pushed to the TokenDistributor.","type":"string"},"pending":{"description":"Pending is pushed to the TokenDistributor and claimable on-chain.","type":"string"},"total":{"description":"Total = Free + Pending, the whole fee balance for the token.","type":"string"}}}}}}
```

## The models.TxInfo object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"models.TxInfo":{"type":"object","properties":{"amount_sent":{"type":"string"},"chain_id":{"type":"integer"},"claim_id":{"type":"string"},"data":{"description":"Data is the unsigned claim()/claimAll() calldata the partner signs from\ntheir claim address (From) to the distributor (To), value 0.","type":"string"},"from":{"type":"string"},"to":{"type":"string"},"token_id":{"type":"string"},"tx_hash":{"type":"string"}}}}}}
```

## The rest.Response object

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"components":{"schemas":{"rest.Response":{"type":"object","properties":{"code":{"type":"string"},"data":{},"isError":{"type":"boolean"},"message":{"type":"string"},"success":{"type":"boolean"}}}}}}
```
