# Loopfi for Saddle
###### tags: `Deployed Contracts`
## Prepare to deploy
***Locker:***
1. maximumBoostPayment: 0, lock 时的 donate 比率最大值。
2. boostRate: 10000, 100%
3. nextMaximumBoostPayment: 0,
4. nextBoostRate: 10000, 100%
5. minimumStake: 10000,从locker存储到staking proxy 的最小比率值
6. maximumStake: 10000,从locker存储到staking proxy 的最大比率值
7. stakeOffsetOnLock: 500,从locker存储到staking proxy 的偏差比率值
8. kickRewardEpochDelay: 4,解锁时间之后的延长自行取回的epoch 时间,即到期4个epoch后,其他用户可以帮用户kick.
9. kickRewardPerEpoch: 100,kick用户时,获取的奖励比率,1%?
// 给locker添加reward token
addReward(
address _rewardsToken,
address _distributor,
bool _useBoost
)
***LpfStakingProxy:***
1. callIncentive: 100, 获取奖励分发时,调用者获取奖励的比率, 1%
***LPFRewardPool:***
1. newRewardRatio: 830,新earmark的奖励打入后,奖励是累加进本阶段还是不做处理的界限比率值。
***SdlBaseRewardPool:***
1. newRewardRatio: 830,新earmark的奖励打入后,奖励是累加进本阶段还是不做处理的界限比率值。
***SdlVirtualBalanceRewardPool:***
1. newRewardRatio: 830,新earmark的奖励打入后,奖励是累加进本阶段还是不做处理的界限比率值。
***SdlBooster:***
1. lockIncentive:1000; //incentive to sdl stakers
2. stakerIncentive:450; //incentive to native token stakers
3. earmarkIncentive:50; //incentive to users who spend gas to make calls
4. platformFee:0; //possible fee to build treasury
5. MaxFees:2000; 以上所有费用的总和最大值
***SdlDepositor:***
1. lockIncentive:10, deposit 时同时lock的奖励比率,0.1%
---
## Trigger actions
### 1. Lock SDL into veSDL
- Trigger lock
```javascript
await depositor.lockSaddle()
```
- Get trigger incentive
```javascript
await depositor.incentiveSdl()
```
### 2. Earmark SDL reward
- Get LP Pool counts
```javascript
const len = await booster.poolLength();
```
- Trigger earmark
```javascript!
// Trigger earmark for Pool 0
await booster.earmarkRewards(0);
```
- Get trigger incentive
```javascript
await booster.callStatic.earmarkRewards(0);
```
### 3. Reward Distribute for LPF Locker:
LpfStakingProxy: [ABI](https://github.com/dforce-network/Stranger/blob/saddle/abi/IStakingProxy.json)
1. 分发locker的奖励: LpfStakingProxy.distribute()
- Get trigger incentive
```javascript
await LpfStakingProxy.callStatic.distribute();
```
2. 分发locker的extra奖励:LpfStakingProxy.distributeOther(_token)
**前提:LPFRewardPool.extraRewardsLength() 返回值不为0,且对应的token在LpfStakingProxy合约中数量不为0**
[LPFRewardPool ABI](https://github.com/dforce-network/Stranger/blob/saddle/abi/ILPFRewardPool.json)
所以先调用 LPFRewardPool.extraRewardsLength(),获取长度,
然后调用 LPFRewardPool.extraRewards(), 获取对应的token地址,
例如 extraRewardsLength = 2,
则token0地址为 extraRewards(0)
则token1地址为 extraRewards(1)
当这两种token存在LpfStakingProxy中时,则distributeOther(token0),distributeOther(token1)
### Lock LPF APY
首先拿 reward token地址, rewardTokenAddress = locker.rewardTokens(0), 默认填写0 即可。
然后是 rewardTokenDetails = locker.rewardData(rewardTokenAddress), 返回值为:
```
Reward {
bool useBoost;
uint40 periodFinish;
uint208 rewardRate;
uint40 lastUpdateTime;
uint208 rewardPerTokenStored;
}
```
则当前token的reward rate为: rewardTokenDetails.rewardRate
则其APY为: rewardRate * rewardPrice * 365 * 24 * 60 * 60 / (totalLocked * lockedTokenPrice)
## Contract Addresses
### 08-29 Mainnet
| | address | link |
|:--------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
| SDL | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| LPF | 0x3650B69f86cB593f116e276C30666834336c0647 | [link](https://etherscan.io/address/0x3650B69f86cB593f116e276C30666834336c0647) |
| pSDL | 0xC1B4dA8f275E9c74b67f170Cd5aa0bee82d4B5E0 | [link](https://etherscan.io/address/0xC1B4dA8f275E9c74b67f170Cd5aa0bee82d4B5E0) |
| voter | 0x6E399F1d376237aE705DD015894fC3FB559521b4 | [link](https://etherscan.io/address/0x6E399F1d376237aE705DD015894fC3FB559521b4) |
| depositor | 0xC64Cb881380Fb53944f6Fc24aC5348De23001633 | [link](https://etherscan.io/address/0xC64Cb881380Fb53944f6Fc24aC5348De23001633) |
| booster | 0xbfd627aCC830B613A12e98e58d89839B1B4A56D4 | [link](https://etherscan.io/address/0xbfd627aCC830B613A12e98e58d89839B1B4A56D4) |
| pSDLStaking | 0x8599657221E5495630B35A655F42cf978bd64c7B | [link](https://etherscan.io/address/0x8599657221E5495630B35A655F42cf978bd64c7B) |
| pSDLExtraReward | 0xBDd5A48427EB1A57d00c92441ECf3109192D94A7 | [link](https://etherscan.io/address/0xBDd5A48427EB1A57d00c92441ECf3109192D94A7) |
| proxyFactory | 0x488A68953e06fc5AA462557e6c213a908a5Abd95 | [link](https://etherscan.io/address/0x488A68953e06fc5AA462557e6c213a908a5Abd95) |
| tokenFactory | 0xb2f344e6bfa63CeF606d126dDb75916b1F6A2155 | [link](https://etherscan.io/address/0xb2f344e6bfa63CeF606d126dDb75916b1F6A2155) |
| rewardFactory | 0xdBeF4388927e6C0883BE6f642C8c273F407C5191 | [link](https://etherscan.io/address/0xdBeF4388927e6C0883BE6f642C8c273F407C5191) |
| stashFactory | 0x3e28F61A770Fa8806bceEF206DD3176a2Bb14D06 | [link](https://etherscan.io/address/0x3e28F61A770Fa8806bceEF206DD3176a2Bb14D06) |
| stashRewardV3 | 0xE5098FEcee6FF001Dfbff586FaCfD6e34F35b837 | [link](https://etherscan.io/address/0xE5098FEcee6FF001Dfbff586FaCfD6e34F35b837) |
| LPFStaking | 0x7477004e5170B65a137bCc5D954703a1C0D09eEb | [link](https://etherscan.io/address/0x7477004e5170B65a137bCc5D954703a1C0D09eEb) |
| locker | 0x74F55c24f07FDE50AFf00f4Ef027d1561C17C619 | [link](https://etherscan.io/address/0x74F55c24f07FDE50AFf00f4Ef027d1561C17C619) |
| LPFStakingProxy | 0x1503e9C2860c68930C64B16918B82a2f70B0eaCa | [link](https://etherscan.io/address/0x1503e9C2860c68930C64B16918B82a2f70B0eaCa) |
| LPF-USX LP | 0xed4DD6aeAeCFC4d289A9578db12100b9a247DF2F | [link](https://etherscan.io/address/0xed4dd6aeaecfc4d289a9578db12100b9a247df2f) |
#### LP Staking Pools
| | address | link |
|:---------------------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
| USX_USDCLP | 0x1AE28a6ACA177c29b5773e91fbf74AfB0B7fE5C9 | [link](https://etherscan.io/address/0x1AE28a6ACA177c29b5773e91fbf74AfB0B7fE5C9) |
| USX_USDCLPStaking | 0xb099220A4204F245D7384871Fb18a7977Cbf5A33 | [link](https://etherscan.io/address/0xb099220A4204F245D7384871Fb18a7977Cbf5A33) |
| USX_USDCLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| USX_USDC Saddle-Pool | 0x2bff1b48cc01284416e681b099a0cddca0231d72 | [link](https://etherscan.io/address/0x2bff1b48cc01284416e681b099a0cddca0231d72) |
| p-USX_USDC | 0xbc89a9b39bb295a8be4e2cbea1af9dc9b47017a3 | [link](https://etherscan.io/address/0xbc89a9b39bb295a8be4e2cbea1af9dc9b47017a3) |
| | address | link |
| :------------------------------ | :----------------------------------------- | :------------------------------------------------------------------------------ |
| saddleUSDV2LP | 0x5f86558387293b6009d7896A61fcc86C17808D62 | [link](https://etherscan.io/address/0x5f86558387293b6009d7896A61fcc86C17808D62) |
| saddleUSDV2LPStaking | 0xc576C2ff34C3FE72E447A2500665f4Bc477eAe06 | [link](https://etherscan.io/address/0xc576C2ff34C3FE72E447A2500665f4Bc477eAe06) |
| saddleUSDV2LPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| saddleUSDV2 Saddle-Pool | 0x2bff1b48cc01284416e681b099a0cddca0231d72 | [link](https://etherscan.io/address/0x2bff1b48cc01284416e681b099a0cddca0231d72) |
| p-saddleUSDV2 | 0xEf7DAe219C4771AdE9600fcE42518010A4AE0ECE | [link](https://etherscan.io/address/0xEf7DAe219C4771AdE9600fcE42518010A4AE0ECE) |
| | address | link |
| :----------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| FRAX_3poolLP | 0x0785aDDf5F7334aDB7ec40cD785EBF39bfD91520 | [link](https://etherscan.io/address/0x0785aDDf5F7334aDB7ec40cD785EBF39bfD91520) |
| FRAX_3poolLPStaking | 0x11092DB71686266313dD37d10c95a2eaa181bFDa | [link](https://etherscan.io/address/0x11092DB71686266313dD37d10c95a2eaa181bFDa) |
| FRAX_3poolLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| FRAX_3pool Saddle-Pool | 0x8cAEa59f3Bf1F341f89c51607E4919841131e47a | [link](https://etherscan.io/address/0x8cAEa59f3Bf1F341f89c51607E4919841131e47a) |
| p-FRAX_3pool | 0x7bCEA7E9676f7e084eE9Ce14A3A1fc7c211CF436 | [link](https://etherscan.io/address/0x7bCEA7E9676f7e084eE9Ce14A3A1fc7c211CF436) |
| | address | link |
| :----------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| FRAX_alUSDLP | 0x3cF7b9479a01eeB3bbfC43581fa3bb21cd888e2A | [link](https://etherscan.io/address/0x3cF7b9479a01eeB3bbfC43581fa3bb21cd888e2A) |
| FRAX_alUSDLPStaking | 0xfaBAeCb9894c6A3A1a24Ac890C98b2A46C5fF764 | [link](https://etherscan.io/address/0xfaBAeCb9894c6A3A1a24Ac890C98b2A46C5fF764) |
| FRAX_alUSDLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| FRAX_alUSD Saddle-Pool | 0xFB516cF3710fC6901F2266aAEB8834cF5e4E9558 | [link](https://etherscan.io/address/0xFB516cF3710fC6901F2266aAEB8834cF5e4E9558) |
| p-FRAX_alUSD | 0x1F056eDC06b6B3844Baa5D7ffF0Aa6c846ab92C1 | [link](https://etherscan.io/address/0x1F056eDC06b6B3844Baa5D7ffF0Aa6c846ab92C1) |
| | address | link |
| :---------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| FRAX_sUSDLP | 0x6Ac7a4cB3BFa90DC651CD53EB098e23c88d04e77 | [link](https://etherscan.io/address/0x6Ac7a4cB3BFa90DC651CD53EB098e23c88d04e77) |
| FRAX_sUSDLPStaking | 0xb6b94BDA18F44B8D361787a34DBaC00Fa13Da6Bb | [link](https://etherscan.io/address/0xb6b94BDA18F44B8D361787a34DBaC00Fa13Da6Bb) |
| FRAX_sUSDLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| FRAX_sUSD Saddle-Pool | 0x69baA0d7c2e864b74173922Ca069Ac79d3be1556 | [link](https://etherscan.io/address/0x69baA0d7c2e864b74173922Ca069Ac79d3be1556) |
| p-FRAX_sUSD | 0x08cFb063379c3E980e347Ca3217022FA35f9DaB9 | [link](https://etherscan.io/address/0x08cFb063379c3E980e347Ca3217022FA35f9DaB9) |
| | address | link |
| :---------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| FRAX_USDCLP | 0x927E6f04609A45B107C789aF34BA90Ebbf479f7f | [link](https://etherscan.io/address/0x927E6f04609A45B107C789aF34BA90Ebbf479f7f) |
| FRAX_USDCLPStaking | 0x32dD7287F2061Cf6Ef009037F8DBE8d18D4d2d14 | [link](https://etherscan.io/address/0x32dD7287F2061Cf6Ef009037F8DBE8d18D4d2d14) |
| FRAX_USDCLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| FRAX_USDC Saddle-Pool | 0x13Cc34Aa8037f722405285AD2C82FE570bfa2bdc | [link](https://etherscan.io/address/0x13Cc34Aa8037f722405285AD2C82FE570bfa2bdc) |
| p-FRAX_USDC | 0x64c4fAf939b148057f2CC6b39887b10E3740cf03 | [link](https://etherscan.io/address/0x64c4fAf939b148057f2CC6b39887b10E3740cf03) |
| | address | link |
| :---------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| FRAX_USDTLP | 0x486DFCfdbF9025c062110E8c0344a15279aD0a85 | [link](https://etherscan.io/address/0x486DFCfdbF9025c062110E8c0344a15279aD0a85) |
| FRAX_USDTLPStaking | 0x93cAcF49F5A53d2D8cABbF21CcD01FB8e07850Dc | [link](https://etherscan.io/address/0x93cAcF49F5A53d2D8cABbF21CcD01FB8e07850Dc) |
| FRAX_USDTLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| FRAX_USDT Saddle-Pool | 0xC765Cd3d015626244AD63B5FB63a97c5634643b9 | [link](https://etherscan.io/address/0xC765Cd3d015626244AD63B5FB63a97c5634643b9) |
| p-FRAX_USDT | 0xB580ba16D035E62Ea7769a7a476741Fc0f1Bd1fa | [link](https://etherscan.io/address/0xB580ba16D035E62Ea7769a7a476741Fc0f1Bd1fa) |
| | address | link |
| :--------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| FRAX_USXLP | 0xAaD59B28CC76eD4c9F7C83E697E5cC925fB0B920 | [link](https://etherscan.io/address/0xAaD59B28CC76eD4c9F7C83E697E5cC925fB0B920) |
| FRAX_USXLPStaking | 0x55bacF825C7cb92e76F4eFF33a6686825F54C482 | [link](https://etherscan.io/address/0x55bacF825C7cb92e76F4eFF33a6686825F54C482) |
| FRAX_USXLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| FRAX_USX Saddle-Pool | 0x1dcB69a2b9148C641a43F731fCee123e2be30bAb | [link](https://etherscan.io/address/0x1dcB69a2b9148C641a43F731fCee123e2be30bAb) |
| p-FRAX_USX | 0x242840fedD8a703e887309897681a88F4A63D87a | [link](https://etherscan.io/address/0x242840fedD8a703e887309897681a88F4A63D87a) |
| | address | link |
| :--------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| saddleD4LP | 0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A | [link](https://etherscan.io/address/0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A) |
| saddleD4LPStaking | 0x3F8e1cfCF7f29CfF7Ed0057Ccbf4ff5396F2b862 | [link](https://etherscan.io/address/0x3F8e1cfCF7f29CfF7Ed0057Ccbf4ff5396F2b862) |
| saddleD4LPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| saddleD4 Saddle-Pool | 0xC69DDcd4DFeF25D8a793241834d4cc4b3668EAD6 | [link](https://etherscan.io/address/0xC69DDcd4DFeF25D8a793241834d4cc4b3668EAD6) |
| p-saddleD4 | 0xa1aFeF97041682F88230dFA09296264754d15471 | [link](https://etherscan.io/address/0xa1aFeF97041682F88230dFA09296264754d15471) |
| | address | link |
| :--------------------------- | :----------------------------------------- | :------------------------------------------------------------------------------ |
| SDL_ETHSLP | 0x0C6F06b32E6Ae0C110861b8607e67dA594781961 | [link](https://etherscan.io/address/0x0C6F06b32E6Ae0C110861b8607e67dA594781961) |
| SDL_ETHSLPStaking | 0xC78aE8A82C17b6F65432FFDc2bBCac4B28A9182E | [link](https://etherscan.io/address/0xC78aE8A82C17b6F65432FFDc2bBCac4B28A9182E) |
| SDL_ETHSLPStakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| SDL_ETH Saddle-Pool | 0x0C6F06b32E6Ae0C110861b8607e67dA594781961 | [link](https://etherscan.io/address/0x0C6F06b32E6Ae0C110861b8607e67dA594781961) |
| p-SDL_ETH | 0x6b52876465a1cec0dB03b6Ed650De2C66dC0e97D | [link](https://etherscan.io/address/0x6b52876465a1cec0dB03b6Ed650De2C66dC0e97D) |
#### Farm
| | address | link |
|:---------------------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
RewardDistributorImpl | 0x989960D0C6dFBbe4fc9594ffbfcE00E97BB6181c | [link](https://etherscan.io/address/0x989960D0C6dFBbe4fc9594ffbfcE00E97BB6181c) |
| rewardDistributor | 0x03163e25EAE1599fF84e6142238929967e118E9F | [link](https://etherscan.io/address/0x03163e25EAE1599fF84e6142238929967e118E9F) |
| LPFUSXStaking | 0xDCa2cA29dc5710fB03A8db7E8B039d2847B69565 | [link](https://etherscan.io/address/0xDCa2cA29dc5710fB03A8db7E8B039d2847B69565) |
| LPFUSX LP | 0xed4dd6aeaecfc4d289a9578db12100b9a247df2f | [link](https://etherscan.io/token/0xed4dd6aeaecfc4d289a9578db12100b9a247df2f) |
### 08-25
| | address | link |
|:----------------|:-------------------------------------------|:--------------------------------------------------------------------------------|
| locker | 0x033ac8137f89b6747dCeDf5a4403C74Cd0Bd3aae | [link](https://etherscan.io/address/0x033ac8137f89b6747dCeDf5a4403C74Cd0Bd3aae) |
| LPFStakingProxy | 0xf24A67ceC97FD7A2270FF37819341c6Eb2BC52eD | [link](https://etherscan.io/address/0xf24A67ceC97FD7A2270FF37819341c6Eb2BC52eD) |
### 08-24
| | address | link |
|:----------------|:-------------------------------------------|:--------------------------------------------------------------------------------|
| locker | 0x4877Db58eB78f6D8Ba23Bd18b29847d676fA303e | [link](https://etherscan.io/address/0x4877Db58eB78f6D8Ba23Bd18b29847d676fA303e) |
| LPFStakingProxy | 0xB49DE8C83c9B9b13e8C6306d2680eB6584D5A1D6 | [link](https://etherscan.io/address/0xB49DE8C83c9B9b13e8C6306d2680eB6584D5A1D6) |
### 08-23
| | address | link |
|:----------------|:-------------------------------------------|:--------------------------------------------------------------------------------|
| SDL | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| LPF | 0x3650B69f86cB593f116e276C30666834336c0647 | [link](https://etherscan.io/address/0x3650B69f86cB593f116e276C30666834336c0647) |
| saddleD4 | 0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A | [link](https://etherscan.io/address/0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A) |
| pSDL | 0x5505c3B2de14AEAa2Ba14aCa697445291e2C26E2 | [link](https://etherscan.io/address/0x5505c3B2de14AEAa2Ba14aCa697445291e2C26E2) |
| voter | 0xbF94DE76e4203B0a21B65e3C842B72F35aC7a861 | [link](https://etherscan.io/address/0xbF94DE76e4203B0a21B65e3C842B72F35aC7a861) |
| depositor | 0xc6dfFA100fDFDC541cA0D5C0AD10cEE8d4E3A53D | [link](https://etherscan.io/address/0xc6dfFA100fDFDC541cA0D5C0AD10cEE8d4E3A53D) |
| booster | 0x089955E3d1cF2cB3DD8563E246926dd6c6f8d2eB | [link](https://etherscan.io/address/0x089955E3d1cF2cB3DD8563E246926dd6c6f8d2eB) |
| pSDLStaking | 0x2bE04Cf2B5A260Fe4bfFDaC2f0741eC1Aca2934a | [link](https://etherscan.io/address/0x2bE04Cf2B5A260Fe4bfFDaC2f0741eC1Aca2934a) |
| pSDLExtraReward | 0x6e3603ADBD0928dCbBF2B863C79Bd924F161794B | [link](https://etherscan.io/address/0x6e3603ADBD0928dCbBF2B863C79Bd924F161794B) |
| proxyFactory | 0xd0D358Ae2Ce2420267Beb0882A29EDEB0eA031cc | [link](https://etherscan.io/address/0xd0D358Ae2Ce2420267Beb0882A29EDEB0eA031cc) |
| tokenFactory | 0x843D47E27ee030f03d9b50707BcFd5096bDa049e | [link](https://etherscan.io/address/0x843D47E27ee030f03d9b50707BcFd5096bDa049e) |
| rewardFactory | 0x2AC128f0f83999bE4ec446dca02b97F4bF5C224E | [link](https://etherscan.io/address/0x2AC128f0f83999bE4ec446dca02b97F4bF5C224E) |
| stashFactory | 0x2816C5777fF5a248DcA9E286C98595C316DB6849 | [link](https://etherscan.io/address/0x2816C5777fF5a248DcA9E286C98595C316DB6849) |
| stashRewardV1 | 0x66685c8CC9FfA4b1858026d0e54a84b7896830F9 | [link](https://etherscan.io/address/0x66685c8CC9FfA4b1858026d0e54a84b7896830F9) |
| stashRewardV2 | 0x7C3636d146032216DD2E85000984DE2D5840F49C | [link](https://etherscan.io/address/0x7C3636d146032216DD2E85000984DE2D5840F49C) |
| stashRewardV3 | 0x618d279279Ac9ACaA44a1733901630c921771DfC | [link](https://etherscan.io/address/0x618d279279Ac9ACaA44a1733901630c921771DfC) |
| LPFStaking | 0x181d12696619C60B82a7f06a0ec943D6bA49F2A6 | [link](https://etherscan.io/address/0x181d12696619C60B82a7f06a0ec943D6bA49F2A6) |
| locker | 0x390f419B60a7937e41708941908f77ADE1Ab48E5 | [link](https://etherscan.io/address/0x390f419B60a7937e41708941908f77ADE1Ab48E5) |
| LPFStakingProxy | 0xec35E5A07958e9df8084C828EB79e8302FBEA028 | [link](https://etherscan.io/address/0xec35E5A07958e9df8084C828EB79e8302FBEA028) |
| treasury | 0x203c34268C4Ef5189543fB507b372c0cAa21074A | [link](https://etherscan.io/address/0x203c34268C4Ef5189543fB507b372c0cAa21074A) |
#### LP Staking Pools
| | address | link |
|:----------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
| saddleD4 | 0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A | [link](https://etherscan.io/address/0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A) |
| saddleD4Staking | 0x4837fa2c44fDe94d97d652A7C4658204605288c2 | [link](https://etherscan.io/address/0x4837fa2c44fDe94d97d652A7C4658204605288c2) |
| saddleD4StakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
### 08-20 update
| | address | link |
|:-------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
| pSDLExtraReward | 0x7b48d9C51135dF0769dE7bb66827C023b4285758 | [link](https://etherscan.io/address/0x7b48d9C51135dF0769dE7bb66827C023b4285758) |
| LPFExtraReward | 0xF39A9AC259ef0d83A884Bc01f3a993D47b8Aa155 | [link](https://etherscan.io/address/0xF39A9AC259ef0d83A884Bc01f3a993D47b8Aa155) |
| locker | 0x169D0d77CE7626b6FB959a483c25b2A87be070d8 | [link](https://etherscan.io/address/0x169D0d77CE7626b6FB959a483c25b2A87be070d8) |
| LPFStakingProxy | 0x582bda485695cbF851F0d78ecaA44a31a5740d7C | [link](https://etherscan.io/address/0x582bda485695cbF851F0d78ecaA44a31a5740d7C) |
| treasury | 0x0fb0c39257163B871C6ce191fB07430dD0a347C0 | [link](https://etherscan.io/address/0x0fb0c39257163B871C6ce191fB07430dD0a347C0) |
### 08-12 Tenderly Mainnet Fork
RPC: https://rpc.tenderly.co/fork/bc6bfd78-510f-45b8-bf93-6e57f6f8d08c
ETH and Token Faucet: https://codesandbox.io/s/tenderly-playground-mzxxv5
| | address | link |
|:----------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
| SDL | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
| LPF | 0x3650B69f86cB593f116e276C30666834336c0647 | [link](https://etherscan.io/address/0x3650B69f86cB593f116e276C30666834336c0647) |
| saddleD4 | 0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A | [link](https://etherscan.io/address/0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A) |
| pSDL | 0xE189e9585b392624c343b750632C00b452022d53 | [link](https://etherscan.io/address/0xE189e9585b392624c343b750632C00b452022d53) |
| voter | 0xD86E43f400e65d1e68fE1eea409799506C51652F | [link](https://etherscan.io/address/0xD86E43f400e65d1e68fE1eea409799506C51652F) |
| depositor | 0xB359f50FBCcb38b3Ee32A9DA523313F3Ad4C12BC | [link](https://etherscan.io/address/0xB359f50FBCcb38b3Ee32A9DA523313F3Ad4C12BC) |
| booster | 0x23b43BFE32cd10b2E3baAf8d5F0D763728922DA0 | [link](https://etherscan.io/address/0x23b43BFE32cd10b2E3baAf8d5F0D763728922DA0) |
| pSDLStaking | 0xA671198aC02b668b33F70A13131aC3175f60D100 | [link](https://etherscan.io/address/0xA671198aC02b668b33F70A13131aC3175f60D100) |
| proxyFactory | 0x304708B4914f6009e34A542d3da3c14464b15D4c | [link](https://etherscan.io/address/0x304708B4914f6009e34A542d3da3c14464b15D4c) |
| tokenFactory | 0x6F4b714e5a9B32391E0c1EF177BccCce1B210eD6 | [link](https://etherscan.io/address/0x6F4b714e5a9B32391E0c1EF177BccCce1B210eD6) |
| rewardFactory | 0xD1A914121F1A748E2f38f8572d815C95c2521E0B | [link](https://etherscan.io/address/0xD1A914121F1A748E2f38f8572d815C95c2521E0B) |
| stashFactory | 0x6356Db2b8C550B41195efE605b02dbD2d42F0393 | [link](https://etherscan.io/address/0x6356Db2b8C550B41195efE605b02dbD2d42F0393) |
| stashRewardV1 | 0xD44DE315762c9f5c585b23A4E8a3B1eBb10A79F2 | [link](https://etherscan.io/address/0xD44DE315762c9f5c585b23A4E8a3B1eBb10A79F2) |
| stashRewardV2 | 0xd3EefE9AEcC4F538434BAD29d82baBe7DA6C2C86 | [link](https://etherscan.io/address/0xd3EefE9AEcC4F538434BAD29d82baBe7DA6C2C86) |
| stashRewardV3 | 0xF5A838fa72c77Dd3E8D4fEfe6862697CF1D5fC14 | [link](https://etherscan.io/address/0xF5A838fa72c77Dd3E8D4fEfe6862697CF1D5fC14) |
| LPFStaking | 0x263d04d9aF1f31302322d6a7F77b4ddcb6B5097C | [link](https://etherscan.io/address/0x263d04d9aF1f31302322d6a7F77b4ddcb6B5097C) |
| LPFExtraReward | 0xA10df4d65E2DCEad594219E7d2996C4f8bdAa979 | [link](https://etherscan.io/address/0xA10df4d65E2DCEad594219E7d2996C4f8bdAa979) |
| locker | 0x29aF456D5084603766D9dc127740D92f719eF260 | [link](https://etherscan.io/address/0x29aF456D5084603766D9dc127740D92f719eF260) |
| LPFStakingProxy | 0x5cA7DdC0A7a7e1C4EbFdD2bBEF9Eb5e42d86EE61 | [link](https://etherscan.io/address/0x5cA7DdC0A7a7e1C4EbFdD2bBEF9Eb5e42d86EE61) |
| Snapshot Delegate | 0x469788fe6e9e9681c6ebf3bf78e7fd26fc015446 | [link](https://etherscan.io/address/0x469788fe6e9e9681c6ebf3bf78e7fd26fc015446) |
#### LP Staking Pools
| | address | link |
|:----------------- |:------------------------------------------ |:------------------------------------------------------------------------------- |
| saddleD4 | 0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A | [link](https://etherscan.io/address/0xd48cF4D7FB0824CC8bAe055dF3092584d0a1726A) |
| saddleD4Staking | 0x42e992125aBA83380CaD66D1B3dA5e5F9AC6fFcb | [link](https://etherscan.io/address/0x42e992125aBA83380CaD66D1B3dA5e5F9AC6fFcb) |
| saddleD4StakingRewardToken | 0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871 | [link](https://etherscan.io/address/0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871) |
## 分发速率
| 合约 | 质押token | 分发速率 | 奖励token |
|:--------------- |:----------- |:----------------- |:--------- |
| pSDLStaking | pSDL | 28749185251393/s | SDL |
| saddleD4Staking | saddleD4 LP | 244368074636842/s | SDL |
| locker | LPF | | pSDL |
## ABI
All ABI can be found in https://github.com/dforce-network/Stranger/tree/saddle/abi
| Contract | ABI |
| :---------- | :--------------------------------------------------------------------------------------------------------- |
| SDL | ERC20.json |
| pSDL | ERC20.json |
| LPF | ERC20.json |
| saddleD4 | ERC20.json |
| depositor | [ISdlDepositor.json](https://github.com/dforce-network/Stranger/tree/saddle/abi/ISdlDepositor.json) |
| booster | [ISdlBooster.json](https://github.com/dforce-network/Stranger/tree/saddle/abi/ISdlBooster.json) |
| pSDLStaking | [ISdlBaseRewardPool.json](https://github.com/dforce-network/Stranger/tree/saddle/abi/ISdlBaseRewardPool.json) |
| LPFStaking | [ILPFRewardPool.json](https://github.com/dforce-network/Stranger/tree/saddle/abi/ILPFRewardPool.json) |
## Usage
### Stake
#### Deposit
- Desposit & Stake `SDL`
```javascript
function deposit(uint256 _amount, bool _lock, address _stakingAddress);
function depositAll(bool _lock, address _stakingAddress);
```
```javascript
// 2)、deposit
await depositor.deposit(depositAmount, false, AddressZero);
// 1)、 deposit & staking
await depositor.deposit(depositAmount, false, pSDLStaking.address);
// deposit & trigger lock up
await depositor.deposit(depositAmount, true, AddressZero);
// deposit & trigger lock up & staking
await depositor.deposit(depositAmount, true, pSDLStaking.address);
// deposit all
await depositor.depositAll(false, AddressZero);
// deposit all & trigger lock up
await depositor.depositAll(true, AddressZero);
// deposite all & trigger lock up & staking
await depositor.depositAll(true, pSDLStaking.address);
```
- Stake `SDL`
```javascript
function stake(uint256 _amount)
function stakeAll()
```
```javascript
await pSDLStaking.stake(amount);
await pSDLStaking.stakeAll(amount);
```
- Trigger locking `SDL`
```javascript
function lockSaddle() external
```
```javascript
await depositor.lockSaddle()
```
#### UnStake
- Claim
```javascript
function getReward() external
```
```javascript
// Stake pSDL
await pSDLStaking.getReward();
```
- Unstake
```javascript
function withdraw(uint256 amount, bool claim)
```
```javascript
// Unstake pSDL
await pSDLStaking.withdraw(amount, true);
```
- Exit
```javascript
function withdrawAll(bool claim) external
```
```javascript
// Unstake pSDL
await pSDLStaking.withdrawAll(true);
```
- Queue Rewards
```javascript
function earmarkRewards(uint256 _pid);
```
```javascript
// earmarkRewards from saddleD4 LP, pid is 0
await booster.earmarkRewards(0);
```
### Gauge
- Stake `LP`
```javascript
function deposit(uint256 _pid, uint256 _amount, bool _stake)
function depositAll(uint256 _pid, bool _stake)
```
```javascript
// deposit saddleD4 LP, pid is 0
await booster.deposit(0, depositAmount, false);
// deposit & staking
await booster.deposit(0, depositAmount, true);
// deposit all saddleD4 LP
await booster.depositAll(0, false);
// deposit all & staking
await booster.depositAll(0, true);
```
- Get `LP` RewardPool
```javascript
const address = await booster.poolInfo[0].sdlRewards;
const saddleD4Staking = new ethers.Contract(address, ISdlBaseRewardPool.abi, provider);
```
- Unstake `LP`
```javascript
function withdrawAllAndUnwrap(bool claim)
```
```javascript
// deposit saddleD4 LP, pid is 0
await saddleD4Staking.withdrawAndUnwrap(amount, true);
// deposit saddleD4 LP, pid is 0
await saddleD4Staking.withdrawAllAndUnwrap(true);
```
- Harvest
```javascript
function getReward()
```
```javascript
await saddleD4Staking.getReward();
```
### LPFLocker
https://hackmd.io/@Triumph/SyhKwZ-69
## Addresses
https://docs.saddle.finance/contracts
## Sequence
### Add Pool
```sequence
PoolManager\nProxy->PoolManager: addPool()
Note right of PoolManager: Checks\nPool\nexistance
PoolManager->Booster: addPool()
Booster->TokenFactory: CreateDepositToken()
Booster->RewardFactory: CreateCrvRewards()
Booster->StashFactory: CreateStash()
Note right of Booster: Setup\nStash
```
### Deposit
```sequence
Booster->Staker: deposit()
Note right of Booster: Handle Stash
Booster->Token: mint()
Booster-->Reward:stakeFor()
```
### Withdraw
```sequence
Booster->Token: burn()
Booster->Staker: withdraw()
Note right of Booster: Handle Stash
```
### Get Reward
1. LP: claimRewards
```sequence
Booster->Staker:claimRewards()
```
2. CRV: earmarkRewards
```sequence
Booster->Staker:claimCrv()
Booster->Stash:claimRewards()
Booster->Stash:processStash()
Booster->Treasury:0% transfer()
Booster->Caller:0.5% transfer()
Booster->LPReward:85% queueNewRewards()
Booster->pSDLReward:10% queueNewRewards()
Booster->LPFReward:4.5% queueNewRewards()
```
3. Fee
```sequence
Booster->Staker:claimFees()
Booster->FeeReward\n(cvxCRVReward):queueNewRewards()
```