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

# 手续费结构

> V5 创建、交易、推荐、借贷、金库以及旧 V3 手续费说明。

LFG.RICH V5 的手续费由协议合约自动处理。

<CardGroup cols={2}>
  <Card title="创建费用" icon="rocket">
    代币创建使用 Factory 当前创建费用，加上创建者可选初始买入的 `devBuyEth`。
  </Card>

  <Card title="交易手续费" icon="arrow-right-arrow-left">
    V5 买入和卖出使用固定 1.25% 总交易手续费。
  </Card>

  <Card title="推荐拆分" icon="people-arrows">
    推荐状态有效时，1.00% 交易奖励给用户的 initial inviter。
  </Card>

  <Card title="借贷费用" icon="landmark">
    借款有一次性 3.00% 费用；可用时，2.00% 奖励会路由给 direct parent。
  </Card>
</CardGroup>

<Warning>
  旧文档中提到的创建者选择 1% 到 10% 交易手续费属于旧 V3 流程。V5 使用固定协议手续费常量。
</Warning>

## 代币创建费用

代币创建使用 Factory 当前的创建费用：

```solidity theme={null}
function creationFee() view returns (uint256);
```

V5 创建函数还接受 `devBuyEth`，即创建者可选的初始买入金额：

```solidity theme={null}
function createToken(
    string name,
    string symbol,
    uint256 devBuyEth
) payable returns (address token, bytes32 poolId);
```

`msg.value` 必须覆盖：

```txt theme={null}
creationFee + devBuyEth
```

多余金额应由合约流程退回。

## 交易手续费

V5 买入和卖出使用固定总交易手续费：

| 手续费组成  |    比率 | 接收方                               |
| ------ | ----: | --------------------------------- |
| 总交易手续费 | 1.25% | 根据推荐状态拆分                          |
| 平台手续费  | 0.25% | 平台 / Factory 侧                    |
| 邀请人手续费 | 1.00% | 用户的 initial inviter；如果没有邀请人则进入平台侧 |

Hook 暴露以下常量：

```solidity theme={null}
function TOTAL_FEE_BPS() view returns (uint256);       // 125
function PLATFORM_FEE_BPS() view returns (uint256);    // 25
function INVITER_FEE_BPS() view returns (uint256);     // 100
function BPS_DENOMINATOR() view returns (uint256);     // 10000
```

买入示例：

```txt theme={null}
用户发送:        1.0000 BNB
总手续费:        0.0125 BNB
平台部分:        0.0025 BNB
邀请人部分:      0.0100 BNB
进入曲线净额:    0.9875 BNB
```

如果交易者未绑定推荐树，邀请人部分会进入平台侧，而不是发送给用户邀请人。

## 借贷手续费

借贷有固定一次性 3% 手续费：

| 手续费组成         |    比率 | 接收方                             |
| ------------- | ----: | ------------------------------- |
| 总借贷手续费        | 3.00% | 根据推荐状态拆分                        |
| 借贷平台手续费       | 1.00% | 平台 / Factory 侧                  |
| 借贷 parent 手续费 | 2.00% | 用户的直接 parent；如果没有 parent 则进入平台侧 |

Hook 常量：

```solidity theme={null}
function BORROW_FEE_BPS() view returns (uint256);           // 300
function BORROW_PLATFORM_FEE_BPS() view returns (uint256);  // 100
function BORROW_PARENT_FEE_BPS() view returns (uint256);    // 200
```

重要区别：

* 交易奖励给用户的 **initial inviter**；
* 借贷奖励给用户的 **direct parent**。

## 旧 V3 手续费模型

旧 V3 示例可能包含代币级别的创建者自选交易手续费和 floor boost 部分。除非页面明确在记录旧 V3，否则不要在新的 V5 文档或 V5 示例中使用该模型。
