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

# Zap

Execution layer: quotes + tx payloads for zap/unzap, and execution tracking

## Get transaction info

> Get zap transaction info by execution id.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Execution layer: quotes + tx payloads for zap/unzap, and execution tracking","name":"Zap"}],"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.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"}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/tx/{execution_id}":{"get":{"description":"Get zap transaction info by execution id.","tags":["Zap"],"summary":"Get transaction info","parameters":[{"schema":{"type":"string"},"description":"execution id","name":"execution_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.ZapTransaction"}}}]}}}},"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"}}}}}}}}}
```

## Build zap

> Build zap transaction signature.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Execution layer: quotes + tx payloads for zap/unzap, and execution tracking","name":"Zap"}],"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.Signature":{"type":"object","properties":{"data":{"type":"string"},"from":{"type":"string"},"orderId":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}},"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"}}}}},"paths":{"/zap/build":{"post":{"description":"Build zap transaction signature.","tags":["Zap"],"summary":"Build zap","parameters":[{"schema":{"type":"string"},"description":"Partner ID","name":"X-YIFI-PARTNER-ID","in":"header"},{"schema":{"type":"string"},"description":"API key","name":"X-YIFI-API-KEY","in":"header"},{"schema":{"type":"string"},"description":"Timestamp in milliseconds","name":"X-YIFI-NONCE","in":"header"},{"schema":{"type":"string"},"description":"HMAC-SHA256 signature","name":"X-YIFI-SIGN","in":"header"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/rest.Response"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/common.Signature"}}}]}}}},"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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ZapQuoteRequest"}}},"description":"zap quote request","required":true}}}}}
```

## Get zap quote

> Get zap quote from core service.

```json
{"openapi":"3.1.1","info":{"title":"YiFi Yield Aggregator – Data Gateway API","version":"v1"},"tags":[{"description":"Execution layer: quotes + tx payloads for zap/unzap, and execution tracking","name":"Zap"}],"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.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"}}}},"core.Msg":{"type":"object","properties":{"message":{"type":"string"}}},"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"}}}}},"paths":{"/zap/quote":{"post":{"description":"Get zap quote from core service.","tags":["Zap"],"summary":"Get zap quote","parameters":[{"schema":{"type":"boolean"},"description":"partner flag","name":"partner","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/rest.Response"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/common.ZapQuoteResponse"}}}]}}}},"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"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/core.ZapQuoteRequest"}}},"description":"zap quote request","required":true}}}}}
```
