<template>
  <v-card title="Dexorder Fee Schedule">
    <h2>Fill Fee</h2>
    <v-card-text>
      Dexorder charges the same fee as the Uniswap pool you trade, capped at a maximum of 0.15%.
    </v-card-text>
    <v-table>
      <thead>
        <tr>
          <th>Uniswap Pool Fee</th>
          <th>Dexorder Fee</th>
          <th>Total Fee</th>
        </tr>
      </thead>
      <tbody>
        <tr><td>0.01%</td><td>0.01%</td><td>0.02%</td></tr>
        <tr><td>0.05%</td><td>0.05%</td><td>0.10%</td></tr>
        <tr><td>0.30%</td><td>0.15%</td><td>0.45%</td></tr>
        <tr><td>1.00%</td><td>0.15%</td><td>1.15%</td></tr>
      </tbody>
    </v-table>

    <h2>Gas Fees</h2>
    <v-card-text>
      In order to execute multi-tranche orders at various future times, Dexorder charges an up-front gas fee to cover
      the cost of all future smart contract calls required to fill your order. These gas fees depend on how many
      tranches are in your order and whether the order triggers a conditional order (stop-loss or take-profit). These
      gas fees are collected in native currency (ETH) and are included in your initial order placement transaction.
      This means your wallet will display the total gas cost for your entire order when you first place it.
    </v-card-text>
    <v-card-text>
      Once you place your order, you will never be charged additional gas fees. Dexorder's up-front gas charge is
      treated like an insurance fund, guaranteeing future execution of your order, even if the price of gas increases
      significantly. If your order does not execute all of its tranches or is cancelled, the gas fee is not refunded.
    </v-card-text>
    <v-card-text>
      Dexorder does not seek to profit from gas fees. They are designed to cover our cost of triggering your order
      multiple times in the future.
    </v-card-text>
    <v-card-text>
      The formula for computing your gas cost is:
      ```javascript
      // Standard order without any conditional order
      totalGasCost = trancheFee * numberOfTranches;

      // Order which triggers a conditional order (stop-loss or take-profit)
      totalGasCost = (trancheFee + orderFee) * estimatedExecutions + trancheFee * estimatedConditionalExecutions;

      estimatedExecutions = numberOfTranches / rateLimit;
      ```

      `trancheFee` and `orderFee` are specified by the `FeeManager` contract and may be adjusted on an hourly basis.
      These fee adjustments have important limits and cannot be set to arbitrarily high values. See the
      <a href="https://github.com/dexorder-trade/contract/blob/master/src/core/FeeManager.sol">
        FeeManager source code
      </a>, which describes the security measures.

      The `estimatedExecutions` is computed as the number of tranches in the order, divided by any rate limit. For
      example, if the rate limit is 20% per hour, then there will be at least 5 executions required to fill the total
      amount, so the number of tranches is multiplied by 5 (same as dividing by 20%).

      View the [source code for fees](https://github.com/dexorder-trade/contract/blob/master/src/core/OrderLib.sol#L20).

    </v-card-text>
    <v-card-text>
      Tranche
    </v-card-text>
    <v-card-text>

    </v-card-text>

  </v-card>

</template>

<script setup>

</script>

<style scoped lang="scss">

</style>