> ## Documentation Index
> Fetch the complete documentation index at: https://guides.koinx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom File - Deep Dive

> Use the Custom File template to bring unsupported or legacy exchanges into KoinX so every crypto transaction is included in your portfolio and crypto tax calculations.

<Card title="AI Summary" icon="sparkles">
  * It requires more manual effort, but it works for **literally any transaction source**.
  * Use **Custom File** when your exchange or transaction source is **not supported in KoinX integrations**
  * Download the template from **Integrations → Custom File → Download Template File**
  * Every row in the file represents **one transaction**
  * Three fields must always be filled: **Date and Time (UTC)**, **Type**, and **Label**
  * Other fields depend on **what happened in that transaction**
  * Upload the completed template under **Integrations → Add Integration → Custom File**
  * Only files in **KoinX Custom File template format** are accepted
</Card>

***

## When Should You Use Custom File?

Not every exchange or transaction source is supported directly in KoinX's integration library.

**Maybe you:**

* traded on a smaller regional exchange
* executed OTC deals
* used a platform that no longer exists
* received crypto from an external wallet
* interacted with DeFi platforms that don't have a native integration

For situations like these, **Custom File** is the universal fallback. Instead of connecting an exchange or wallet, you upload your transaction history using **KoinX's standardised template format**.

<Tip>
  If the exchange **is supported in KoinX**, always use the **native integration or exchange file upload** instead.

  Custom File should be treated as the **last resort**.
</Tip>

***

## How Custom File Works

The Custom File template is a **structured spreadsheet**.

Each row describes **one transaction**, including:

* what happened
* which assets moved
* how much was sent or received
* any fees involved

KoinX reads this data and reconstructs the transaction history. Think of it as **manually describing your crypto activity to the system**.

***

## How to Upload a Custom File

<Steps>
  <Step title="Click Add Integration." />

  <Step title="Select Custom File from the integrations list.">
    You will see a page titled Integrate Custom File with an auto-generated wallet name such as: <kbd>Custom File-1</kbd>
  </Step>

  <Step title="Click Download Template File.">
    This downloads the official **KoinX Custom File template spreadsheet**.
  </Step>

  <Step title="Open and Fill the Document">
    Only files using this exact format can be uploaded. Open the template in **Excel or Google Sheets**. Each row represents **one transaction**.

    Fill the fields according to the guide below.
  </Step>

  <Step title="Return to the Custom File integration page." />

  <Step title="Upload the File" />

  <Step title="Click Submit">
    KoinX will process the file and import the transactions.
  </Step>
</Steps>

<Note>
  The Custom File upload area **only accepts files in KoinX template format**.

  You **cannot upload a raw exchange CSV** here.

  If your exchange is supported in KoinX, use the **exchange-specific file upload integration** instead.
</Note>

***

## Understanding the Template Structure

The template contains **multiple columns** so it can support **every possible crypto transaction type**. However, **not every column applies to every transaction**.

We're dividing this template to two parts:

1. Required Fields
2. Transaction Data Fields

This allows the template to represent **any crypto activity**. Let's dive deeper to understand these fields and what values are to be entered:

***

### Required Fields (Always Needed)

These fields must be filled **for every row**. If any are missing, the file will fail to upload.

1. **Date and Time (UTC)**
   This is the **exact timestamp of the transaction**.
   Format: <kbd>YYYY-MM-DD HH:MM:SS</kbd>\
   Example: 2023-05-30 14:34:25
   <Note>
     1. Must use **24-hour format**
     2. Must be **UTC timezone**
     3. Avoid letting Excel auto-format dates. A safe approach is to **copy the example timestamp from the template** and edit it. Spreadsheet software sometimes silently changes date formats, which can break the import.
   </Note>
2. **Type**
   The **Type** describes the broad category of the transaction.
   Allowed values:
   | Type          | Description                    |
   | :------------ | :----------------------------- |
   | Trade         | Exchange one asset for another |
   | Deposit       | Receiving crypto               |
   | Withdrawal    | Sending crypto                 |
   | Margin Trade  | Margin trading transactions    |
   | Futures Trade | Futures trading transactions   |
   | Expense       | Fees and costs                 |
