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

# ribbon_v1_avalanche

> Tables in tt-contracts.ribbon_v1_avalanche

## Tables

### MarginPool\_TransferToPool\_event

Asset deposits into Ribbon Finance margin pools emitted when users transfer collateral to the pool contract. Records user address, asset contract address, and deposit amount for tracking collateral movements in options vault strategies.

<Accordion title="Columns">
  | Column             | Type        | Description                                                                                                                                          |
  | ------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `block_timestamp`  | `TIMESTAMP` | Timestamp when the block was produced. UTC timezone, millisecond precision.                                                                          |
  | `block_number`     | `INT64`     | Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block's position in the blockchain. |
  | `transaction_hash` | `STRING`    | Unique identifier for the transaction. 66-character hex string including 0x prefix.                                                                  |
  | `log_index`        | `INT64`     | Position of the event within the block's transaction logs. Zero-indexed integer representing the sequential order of log emission.                   |
  | `address`          | `STRING`    | Contract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string.                                                              |
  | `removed`          | `BOOL`      | Boolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization.                                         |
  | `in_asset`         | `STRING`    | Contract address of the asset or token. Hex-encoded, 0x-prefixed, 42-character string.                                                               |
  | `in_user`          | `STRING`    | Address of the user account associated with the transaction or protocol operation. Hex-encoded, 0x-prefixed, 42-character string.                    |
  | `in_amount`        | `STRING`    | Input amount for the swap, transaction, or operation. Numeric string representation of token quantity in smallest denomination.                      |
</Accordion>

<Accordion title="Sample Data">
  | address                                    | in\_user                                   | removed | in\_asset                                  | in\_amount              | log\_index | block\_number | block\_timestamp         | transaction\_hash                                                  |
  | ------------------------------------------ | ------------------------------------------ | ------- | ------------------------------------------ | ----------------------- | ---------- | ------------- | ------------------------ | ------------------------------------------------------------------ |
  | 0xccf6629aeab734e621cc59ebb0297196774fdb9d | 0x6bf686d99a4ce17798c45d09c21181fac29a9fb3 | false   | 0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be | 10039681837431460402289 | 10         | 29621795      | 2023-05-05T09:57:11.000Z | 0x7da540e67c9399ac5639b077289c0acb81860c821292d466b4d8c4c71bdeb45e |
  | 0xccf6629aeab734e621cc59ebb0297196774fdb9d | 0x98d03125c62dae2328d9d3cb32b7b969e6a87787 | false   | 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7 | 12905720700724335956170 | 4          | 29621688      | 2023-05-05T09:53:36.000Z | 0xa8c0ad287d42fec31c5379242331c60bd5556c72ca5f7ed3ac2c7c127254be56 |
  | 0xccf6629aeab734e621cc59ebb0297196774fdb9d | 0x98d03125c62dae2328d9d3cb32b7b969e6a87787 | false   | 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7 | 11861224559582515541246 | 4          | 34635845      | 2023-09-01T09:56:10.000Z | 0x6ff89c607befb460785f4611490d47c9024ca66abe59c6689e4c13061bc487f8 |
</Accordion>

<Accordion title="Example Query">
  **Query with partition filter**

  ```sql theme={null}
  SELECT *
  FROM `tt-contracts.ribbon_v1_avalanche.MarginPool_TransferToPool_event`
  WHERE block_timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
  LIMIT 100
  ```
</Accordion>

***

### MarginPool\_TransferToUser\_event

Asset transfer events from Ribbon Finance margin pool contracts recording withdrawals to user accounts. Contains user address, asset token address, and transfer amount for tracking collateral movements and liquidity operations.

<Accordion title="Columns">
  | Column             | Type        | Description                                                                                                                                          |
  | ------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `block_timestamp`  | `TIMESTAMP` | Timestamp when the block was produced. UTC timezone, millisecond precision.                                                                          |
  | `block_number`     | `INT64`     | Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block's position in the blockchain. |
  | `transaction_hash` | `STRING`    | Unique identifier for the transaction. 66-character hex string including 0x prefix.                                                                  |
  | `log_index`        | `INT64`     | Position of the event within the block's transaction logs. Zero-indexed integer representing the sequential order of log emission.                   |
  | `address`          | `STRING`    | Contract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string.                                                              |
  | `removed`          | `BOOL`      | Boolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization.                                         |
  | `in_asset`         | `STRING`    | Contract address of the asset or token. Hex-encoded, 0x-prefixed, 42-character string.                                                               |
  | `in_user`          | `STRING`    | Address of the user account associated with the transaction or protocol operation. Hex-encoded, 0x-prefixed, 42-character string.                    |
  | `in_amount`        | `STRING`    | Input amount for the swap, transaction, or operation. Numeric string representation of token quantity in smallest denomination.                      |
</Accordion>

<Accordion title="Sample Data">
  | address                                    | in\_user                                   | removed | in\_asset                                  | in\_amount               | log\_index | block\_number | block\_timestamp         | transaction\_hash                                                  |
  | ------------------------------------------ | ------------------------------------------ | ------- | ------------------------------------------ | ------------------------ | ---------- | ------------- | ------------------------ | ------------------------------------------------------------------ |
  | 0xccf6629aeab734e621cc59ebb0297196774fdb9d | 0x98d03125c62dae2328d9d3cb32b7b969e6a87787 | false   | 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7 | 256524259989679921113046 | 72         | 10164817      | 2022-01-28T10:57:29.000Z | 0xa00479d59ba907c6229bc2c00aae3af817a2aa938b90487a5331d80fac822b48 |
  | 0xccf6629aeab734e621cc59ebb0297196774fdb9d | 0x6bf686d99a4ce17798c45d09c21181fac29a9fb3 | false   | 0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be | 9264790652264428961042   | 1          | 23999929      | 2022-12-23T09:10:07.000Z | 0xd9c5a2099b26e14b468b679ea5bcf7ebc66b679e1fb601c7da899f9b722b10b6 |
  | 0xccf6629aeab734e621cc59ebb0297196774fdb9d | 0x98d03125c62dae2328d9d3cb32b7b969e6a87787 | false   | 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7 | 20120005661554317614418  | 1          | 23999930      | 2022-12-23T09:10:09.000Z | 0xe853b2c4d53a5a480529c24268161b41ad7f715a722ab02fe9cefbfc4df0e3c0 |
</Accordion>

<Accordion title="Example Query">
  **Query with partition filter**

  ```sql theme={null}
  SELECT *
  FROM `tt-contracts.ribbon_v1_avalanche.MarginPool_TransferToUser_event`
  WHERE block_timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
  LIMIT 100
  ```
</Accordion>

***
