or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Lyra v2 liquidations
Mainnet constants
Explorer URL: https://explorer.lyra.finance
RPC URL: https://rpc.lyra.finance
ChainID: 957
Bidding/Margin helper
Helper contract to make the bidding process simpler, but this is unaudited and somewhat higher risk as you have to approve it to access your full subaccount.
code can be found here: https://github.com/lyra-finance/v2-matching/blob/master/src/periphery/LyraAuctionUtils.sol
This was deployed to testnet with address: 0x69812bDf2b6466E8e40A9790105e547d9Aed77B7
Bidding script
Glossary
Running the liquidation scripts
pnpm i
cp .env.mainnet.example .env
--help
to see more options. E.g.pnpm cmd liquidationFlow --help
pnpm cmd setupLiquidationAccs -t <tradingDepositAmt> -b <biddingDepositAmt>
tradingDepositAmount
: Amount of total funds to deposit into the trading account. There are the funds you want to trade with.bidderDepositAmount
: Amount of total funds to prepare to use as collateral in bidding. These are not accessible on the exchange.pnpm cmd getAllCurrentAuctions
pnpm cmd liquidationFlow -d -p 0.1 -c <collateralAmt> <accountToLiquidate>
-m
(merge) flag:-d
(deposit) flag:Flagging accounts
https://gist.github.com/0xdomrom/663e6a83ea08a439497c99a49770d314
Here is the logic for scraping all subaccounts + fetching balances + margin requirements (using the contract above for margin reqs). Wont work as is, has a bunch of imports I'd need to compile into a single file to work.
This also:
which both would improve efficiency tremendously
Logic starts at FlagAccounts.run_job().
Once you've figured out that an account is below margin requirements, you can atomically flag + bid using the function in the utils contract, or you can flag and then wait for a larger discount.
Testnet
This whole process can be run on testnet. Follow the same instructions but use
.env.testnet.example
instead of.env.mainnet.example
Testnet constants
Explorer URL: https://explorerl2new-prod-testnet-0eakp60405.t.conduit.xyz/
RPC URL: https://l2-prod-testnet-0eakp60405.t.conduit.xyz
ChainID: 901