3. **Label**
   Label adds **more detail about the transaction**. The allowed labels depend on the **Type** you selected.
   For example:
   | Type                                                                                       | Supported Labels                                                                                                                                                                                                                                                                                    |
   | :----------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Trade Margin TradeFutures Trade**                                                        | Swap, Buy, Sell, Swap <br /><br />*Note - Swap is only for Trade type*                                                                                                                                                                                                                              |
   | **Deposit**                                                                                | External Deposit, Collateral Unlock, Refund, <br />Reward, Airdrop, Staking Interest, Fixed Deposit Unlock,<br />Borrow, Lend Settlement, Receive from Pool, Receive Loan,<br />Funding Interest, Futures Realised Profit, Options Realised Profit, <br />Salary, Mining Income, Consultancy Income |
   | **Withdrawal**                                                                             | External Withdraw, Collateral Lock, Lend<br />Fixed Deposit Lock, <br />Borrow Settlement, Send to Pool, Repay Loan<br />Funding Fee, Futures Realised Loss, Options Realised Loss,<br />Donation                                                                                                   |
   | **Expense**                                                                                | Futures Fee, Options Fee, Brokerage or Gas Fee, <br />Margin Interest Payment,<br />Mining Expense, Consultancy Expense                                                                                                                                                                             |
   | Labels must **match the Type**. Using an incompatible label will cause the upload to fail. |                                                                                                                                                                                                                                                                                                     |
   | Example:                                                                                   |                                                                                                                                                                                                                                                                                                     |
   ```text theme={null}
   Deposit → Airdrop
   Trade → Buy
   Expense → Gas Fee
   ```

### Transaction Data Fields

The remaining fields describe **what assets moved in the transaction**.

You only fill the fields relevant to that transaction.

1. **Received Asset Fields**
   Use these when crypto was **received**.
   | Field                                                                          | Description                                                               |
   | :----------------------------------------------------------------------------- | :------------------------------------------------------------------------ |
   | Received Coin                                                                  | The asset received (BTC, ETH, USDT, etc.)                                 |
   | Received Coin Amount                                                           | Quantity received                                                         |
   | Received Coin Amount in <br />Base Currency                                    | Value in your base currency for entire quantity<br />(USD, EUR, INR etc.) |
   | Example: I received 1.5 ETH and the price during the transaction was 3000 USD. |                                                                           |
   ```text theme={null}
   Received Coin: ETH
   Received Coin Amount: 1.5
   Received Coin Amount in Base Currency: 4500 USD
   ```
2. **Sent Asset Fields**
   Use these when crypto was **sent**.
   | Field                             | Description            |
   | :-------------------------------- | :--------------------- |
   | Sent Coin                         | The asset sent         |
   | Sent Coin Amount                  | Quantity sent          |
   | Sent Coin Amount in Base Currency | Value in base currency |
   | Example:                          |                        |
   ```text theme={null}
   Sent Coin: USDT
   Sent Coin Amount: 2500
   ```
3. **Fee Fields**
   Use these when a **transaction fee** was paid.
   | Field                            | Description                |
   | :------------------------------- | :------------------------- |
   | Fee Coin                         | Asset used to pay the fee  |
   | Fee Coin Amount                  | Fee amount                 |
   | Fee Coin Amount in Base Currency | Fee value in base currency |
   | Example:                         |                            |
   ```text theme={null}
   Fee Coin: ETH
   Fee Coin Amount: 0.002
   ```
4. TDS Fields
   These apply **only when tax was deducted at source**.
   Primarily relevant for **Indian exchanges**.
   | Field                            | Description                     |
   | :------------------------------- | :------------------------------ |
   | TDS Coin                         | Asset in which TDS was deducted |
   | TDS Coin Amount                  | Quantity deducted               |
   | TDS Coin Amount in Base Currency | Value of TDS                    |
   | If no TDS applies:               |                                 |
   ```text theme={null}
   TDS Coin = -
   TDS Coin Amount = 0
   ```
