# FluidDexRegularPayback

### Description

Payback debt to Fluid Vault T2 (2\_col:1\_debt, smart collateral vault)

> This sdk action uses FluidDexPayback as underlying smart contract.

### Action ID

`0x1de2c822`

### SDK Action

```ts
const fluidDexRegularPaybackAction = new dfs.actions.fluid.FluidDexRegularPaybackAction(
    vault,
    from,
    nftId,
    paybackAmount
);
```

### Action Type

`STANDARD_ACTION`

### Input Parameters

{% hint style="info" %}
SDK will set **PaybackVariableData** as empty for regular payback action
{% endhint %}

```solidity
    /// @param debtAmount0 Amount of debt token 0 to payback.
    /// @param debtAmount1 Amount of debt token 1 to payback.
    /// @param minDebtShares Min amount of debt shares to burn. Can be empty for max payback (see maxAmountToPull)
    /// @param maxAmountToPull Maximum amount of debt token to pull from the user. Only used for max payback when:
    /// 1. variableData.debtAmount0 == type(uint256).max -> all debt will be paid back in debt token0.
    ///    Any existing amount of debt token1 will be converted to debt token0 on fluid.
    /// 2. variableData.debtAmount1 == type(uint256).max -> all debt will be paid back in debt token1.
    ///    Any existing amount of debt token0 will be converted to debt token1 on fluid.
    struct PaybackVariableData {
        uint256 debtAmount0;
        uint256 debtAmount1;
        uint256 minDebtShares;
        uint256 maxAmountToPull;
    }
    
    /// @param vault The address of the Fluid DEX vault.
    /// @param from Address to pull the debt tokens from.
    /// @param nftId The NFT ID of the position.
    /// @param paybackAmount The amount of debt to payback. Used if vault is T2.
    /// @param paybackVariableData Variable data for payback action. Used if vault is T3 or T4.
    struct Params {
        address vault;
        address from;
        uint256 nftId;
        uint256 paybackAmount;
        FluidDexModel.PaybackVariableData paybackVariableData;
    }
```

### Return Value

{% hint style="info" %}
For regular payback action, return value will represent payback amount
{% endhint %}

```solidity
return bytes32(paybackAmountOrBurnedShares);
```

### Events and Logs

```solidity
emit ActionEvent("FluidDexPayback", logData);
logger.logActionDirectEvent("FluidDexPayback", logData);
bytes memory logData = abi.encode(params);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defisaver.com/actions/fluid/fluiddexregularpayback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
