-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create SCHEMA_AMM (with vault) #48
Conversation
| pair_index | The index of the token in the smart contract (one row for each pair). | number | | ||
| pair_address | The contract address of the pair. | string | | ||
| pair_symbol | The symbol of the pair. | string | | ||
| pair_liquidity | The liquidity available for trading for the pair (24h rolling average, in tokens). | string | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eg if this is a BTC/USD pair, will it be :
base index 0
quote index 1
pair_liquidity - liquidity available for each token?
for other verticals, we just use the amount on the daily / hourly snapshot (00:59:59 or 23:59:59), and we date_trunc the timestamp . probably easier if they are doing it on sql?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datatype for pair_liquidity and pair_liquidity_usd is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah liquidity for each
| liquidation_fees_usd | The total liquidation fees accrued for each pair (24h rolling average, in USD). | number | | ||
| funding_rate | The funding rate for each pair at the time of the snapshot, as a percentage. | number | | ||
| open_fees_usd | The total open fees accrued for each pair (24h rolling average, in USD). | number | | ||
| close_fees_usd | The total close fees accrued for each pair (24h rolling average, in USD). | number | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the difference between this and the same columns in the vault schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's my thinking, if we are tracking a few pairs and not all of them in the vault, we might end up underestimating the total
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vault_fees are toal fees accrued by the protocol.
those fees can only be calculated at the pair level
in the vault, it's usd values, not fees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally we want to get all token amount and usd amount as optional. in case if token price is missing we can still use our internal price table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, sounds fair.
| tvl | Total Value Locked at snapshot, in tokens (one entry for each token in the vault). | number | | ||
| tvl_usd | Total Value Locked at snapshot (TOTAL of all tokens, in USD). | number | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tvl - is this the token amount ? if so maybe lets name it token_amount and token_amount_usd?
also token_address is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find token_amount rather confusing compared to tvl.
I don't think we need any token_address at the vault level, just the vault address, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using sudo as an example here
their SLP is one vault, so shouldnt there be token address to identify the correct asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, i'll add it.
| amount_useful_usd | The amount of liquid tokens supplied in USD. | number | | ||
| liquidated_amount | The amount of tokens liquidated from the LP (when the taker has positive PnL if a position is closed), decimal normalized. | number | | ||
| liquidated_amount_usd | The amount liquidated, in USD. | number | | ||
| total_lp_fees_usd | Total fees generated for the LP at the time of snapshot (in USD). | number | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
total_lp_fees_usd
- is this the amount of fee that is earned by the individual LP provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's in the LP snapshot, so for each LP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this field seems difficult to calculate here, but we can leave it here and wait for team's feedback
No description provided.