5. **Address and Hash Fields**
   These are useful for **blockchain transactions**.
   | Field                    | Description                |
   | :----------------------- | :------------------------- |
   | From Address             | Source wallet address      |
   | To Address               | Destination wallet address |
   | Transaction Hash         | Blockchain transaction ID  |
   | If unknown: <kbd>-</kbd> |                            |
6. **Token Contract Fields**
   These identify tokens on **EVM chains**.
   | Field                          | Description                       |
   | :----------------------------- | :-------------------------------- |
   | Received Coin Contract Address | Token contract for received asset |
   | Sent Coin Contract Address     | Token contract for sent asset     |
   <Info>
     Only required for **less common tokens**.
   </Info>

***

## Rules for Empty Fields

Do **not leave cells blank**. Use placeholders.

| Field Type            | Value to Enter |
| :-------------------- | :------------- |
| Coin fields           | `-`            |
| Amount fields         | `0`            |
| Address / hash fields | `-`            |

Example:

```text theme={null}
No coin received → Received Coin = -
No amount received → Received Coin Amount = 0
```

***

## Sample Scenarios:

<Accordion title="Buying ETH using USDT">
  Type: Trade\
  Label: Buy

  Example: Received 1.5 ETH and Sent 2850 USDT

  ```text theme={null}
  2023-05-30 14:34:25 | Trade | Buy | ETH | 1.5 | 0 | USDT | 2850 | 0
  ```
</Accordion>

<Accordion title="Receiving an Airdrop">
  Type: Deposit\
  Label: Airdrop

  Example - Received 500 ARB tokens

  ```text theme={null}
  2023-06-15 09:00:00 | Deposit | Airdrop | ARB | 500 | 0
  ```
</Accordion>

<Accordion title="Sending BTC to another wallet">
  Type: Withdrawal\
  Label: External Withdraw

  Example - Sent 0.1 BTC

  ```text theme={null}
  2023-06-20 10:00:00 | Withdrawal | External Withdraw | - | 0 | BTC | 0.1
  ```
</Accordion>

<Accordion title="Paying Gas Fees">
  Type: Expense\
  Label: Brokerage or Gas Fee

  Example - Paid gas fee of 0.003 ETH

  ```text theme={null}
  2023-07-01 18:22:10 | Expense | Brokerage or Gas Fee | - | 0 | ETH | 0.003
  ```
</Accordion>

***

## Common Issues and Fixes

<Accordion title="Upload fails with &#x22;Invalid Format&#x22;">
  Most common cause:

  1. Incorrect timestamp format.\
     Make sure the format is: YYYY-MM-DD HH:MM:SS. And that the timezone is UTC.
  2. Label does not match Type\
     Example mistake: Type: Trade and Label: Airdrop\
     This will fail because **Airdrop is only allowed for Deposit**.
</Accordion>

<Accordion title="Missing transaction details">
  If you don't know certain values:

  * Use `0` for amounts
  * Use `-` for coin names or addresses

  Even partial data can still be processed.
</Accordion>

<Accordion title="Uploading more transactions later">
  You can upload **multiple files** to the same Custom File integration.

  Each upload will **add new transactions**.
</Accordion>

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Can I upload a regular exchange CSV?">
    No. The Custom File integration **only accepts KoinX template format**.

    Use the exchange-specific integration if available.
  </Accordion>

  <Accordion title="What happens if base currency values are 0?">
    KoinX will try to determine the market price at that timestamp using its pricing data.

    Providing values manually may improve accuracy for obscure tokens.
  </Accordion>

  <Accordion title="Do I need to fill TDS fields?">
    Only if **TDS was actually deducted**.

    Otherwise:

    ```text theme={null}
    TDS Coin = -
    TDS Coin Amount = 0
    ```
  </Accordion>

  <Accordion title="Can KoinX create the custom file for me?">
    Yes, KoinX offers custom file creation as a chargeable service. The cost depends on the transaction count and complexity of the transaction types.
  </Accordion>
</AccordionGroup>
